FrmVrpApplNew.cs 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using Core.StlMes.Client.Mcp.Control;
  6. using Core.StlMes.Client.Mcp.VRP.Entity;
  7. using CoreFS.CA06;
  8. using Infragistics.Win.UltraWinEditors;
  9. using Infragistics.Win.UltraWinGrid;
  10. using System;
  11. using System.Collections;
  12. using System.Collections.Generic;
  13. using System.ComponentModel;
  14. using System.Data;
  15. using System.Drawing;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Windows.Forms;
  19. namespace Core.StlMes.Client.Mcp.VRP.Vrp
  20. {
  21. public partial class FrmVrpApplNew : FrmBase
  22. {
  23. public FrmVrpApplNew()
  24. {
  25. InitializeComponent();
  26. }
  27. private string[] arr = null;
  28. private string httType = "";//热处理状态
  29. private string minTemp = "";//最低回火温度
  30. private string httTech = "";//热处理工艺制度
  31. private string Process = "";//参数
  32. private void InitColumns()
  33. {
  34. }
  35. private void FrmVrpApplNew_Load(object sender, EventArgs e)
  36. {
  37. DateTime now = DateTime.Now;
  38. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  39. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  40. this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  41. this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  42. EntityHelper.ShowGridCaption<MatBcMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  43. EntityHelper.ShowGridCaption<MatBcMEntity1>(ultraGrid2.DisplayLayout.Bands[0]);
  44. ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
  45. EntityHelper.ShowGridCaption<QcmZgJugdeApplyEntity>(ultraGrid3.DisplayLayout.Bands[0]);
  46. EntityHelper.ShowGridCaption<QcmZgJugdeApplyEntity>(ultraGrid4.DisplayLayout.Bands[0]);
  47. //F1功能
  48. this.IsLoadUserView = true;
  49. if (this.CustomInfo.ToString().Equals("JGX"))
  50. {
  51. Process = "G";//参数
  52. arr = new string[] { "002023017007"};
  53. }
  54. else
  55. {
  56. Process = this.CustomInfo.ToString();//参数
  57. arr = this.ValidDataPurviewIds;
  58. }
  59. if (Process != "G")
  60. {
  61. ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressure"].Hidden = true;
  62. ultraGrid1.DisplayLayout.Bands[0].Columns["HoldtimeTime"].Hidden = true;
  63. ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressureY"].Hidden = true;
  64. ultraGrid1.DisplayLayout.Bands[0].Columns["MchWatergageResult"].Hidden = true;
  65. ultraGrid1.DisplayLayout.Bands[0].Columns["MchPathResult"].Hidden = true;
  66. ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelMin"].Hidden = true;
  67. ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelMin2"].Hidden = true;
  68. ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelLen"].Hidden = true;
  69. ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelLen2"].Hidden = true;
  70. ultraGrid1.DisplayLayout.Bands[0].Columns["MeasuredEndPart"].Hidden = true;
  71. ultraGrid1.DisplayLayout.Bands[0].Columns["MeasuredMiddlePart"].Hidden = true;
  72. ultraGrid1.DisplayLayout.Bands[0].Columns["MeasuredTailPart"].Hidden = true;
  73. ultraGrid1.DisplayLayout.Bands[0].Columns["MchChamferingResult"].Hidden = true;
  74. ultraGrid1.DisplayLayout.Bands[0].Columns["MchTwistinglyResult"].Hidden = true;
  75. ultraGrid1.DisplayLayout.Bands[0].Columns["MchDimensionsResult"].Hidden = true;
  76. ultraGrid1.DisplayLayout.Bands[0].Columns["MchVisualResult"].Hidden = true;
  77. ultraGrid1.DisplayLayout.Bands[0].Columns["MchThreadInspectionResult"].Hidden = true;
  78. ultraGrid1.DisplayLayout.Bands[0].Columns["MchRemanenceResult"].Hidden = true;
  79. ultraGrid1.DisplayLayout.Bands[0].Columns["MchRadioactivityResult"].Hidden = true;
  80. ultraGrid1.DisplayLayout.Bands[0].Columns["MchBevelResult"].Hidden = true;
  81. ultraGrid1.DisplayLayout.Bands[0].Columns["AngleVal"].Hidden = true;
  82. ultraGrid1.DisplayLayout.Bands[0].Columns["EdgeVal"].Hidden = true;
  83. ultraGrid2.DisplayLayout.Bands[0].Columns["GroupLength"].Hidden = true;
  84. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingGrade"].Header.Caption = "探伤等级";
  85. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingType"].Header.Caption = "探伤种类";
  86. ultraGrid1.DisplayLayout.Bands[0].Columns["DetectResultCode"].Header.Caption = "探伤结果";
  87. }
  88. else
  89. {
  90. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingGrade"].Header.Caption = "管端探伤等级";
  91. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingType"].Header.Caption = "管端探伤种类";
  92. ultraGrid1.DisplayLayout.Bands[0].Columns["DetectResultCode"].Header.Caption = "管端探伤结果";
  93. }
  94. if (Process=="E")
  95. {
  96. ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressure"].Hidden = false;
  97. ultraGrid1.DisplayLayout.Bands[0].Columns["HoldtimeTime"].Hidden = false;
  98. ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressureY"].Hidden = false;
  99. }
  100. if (Process != "F")
  101. {
  102. ultraGrid2.DisplayLayout.Bands[0].Columns["StorageName"].Hidden = true;
  103. ultraGrid1.DisplayLayout.Bands[0].Columns["HttType"].Hidden = true;
  104. ultraGrid1.DisplayLayout.Bands[0].Columns["MinTemp"].Hidden = true;
  105. ultraGrid1.DisplayLayout.Bands[0].Columns["HttTechnology"].Hidden = true;
  106. ultraGrid1.DisplayLayout.Bands[0].Columns["NotchInfo"].Hidden = true;
  107. ultraGrid1.DisplayLayout.Bands[0].Columns["NotchLength"].Hidden = true;
  108. ultraGrid1.DisplayLayout.Bands[0].Columns["NotchWidth"].Hidden = true;
  109. ultraGrid1.DisplayLayout.Bands[0].Columns["NotchDepth"].Hidden = true;
  110. }
  111. else
  112. {
  113. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingGrade"].Hidden = true;
  114. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingType"].Hidden = true;
  115. ultraGrid1.DisplayLayout.Bands[0].Columns["DetectResultCode"].Hidden = true;
  116. ultraGrid1.DisplayLayout.Bands[0].Columns["TestingStandar"].Hidden = true;
  117. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryBsStorage",
  118. new object[] { "" },
  119. this.ob);//库位下拉
  120. if (dt.Rows.Count > 0)
  121. {
  122. txtStorage.DataSource = dt;
  123. txtStorage.ValueMember = "STORAGE_NO";
  124. txtStorage.DisplayMember = "STORAGE_NAME";
  125. YdmBaseClass.SetComboItemHeight(txtStorage);
  126. }
  127. }
  128. //加载探伤等级
  129. DataTable ds = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryTestingGrade", new object[] { "4022" }, ob);//快速检索码
  130. if (ds != null && ds.Rows.Count > 0)
  131. {
  132. ultraTestingGrade.DataSource = ds;
  133. ultraTestingGrade.ValueMember = "BASECODE";
  134. ultraTestingGrade.DisplayMember = "BASENAME";
  135. YdmBaseClass.SetComboItemHeight(ultraTestingGrade);
  136. }
  137. //加载探伤种类
  138. DataTable dType = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryTestingGrade", new object[] { "4104" }, ob);//快速检索码
  139. if (dType != null && ds.Rows.Count > 0)
  140. {
  141. ultraTestingType.DataSource = dType;
  142. ultraTestingType.ValueMember = "BASECODE";
  143. ultraTestingType.DisplayMember = "BASENAME";
  144. YdmBaseClass.SetComboItemHeight(ultraTestingType);
  145. }
  146. //加载探伤标准
  147. DataTable dd = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryTestingGrade", new object[] { "4021" }, ob);//快速检索码
  148. if (dd != null && ds.Rows.Count > 0)
  149. {
  150. ultraTestingStandar.DataSource = dd;
  151. ultraTestingStandar.ValueMember = "BASECODE";
  152. ultraTestingStandar.DisplayMember = "BASENAME";
  153. YdmBaseClass.SetComboItemHeight(ultraTestingStandar);
  154. }
  155. }
  156. private void getDeliveryNo(string ordLnPk)
  157. {
  158. DataTable dd = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryDeliveryNo", new object[] { ordLnPk }, ob);//快速检索码
  159. if (dd != null && dd.Rows.Count > 0)
  160. {
  161. DeliveryNoText.DataSource = dd;
  162. DeliveryNoText.ValueMember = "BASECODE";
  163. DeliveryNoText.DisplayMember = "BASENAME";
  164. YdmBaseClass.SetComboItemHeight(DeliveryNoText);
  165. }
  166. }
  167. /// <summary>
  168. /// 重写基类方法
  169. /// </summary>
  170. /// <param name="sender"></param>
  171. /// <param name="ToolbarKey"></param>
  172. public override void ToolBar_Click(object sender, string ToolbarKey)
  173. {
  174. switch (ToolbarKey)
  175. {
  176. case "DoQueryMat":
  177. QueryMat();
  178. break;
  179. case "DoDecision":
  180. DoDecision();
  181. break;
  182. case "cancelDoDecision":
  183. cancelDoDecision();
  184. break;
  185. case"UpdateProWgt":
  186. updateProWgt();
  187. break;
  188. case "PrintReport":
  189. printReport();
  190. break;
  191. case "DoUpdate":
  192. DoUpdate();
  193. break;
  194. case "DoKpFlag":
  195. DoKpFlag();
  196. break;
  197. case "inspection":
  198. inspection();
  199. break;
  200. case "inspection2":
  201. inspection2();
  202. break;
  203. case "inspection3":
  204. inspection3();
  205. break;
  206. case "Export":
  207. if (this.ultraTabControl1.Tabs[0].Active)
  208. {
  209. GridHelper.ulGridToExcel(ultraGrid1, "申请判定信息");
  210. }
  211. else if (this.ultraTabControl1.Tabs[1].Active)
  212. {
  213. GridHelper.ulGridToExcel(ultraGrid4, "申请判定信息");
  214. }
  215. break;
  216. case "doSaveOrdLnDlyPk":
  217. doSaveOrdLnDlyPk();
  218. break;
  219. case "Close":
  220. this.Close();
  221. break;
  222. }
  223. }
  224. /// <summary>
  225. /// 报检
  226. /// </summary>
  227. private void inspection()
  228. {
  229. this.ultraGrid1.UpdateData();
  230. this.ultraGrid2.UpdateData();
  231. UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
  232. string departMentid = UserInfo.GetDeptid();
  233. string flag = "0"; //报检
  234. if (uRow1 == null)
  235. {
  236. MessageUtil.ShowTips("请选择需要报检的炉信息!");
  237. return;
  238. }
  239. if (!(uRow1.Cells["Target"].Value.ToString().Equals("A") || (uRow1.Cells["Target"].Value.ToString().Equals("B") && uRow1.Cells["StdName"].Text.ToUpper().Contains("JY") && (!uRow1.Cells["PlineName"].Text.Contains("168")))))
  240. {
  241. MessageUtil.ShowTips("不是成品的不能报检!");
  242. return;
  243. }
  244. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  245. ArrayList parm = new ArrayList();
  246. foreach (UltraGridRow uRow in checkMagRows)
  247. {
  248. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  249. string matZcTity = JSONFormat.Format(matZcEntity);
  250. parm.Add(matZcTity);
  251. }
  252. CoreClientParam ccp = new CoreClientParam();
  253. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  254. ccp.MethodName = "inspection";
  255. ccp.ServerParams = new object[] { parm, Process, flag, this.UserInfo.GetUserName() };
  256. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  257. if (ccp.ReturnCode != -1)
  258. {
  259. if (ccp.ReturnInfo.Equals("报检成功!"))
  260. {
  261. QueryMat();
  262. MatBcMEntity1bindingSource.Clear();
  263. MessageUtil.ShowTips(ccp.ReturnInfo);
  264. }
  265. else
  266. {
  267. MessageUtil.ShowTips(ccp.ReturnInfo);
  268. }
  269. }
  270. }
  271. /// <summary>
  272. /// 报检2(必检)
  273. /// </summary>
  274. private void inspection2()
  275. {
  276. this.ultraGrid1.UpdateData();
  277. this.ultraGrid2.UpdateData();
  278. UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
  279. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  280. string departMentid = UserInfo.GetDeptid();
  281. string flag = "1"; //必检
  282. if (uRow1 == null)
  283. {
  284. MessageUtil.ShowTips("请选择需要报检的炉信息!");
  285. return;
  286. }
  287. if (!uRow1.Cells["Target"].Value.ToString().Equals("A"))
  288. {
  289. MessageUtil.ShowTips("不是成品的不能报检!");
  290. return;
  291. }
  292. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  293. ArrayList parm = new ArrayList();
  294. foreach (UltraGridRow uRow in checkMagRows)
  295. {
  296. MatBcMEntity1 matZcEntity = (MatBcMEntity1)uRow.ListObject;
  297. string matZcTity = JSONFormat.Format(matZcEntity);
  298. parm.Add(matZcTity);
  299. }
  300. CoreClientParam ccp = new CoreClientParam();
  301. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  302. ccp.MethodName = "inspection";
  303. ccp.ServerParams = new object[] { parm, Process, flag };
  304. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  305. if (ccp.ReturnCode != -1)
  306. {
  307. if (ccp.ReturnInfo.Equals("报检成功!"))
  308. {
  309. QueryMat();
  310. MatBcMEntity1bindingSource.Clear();
  311. MessageUtil.ShowTips(ccp.ReturnInfo);
  312. }
  313. else
  314. {
  315. MessageUtil.ShowTips(ccp.ReturnInfo);
  316. }
  317. }
  318. }
  319. /// <summary>
  320. /// 免检
  321. /// </summary>
  322. private void inspection3()
  323. {
  324. this.ultraGrid1.UpdateData();
  325. this.ultraGrid2.UpdateData();
  326. UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
  327. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  328. string departMentid = UserInfo.GetDeptid();
  329. string flag = "3"; //免检
  330. if (uRow1 == null)
  331. {
  332. MessageUtil.ShowTips("请选择需要报检的炉信息!");
  333. return;
  334. }
  335. if (!uRow1.Cells["Target"].Value.ToString().Equals("A"))
  336. {
  337. MessageUtil.ShowTips("不是成品的不能报检!");
  338. return;
  339. }
  340. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  341. ArrayList parm = new ArrayList();
  342. foreach (UltraGridRow uRow in checkMagRows)
  343. {
  344. MatBcMEntity1 matZcEntity = (MatBcMEntity1)uRow.ListObject;
  345. string matZcTity = JSONFormat.Format(matZcEntity);
  346. parm.Add(matZcTity);
  347. }
  348. CoreClientParam ccp = new CoreClientParam();
  349. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  350. ccp.MethodName = "inspection";
  351. ccp.ServerParams = new object[] { parm, Process, flag };
  352. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  353. if (ccp.ReturnCode != -1)
  354. {
  355. if (ccp.ReturnInfo.Equals("报检成功!"))
  356. {
  357. QueryMat();
  358. MatBcMEntity1bindingSource.Clear();
  359. MessageUtil.ShowTips(ccp.ReturnInfo);
  360. }
  361. else
  362. {
  363. MessageUtil.ShowTips(ccp.ReturnInfo);
  364. }
  365. }
  366. }
  367. /// <summary>
  368. /// 打印缴库单
  369. /// </summary>
  370. private void printReport()
  371. {
  372. IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  373. if (checkMags.Count() == 0)
  374. {
  375. MessageUtil.ShowTips("请选择需要打印的炉批信息!");
  376. return;
  377. }
  378. ArrayList parmList = new ArrayList();
  379. foreach (UltraGridRow row in checkMags)
  380. {
  381. MatBcMEntity1 matBcEntity = (MatBcMEntity1)row.ListObject;
  382. if (matBcEntity.JugdeApplyCode.Equals(""))
  383. {
  384. MessageUtil.ShowTips("炉批没有进行送判,不允许打印!");
  385. return;
  386. }
  387. }
  388. this.ultraGrid1.UpdateData();
  389. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  390. if (uRow == null)
  391. {
  392. MessageUtil.ShowTips("请选择需要打印的信息");
  393. return;
  394. }
  395. string heatNo = uRow.Cells["HeatPlanNo"].Value.ToString();
  396. string judgeNo = uRow.Cells["JudgeStoveNo"].Value.ToString();
  397. string batchNo = uRow.Cells["BatchNo"].Value.ToString();
  398. string plineCode = uRow.Cells["PlineCode"].Value.ToString();
  399. string Process = uRow.Cells["ProcessCdoe"].Value.ToString();
  400. string Target = uRow.Cells["Target"].Value.ToString();
  401. var strurl = "";
  402. if (Process.Equals("F"))
  403. {
  404. if (Target.Equals("A"))
  405. {
  406. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=MchRotaCrackDetetionASemiListHeatReport.cpt&judgeNo=" + judgeNo + "&batchNo=" + batchNo + "&heatNo=" + heatNo;
  407. }
  408. else
  409. {
  410. //strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=HttRotaCrackDetetionSemiListHeatReport.cpt&judgeStoveNo=" + judgeNo + "&heatPlanNo=" + heatNo + "&plineCode=" + plineCode;
  411. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=HttRotaCrackDetetionSemiListHeatReport.cpt&judgeStoveNo=" + judgeNo + "&heatPlanNo=" + heatNo + "&plineCode=" + plineCode;
  412. }
  413. }
  414. if (Process.Equals("G"))
  415. {
  416. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=MchRotaCrackDetetionSemiListHeatReport.cpt&judgeNo=" + judgeNo + "&batchNo=" + batchNo + "&heatNo=" + heatNo;
  417. }
  418. var fre = new FrmRepExcel(ob, strurl);
  419. fre.AutoSize = true;
  420. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  421. fre.WindowState = FormWindowState.Maximized;
  422. fre.Show();
  423. }
  424. /// <summary>
  425. /// 查询
  426. /// </summary>
  427. private void QueryMat()
  428. {
  429. string jugeNo = "";
  430. string startTim = "";
  431. string endTim = "";
  432. ArrayList list = new ArrayList();
  433. if (this.chkStoveNo.Checked && this.txtJudgeNo.Text.Trim() != "")
  434. {
  435. jugeNo = this.txtJudgeNo.Text.Trim();
  436. }
  437. if (chkTim2.Checked)
  438. {
  439. if (DateTime.Parse(this.StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
  440. {
  441. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  442. return;
  443. }
  444. else
  445. {
  446. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  447. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  448. }
  449. }
  450. list.Add(startTim);
  451. list.Add(endTim);
  452. list.Add(jugeNo);
  453. list.Add(this.ultraOptionSet1.CheckedItem.DataValue.ToString());
  454. list.Add(Process);
  455. if (ultraTabControl1.SelectedTab.Index == 0)
  456. {
  457. MatBcMEntity1bindingSource.Clear();
  458. List<MatBcMEntity> listSource = EntityHelper.GetData<MatBcMEntity>(
  459. "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMat", new object[] { list, arr }, this.ob);
  460. MatBcMEntitybindingSource.DataSource = listSource;
  461. foreach (UltraGridRow uRow in this.ultraGrid1.Rows)
  462. {
  463. if (uRow.Cells["Target"].Text == "A" )
  464. {
  465. DataTable bj = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryPlineCodeBM", new object[] { uRow.Cells["PlineCode"].Text }, ob);
  466. if (bj.Rows.Count > 0)
  467. {
  468. if (int.Parse(bj.Rows[0][0].ToString3()) > 0)
  469. {
  470. if (int.Parse(uRow.Cells["Bjz"].Text.ToString3()) > 0 && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) >= int.Parse(uRow.Cells["ActCount"].Text.ToString3()) && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) == int.Parse(uRow.Cells["Yjz"].Text.ToString3()) && int.Parse(uRow.Cells["Xcjz"].Text.ToString3()) == 0)
  471. {
  472. uRow.Cells["IsOk"].Value = "可送判";
  473. }
  474. else
  475. {
  476. uRow.Cells["IsOk"].Value = "不可送判";
  477. }
  478. //待报检支= 送判支+下线支-报检支+重检支
  479. int dbjz = int.Parse(uRow.Cells["Spz"].Text.ToString3()) + int.Parse(uRow.Cells["ActCount"].Text.ToString3()) - int.Parse(uRow.Cells["Bjz"].Text.ToString3()) + int.Parse(uRow.Cells["Ycjz"].Text.ToString3());
  480. if (dbjz > 0)
  481. {
  482. uRow.Cells["DBJZ"].Value = dbjz;
  483. }
  484. else
  485. {
  486. uRow.Cells["DBJZ"].Value = 0;
  487. }
  488. }
  489. }
  490. }
  491. }
  492. }
  493. else if (ultraTabControl1.SelectedTab.Index == 1)
  494. {
  495. List<QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<QcmZgJugdeApplyEntity>(
  496. "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, UserInfo.GetDeptid(), Process, arr }, this.ob);
  497. qcmZgJugdeApplyEntityBindingSource.DataSource = listSource;
  498. }
  499. }
  500. /// <summary>
  501. /// 回报过磅重量
  502. /// </summary>
  503. private void updateProWgt()
  504. {
  505. this.ultraGrid1.UpdateData();
  506. this.ultraGrid2.UpdateData();
  507. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  508. if (uRow == null) return;
  509. string PlinCode = uRow.Cells["PlineCode"].Value.ToString();
  510. string JugdeApplyCode = uRow.Cells["JugdeApplyCode"].Value.ToString();
  511. if (!PlinCode.Equals("C018"))
  512. {
  513. //if (uRow.Cells["Target"].Value.Equals("B") || uRow.Cells["Target"].Value.Equals("C"))
  514. //{
  515. // MessageUtil.ShowTips("半成品不允许回报过磅重量!");
  516. // return;
  517. //}
  518. }
  519. if (!JugdeApplyCode.Equals(""))
  520. {
  521. MessageUtil.ShowTips("已送判,不能回报过磅重量!");
  522. return;
  523. }
  524. if (Process == "G")
  525. {
  526. MessageUtil.ShowTips("请走测量点回报过磅重量!");
  527. return;
  528. }
  529. if (uRow == null)
  530. {
  531. MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
  532. return;
  533. }
  534. if (!StringUtil.IsDouble(uRow.Cells["PonderGrossWt"].Value.ToString3()))
  535. {
  536. MessageUtil.ShowTips("过磅重量应输入数字!");
  537. return;
  538. }
  539. if (Double.Parse(uRow.Cells["PonderGrossWt"].Value.ToString3()) <= 0)
  540. {
  541. MessageUtil.ShowTips("请输入正确的过磅重量!");
  542. return;
  543. }
  544. ArrayList list = new ArrayList();
  545. list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
  546. list.Add(uRow.Cells["PonderGrossWt"].Value.ToString3());
  547. list.Add(uRow.Cells["BelongCode"].Value.ToString());
  548. list.Add(this.UserInfo.GetUserName());
  549. ArrayList ArrList = new ArrayList();
  550. IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  551. if (checkMags.Count() == 0)
  552. {
  553. MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
  554. }
  555. else
  556. {
  557. foreach (UltraGridRow urg in checkMags)
  558. {
  559. ArrayList arrList = new ArrayList();
  560. if(!StringUtil.IsDouble(urg.Cells["PonderGrossWt"].Value.ToString3()))
  561. {
  562. MessageUtil.ShowTips("过磅重量应输入数字!");
  563. return;
  564. }
  565. if(Double.Parse(urg.Cells["PonderGrossWt"].Value.ToString3())<0)
  566. {
  567. MessageUtil.ShowTips("请输入正确的过磅重量!");
  568. return;
  569. }
  570. arrList.Add(urg.Cells["JudgeStoveNo"].Value.ToString());
  571. arrList.Add(urg.Cells["PonderGrossWt"].Value.ToString3());
  572. arrList.Add(urg.Cells["BelongCode"].Value.ToString());
  573. arrList.Add(urg.Cells["BatchNo"].Value.ToString());
  574. arrList.Add(urg.Cells["HeatPlanNoNext"].Value.ToString());
  575. arrList.Add(urg.Cells["BatchGroudNo"].Value.ToString());
  576. arrList.Add(urg.Cells["ProOrderNo"].Value.ToString());
  577. arrList.Add(urg.Cells["LotNo"].Value.ToString());
  578. arrList.Add(this.UserInfo.GetUserName());
  579. ArrList.Add(arrList);
  580. }
  581. }
  582. CoreClientParam ccp = new CoreClientParam();
  583. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  584. ccp.MethodName = "updateProWgt";
  585. ccp.ServerParams = new object[] { list,ArrList };
  586. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  587. if (ccp.ReturnCode != -1)
  588. {
  589. if (ccp.ReturnInfo.Equals("回报成功!"))
  590. {
  591. QueryMat();
  592. MessageUtil.ShowTips(ccp.ReturnInfo);
  593. }
  594. else
  595. {
  596. MessageUtil.ShowTips(ccp.ReturnInfo);
  597. }
  598. }
  599. }
  600. /// <summary>
  601. /// 申请判定
  602. /// </summary>
  603. private void DoDecision()
  604. {
  605. this.ultraGrid1.UpdateData();
  606. this.ultraGrid2.UpdateData();
  607. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  608. UltraGridRow sRow = this.ultraGrid1.ActiveRow;
  609. if (uRow == null) return;
  610. if (sRow == null) return;
  611. string Process = sRow.Cells["ProcessCdoe"].Value.ToString();
  612. string PlinCode = sRow.Cells["PlineCode"].Value.ToString();
  613. string judgeNo = sRow.Cells["JudgeStoveNo"].Value.ToString();
  614. string batchNo = uRow.Cells["BatchNo"].Value.ToString();
  615. int JugdeApplyNum1 = int.Parse(sRow.Cells["ActCount"].Value.ToString());
  616. int JugdeApplyNum2 = 0;
  617. double ActWeightTep = 0.0;
  618. double ActWeightTep1 = 0.0;
  619. double ActWeightTep2 = 0.0;
  620. double ActWeightTep3 = 0.0;
  621. double ActLenTep = 0.0;
  622. double ActLenTep1 = 0.0;
  623. double ActLenTep2 = 0.0;
  624. double ActLenTep3 = 0.0;
  625. IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  626. if (checkMags.Count() == 0)
  627. {
  628. MessageUtil.ShowTips("请选择需要送判的炉批信息!");
  629. return;
  630. }
  631. //成品没检验合格的不能送判
  632. if (sRow.Cells["Target"].Text == "A" )
  633. {
  634. DataTable bj = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryPlineCodeBM", new object[] { sRow.Cells["PlineCode"].Text }, ob);
  635. if (bj.Rows.Count > 0)
  636. {
  637. if (int.Parse(bj.Rows[0][0].ToString3()) > 0)
  638. {
  639. if (sRow.Cells["IsOk"].Text.ToString().Equals("不可送判"))
  640. {
  641. MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!");
  642. return;
  643. }
  644. }
  645. }
  646. }
  647. if (Process == "G" )
  648. {
  649. UltraGridRow uug = this.ultraGrid3.ActiveRow;
  650. if (uug != null)
  651. {
  652. if (uug.Cells["ProcessCode"].Value.Equals("镦拔扩"))
  653. {
  654. MessageUtil.ShowTips("镦拔扩工序有紧急放行但未判定或判定不合格,不允许申请判定!");
  655. return;
  656. }
  657. else if (uug.Cells["ProcessCode"].Value.Equals("热处理"))
  658. {
  659. MessageUtil.ShowTips("热处理工序有紧急放行但未判定或判定不合格,不允许申请判定!");
  660. return;
  661. }
  662. else if (uug.Cells["ProcessCode"].Value.Equals("扎管"))
  663. {
  664. MessageUtil.ShowTips("扎管工序有紧急放行但未判定或判定不合格,不允许申请判定!");
  665. return;
  666. }
  667. }
  668. }
  669. DataTable dtF = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getInsancyFlag",
  670. new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), Process },
  671. this.ob);
  672. if (dtF.Rows.Count > 0)
  673. {
  674. if (dtF.Rows[0]["INSTANCY_FLAG"].Equals("1"))
  675. {
  676. MessageUtil.ShowTips("有紧急放行但未判定或判定不合格,不允许申请判定!");
  677. return;
  678. }
  679. }
  680. //if (sRow.Cells["Target"].Text.Equals("A"))
  681. //{
  682. // if (double.Parse(sRow.Cells["PonderGrossWt"].Text.ToString3()) <= 0)
  683. // {
  684. // MessageUtil.ShowTips("A字头必须回报过磅重量!");
  685. // return;
  686. // }
  687. //}
  688. if (int.Parse(sRow.Cells["PonderGrossCount"].Text.ToString3())>0)
  689. {
  690. if (sRow.Cells["ActCount"].Text.Trim() != sRow.Cells["PonderGrossCount"].Text.Trim())
  691. {
  692. MessageUtil.ShowTips("送判炉号有部分过磅了,部分没有过磅,不允许申请判定!");
  693. return;
  694. }
  695. }
  696. if (PlinCode.Equals("C018"))
  697. {
  698. DataTable dtwt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryWt",
  699. new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), sRow.Cells["ActCount"].Value.ToString() },
  700. this.ob);
  701. if (dtwt.Rows.Count > 0)
  702. {
  703. if (dtwt.Rows[0]["PONDER_GROSS_WT"].Equals("0"))
  704. {
  705. MessageUtil.ShowTips("必须回报过磅重量!");
  706. return;
  707. }
  708. }
  709. }
  710. else
  711. {
  712. if (sRow.Cells["Target"].Text.Equals("A"))
  713. {
  714. DataTable dtwt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryWt",
  715. new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), sRow.Cells["ActCount"].Value.ToString() },
  716. this.ob);
  717. if (dtwt.Rows.Count > 0)
  718. {
  719. if (PlinCode.Equals("C075"))
  720. {
  721. if (dtwt.Rows[0]["PONDER_GROSS_WT"].Equals("0"))
  722. {
  723. MessageUtil.ShowTips("必须回报过磅重量!");
  724. return;
  725. }
  726. }
  727. }
  728. }
  729. }
  730. ArrayList parmList = new ArrayList();
  731. foreach(UltraGridRow row in checkMags)
  732. {
  733. MatBcMEntity1 matBcEntity = (MatBcMEntity1)row.ListObject;
  734. if (!matBcEntity.JugdeApplyCode.Equals(""))
  735. {
  736. MessageUtil.ShowTips("炉批已进行送判,不允许重复送判!");
  737. return;
  738. }
  739. if (!sRow.Cells["HttType"].Value.Equals(""))
  740. {
  741. matBcEntity.HttType = sRow.Cells["HttType"].Text.ToString();
  742. }
  743. if (!sRow.Cells["MinTemp"].Text.Equals(""))
  744. {
  745. matBcEntity.MinTemp = sRow.Cells["MinTemp"].Text.ToString();
  746. }
  747. if (!sRow.Cells["HttTechnology"].Text.Equals(""))
  748. {
  749. matBcEntity.HttTechnology = sRow.Cells["HttTechnology"].Text.ToString();
  750. }
  751. if (!sRow.Cells["NotchInfo"].Text.Equals(""))
  752. {
  753. matBcEntity.NotchInfo = sRow.Cells["NotchInfo"].Text.ToString();
  754. }
  755. if (!sRow.Cells["NotchLength"].Text.Equals(""))
  756. {
  757. matBcEntity.NotchLength = sRow.Cells["NotchLength"].Text.ToString();
  758. }
  759. if (!sRow.Cells["NotchWidth"].Text.Equals(""))
  760. {
  761. matBcEntity.NotchWidth = sRow.Cells["NotchWidth"].Text.ToString();
  762. }
  763. if (!sRow.Cells["NotchDepth"].Text.Equals(""))
  764. {
  765. matBcEntity.NotchDepth = sRow.Cells["NotchDepth"].Text.ToString();
  766. }
  767. if (!row.Cells["StorageName"].Value.Equals(""))
  768. {
  769. matBcEntity.StorageName = row.Cells["StorageName"].Value.ToString();
  770. }
  771. if (!string.IsNullOrWhiteSpace(sRow.Cells["TestPressure"].Value.ToString()))
  772. {
  773. matBcEntity.TestPressure = sRow.Cells["TestPressure"].Value.ToString().Trim();
  774. if (!StringUtil.IsNumber(sRow.Cells["TestPressure"].Value.ToString()))
  775. {
  776. MessageUtil.ShowTips("输入的水压压力不是数字,请重新输入!");
  777. return;
  778. }
  779. }
  780. if (!string.IsNullOrWhiteSpace(sRow.Cells["HoldtimeTime"].Value.ToString()))
  781. {
  782. matBcEntity.HoldtimeTime = sRow.Cells["HoldtimeTime"].Value.ToString().Trim();
  783. if (!StringUtil.IsNumber(sRow.Cells["HoldtimeTime"].Value.ToString()))
  784. {
  785. MessageUtil.ShowTips("输入的保压时间不是数字,请重新输入!");
  786. return;
  787. }
  788. }
  789. if (!string.IsNullOrWhiteSpace(sRow.Cells["TestPressureY"].Value.ToString()))
  790. {
  791. matBcEntity.TestPressureY = sRow.Cells["TestPressureY"].Value.ToString().Trim();
  792. if (!StringUtil.IsNumber(sRow.Cells["TestPressureY"].Value.ToString()))
  793. {
  794. MessageUtil.ShowTips("输入的水压压力不是数字,请重新输入!");
  795. return;
  796. }
  797. }
  798. if (!sRow.Cells["MchWatergageResult"].Value.Equals(""))
  799. {
  800. matBcEntity.MchWatergageResult = sRow.Cells["MchWatergageResult"].Value.ToString();
  801. matBcEntity.WpressureResultCode = "40740501"; //水压结果代码
  802. }
  803. if (!sRow.Cells["MchPathResult"].Value.Equals(""))
  804. {
  805. matBcEntity.MchPathResult = sRow.Cells["MchPathResult"].Value.ToString();
  806. }
  807. if (!sRow.Cells["DriftModelMin"].Value.Equals(""))
  808. {
  809. matBcEntity.DriftModelMin = sRow.Cells["DriftModelMin"].Value.ToString().Trim();
  810. if (!StringUtil.IsNumber(sRow.Cells["DriftModelMin"].Value.ToString()))
  811. {
  812. MessageUtil.ShowTips("输入的通径头最小尺寸不是数字,请重新输入!");
  813. return;
  814. }
  815. }
  816. if (!sRow.Cells["DriftModelMin2"].Value.Equals(""))
  817. {
  818. matBcEntity.DriftModelMin2 = sRow.Cells["DriftModelMin2"].Value.ToString().Trim();
  819. if (!StringUtil.IsNumber(sRow.Cells["DriftModelMin2"].Value.ToString()))
  820. {
  821. MessageUtil.ShowTips("输入的通径头最小尺寸不是数字,请重新输入!");
  822. return;
  823. }
  824. }
  825. if (!sRow.Cells["DriftModelLen"].Value.Equals(""))
  826. {
  827. matBcEntity.DriftModelLen = sRow.Cells["DriftModelLen"].Value.ToString().Trim();
  828. if (!StringUtil.IsNumber(sRow.Cells["DriftModelLen"].Value.ToString()))
  829. {
  830. MessageUtil.ShowTips("输入的通径头有效长度不是数字,请重新输入!");
  831. return;
  832. }
  833. }
  834. if (!sRow.Cells["DriftModelLen2"].Value.Equals(""))
  835. {
  836. matBcEntity.DriftModelLen2 = sRow.Cells["DriftModelLen2"].Value.ToString().Trim();
  837. if (!StringUtil.IsNumber(sRow.Cells["DriftModelLen2"].Value.ToString()))
  838. {
  839. MessageUtil.ShowTips("输入的通径头有效长度不是数字,请重新输入!");
  840. return;
  841. }
  842. }
  843. if (!sRow.Cells["MeasuredEndPart"].Value.Equals(""))
  844. {
  845. matBcEntity.MeasuredEndPart = sRow.Cells["MeasuredEndPart"].Value.ToString().Trim();
  846. if (!StringUtil.IsNumber(sRow.Cells["MeasuredEndPart"].Value.ToString()))
  847. {
  848. MessageUtil.ShowTips("输入的测量端部不是数字,请重新输入!");
  849. return;
  850. }
  851. }
  852. if (!sRow.Cells["MeasuredMiddlePart"].Value.Equals(""))
  853. {
  854. matBcEntity.MeasuredMiddlePart = sRow.Cells["MeasuredMiddlePart"].Value.ToString().Trim();
  855. if (!StringUtil.IsNumber(sRow.Cells["MeasuredMiddlePart"].Value.ToString()))
  856. {
  857. MessageUtil.ShowTips("输入的测量中部不是数字,请重新输入!");
  858. return;
  859. }
  860. }
  861. if (!sRow.Cells["MeasuredTailPart"].Value.Equals(""))
  862. {
  863. matBcEntity.MeasuredTailPart = sRow.Cells["MeasuredTailPart"].Value.ToString().Trim();
  864. if (!StringUtil.IsNumber(sRow.Cells["MeasuredTailPart"].Value.ToString()))
  865. {
  866. MessageUtil.ShowTips("输入的测量尾部不是数字,请重新输入!");
  867. return;
  868. }
  869. }
  870. if (!sRow.Cells["MchChamferingResult"].Value.Equals(""))
  871. {
  872. matBcEntity.MchChamferingResult = sRow.Cells["MchChamferingResult"].Value.ToString();
  873. }
  874. if (!sRow.Cells["MchTwistinglyResult"].Value.Equals(""))
  875. {
  876. matBcEntity.MchTwistinglyResult = sRow.Cells["MchTwistinglyResult"].Value.ToString();
  877. }
  878. if (!sRow.Cells["MchDimensionsResult"].Value.Equals(""))
  879. {
  880. matBcEntity.MchDimensionsResult = sRow.Cells["MchDimensionsResult"].Value.ToString();
  881. matBcEntity.SpecResultCode = "40740301"; //公差结果代码
  882. }
  883. if (!sRow.Cells["MchVisualResult"].Value.Equals(""))
  884. {
  885. matBcEntity.MchVisualResult = sRow.Cells["MchVisualResult"].Value.ToString();
  886. matBcEntity.FaceResultCode = "40740601"; //表面结果代码
  887. }
  888. if (!sRow.Cells["MchThreadInspectionResult"].Value.Equals(""))
  889. {
  890. matBcEntity.MchThreadInspectionResult = sRow.Cells["MchThreadInspectionResult"].Value.ToString();
  891. }
  892. if (!sRow.Cells["MchRemanenceResult"].Value.Equals(""))
  893. {
  894. matBcEntity.MchRemanenceResult = sRow.Cells["MchRemanenceResult"].Value.ToString();
  895. }
  896. if (!sRow.Cells["MchRadioactivityResult"].Value.Equals(""))
  897. {
  898. matBcEntity.MchRadioactivityResult = sRow.Cells["MchRadioactivityResult"].Value.ToString();
  899. }
  900. if (!sRow.Cells["MchBevelResult"].Value.Equals(""))
  901. {
  902. matBcEntity.MchBevelResult = sRow.Cells["MchBevelResult"].Value.ToString();
  903. }
  904. if (!sRow.Cells["AngleVal"].Value.Equals(""))
  905. {
  906. matBcEntity.AngleVal = sRow.Cells["AngleVal"].Value.ToString();
  907. }
  908. if (!sRow.Cells["EdgeVal"].Value.Equals(""))
  909. {
  910. matBcEntity.EdgeVal = sRow.Cells["EdgeVal"].Value.ToString();
  911. }
  912. if (!sRow.Cells["TestingGrade"].Value.Equals(""))
  913. {
  914. matBcEntity.TestingGrade = sRow.Cells["TestingGrade"].Text.ToString();
  915. }
  916. if (!sRow.Cells["TestingType"].Value.Equals(""))
  917. {
  918. matBcEntity.TestingType = sRow.Cells["TestingType"].Text.ToString();
  919. }
  920. if (!sRow.Cells["DetectResultCode"].Value.Equals(""))
  921. {
  922. matBcEntity.DetectResultCode = sRow.Cells["DetectResultCode"].Value.ToString();
  923. }
  924. if (!sRow.Cells["TestingStandar"].Value.Equals(""))
  925. {
  926. matBcEntity.TestingStandar = sRow.Cells["TestingStandar"].Text.ToString();
  927. }
  928. if (matBcEntity.MinTemp.Trim() != "")
  929. {
  930. string MinTem = matBcEntity.MinTemp.Replace("℃", "");
  931. int a;
  932. if (int.TryParse(MinTem, out a))
  933. {
  934. matBcEntity.MinTemp = a + "℃";
  935. }
  936. else
  937. {
  938. MessageBox.Show("请输入正确的最低回火温度, 请输入数字,或者正确的℃单位");
  939. return;
  940. }
  941. }
  942. string matEntity = JSONFormat.Format(matBcEntity);
  943. parmList.Add(matEntity);
  944. JugdeApplyNum2 += int.Parse(row.Cells["ActCount"].Value.ToString());
  945. string LengthType = row.Cells["LengthType"].Value.ToString();//长度类型(0-正尺,1-长尺,2-短尺)
  946. string InMold = row.Cells["InMold"].Value.ToString();//入库区分(801701-非计划入,801703-按计划入)
  947. double ActLen1 = double.Parse(row.Cells["ActLen1"].Value.ToString3());//累计送判米
  948. double ActWeight1 = double.Parse(row.Cells["ActWeight1"].Value.ToString3());//累计送判吨
  949. double ActWeightL = double.Parse(row.Cells["ActWeightL"].Value.ToString3());//累计送判吨(长尺)
  950. double ActWeightS = double.Parse(row.Cells["ActWeightS"].Value.ToString3());//累计送判吨(短尺)
  951. double ActLen2 = double.Parse(row.Cells["ActLen2"].Value.ToString3());//累计送判米(按计划入)
  952. double ActWeight2 = double.Parse(row.Cells["ActWeight2"].Value.ToString3());//累计送判吨(按计划入)
  953. double PaydownWtMax = double.Parse(row.Cells["PaydownWtMax"].Value.ToString3());//缴库量上限
  954. double Orderweight = double.Parse(row.Cells["Orderweight"].Value.ToString3());//估算量
  955. double OrderWtMaxShort = double.Parse(row.Cells["OrderWtMaxShort"].Value.ToString3());//短尺缴库量上限
  956. double OrderWtMaxLong = double.Parse(row.Cells["OrderWtMaxLong"].Value.ToString3());//长尺缴库量上限
  957. double Kspz = double.Parse(row.Cells["Kspz"].Value.ToString3());//预计可送判支
  958. double Cfz = double.Parse(row.Cells["Cfz"].Value.ToString3());//拆分支
  959. if (sRow.Cells["Target"].Text == "A" && sRow.Cells["PlineCode"].Text != "C092" && sRow.Cells["PlineCode"].Text != "C102")
  960. {
  961. //正尺
  962. if (LengthType.Equals("正尺") && InMold.Equals("801703"))
  963. {
  964. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  965. {
  966. ActWeightTep += double.Parse(row.Cells["ActWeight"].Value.ToString());
  967. if (PaydownWtMax < ActWeight2 + ActWeightTep && checkMags.Count() > 1)
  968. {
  969. MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
  970. return;
  971. }
  972. }
  973. else
  974. {
  975. ActLenTep += double.Parse(row.Cells["ActLen"].Value.ToString());
  976. if (PaydownWtMax < ActLen2 + ActLenTep && checkMags.Count() > 1)
  977. {
  978. MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
  979. return;
  980. }
  981. }
  982. }
  983. //长尺
  984. if (LengthType.Equals("长尺") && InMold.Equals("801703"))
  985. {
  986. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  987. {
  988. ActWeightTep1 += double.Parse(row.Cells["ActWeight"].Value.ToString());
  989. if (OrderWtMaxLong < ActWeightL + ActWeightTep1 && checkMags.Count() > 1)
  990. {
  991. MessageBox.Show("选中的长尺总量超出长尺缴库量上限,请分开送判");
  992. return;
  993. }
  994. }else
  995. {
  996. ActLenTep1 += double.Parse(row.Cells["ActLen"].Value.ToString());
  997. if (OrderWtMaxLong < ActLen2 + ActLenTep1 && checkMags.Count() > 1)
  998. {
  999. MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
  1000. return;
  1001. }
  1002. }
  1003. }
  1004. //短尺
  1005. if (LengthType.Equals("短尺") && InMold.Equals("801703"))
  1006. {
  1007. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  1008. {
  1009. ActWeightTep2 += double.Parse(row.Cells["ActWeight"].Value.ToString());
  1010. if (OrderWtMaxShort < ActWeightS + ActWeightTep2 && checkMags.Count() > 1)
  1011. {
  1012. MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判");
  1013. return;
  1014. }
  1015. }
  1016. else
  1017. {
  1018. ActLenTep2 += double.Parse(row.Cells["ActLen"].Value.ToString());
  1019. if (OrderWtMaxShort < ActWeightS + ActLenTep2 && checkMags.Count() > 1)
  1020. {
  1021. MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判");
  1022. return;
  1023. }
  1024. }
  1025. }
  1026. //按计划入
  1027. if ( InMold.Equals("801703"))
  1028. {
  1029. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  1030. {
  1031. ActWeightTep3 += double.Parse(row.Cells["ActWeight"].Value.ToString());
  1032. if (PaydownWtMax < ActWeight2 + ActWeightTep3 && checkMags.Count() > 1)
  1033. {
  1034. MessageBox.Show("选中的总量超出缴库量上限,请分开送判");
  1035. return;
  1036. }
  1037. }
  1038. else
  1039. {
  1040. ActLenTep3 += double.Parse(row.Cells["ActLen"].Value.ToString());
  1041. if (PaydownWtMax < ActWeight2 + ActLenTep3 && checkMags.Count() > 1)
  1042. {
  1043. MessageBox.Show("选中的总量超出缴库量上限,请分开送判");
  1044. return;
  1045. }
  1046. }
  1047. }
  1048. //非计划入
  1049. if (InMold.Equals("801701"))
  1050. {
  1051. if (Cfz > int.Parse(row.Cells["ActCount"].Value.ToString()))
  1052. {
  1053. MessageBox.Show("输入的拆分支数不能大于实际送判支数");
  1054. return;
  1055. }
  1056. }
  1057. }
  1058. }
  1059. if (JugdeApplyNum1 < JugdeApplyNum2)
  1060. {
  1061. MessageUtil.ShowTips("上下两部分的送判支数不一致,请把查询范围放大!");
  1062. return;
  1063. }
  1064. //检查是否过测量点-提示
  1065. if (Process == "G")
  1066. {
  1067. CoreClientParam ccp1 = new CoreClientParam();
  1068. ccp1.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  1069. ccp1.MethodName = "doCheckIsMeasure";
  1070. ccp1.ServerParams = new object[] {parmList};
  1071. ccp1 = ob.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  1072. if (ccp1.ReturnCode != -1)
  1073. {
  1074. if (ccp1.ReturnInfo.Equals("获取成功!"))
  1075. {
  1076. int count = int.Parse(ccp1.ReturnObject.ToString3());
  1077. if (count > 0)
  1078. {
  1079. if (MessageUtil.ShowYesNoAndQuestion("有" + count + "支未过测量点,请确认是否继续申请判定?") == DialogResult.No)
  1080. return;
  1081. }
  1082. }
  1083. }
  1084. }
  1085. CoreClientParam ccp = new CoreClientParam();
  1086. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  1087. ccp.MethodName = "doDecision";
  1088. ccp.ServerParams = new object[] { parmList,this.txtMemo.Text,UserInfo.GetUserName() ,Process,"gx"};
  1089. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1090. if (ccp.ReturnCode != -1)
  1091. {
  1092. if (ccp.ReturnInfo.Equals("申请判定成功!"))
  1093. {
  1094. string applyCode = ccp.ReturnObject.ToString();
  1095. foreach (UltraGridRow row in checkMags)
  1096. {
  1097. OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
  1098. //OpeBase obPss = new OpeBase();
  1099. //obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";
  1100. ccp.ServerName = "com.steering.pss.judge.Bll.BllCreateGroupStoveInfo";
  1101. ccp.MethodName = "Create";
  1102. ccp.ServerParams = new object[] { Process, row.Cells["LotNo"].Value.ToString(),row.Cells["JudgeStoveNo"].Value.ToString(),
  1103. row.Cells["BatchNo"].Value.ToString(),applyCode };
  1104. ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1105. if (ccp.ReturnInfo != "")
  1106. {
  1107. MessageUtil.ShowWarning(ccp.ReturnInfo);
  1108. }
  1109. }
  1110. DataTable dt = null;
  1111. if (Process.Equals("E"))
  1112. {
  1113. dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcess",
  1114. new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString() },
  1115. this.ob);
  1116. }else if(Process.Equals("F"))
  1117. {
  1118. dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessRcl",
  1119. new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString() },
  1120. this.ob);
  1121. }
  1122. else if (Process.Equals("G"))
  1123. {
  1124. dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessJgx",
  1125. new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString() },
  1126. this.ob);
  1127. CoreClientParam ccpNew = new CoreClientParam
  1128. {
  1129. ServerName = "com.steering.pss.judge.Bll.BllZcColligateJudge",
  1130. MethodName = "getJgxResultInfo",
  1131. ServerParams = new object[] { applyCode, sRow.Cells["JudgeStoveNo"].Value.ToString(), batchNo }
  1132. };
  1133. OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
  1134. ccpNew = obPss.ExecuteQuery(ccpNew, CoreInvokeType.Internal);
  1135. var json = ccpNew.ReturnObject.ToString2();
  1136. var dtNew = Newtonsoft.Json.JsonConvert.DeserializeObject(json, typeof(DataTable)) as DataTable;
  1137. if ( dtNew != null && dtNew.Rows.Count > 0)
  1138. {
  1139. for (int i = 0; i < dtNew.Rows.Count;i++ )
  1140. {
  1141. if (dtNew.Rows[i]["Result"].Equals(""))
  1142. {
  1143. MessageUtil.ShowWarning(dtNew.Rows[i]["Item"].ToString() + "不合,请撤销送判!");
  1144. }
  1145. }
  1146. }
  1147. }
  1148. if (dt.Rows.Count > 0)
  1149. {
  1150. //if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B024"))
  1151. if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010"))
  1152. {
  1153. foreach (UltraGridRow row in checkMags)
  1154. {
  1155. OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
  1156. /* OpeBase obPss = new OpeBase();
  1157. obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";*/
  1158. ccp.ServerName = "com.steering.pss.judge.Bll.BllDbkSpecJudge";
  1159. ccp.MethodName = "judge";
  1160. ccp.ServerParams = new object[] { applyCode, row.Cells["JudgeStoveNo"].Value.ToString(), row.Cells["BatchNo"].Value.ToString() };
  1161. ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1162. if (ccp.ReturnInfo != "")
  1163. {
  1164. MessageUtil.ShowWarning(ccp.ReturnInfo);
  1165. }
  1166. }
  1167. }
  1168. }
  1169. QueryMat();
  1170. this.txtMemo.Text = "";
  1171. MessageUtil.ShowTips("申请判定成功!");
  1172. }
  1173. else
  1174. {
  1175. MessageUtil.ShowTips(ccp.ReturnInfo);
  1176. }
  1177. }
  1178. }
  1179. /// <summary>
  1180. /// 撤销申请判定
  1181. /// </summary>
  1182. private void cancelDoDecision()
  1183. {
  1184. this.ultraGrid2.UpdateData();
  1185. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  1186. if (uRow == null) return;
  1187. string plinCode = uRow.Cells["PlineCode"].Text.ToString();
  1188. string nextGx = uRow.Cells["NextProcessCdoe"].Text.ToString();
  1189. string gx = uRow.Cells["ProcessCdoe"].Text.ToString();
  1190. IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  1191. if (checkMags.Count() == 0)
  1192. {
  1193. MessageUtil.ShowTips("请选择需要撤销送判的炉批信息!");
  1194. return;
  1195. }
  1196. if (nextGx.Equals("F"))
  1197. {
  1198. DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryPlnRclM",
  1199. new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1200. this.ob);
  1201. if (!dtPln.Rows[0]["COUNT"].Equals("0"))
  1202. {
  1203. MessageUtil.ShowTips("该炉计划在下工序不是计划或下发状态,不允许撤销判定!");
  1204. return;
  1205. }
  1206. }else if(nextGx.Equals("G"))
  1207. {
  1208. DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryPlnJgx",
  1209. new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1210. this.ob);
  1211. //if (!dtPln.Rows[0]["COUNT"].Equals("0"))
  1212. //{
  1213. // MessageUtil.ShowTips("该炉计划在下工序不是计划或下发状态,不允许撤销判定!");
  1214. // return;
  1215. //}
  1216. }else if(nextGx.Equals("H"))
  1217. {
  1218. DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryPlnJg",
  1219. new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1220. this.ob);
  1221. if (!dtPln.Rows[0]["COUNT"].Equals("0"))
  1222. {
  1223. MessageUtil.ShowTips("该炉计划在下工序不是计划或下发状态,不允许撤销判定!");
  1224. return;
  1225. }
  1226. }
  1227. ArrayList parmList = new ArrayList();
  1228. foreach (UltraGridRow row in checkMags)
  1229. {
  1230. string valueFlag = "";
  1231. string instock = "";
  1232. string processDesc = "";
  1233. DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.SelectValueFlag",
  1234. new object[] { row.Cells["JugdeApplyCode"].Value.ToString(), row.Cells["JugdeApplySequeno"].Value.ToString(),
  1235. row.Cells["JudgeStoveNo"].Value.ToString(),row.Cells["BatchNo"].Value.ToString(),row.Cells["BatchGroudNo"].Value.ToString(),
  1236. row.Cells["PlineCode"].Value.ToString() },
  1237. this.ob);
  1238. if(dtPln.Rows.Count>0)
  1239. {
  1240. valueFlag = dtPln.Rows[0]["VALIDFLAG"].ToString();
  1241. instock = dtPln.Rows[0]["INSTOCK_FLAG"].ToString();
  1242. }
  1243. DataTable dtDe = null;
  1244. if(gx.Equals("E"))
  1245. {
  1246. dtDe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryProcessDesc",
  1247. new object[] { row.Cells["JudgeStoveNo"].Value.ToString() },
  1248. this.ob);
  1249. }else if(gx.Equals("F"))
  1250. {
  1251. dtDe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryProcessRclDesc",
  1252. new object[] { row.Cells["JudgeStoveNo"].Value.ToString() },
  1253. this.ob);
  1254. }
  1255. else if (gx.Equals("G"))
  1256. {
  1257. dtDe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessJgx",
  1258. new object[] { row.Cells["JudgeStoveNo"].Value.ToString() },
  1259. this.ob);
  1260. }
  1261. if(dtDe.Rows.Count>0)
  1262. {
  1263. processDesc = dtDe.Rows[0]["PROCESS_CODE_C"].ToString();
  1264. }
  1265. if (!"B008".Equals(processDesc)
  1266. && !"B010".Equals(processDesc) && !"B024".Equals(processDesc))
  1267. {
  1268. if (!valueFlag.Equals("00") && !valueFlag.Equals("10"))
  1269. {
  1270. MessageUtil.ShowTips("该炉批已不是初始状态/撤判状态,不允许撤销申请判定!");
  1271. return;
  1272. }
  1273. if (instock.Equals("1"))
  1274. {
  1275. MessageUtil.ShowTips("质保部已经接收不允许撤销!");
  1276. return;
  1277. }
  1278. }
  1279. MatBcMEntity1 matBcEntity = (MatBcMEntity1)row.ListObject;
  1280. if (matBcEntity.JugdeApplyCode.Equals(""))
  1281. {
  1282. MessageUtil.ShowTips("炉批未送判,不允许撤销申请判定!");
  1283. return;
  1284. }
  1285. string matEntity = JSONFormat.Format(matBcEntity);
  1286. parmList.Add(matEntity);
  1287. }
  1288. DataTable dt = null;
  1289. if (gx.Equals("E"))
  1290. {
  1291. dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcess",
  1292. new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1293. this.ob);
  1294. }
  1295. else if (gx.Equals("F"))
  1296. {
  1297. dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessRcl",
  1298. new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1299. this.ob);
  1300. }
  1301. else if (gx.Equals("G"))
  1302. {
  1303. dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessJgx",
  1304. new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1305. this.ob);
  1306. }
  1307. if (dt.Rows.Count > 0)
  1308. {
  1309. if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B024"))
  1310. {
  1311. foreach (UltraGridRow row in checkMags)
  1312. {
  1313. OpeBase obPss = new OpeBase();
  1314. obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";
  1315. CoreClientParam ccp1 = new CoreClientParam();
  1316. ccp1.ServerName = "com.steering.pss.judge.Bll.BllDbkSpecJudge";
  1317. ccp1.MethodName = "cancelJudge";
  1318. ccp1.ServerParams = new object[] { uRow.Cells["JugdeApplyCode"].Value.ToString(), row.Cells["JudgeStoveNo"].Value.ToString(), row.Cells["BatchNo"].Value.ToString() };
  1319. ccp1 = obPss.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  1320. //if (ccp.ReturnInfo != "")
  1321. //{
  1322. // MessageUtil.ShowWarning(ccp.ReturnInfo);
  1323. // return;
  1324. //}
  1325. }
  1326. }
  1327. }
  1328. CoreClientParam ccp = new CoreClientParam();
  1329. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  1330. ccp.MethodName = "cancelDoDecision";
  1331. ccp.ServerParams = new object[] { parmList, gx };
  1332. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1333. if (ccp.ReturnCode != -1)
  1334. {
  1335. if (ccp.ReturnInfo.Equals("撤销成功!"))
  1336. {
  1337. string applyCode = ccp.ReturnObject.ToString();
  1338. // DataTable dt = null;
  1339. // if (gx.Equals("E"))
  1340. // {
  1341. // dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcess",
  1342. // new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1343. // this.ob);
  1344. // }else if(gx.Equals("F"))
  1345. // {
  1346. // dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessRcl",
  1347. //new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
  1348. //this.ob);
  1349. // }
  1350. // if (dt.Rows.Count > 0)
  1351. // {
  1352. // if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B024"))
  1353. // {
  1354. // foreach (UltraGridRow row in checkMags)
  1355. // {
  1356. // OpeBase obPss = new OpeBase();
  1357. // obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";
  1358. // ccp.ServerName = "com.steering.pss.judge.Bll.BllDbkSpecJudge";
  1359. // ccp.MethodName = "cancelJudge";
  1360. // ccp.ServerParams = new object[] { applyCode, row.Cells["JudgeStoveNo"].Value.ToString(), row.Cells["BatchNo"].Value.ToString() };
  1361. // ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1362. // if(ccp.ReturnInfo != "")
  1363. // {
  1364. // MessageUtil.ShowWarning(ccp.ReturnInfo);
  1365. // return;
  1366. // }
  1367. // }
  1368. // }
  1369. // }
  1370. QueryMat();
  1371. this.txtMemo.Text = "";
  1372. MessageUtil.ShowTips(ccp.ReturnInfo);
  1373. }
  1374. else
  1375. {
  1376. MessageUtil.ShowTips(ccp.ReturnInfo);
  1377. }
  1378. }
  1379. }
  1380. private void txtMemo_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1381. {
  1382. UltraTextEditor textEditor = (UltraTextEditor)sender;
  1383. PopupTextBox popupText = new PopupTextBox(textEditor.Text, 500);
  1384. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  1385. {
  1386. textEditor.Text = popupText.TextInfo.Trim();
  1387. }
  1388. }
  1389. private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
  1390. {
  1391. this.txtJudgeNo.Enabled = this.chkStoveNo.Checked;
  1392. }
  1393. private void chkTim2_CheckedChanged(object sender, EventArgs e)
  1394. {
  1395. this.StartTime.Enabled = this.EndTime.Enabled = this.chkTim2.Checked;
  1396. }
  1397. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  1398. {
  1399. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  1400. if (uRow == null)
  1401. {
  1402. return;
  1403. }
  1404. doQueryRemark(uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text);
  1405. doQueryJudgeBath(uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["JugdeApplyCode"].Text);
  1406. if (uRow.Cells["ProcessCdoe"].Value.ToString() == "G")
  1407. {
  1408. //加工水压结果
  1409. if (uRow.Cells["TestPressure"].Value == "" || uRow.Cells["HoldtimeTime"].Value == "" || uRow.Cells["TestPressureY"].Value == "" || uRow.Cells["MchWatergageResult"].Value == "")
  1410. {
  1411. DataTable dtWater = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryWicValue",
  1412. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  1413. if (dtWater.Rows.Count > 0)
  1414. {
  1415. uRow.Cells["TestPressure"].Value = dtWater.Rows[0]["TEST_PRESSURE"].ToString();
  1416. uRow.Cells["HoldtimeTime"].Value = dtWater.Rows[0]["HOLDTIME_TIME"].ToString();
  1417. uRow.Cells["TestPressureY"].Value = dtWater.Rows[0]["TEST_PRESSURE_Y"].ToString();
  1418. uRow.Cells["MchWatergageResult"].Value = "合格";
  1419. }
  1420. }
  1421. if (uRow.Cells["MchPathResult"].Value == "") //加工通径结果
  1422. {
  1423. DataTable dtPath = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMchPathResult",
  1424. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  1425. if (dtPath.Rows.Count > 0)
  1426. {
  1427. if (dtPath.Rows[0]["ACOUNT"].ToString() != "0")
  1428. {
  1429. uRow.Cells["MchPathResult"].Value = "合格";
  1430. }
  1431. uRow.Cells["DriftModelMin"].Value = dtPath.Rows[0]["DRIFT_MODEL_MIN"].ToString();
  1432. uRow.Cells["DriftModelMin2"].Value = dtPath.Rows[0]["DRIFT_MODEL_MIN2"].ToString();
  1433. uRow.Cells["DriftModelLen"].Value = dtPath.Rows[0]["DRIFT_MODEL_LEN"].ToString();
  1434. uRow.Cells["DriftModelLen2"].Value = dtPath.Rows[0]["DRIFT_MODEL_LEN2"].ToString();
  1435. uRow.Cells["MeasuredEndPart"].Value = dtPath.Rows[0]["MEASURED_END_PART"].ToString();
  1436. uRow.Cells["MeasuredMiddlePart"].Value = dtPath.Rows[0]["MEASURED_MIDDLE_PART"].ToString();
  1437. uRow.Cells["MeasuredTailPart"].Value = dtPath.Rows[0]["MEASURED_TAIL_PART"].ToString();
  1438. }
  1439. }
  1440. if (uRow.Cells["MchChamferingResult"].Value == "") //加工倒棱结果
  1441. {
  1442. DataTable dtChamfering = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMchChamferingResult",
  1443. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  1444. if (dtChamfering.Rows.Count > 0)
  1445. {
  1446. if (!dtChamfering.Rows[0]["ANGLE_VAL"].ToString().Equals("")) //角度不为空,结果才是合格
  1447. {
  1448. //uRow.Cells["MchChamferingResult"].Value = "合格";
  1449. uRow.Cells["MchBevelResult"].Value = "合格";
  1450. uRow.Cells["AngleVal"].Value = dtChamfering.Rows[0]["ANGLE_VAL"].ToString();
  1451. uRow.Cells["EdgeVal"].Value = dtChamfering.Rows[0]["EDGE_VAL"].ToString();
  1452. }
  1453. }
  1454. }
  1455. if (uRow.Cells["MchTwistinglyResult"].Value == "") //加工拧接结果
  1456. {
  1457. DataTable dtTwistingly = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMchTwistinglyResult",
  1458. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  1459. if (dtTwistingly.Rows.Count > 0)
  1460. {
  1461. uRow.Cells["MchTwistinglyResult"].Value = "合格";
  1462. }
  1463. }
  1464. if (uRow.Cells["TestingType"].Value == "") //加工探伤结果
  1465. {
  1466. DataTable dtMTs = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttCrackDetectionEt",
  1467. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, "G" }, this.ob);
  1468. if (dtMTs.Rows.Count > 0)
  1469. {
  1470. uRow.Cells["DetectResultCode"].Value = "40740401";
  1471. uRow.Cells["TestingType"].Value = dtMTs.Rows[0]["TESTING_TYPE"].ToString();
  1472. uRow.Cells["TestingGrade"].Value = dtMTs.Rows[0]["TESTING_GRADE"].ToString();
  1473. }
  1474. }
  1475. }
  1476. if (uRow.Cells["HttType"].Value == "")
  1477. {
  1478. DataTable dtHtt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttType",
  1479. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["PlineCode"].Text },
  1480. this.ob); //热处理类型
  1481. if (dtHtt.Rows.Count > 0)
  1482. {
  1483. uRow.Cells["HttType"].Value = dtHtt.Rows[0]["SORT_CODE"].ToString();
  1484. }
  1485. }
  1486. if (uRow.Cells["MinTemp"].Value == "" && uRow.Cells["JugdeApplyCode"].Value == "")
  1487. {
  1488. DataTable dtHttTe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttTemp",
  1489. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["PlineCode"].Text },
  1490. this.ob); //热处理最低回火温度,工艺制度
  1491. if (dtHttTe.Rows.Count > 0)
  1492. {
  1493. uRow.Cells["MinTemp"].Value = dtHttTe.Rows[0]["LHEAT_EXIT_TEMP"].ToString();
  1494. uRow.Cells["HttTechnology"].Value = dtHttTe.Rows[0]["HEAT_EXIT_TEMP"].ToString();
  1495. }
  1496. }else if(uRow.Cells["MinTemp"].Value == "" && uRow.Cells["JugdeApplyCode"].Value != "")
  1497. {
  1498. DataTable dtHttTe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttTempTech",
  1499. new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["PlineCode"].Text },
  1500. this.ob); //热处理最低回火温度,工艺制度
  1501. if (dtHttTe.Rows.Count > 0)
  1502. {
  1503. uRow.Cells["MinTemp"].Value = dtHttTe.Rows[0]["MIN_TEMP"].ToString();
  1504. uRow.Cells["HttTechnology"].Value = dtHttTe.Rows[0]["HTT_TECHNOLOGY"].ToString();
  1505. }
  1506. }
  1507. if (uRow.Cells["NotchLength"].Value == "")
  1508. {
  1509. DataTable dtHttDa = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttData",
  1510. new object[] {uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["PlineCode"].Text}, this.ob);
  1511. if (dtHttDa.Rows.Count > 0)
  1512. {
  1513. uRow.Cells["NotchLength"].Value = dtHttDa.Rows[0]["NOTCH_LENGTH"].ToString();
  1514. uRow.Cells["NotchWidth"].Value = dtHttDa.Rows[0]["NOTCH_WIDTH"].ToString();
  1515. uRow.Cells["NotchDepth"].Value = dtHttDa.Rows[0]["NOTCH_DEPTH"].ToString();
  1516. }
  1517. }
  1518. /* }*/
  1519. foreach (UltraGridRow urg in ultraGrid2.Rows)
  1520. {
  1521. DataTable dtStorage = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryStorage",
  1522. new object[] { urg.Cells["JudgeStoveNo"].Text, urg.Cells["BatchNo"].Text },
  1523. this.ob);//储存位置
  1524. if (dtStorage.Rows.Count > 0)
  1525. {
  1526. urg.Cells["StorageName"].Value = dtStorage.Rows[0]["STORAGE_NAME"].ToString();
  1527. urg.Cells["StorageNo"].Value = dtStorage.Rows[0]["STORAGE_NO"].ToString();
  1528. }
  1529. }
  1530. }
  1531. /// <summary>
  1532. /// 查询炉批信息
  1533. /// </summary>
  1534. private void doQueryJudgeBath(string heatPlanNo, string judgeNo, string jugdeApplyCode)
  1535. {
  1536. List<MatBcMEntity1> listSource = EntityHelper.GetData<MatBcMEntity1>(
  1537. "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryJudgeBath", new object[] { heatPlanNo, judgeNo, jugdeApplyCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  1538. if (listSource.Count > 0)
  1539. {
  1540. this.getDeliveryNo(listSource[0].OrdLnPk.ToString());
  1541. }
  1542. MatBcMEntity1bindingSource.DataSource = listSource;
  1543. foreach(UltraGridRow row in this.ultraGrid2.Rows)
  1544. {
  1545. row.Cells["CHK"].Value = "True";
  1546. row.Update();
  1547. }
  1548. }
  1549. private void doSaveOrdLnDlyPk()
  1550. {
  1551. IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  1552. if (checkMags.Count() == 0)
  1553. {
  1554. MessageUtil.ShowTips("请选择需要修改的数据!");
  1555. return;
  1556. }
  1557. ArrayList parmList = new ArrayList();
  1558. foreach (UltraGridRow row in checkMags)
  1559. {
  1560. MatBcMEntity1 matBcEntity1 = (MatBcMEntity1)row.ListObject;
  1561. string OrdLnDlyPk = row.Cells["OrderSeqNo"].Value.ToString();
  1562. string OrderSeqNo = row.Cells["OrderSeqNo"].Text.ToString();
  1563. if (OrdLnDlyPk.Equals(OrderSeqNo))
  1564. {
  1565. return;
  1566. }
  1567. matBcEntity1.OrdLnDlyPk = OrdLnDlyPk;
  1568. matBcEntity1.OrderSeqNo = OrderSeqNo;
  1569. string matEntity = JSONFormat.Format(matBcEntity1);
  1570. parmList.Add(matEntity);
  1571. }
  1572. CoreClientParam ccp = new CoreClientParam();
  1573. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  1574. ccp.MethodName = "doSaveOrdLnDlyPk";
  1575. ccp.ServerParams = new object[] { parmList };
  1576. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1577. if (ccp.ReturnCode != -1)
  1578. {
  1579. if (ccp.ReturnInfo.Equals("保存成功!"))
  1580. {
  1581. MessageUtil.ShowTips(ccp.ReturnInfo);
  1582. }
  1583. else
  1584. {
  1585. MessageUtil.ShowTips(ccp.ReturnInfo);
  1586. }
  1587. }
  1588. }
  1589. private void doQueryRemark(string heatPlanNo, string judgeNo)
  1590. {
  1591. DataTable ds = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryRemark", new object[] { judgeNo, heatPlanNo}, ob);
  1592. txtMemo.Text = ds.Rows[0]["Remark"].ToString();
  1593. }
  1594. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  1595. {
  1596. UltraGridRow urg = ultraGrid1.ActiveRow;
  1597. e.Cell.Row.Update();//选中的有铅笔形状会和勾选的不一样
  1598. double wt = 0.0;
  1599. foreach (UltraGridRow row in this.ultraGrid2.Rows)
  1600. {
  1601. wt += Convert.ToDouble(row.Cells["PonderGrossWt"].Value);
  1602. }
  1603. urg.Cells["PonderGrossWt"].Value = wt;
  1604. }
  1605. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  1606. {
  1607. string heatPlanNo = "";
  1608. string judgeNo = "";
  1609. UltraGridRow urg = ultraGrid1.ActiveRow;
  1610. if(urg==null)
  1611. {
  1612. return;
  1613. }
  1614. else
  1615. {
  1616. heatPlanNo = urg.Cells["HeatPlanNo"].Value.ToString();
  1617. judgeNo = urg.Cells["JudgeStoveNo"].Value.ToString();
  1618. }
  1619. ultraGrid1.UpdateData();
  1620. if (e.Cell.Column.Key.Equals("PonderGrossWt") && urg.Cells["PonderGrossWt"].Text != "")
  1621. {
  1622. string count = "";
  1623. DataTable dtHtt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryJudgeBathCount",
  1624. new object[] {heatPlanNo, judgeNo, this.ultraOptionSet1.CheckedItem.DataValue.ToString()},
  1625. this.ob); //热处理类型
  1626. if (dtHtt.Rows.Count > 0)
  1627. {
  1628. count =
  1629. (Convert.ToDouble(urg.Cells["PonderGrossWt"].Text.ToString())/
  1630. Convert.ToDouble(urg.Cells["ActCount"].Text.ToString())).ToString("f6");
  1631. }
  1632. foreach (UltraGridRow row in this.ultraGrid2.Rows)
  1633. {
  1634. // row.Cells["PonderGrossWt"].Value = (Convert.ToDouble(count) * Convert.ToInt32(dtHtt.Rows[i]["COUNT"].ToString())).ToString("f3");
  1635. row.Cells["PonderGrossWt"].Value =
  1636. (Convert.ToDouble(count)*Convert.ToInt32(row.Cells["ActCount"].Text.ToString())).ToString("f3");
  1637. row.Cells["CHK"].Value = "True";
  1638. row.Update();
  1639. }
  1640. }
  1641. }
  1642. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1643. {
  1644. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  1645. if (uRow == null)
  1646. {
  1647. return;
  1648. }
  1649. //doQueryJudgeBath(uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["JugdeApplyCode"].Text);
  1650. if (uRow.Cells["ProcessCdoe"].Value.ToString() == "G" || uRow.Cells["ProcessCdoe"].Value.ToString() == "F")
  1651. {
  1652. //Box.Visible = false;
  1653. List<QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<QcmZgJugdeApplyEntity>(
  1654. "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryQcmZgApplyData", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  1655. QcmZgApplyEntitybindingSource1.DataSource = listSource;
  1656. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryQcmZgApplyData2",
  1657. // new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
  1658. if (listSource.Count > 0)
  1659. {
  1660. ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
  1661. foreach (UltraGridRow row in this.ultraGrid2.Rows)
  1662. {
  1663. row.Cells["isFlag"].Value = "是";
  1664. }
  1665. }
  1666. else
  1667. {
  1668. ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
  1669. foreach (UltraGridRow row in this.ultraGrid2.Rows)
  1670. {
  1671. row.Cells["isFlag"].Value = "否";
  1672. }
  1673. }
  1674. }
  1675. //else
  1676. //{
  1677. // Box.Visible = false;
  1678. //}
  1679. foreach(UltraGridRow urg in ultraGrid3.Rows)
  1680. {
  1681. if (urg.Cells["ProcessCode"].Value.Equals("D"))
  1682. {
  1683. urg.Cells["ProcessCode"].Value = "扎管";
  1684. }
  1685. else if (urg.Cells["ProcessCode"].Value.Equals("E"))
  1686. {
  1687. urg.Cells["ProcessCode"].Value = "镦拔扩";
  1688. }
  1689. else if (urg.Cells["ProcessCode"].Value.Equals("F"))
  1690. {
  1691. urg.Cells["ProcessCode"].Value = "热处理";
  1692. }
  1693. }
  1694. ultraGrid2.UpdateData();
  1695. }
  1696. private void ultraGrid4_ClickCellButton(object sender, CellEventArgs e)
  1697. {
  1698. this.ultraGrid4.UpdateData();
  1699. if (e.Cell.Column.Key == "JugdeApplyCode")
  1700. {
  1701. string jugdeApplyCode = ultraGrid4.ActiveRow.Cells["JugdeApplyCode"].Value.ToString();
  1702. string judgeStoveNo = ultraGrid4.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
  1703. string ordenNo = ultraGrid4.ActiveRow.Cells["ProOrderNo"].Value.ToString();
  1704. FrmQcmAddAsk orderZg = new FrmQcmAddAsk(jugdeApplyCode, judgeStoveNo, ordenNo, this.ob);
  1705. orderZg.ShowDialog();
  1706. }
  1707. }
  1708. private void DoUpdate()
  1709. {
  1710. this.ultraGrid2.UpdateData();
  1711. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  1712. UltraGridRow sRow = this.ultraGrid1.ActiveRow;
  1713. if (uRow == null) return;
  1714. if (sRow == null) return;
  1715. string Process = sRow.Cells["ProcessCdoe"].Value.ToString();
  1716. MatBcMEntity matBcEntity = (MatBcMEntity)ultraGrid1.ActiveRow.ListObject;
  1717. if (!sRow.Cells["TestingGrade"].Value.Equals(""))
  1718. {
  1719. matBcEntity.TestingGrade = sRow.Cells["TestingGrade"].Text.ToString();
  1720. }
  1721. if (!sRow.Cells["TestingType"].Value.Equals(""))
  1722. {
  1723. matBcEntity.TestingType = sRow.Cells["TestingType"].Text.ToString();
  1724. }
  1725. if (!sRow.Cells["DetectResultCode"].Value.Equals(""))
  1726. {
  1727. matBcEntity.DetectResultCode = sRow.Cells["DetectResultCode"].Value.ToString();
  1728. }
  1729. if (!sRow.Cells["TestingStandar"].Value.Equals(""))
  1730. {
  1731. matBcEntity.TestingStandar = sRow.Cells["TestingStandar"].Text.ToString();
  1732. }
  1733. string matEntity = JSONFormat.Format(matBcEntity);
  1734. CoreClientParam ccp = new CoreClientParam();
  1735. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  1736. ccp.MethodName = "DoUpdateJudge";
  1737. ccp.ServerParams = new object[] { matEntity };
  1738. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1739. if (ccp.ReturnCode != -1)
  1740. {
  1741. if (ccp.ReturnInfo.Equals("修改成功!"))
  1742. {
  1743. QueryMat();
  1744. MessageUtil.ShowTips("修改成功!");
  1745. }
  1746. else
  1747. {
  1748. MessageUtil.ShowTips(ccp.ReturnInfo);
  1749. }
  1750. }
  1751. }
  1752. /// <summary>
  1753. /// 标识空跑
  1754. /// </summary>
  1755. private void DoKpFlag()
  1756. {
  1757. this.ultraGrid4.UpdateData();
  1758. UltraGridRow uRow = this.ultraGrid4.ActiveRow;
  1759. if (uRow == null) return;
  1760. IQueryable<UltraGridRow> checkMags = this.ultraGrid4.Rows.AsQueryable().Where(" CHK = 'True'");
  1761. if (checkMags.Count() == 0)
  1762. {
  1763. MessageUtil.ShowTips("请选择需要送判的炉批信息!");
  1764. return;
  1765. }
  1766. ArrayList parmList = new ArrayList();
  1767. foreach (UltraGridRow row in checkMags)
  1768. {
  1769. QcmZgJugdeApplyEntity matBcEntity = (QcmZgJugdeApplyEntity)row.ListObject;
  1770. string matEntity = JSONFormat.Format(matBcEntity);
  1771. parmList.Add(matEntity);
  1772. }
  1773. CoreClientParam ccp = new CoreClientParam();
  1774. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  1775. ccp.MethodName = "DoKpFlag";
  1776. ccp.ServerParams = new object[] { parmList };
  1777. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1778. if (ccp.ReturnCode != -1)
  1779. {
  1780. if (ccp.ReturnInfo.Equals("标识成功!"))
  1781. {
  1782. QueryMat();
  1783. MessageUtil.ShowTips("标识成功!");
  1784. }
  1785. else
  1786. {
  1787. MessageUtil.ShowTips(ccp.ReturnInfo);
  1788. }
  1789. }
  1790. }
  1791. }
  1792. }