FrmPhosphateResult.cs 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using com.steering.mes.mcp.entity;
  11. using Core.Mes.Client.Comm.Server;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Core.Mes.Client.Comm.Control;
  14. using Core.StlMes.Client.Mcp.Common;
  15. using Core.Mes.Client.Comm.Tool;
  16. using Core.StlMes.Client.Mcp.CollarMaterial;
  17. using System.Collections;
  18. using Core.StlMes.Client.Mcp.Control;
  19. using Core.StlMes.Client.Mcp.Coupling;
  20. using Core.StlMes.Client.Mcp.Entity;
  21. using Core.StlMes.Client.Mcp.Report;
  22. using Infragistics.Win;
  23. namespace Core.StlMes.Client.Coup
  24. {
  25. public partial class FrmPhosphateResult : FrmBase
  26. {
  27. private string departm = "";//获取部门ID
  28. private string[] plineCode = null;//获取产线代码
  29. private string Process= "";//工序
  30. private string ProName = "";//工序名称
  31. private string PbGx = "";//喷标工序
  32. private string PbName = "";//喷标工序名称
  33. private string LiXian = "";
  34. private string StrMemo = "";//备注
  35. private string[] plineCodes;
  36. private int CutPiece = 0;
  37. private int phosphatePiece = 0;
  38. public FrmPhosphateResult()
  39. {
  40. InitializeComponent();
  41. }
  42. protected override void OnLoad(EventArgs e)
  43. {
  44. base.OnLoad(e);
  45. this.ultraGrid2.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnBottom;
  46. this.ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  47. this.ultraGrid2.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.Select;
  48. //this.coupThreadingControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  49. //禁控件过滤
  50. //this.coupWoIdPlanControl1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  51. //this.phosphateContro1.Grid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  52. //设置计划区控件只读
  53. //this.coupWoIdPlanControl1.SetAllColumnsActiveOnly();
  54. //coupWoIdPlanControl1.Ob = this.ob;
  55. initControl();
  56. }
  57. private void FrmPhosphateResult_Load(object sender, EventArgs e)
  58. {
  59. EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGridWoId.DisplayLayout.Bands[0]);
  60. EntityHelper.ShowGridCaption<PlnZyJgWorkbillEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  61. EntityHelper.ShowGridCaption<PlnZyJgWorkMidbillEntity>(ultraGrid3.DisplayLayout.Bands[0]);
  62. departm = UserInfo.GetDeptid();
  63. //plineCode = McpBaseHelper.GetPCodePline(departm, this.ob);
  64. plineCodes = comm.GetPlineCode(this.ValidDataPurviewIds, "H", ob);
  65. //McpBaseHelper.InitPlineUnit(cmbCname, plineCode, this.ob);
  66. ProTime.Value = DateTime.Today;
  67. dateTime.Value = DateTime.Today;
  68. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryColUser", new object[] { "7030" }, this.ob);
  69. if (dt.Rows.Count > 0)
  70. {
  71. Operator.DataSource = dt;
  72. Operator.DisplayMember = "BASENAME";
  73. Operator.ValueMember = "BASECODE";
  74. YdmBaseClass.SetComboItemHeight(Operator);
  75. }
  76. //获取磷化工序
  77. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "700310" }, this.ob);
  78. if (dt2.Rows.Count > 0)
  79. {
  80. Process = dt2.Rows[0]["BASECODE"].ToString();
  81. ProName = dt2.Rows[0]["BASENAME"].ToString();
  82. }
  83. //获取喷标工序
  84. DataTable dt3 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "700311" }, this.ob);
  85. if (dt3.Rows.Count > 0)
  86. {
  87. PbGx = dt3.Rows[0]["BASECODE"].ToString();
  88. PbName = dt3.Rows[0]["BASENAME"].ToString();
  89. }
  90. }
  91. public override void ToolBar_Click(object sender, string ToolbarKey)
  92. {
  93. switch (ToolbarKey)
  94. {
  95. case "DoQuery":
  96. QuerySinglePlan();
  97. break;
  98. case "DoQueryInList":
  99. doQueryInList();
  100. break;
  101. case "DoSave":
  102. DoSave();
  103. break;
  104. case "DoDelete":
  105. DoDelete();
  106. break;
  107. case "DoUpdate":
  108. DoUpdate();
  109. break;
  110. case "DoInsDelete":
  111. DoInsDelete();//检验删除
  112. break;
  113. case "DoInsUpdate":
  114. DoInsUpdate();//检验修改
  115. break;
  116. case "DoComplete":
  117. DoComplete();//结炉
  118. break;
  119. case "UnDoComplete":
  120. UnDoComplete();//撤销结炉
  121. break;
  122. case "Offline"://离线
  123. Offline();
  124. break;
  125. //case "unOffline"://撤销离线
  126. // unOffline();
  127. // break;
  128. case "Confirm":
  129. confirm();//确认
  130. break;
  131. case "CancelConfirm":
  132. cancelConfirm();
  133. break;
  134. case "DoClose":
  135. this.Close();
  136. break;
  137. }
  138. }
  139. ///
  140. /// 取消确认
  141. ///
  142. private void cancelConfirm()
  143. {
  144. ultraGrid4.UpdateData();
  145. UltraGridRow uRow = this.ultraGrid4.ActiveRow;
  146. if (uRow == null) { MessageUtil.ShowTips("无磷化实绩!"); return; }
  147. UltraGridRow row = this.ultraGridWoId.ActiveRow;
  148. if (row == null)
  149. {
  150. MessageUtil.ShowTips("无工单信息,不允许此操作!");
  151. }
  152. ArrayList list1 = new ArrayList();
  153. int UpdaCount = 0;
  154. foreach (UltraGridRow ugr in ultraGrid4.Rows)
  155. {
  156. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  157. {
  158. if (ugr.Cells["CONFIRM"].Value.ToString().Equals("0"))
  159. {
  160. MessageUtil.ShowTips("选中有没确认实绩,不允许取消确认!");
  161. return;
  162. }
  163. UpdaCount += 1;
  164. ArrayList list = new ArrayList();
  165. list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
  166. list.Add(UserInfo.GetUserName());
  167. list.Add(DateTime.Now.ToString());
  168. list1.Add(list);
  169. }
  170. }
  171. if (UpdaCount == 0) { MessageUtil.ShowTips("请选择磷化实绩数据!"); return; }
  172. if (MessageUtil.ShowYesNoAndQuestion("是否取消确认磷化实绩?") == DialogResult.No)
  173. {
  174. return;
  175. }
  176. CoreClientParam ccp = new CoreClientParam();
  177. try
  178. {
  179. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  180. if (Constant.WaitingForm == null)
  181. {
  182. Constant.WaitingForm = new WaitingForm();
  183. }
  184. Constant.WaitingForm.ShowToUser = true;
  185. Constant.WaitingForm.Show();
  186. Constant.WaitingForm.Update();
  187. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  188. ccp.MethodName = "getCancelConfirm";
  189. ccp.ServerParams = new object[] { list1 };
  190. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  191. this.Cursor = Cursors.Default;
  192. Constant.WaitingForm.ShowToUser = false;
  193. Constant.WaitingForm.Close();
  194. Constant.WaitingForm = null;
  195. }
  196. catch (Exception ex)
  197. {
  198. this.Cursor = Cursors.Default;
  199. Constant.WaitingForm.ShowToUser = false;
  200. Constant.WaitingForm.Close();
  201. Constant.WaitingForm = null;
  202. }
  203. if (ccp.ReturnCode != -1)
  204. {
  205. MessageUtil.ShowTips(ccp.ReturnInfo);
  206. if (ccp.ReturnInfo.Equals("取消确认成功!"))
  207. {
  208. QuerySinglePlan();
  209. }
  210. }
  211. }
  212. ///
  213. /// 确认
  214. ///
  215. private void confirm()
  216. {
  217. ultraGrid4.UpdateData();
  218. UltraGridRow uRow = this.ultraGrid4.ActiveRow;
  219. if (uRow == null) { MessageUtil.ShowTips("无磷化实绩!"); return; }
  220. UltraGridRow row = this.ultraGridWoId.ActiveRow;
  221. if (row == null)
  222. {
  223. MessageUtil.ShowTips("无工单信息,不允许此操作!");
  224. }
  225. ArrayList list1 = new ArrayList();
  226. int UpdaCount = 0;
  227. foreach (UltraGridRow ugr in ultraGrid4.Rows)
  228. {
  229. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  230. {
  231. if (ugr.Cells["CONFIRM"].Value.ToString().Equals("1"))
  232. {
  233. MessageUtil.ShowTips("选中有已确认实绩,不允许再次确认!");
  234. return;
  235. }
  236. UpdaCount += 1;
  237. ArrayList list = new ArrayList();
  238. list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
  239. list.Add(UserInfo.GetUserName());
  240. list.Add(DateTime.Now.ToString());
  241. list1.Add(list);
  242. }
  243. }
  244. if (UpdaCount == 0) { MessageUtil.ShowTips("请选择磷化实绩数据!"); return; }
  245. if (MessageUtil.ShowYesNoAndQuestion("是否确认磷化实绩?") == DialogResult.No)
  246. {
  247. return;
  248. }
  249. CoreClientParam ccp = new CoreClientParam();
  250. try
  251. {
  252. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  253. if (Constant.WaitingForm == null)
  254. {
  255. Constant.WaitingForm = new WaitingForm();
  256. }
  257. Constant.WaitingForm.ShowToUser = true;
  258. Constant.WaitingForm.Show();
  259. Constant.WaitingForm.Update();
  260. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  261. ccp.MethodName = "getConfirm";
  262. ccp.ServerParams = new object[] { list1 };
  263. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  264. this.Cursor = Cursors.Default;
  265. Constant.WaitingForm.ShowToUser = false;
  266. Constant.WaitingForm.Close();
  267. Constant.WaitingForm = null;
  268. }
  269. catch (Exception ex)
  270. {
  271. this.Cursor = Cursors.Default;
  272. Constant.WaitingForm.ShowToUser = false;
  273. Constant.WaitingForm.Close();
  274. Constant.WaitingForm = null;
  275. }
  276. if (ccp.ReturnCode != -1)
  277. {
  278. MessageUtil.ShowTips(ccp.ReturnInfo);
  279. if (ccp.ReturnInfo.Equals("确认成功!"))
  280. {
  281. QuerySinglePlan();
  282. }
  283. }
  284. }
  285. //查询交库实绩
  286. private void doQueryInList()
  287. {
  288. string[] starts = { };
  289. string woId = "";
  290. string judgeStoveNo = "";
  291. string plnNo = "";
  292. #region 条件
  293. if (chkStarts.Checked)
  294. {
  295. if (string.IsNullOrEmpty(cmbStarts.Text.Trim()))
  296. {
  297. MessageUtil.ShowTips("请选择工单状态!");
  298. return;
  299. }
  300. else
  301. {
  302. starts = (cmbStarts.Value as List<object>).Select(p => p.ToString().Trim()).ToArray();
  303. }
  304. }
  305. if (chkwoId.Checked && string.IsNullOrEmpty(txtWoId.Text.Trim()))
  306. {
  307. MessageUtil.ShowTips("请输入工单号!");
  308. return;
  309. }
  310. else
  311. {
  312. woId = txtWoId.Text.ToString().Trim();
  313. }
  314. if (chkPlnNo.Checked && string.IsNullOrEmpty(txtPlnNo.Text.Trim()))
  315. {
  316. MessageUtil.ShowTips("请输入炉次计划号!");
  317. return;
  318. }
  319. else
  320. {
  321. plnNo = txtPlnNo.Text.ToString().Trim();
  322. }
  323. if (chkJuNo.Checked && string.IsNullOrEmpty(txtJudgeStoveNO.Text.Trim()))
  324. {
  325. MessageUtil.ShowTips("请输入炉号!");
  326. return;
  327. }
  328. else
  329. {
  330. judgeStoveNo = txtJudgeStoveNO.Text.ToString().Trim();
  331. }
  332. #endregion
  333. ArrayList list = new ArrayList();
  334. list.Add(woId);
  335. list.Add(plnNo);
  336. list.Add(judgeStoveNo);
  337. List<PlnZyJgWorkMidbillEntity> listSource1 = EntityHelper.GetData<PlnZyJgWorkMidbillEntity>
  338. ("com.steering.mes.mcp.coup.PhosphateResultService.getphosInResult", new object[] { list, starts }, this.ob);
  339. PlnMiddbindingSource.DataSource = listSource1;
  340. //DataTable dt1 = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmInLibrary.doQueryMatNo", new object[] { list, plineCode[0].ToString() }, this.ob);
  341. //GridHelper.CopyDataToDatatable(ref dt1, ref dataTable2, true);
  342. }
  343. /// <summary>
  344. /// 离线
  345. /// </summary>
  346. private void Offline()
  347. {
  348. string _strat = "";
  349. //UltraGridRow row1 = ultraGrid4.ActiveRow;
  350. //if (row1 == null)
  351. //{
  352. // MessageUtil.ShowTips("没有磷化实绩不能离线!");
  353. // return;
  354. //}
  355. OffLineCut frm = new OffLineCut();
  356. frm.ShowDialog();
  357. LiXian = frm.StrNum;
  358. _strat = frm.Strat;
  359. StrMemo = frm.StrMemo;
  360. if (_strat.Equals("2")) return;
  361. if (LiXian.Equals("") || LiXian.Equals("0")) { MessageUtil.ShowTips("离线个数不能为空!"); return; }
  362. UltraGridRow row = ultraGridWoId.ActiveRow;
  363. if (row == null) return;
  364. if (row.Cells["ZyBillStatus"].Value.ToString() == "生产完成")
  365. {
  366. MessageUtil.ShowTips("此炉次计划整体已生产完成,不允许此操作!");
  367. return;
  368. }
  369. string woId = row.Cells["WoId"].Value.ToString();
  370. //查询切断实绩支数和
  371. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResult", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
  372. //VrpLoadingResultEntity result1 = new VrpLoadingResultEntity();
  373. //this.planExpanQuery1.Value = result;
  374. string pronum = "";//锯切支数
  375. string cutnum = "";//锯切个数
  376. if (dt.Rows.Count > 0)
  377. {
  378. pronum = dt.Rows[0]["PRO_NUM"].ToString();
  379. cutnum = dt.Rows[0]["CUT_NUM"].ToString();
  380. }
  381. else
  382. {
  383. pronum = "0";
  384. cutnum = "0";
  385. }
  386. if (!row.Cells["Ifsplit"].Value.Equals("1"))
  387. {
  388. if (Convert.ToInt32(LiXian) > Convert.ToInt32(cutnum) - Convert.ToInt32(phosphatePiece) - Convert.ToInt32(offlinePiece.Value))
  389. {
  390. MessageUtil.ShowTips("离线个数不能大于锯切个数减去已经磷化和离线个数的差!");
  391. return;
  392. }
  393. }
  394. offlinePiece.Value = Convert.ToInt32(LiXian) + Convert.ToInt32(offlinePiece.Value);
  395. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
  396. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  397. //{
  398. // if (dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  399. // {
  400. // MessageUtil.ShowTips("此工单镀铜工序点已结炉,不允许此操作!");
  401. // return;
  402. // }
  403. //}
  404. // if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  405. //{
  406. // if (dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  407. // {
  408. // MessageUtil.ShowTips("此工单磷化工序点已结炉,不允许此操作!");
  409. // return;
  410. // }
  411. //}
  412. // else
  413. //{
  414. // MessageUtil.ShowTips("此工序没有磷化镀铜,不允许离线!");
  415. // return;
  416. //}
  417. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryCouplingcominfo", new object[] { woId, Process }, this.ob);
  418. //if (dt.Rows[0]["STATION_STATUS"].ToString().Equals("2"))
  419. //{
  420. // MessageUtil.ShowTips("此工单工序点已结炉,不允许此操作!");
  421. // return;
  422. //}
  423. string offline = "";
  424. string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  425. ArrayList list = new ArrayList();
  426. list.Add(LiXian);
  427. list.Add(row.Cells["WoId"].Text.ToString());
  428. list.Add(row.Cells["HeatPlanNo"].Text.ToString());
  429. list.Add(row.Cells["JudgeStoveNo"].Text.ToString());
  430. list.Add(row.Cells["BatchNo"].Text.ToString());
  431. list.Add(row.Cells["PlineCode"].Text.ToString());
  432. list.Add(row.Cells["PlineName"].Text.ToString());
  433. list.Add(this.UserInfo.GetUserName());
  434. list.Add(this.UserInfo.GetUserOrder());
  435. list.Add(this.UserInfo.GetUserGroup());
  436. list.Add(time);
  437. list.Add("");
  438. list.Add(StrMemo);
  439. list.Add(row.Cells["BatchGroudNo"].Value.ToString());
  440. if (row.Cells["CoatType"].Text.ToString().Equals("磷化"))
  441. {
  442. offline = "1";
  443. }
  444. else if (row.Cells["CoatType"].Text.ToString().Equals("镀铜"))
  445. {
  446. offline = "0";
  447. }
  448. else
  449. {
  450. offline = "2";
  451. }
  452. list.Add(offline);
  453. list.Add(row.Cells["CoatType"].Text.ToString());
  454. CoreClientParam ccp = new CoreClientParam();
  455. try
  456. {
  457. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  458. if (Constant.WaitingForm == null)
  459. {
  460. Constant.WaitingForm = new WaitingForm();
  461. }
  462. Constant.WaitingForm.ShowToUser = true;
  463. Constant.WaitingForm.Show();
  464. Constant.WaitingForm.Update();
  465. ccp.ServerName = "com.steering.mes.mcp.coup.CoupCutService";
  466. ccp.MethodName = "lixianThreadingResult";
  467. ccp.ServerParams = new object[] { list, Process,ProName };
  468. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  469. this.Cursor = Cursors.Default;
  470. Constant.WaitingForm.ShowToUser = false;
  471. Constant.WaitingForm.Close();
  472. Constant.WaitingForm = null;
  473. }
  474. catch (Exception ex)
  475. {
  476. this.Cursor = Cursors.Default;
  477. Constant.WaitingForm.ShowToUser = false;
  478. Constant.WaitingForm.Close();
  479. Constant.WaitingForm = null;
  480. }
  481. if (ccp.ReturnCode != -1)
  482. {
  483. MessageUtil.ShowTips(ccp.ReturnInfo);
  484. if (ccp.ReturnInfo.Equals("离线成功!"))
  485. {
  486. QuerySinglePlan();
  487. //DoClean();
  488. }
  489. }
  490. }
  491. /// 撤销离线
  492. /// </summary>
  493. private void unOffline()
  494. {
  495. //phosphateContro1.UpdateData();
  496. ultraGrid2.UpdateData();
  497. UltraGridRow row = ultraGridWoId.ActiveRow;
  498. if (row == null) { MessageUtil.ShowTips("无接箍计划!"); return; }
  499. if (row.Cells["ZyBillStatus"].Value.ToString() == "生产完成")
  500. {
  501. MessageUtil.ShowTips("此炉次计划整体已生产完成,不允许此操作!");
  502. return;
  503. }
  504. //string zYgNo = row.Cells["ZY_PLAN_ID"].Value.ToString();
  505. string woId = row.Cells["WoId"].Value.ToString();
  506. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
  507. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  508. //{
  509. // if (dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  510. // {
  511. // MessageUtil.ShowTips("此工单镀铜工序点已结炉,不允许此操作!");
  512. // return;
  513. // }
  514. //}
  515. //else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  516. //{
  517. // if (dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  518. // {
  519. // MessageUtil.ShowTips("此工单磷化工序点已结炉,不允许此操作!");
  520. // return;
  521. // }
  522. //}
  523. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryCouplingcominfo", new object[] { woId, Process }, this.ob);
  524. //if (dt.Rows[0]["STATION_STATUS"].ToString().Equals("2"))
  525. //{
  526. // MessageUtil.ShowTips("此工单工序点已结炉,不允许此操作!");
  527. // return;
  528. //}
  529. int DeleteCount = 0;
  530. ArrayList list1 = new ArrayList();
  531. ArrayList pram = new ArrayList();
  532. if (row.Cells["CoatType"].Text.Trim().Equals("磷化"))
  533. {
  534. UltraGridRow rowMat = ultraGrid4.ActiveRow;
  535. if (rowMat == null) { MessageUtil.ShowTips("无磷化实绩记录!"); return; }
  536. pram.Add("0");
  537. //pram.Add(row.Cells["ZY_PLAN_ID"].Text.Trim());
  538. pram.Add(row.Cells["IfOutCopper"].Text.Trim());
  539. pram.Add(row.Cells["WoId"].Text.Trim());
  540. pram.Add(Process);
  541. foreach (UltraGridRow ugr in ultraGrid4.Rows)
  542. {
  543. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  544. {
  545. DeleteCount += 1;
  546. ArrayList list = new ArrayList();
  547. list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
  548. list.Add(ugr.Cells["OFF_NUM"].Text.ToString());
  549. list1.Add(list);
  550. }
  551. }
  552. }
  553. else if (row.Cells["COAT_TYPE"].Text.Trim().Equals("镀铜"))
  554. {
  555. UltraGridRow rowMat = ultraGrid5.ActiveRow;
  556. if (rowMat == null) { MessageUtil.ShowTips("无镀铜实绩记录!"); return; }
  557. pram.Add("1");
  558. //pram.Add(row.Cells["ZY_PLAN_ID"].Text.Trim());
  559. pram.Add(row.Cells["IfOutCopper"].Text.Trim());
  560. pram.Add(row.Cells["WoId"].Text.Trim());
  561. pram.Add(Process);
  562. foreach (UltraGridRow ugr in ultraGrid5.Rows)
  563. {
  564. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  565. {
  566. DeleteCount += 1;
  567. ArrayList list = new ArrayList();
  568. list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
  569. list.Add(ugr.Cells["OFF_NUM"].Text.ToString());
  570. list1.Add(list);
  571. }
  572. }
  573. }
  574. else
  575. {
  576. MessageUtil.ShowTips("不需要镀铜磷化!");
  577. return;
  578. }
  579. if (DeleteCount == 0) { MessageUtil.ShowTips("请选择要删除的记录!"); return; }
  580. if (MessageUtil.ShowYesNoAndQuestion("是否撤销离线?") == DialogResult.No)
  581. {
  582. return;
  583. }
  584. CoreClientParam ccp = new CoreClientParam();
  585. try
  586. {
  587. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  588. if (Constant.WaitingForm == null)
  589. {
  590. Constant.WaitingForm = new WaitingForm();
  591. }
  592. Constant.WaitingForm.ShowToUser = true;
  593. Constant.WaitingForm.Show();
  594. Constant.WaitingForm.Update();
  595. ccp.ServerName = "com.steering.mes.mcp.coup.CoupCutService";
  596. ccp.MethodName = "unlixianThreadingResult";
  597. ccp.ServerParams = new object[] { list1, woId, Process };
  598. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  599. this.Cursor = Cursors.Default;
  600. Constant.WaitingForm.ShowToUser = false;
  601. Constant.WaitingForm.Close();
  602. Constant.WaitingForm = null;
  603. }
  604. catch (Exception ex)
  605. {
  606. this.Cursor = Cursors.Default;
  607. Constant.WaitingForm.ShowToUser = false;
  608. Constant.WaitingForm.Close();
  609. Constant.WaitingForm = null;
  610. }
  611. if (ccp.ReturnCode == -1) return;
  612. MessageUtil.ShowTips(ccp.ReturnInfo);
  613. if (ccp.ReturnInfo.Equals("撤销离线成功!"))
  614. {
  615. QuerySinglePlan();
  616. }
  617. }
  618. /// <summary>
  619. /// 结炉
  620. /// </summary>
  621. private void DoComplete()
  622. {
  623. UltraGridRow row = ultraGridWoId.ActiveRow;
  624. if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
  625. //string zYgNo = row.Cells["ZY_PLAN_ID"].Value.ToString();
  626. string woId = row.Cells["WoId"].Value.ToString();
  627. // DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId }, this.ob);
  628. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  629. //{
  630. // if (dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  631. // {
  632. // MessageUtil.ShowTips("此工单镀铜工序点已结炉,不允许此操作!");
  633. // return;
  634. // }
  635. //}
  636. //else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  637. //{
  638. // if (dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  639. // {
  640. // MessageUtil.ShowTips("此工单磷化工序点已结炉,不允许此操作!");
  641. // return;
  642. // }
  643. //}
  644. //else
  645. //{
  646. // MessageUtil.ShowTips("不需磷化镀铜,不允许次操作!");
  647. // return;
  648. //}
  649. //if (dt.Rows[0]["ZyBillStatus"].ToString().Equals("生产完成"))
  650. //{
  651. // MessageUtil.ShowTips("此工单状态已生产完成,不允许此操作!");
  652. // return;
  653. //}
  654. //ArrayList list = new ArrayList();
  655. //list.Add(row.Cells["COAT_TYPE"].Text.ToString());
  656. //list.Add(Process);
  657. //list.Add(woId);
  658. //list.Add(row.Cells["IF_OUT_COPPER"].Text.ToString());
  659. if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉?") == DialogResult.No)
  660. {
  661. return;
  662. }
  663. CoreClientParam ccp = new CoreClientParam();
  664. try
  665. {
  666. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  667. if (Constant.WaitingForm == null)
  668. {
  669. Constant.WaitingForm = new WaitingForm();
  670. }
  671. Constant.WaitingForm.ShowToUser = true;
  672. Constant.WaitingForm.Show();
  673. Constant.WaitingForm.Update();
  674. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  675. ccp.MethodName = "updatePlanResult";
  676. ccp.ServerParams = new object[] { Process,PbGx, woId };
  677. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  678. this.Cursor = Cursors.Default;
  679. Constant.WaitingForm.ShowToUser = false;
  680. Constant.WaitingForm.Close();
  681. Constant.WaitingForm = null;
  682. }
  683. catch (Exception ex)
  684. {
  685. this.Cursor = Cursors.Default;
  686. Constant.WaitingForm.ShowToUser = false;
  687. Constant.WaitingForm.Close();
  688. Constant.WaitingForm = null;
  689. }
  690. if (ccp.ReturnCode == -1) return;
  691. MessageUtil.ShowTips(ccp.ReturnInfo);
  692. if (ccp.ReturnInfo.Equals("结炉成功!"))
  693. {
  694. QuerySinglePlan();
  695. }
  696. }
  697. /// <summary>
  698. /// 撤销结炉
  699. /// </summary>
  700. private void UnDoComplete()
  701. {
  702. UltraGridRow row = ultraGridWoId.ActiveRow;
  703. if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
  704. //string zYgNo = row.Cells["ZY_PLAN_ID"].Value.ToString();
  705. string woId = row.Cells["WoId"].Value.ToString();
  706. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
  707. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  708. //{
  709. // if (!dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  710. // {
  711. // MessageUtil.ShowTips("此工单镀铜工序点未结炉,不允许此操作!");
  712. // return;
  713. // }
  714. //}
  715. //else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  716. //{
  717. // if (!dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  718. // {
  719. // MessageUtil.ShowTips("此工单磷化工序点未结炉,不允许此操作!");
  720. // return;
  721. // }
  722. //}
  723. //else
  724. //{
  725. // MessageUtil.ShowTips("不需磷化镀铜,不允许次操作!");
  726. // return;
  727. //}
  728. //if (dt.Rows[0]["ZyBillStatus"].ToString().Equals("生产完成"))
  729. //{
  730. // MessageUtil.ShowTips("此工单状态已生产完成,不允许此操作!");
  731. // return;
  732. //}
  733. //ArrayList list = new ArrayList();
  734. //list.Add(zYgNo);
  735. //list.Add(row.Cells["COAT_TYPE"].Text.ToString());
  736. //list.Add(Process);
  737. //list.Add(woId);
  738. //list.Add(row.Cells["IF_OUT_COPPER"].Text.ToString());
  739. if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销结炉?") == DialogResult.No)
  740. {
  741. return;
  742. }
  743. CoreClientParam ccp = new CoreClientParam();
  744. try
  745. {
  746. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  747. if (Constant.WaitingForm == null)
  748. {
  749. Constant.WaitingForm = new WaitingForm();
  750. }
  751. Constant.WaitingForm.ShowToUser = true;
  752. Constant.WaitingForm.Show();
  753. Constant.WaitingForm.Update();
  754. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  755. ccp.MethodName = "unDoCompleteResult";
  756. ccp.ServerParams = new object[] { Process, PbGx,woId };
  757. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  758. this.Cursor = Cursors.Default;
  759. Constant.WaitingForm.ShowToUser = false;
  760. Constant.WaitingForm.Close();
  761. Constant.WaitingForm = null;
  762. }
  763. catch (Exception ex)
  764. {
  765. this.Cursor = Cursors.Default;
  766. Constant.WaitingForm.ShowToUser = false;
  767. Constant.WaitingForm.Close();
  768. Constant.WaitingForm = null;
  769. }
  770. if (ccp.ReturnCode == -1) return;
  771. MessageUtil.ShowTips(ccp.ReturnInfo);
  772. if (ccp.ReturnInfo.Equals("撤销结炉成功!"))
  773. {
  774. QuerySinglePlan();
  775. }
  776. }
  777. /// <summary>
  778. /// 简单查询
  779. /// </summary>
  780. private void QuerySinglePlan()
  781. {
  782. string woId = "";
  783. string[] starts = { };
  784. string judgeStoveNo = "";
  785. string plnNo = "";
  786. #region 条件
  787. if (chkStarts.Checked)
  788. {
  789. if (string.IsNullOrEmpty(cmbStarts.Text.Trim()))
  790. {
  791. MessageUtil.ShowTips("请选择工单状态!");
  792. return;
  793. }
  794. else
  795. {
  796. starts = (cmbStarts.Value as List<object>).Select(p => p.ToString().Trim()).ToArray();
  797. }
  798. }
  799. if (chkwoId.Checked)
  800. {
  801. if (chkwoId.Checked && string.IsNullOrEmpty(txtWoId.Text.Trim()))
  802. {
  803. MessageUtil.ShowTips("请输入工单号!");
  804. return;
  805. }
  806. else
  807. {
  808. woId = txtWoId.Text.ToString().Trim();
  809. }
  810. }
  811. else
  812. {
  813. woId = "";
  814. }
  815. if (chkPlnNo.Checked)
  816. {
  817. if (chkPlnNo.Checked && string.IsNullOrEmpty(txtPlnNo.Text.Trim()))
  818. {
  819. MessageUtil.ShowTips("请输入炉次计划号!");
  820. return;
  821. }
  822. else
  823. {
  824. plnNo = txtPlnNo.Text.ToString().Trim();
  825. }
  826. }
  827. else
  828. {
  829. plnNo = "";
  830. }
  831. if (chkJuNo.Checked)
  832. {
  833. if (chkJuNo.Checked && string.IsNullOrEmpty(txtJudgeStoveNO.Text.Trim()))
  834. {
  835. MessageUtil.ShowTips("请输入炉号!");
  836. return;
  837. }
  838. else
  839. {
  840. judgeStoveNo = txtJudgeStoveNO.Text.ToString().Trim();
  841. }
  842. }
  843. else
  844. {
  845. judgeStoveNo = "";
  846. }
  847. #endregion
  848. List<PlnZyJgWorkbillEntity> listSource = EntityHelper.GetData<PlnZyJgWorkbillEntity>
  849. ("com.steering.mes.mcp.coup.CoupLoadingService.getQueryWoId", new object[] { woId, plnNo, judgeStoveNo, starts, plineCodes }, this.ob);
  850. plnZyJgWorkbillEntitySource.DataSource = listSource;
  851. DoClean();
  852. //GridHelper.RefreshAndAutoSize(ultraGridWoId);
  853. // List<PlnZyJgWorkbillEntity> listSource1 = EntityHelper.GetData<PlnZyJgWorkbillEntity>
  854. //("com.steering.mes.mcp.coup.CoupLoadingService.ulgetQueryWoId", new object[] { woId, plnNo, judgeStoveNo, starts, plineCode[0].ToString() }, this.ob);
  855. // bindingSource1.DataSource = listSource1;
  856. // GridHelper.RefreshAndAutoSize(ultraGrid1);
  857. }
  858. private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  859. {
  860. if (toolMenu == null) return;
  861. if (e.Tab.TabControl.SelectedTab.Key.Equals("0"))
  862. {
  863. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery")) { toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.True; }
  864. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList")) { toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False; }
  865. if (toolMenu.Toolbars[0].Tools.Exists("DoSave")) { toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.True; }
  866. if (toolMenu.Toolbars[0].Tools.Exists("DoDelete")) { toolMenu.Toolbars[0].Tools["DoDelete"].InstanceProps.Visible = DefaultableBoolean.True; }
  867. if (toolMenu.Toolbars[0].Tools.Exists("DoUpdate")) { toolMenu.Toolbars[0].Tools["DoUpdate"].InstanceProps.Visible = DefaultableBoolean.True; }
  868. if (toolMenu.Toolbars[0].Tools.Exists("DoInsDelete")) { toolMenu.Toolbars[0].Tools["DoInsDelete"].InstanceProps.Visible = DefaultableBoolean.True; }
  869. if (toolMenu.Toolbars[0].Tools.Exists("DoInsUpdate")) { toolMenu.Toolbars[0].Tools["DoInsUpdate"].InstanceProps.Visible = DefaultableBoolean.True; }
  870. if (toolMenu.Toolbars[0].Tools.Exists("DoComplete")) { toolMenu.Toolbars[0].Tools["DoComplete"].InstanceProps.Visible = DefaultableBoolean.True; }
  871. if (toolMenu.Toolbars[0].Tools.Exists("UnDoComplete")) { toolMenu.Toolbars[0].Tools["UnDoComplete"].InstanceProps.Visible = DefaultableBoolean.True; }
  872. if (toolMenu.Toolbars[0].Tools.Exists("Offline")) { toolMenu.Toolbars[0].Tools["Offline"].InstanceProps.Visible = DefaultableBoolean.True; }
  873. if (toolMenu.Toolbars[0].Tools.Exists("DoClose")) { toolMenu.Toolbars[0].Tools["DoClose"].InstanceProps.Visible = DefaultableBoolean.True; }
  874. }
  875. else
  876. {
  877. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery")) { toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False; }
  878. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList")) { toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.True; }
  879. if (toolMenu.Toolbars[0].Tools.Exists("DoSave")) { toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False; }
  880. if (toolMenu.Toolbars[0].Tools.Exists("DoDelete")) { toolMenu.Toolbars[0].Tools["DoDelete"].InstanceProps.Visible = DefaultableBoolean.False; }
  881. if (toolMenu.Toolbars[0].Tools.Exists("DoUpdate")) { toolMenu.Toolbars[0].Tools["DoUpdate"].InstanceProps.Visible = DefaultableBoolean.False; }
  882. if (toolMenu.Toolbars[0].Tools.Exists("DoInsDelete")) { toolMenu.Toolbars[0].Tools["DoInsDelete"].InstanceProps.Visible = DefaultableBoolean.False; }
  883. if (toolMenu.Toolbars[0].Tools.Exists("DoInsUpdate")) { toolMenu.Toolbars[0].Tools["DoInsUpdate"].InstanceProps.Visible = DefaultableBoolean.False; }
  884. if (toolMenu.Toolbars[0].Tools.Exists("DoComplete")) { toolMenu.Toolbars[0].Tools["DoComplete"].InstanceProps.Visible = DefaultableBoolean.False; }
  885. if (toolMenu.Toolbars[0].Tools.Exists("UnDoComplete")) { toolMenu.Toolbars[0].Tools["UnDoComplete"].InstanceProps.Visible = DefaultableBoolean.False; }
  886. if (toolMenu.Toolbars[0].Tools.Exists("Offline")) { toolMenu.Toolbars[0].Tools["Offline"].InstanceProps.Visible = DefaultableBoolean.False; }
  887. if (toolMenu.Toolbars[0].Tools.Exists("DoClose")) { toolMenu.Toolbars[0].Tools["DoClose"].InstanceProps.Visible = DefaultableBoolean.False; }
  888. }
  889. }
  890. private void FrmPhosphateResult_Shown(object sender, EventArgs e)
  891. {
  892. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery")) { toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.True; }
  893. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList")) { toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False; }
  894. if (toolMenu.Toolbars[0].Tools.Exists("DoSave")) { toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.True; }
  895. if (toolMenu.Toolbars[0].Tools.Exists("DoDelete")) { toolMenu.Toolbars[0].Tools["DoDelete"].InstanceProps.Visible = DefaultableBoolean.True; }
  896. if (toolMenu.Toolbars[0].Tools.Exists("DoUpdate")) { toolMenu.Toolbars[0].Tools["DoUpdate"].InstanceProps.Visible = DefaultableBoolean.True; }
  897. if (toolMenu.Toolbars[0].Tools.Exists("DoInsDelete")) { toolMenu.Toolbars[0].Tools["DoInsDelete"].InstanceProps.Visible = DefaultableBoolean.True; }
  898. if (toolMenu.Toolbars[0].Tools.Exists("DoInsUpdate")) { toolMenu.Toolbars[0].Tools["DoInsUpdate"].InstanceProps.Visible = DefaultableBoolean.True; }
  899. if (toolMenu.Toolbars[0].Tools.Exists("DoComplete")) { toolMenu.Toolbars[0].Tools["DoComplete"].InstanceProps.Visible = DefaultableBoolean.True; }
  900. if (toolMenu.Toolbars[0].Tools.Exists("UnDoComplete")) { toolMenu.Toolbars[0].Tools["UnDoComplete"].InstanceProps.Visible = DefaultableBoolean.True; }
  901. if (toolMenu.Toolbars[0].Tools.Exists("Offline")) { toolMenu.Toolbars[0].Tools["Offline"].InstanceProps.Visible = DefaultableBoolean.True; }
  902. if (toolMenu.Toolbars[0].Tools.Exists("DoClose")) { toolMenu.Toolbars[0].Tools["DoClose"].InstanceProps.Visible = DefaultableBoolean.True; }
  903. }
  904. /// <summary>
  905. /// 接箍磷化检测实绩
  906. /// </summary>
  907. /// <param name="sender"></param>
  908. /// <param name="e"></param>
  909. private void ultraGridWoId_AfterRowActivate(object sender, EventArgs e)
  910. {
  911. UltraGridRow row = ultraGridWoId.ActiveRow;
  912. if (row == null) return;
  913. //string planNO = row.Cells["ZY_PLAN_ID"].Value.ToString();
  914. string plinCode = row.Cells["PlineCode"].Value.ToString();
  915. string woId = row.Cells["WoId"].Value.ToString();
  916. //this.getCoupProcessPlan(woId,planNO);
  917. //if (row.Cells["CoatType"].Text.Trim().Equals("磷化"))
  918. //{
  919. // //ultraTabControl2.Tabs[1].Visible = false;
  920. // ultraTabControl2.Tabs[2].Visible = true;
  921. // ultraTabControl2.Tabs[0].Visible = true;
  922. //}
  923. //else
  924. //{
  925. //this.getCopperPlantResult(woId);
  926. //ultraTabControl2.Tabs[0].Visible = false;
  927. //ultraTabControl2.Tabs[2].Visible = true;
  928. //ultraTabControl2.Tabs[1].Visible = true;
  929. //}
  930. if (row.Cells["DemandCopper"].Text.ToString().Contains("喷标"))
  931. {
  932. spray.Value = "1";
  933. }
  934. else
  935. {
  936. spray.Value = "0";
  937. }
  938. this.getCoupPhosphateResult(woId);
  939. //获取检测项目
  940. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPhosphateItem", new object[] { plinCode }, this.ob);
  941. JcProject.DataSource = dt;
  942. JcProject.DisplayMember = "TEST_ITEMS";
  943. JcProject.ValueMember = "ITEM_NO";
  944. PipeManageClass.SetComboItemHeight(JcProject);
  945. initControl();
  946. DoClean();
  947. }
  948. /// <summary>
  949. /// 查询磷化检验记录
  950. /// </summary>
  951. /// <param name="planNo"></param>
  952. private void getCoupPhosphateResultD(string resultNo,string woId)
  953. {
  954. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.getPhosphateRD", new object[] { resultNo,woId }, this.ob);
  955. GridHelper.CopyDataToDatatable(ref dt, ref dtInspect, true);
  956. }
  957. /// <summary>
  958. /// 查询磷化检测实绩
  959. /// </summary>
  960. /// <param name="planNo"></param>
  961. private void getCoupPhosphateResult(string woId)
  962. {
  963. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.getPhosphateResult", new object[] { woId }, this.ob);
  964. GridHelper.CopyDataToDatatable(ref dt, ref dtSelfChecked, true);
  965. foreach (UltraGridRow urg in ultraGrid4.Rows)
  966. {
  967. if (urg.Cells["CONFIRM"].Value.Equals("1"))
  968. {
  969. urg.Appearance.BackColor = Color.LightGreen;
  970. }
  971. }
  972. this.initControl();
  973. }
  974. /// <summary>
  975. /// 查询镀铜实绩
  976. /// </summary>
  977. /// <param name="planNo"></param>
  978. private void getCopperPlantResult(string woId)
  979. {
  980. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.getPhosphateResult", new object[] {woId }, this.ob);
  981. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  982. this.initControl();
  983. }
  984. /// <summary>
  985. /// 接箍加工计划详情
  986. /// </summary>
  987. /// <param name="planNo"></param>
  988. //private void getCoupProcessPlan(string woId,string planNo)
  989. //{
  990. // DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, planNo }, this.ob);
  991. // if (dt != null && dt.Rows.Count > 0)
  992. // {
  993. // this.coupWoIdPlanControl1.Value.PlineName = dt.Rows[0]["PLINE_NAME"].ToString();
  994. // this.coupWoIdPlanControl1.Value.CutMachGrpNm = dt.Rows[0]["CUT_MACH_GRP_NM"].ToString();
  995. // this.coupWoIdPlanControl1.Value.Memo = dt.Rows[0]["MEMO"].ToString();
  996. // this.coupWoIdPlanControl1.Value.ZyPlanId = dt.Rows[0]["ZY_PLAN_ID"].ToString();
  997. // this.coupWoIdPlanControl1.Value.IfMonitorJg = dt.Rows[0]["IF_MONITOR_JG"].ToString();
  998. // this.coupWoIdPlanControl1.Value.LoadPieces = dt.Rows[0]["LOAD_PIECES"].ToString();
  999. // this.coupWoIdPlanControl1.Value.LoadWeight = dt.Rows[0]["LOAD_WEIGHT"].ToString();
  1000. // this.coupWoIdPlanControl1.Value.ProPlanId = dt.Rows[0]["PRO_PLAN_ID"].ToString();
  1001. // this.coupWoIdPlanControl1.Value.Steelname = dt.Rows[0]["STEELNAME"].ToString();
  1002. // this.coupWoIdPlanControl1.Value.Gradename = dt.Rows[0]["GRADENAME"].ToString();
  1003. // this.coupWoIdPlanControl1.Value.JglDesc = dt.Rows[0]["JGL_DESC"].ToString();
  1004. // this.coupWoIdPlanControl1.Value.CodeJg = dt.Rows[0]["CODE_JG"].ToString();
  1005. // this.coupWoIdPlanControl1.Value.ModelDesc = dt.Rows[0]["MODEL_DESC"].ToString();
  1006. // this.coupWoIdPlanControl1.Value.SpecJgDesc = dt.Rows[0]["SPEC_JG_DESC"].ToString();
  1007. // this.coupWoIdPlanControl1.Value.StyleJg = dt.Rows[0]["STYLE_JG"].ToString();
  1008. // this.coupWoIdPlanControl1.Value.PlanJgNum = dt.Rows[0]["PLAN_JG_NUM"].ToString();
  1009. // this.coupWoIdPlanControl1.Value.CsJgNum = dt.Rows[0]["CS_JG_NUM"].ToString();
  1010. // this.coupWoIdPlanControl1.Value.XqJgNum = dt.Rows[0]["XQ_JG_NUM"].ToString();
  1011. // this.coupWoIdPlanControl1.Value.InstoreNum = dt.Rows[0]["INSTORE_NUM"].ToString();
  1012. // this.coupWoIdPlanControl1.Value.BlWlDesc = dt.Rows[0]["BL_WL_DESC"].ToString();
  1013. // //this.coupWoIdPlanControl1.Value.LoadWeight = "";
  1014. // this.coupWoIdPlanControl1.UpdateData();
  1015. // }
  1016. //}
  1017. /// <summary>
  1018. /// 初始化控件
  1019. /// </summary>
  1020. private void initControl()
  1021. {
  1022. UltraGridRow row = ultraGridWoId.ActiveRow;
  1023. if (row == null) return;
  1024. //查询切断实绩支数和
  1025. DataTable dtCut = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResultPiece", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
  1026. string pronum = "";
  1027. if (dtCut.Rows.Count > 0)
  1028. {
  1029. pronum = dtCut.Rows[0]["PRO_NUM"].ToString();
  1030. }
  1031. else
  1032. {
  1033. pronum = "0";
  1034. }
  1035. CutPiece = Convert.ToInt32(pronum);
  1036. //查询磷化实绩支数和
  1037. DataTable dtThread = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.getphosphResult", new object[] { row.Cells["WoId"].Value.ToString() }, this.ob);
  1038. if (dtThread.Rows.Count > 0)
  1039. {
  1040. phosphatePiece = Convert.ToInt32(dtThread.Rows[0]["PRO_NUM"].ToString());
  1041. }
  1042. else
  1043. {
  1044. phosphatePiece = 0;
  1045. }
  1046. //PhosphateResult result = new PhosphateResult();
  1047. ////if (CutPiece - threadNum <= 0)
  1048. ////{
  1049. //// result.ColCount = Convert.ToString(0);
  1050. //// phosphatePiece = 0;
  1051. ////}
  1052. ////else
  1053. ////{
  1054. //// result.ColCount = Convert.ToString(CutPiece - threadNum);
  1055. //// phosphatePiece = CutPiece - threadNum;
  1056. ////}
  1057. //result.ColShft = UserInfo.GetUserOrder();
  1058. //result.ColGroup = UserInfo.GetUserGroup();
  1059. //result.ColUser = UserInfo.GetUserName();
  1060. //result.ColTime = DateTime.Now.ToString("yyyy-MM-dd");
  1061. //if (row != null)
  1062. //{
  1063. // result.IsSpray = row.Cells["IfOutCopper"].Value.ToString();
  1064. //}
  1065. //this.phosphateContro1.Value = result;
  1066. }
  1067. private void DoClean()
  1068. {
  1069. numPieces.Value = "0";
  1070. txtEmbossed.Text = "";
  1071. adhesion.Text = "";
  1072. anti.Text = "";
  1073. reaction.Text = "";
  1074. surface.Text = "";
  1075. producer.Text = "";
  1076. Operator.Text = "";
  1077. group.Text = "";
  1078. user.Text = "";
  1079. txtSpray.Text = "";
  1080. sprayCount.Value = "0";
  1081. Memo.Text = "";
  1082. }
  1083. /// <summary>
  1084. /// 保存实绩
  1085. /// </summary>
  1086. private void DoSave()
  1087. {
  1088. ultraGrid2.UpdateData();
  1089. UltraGridRow row = ultraGridWoId.ActiveRow;
  1090. if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
  1091. string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
  1092. string woId = row.Cells["WoId"].Value.ToString();
  1093. if (!row.Cells["ZyBillStatus"].Value.ToString().Equals("生产中"))
  1094. {
  1095. MessageUtil.ShowTips("此工单不是生产中,不允许此操作!");
  1096. return;
  1097. }
  1098. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
  1099. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  1100. //{
  1101. // if (dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  1102. // {
  1103. // MessageUtil.ShowTips("此工单镀铜工序点已结炉,不允许此操作!");
  1104. // return;
  1105. // }
  1106. //}
  1107. //else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  1108. //{
  1109. // if (dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  1110. // {
  1111. // MessageUtil.ShowTips("此工单磷化工序点已结炉,不允许此操作!");
  1112. // return;
  1113. // }
  1114. //}
  1115. //QueryStatusGd(row.Cells["WoId"].Value.ToString(), row.Cells["ZY_PLAN_ID"].Value.ToString());
  1116. //if (row.Cells["CoatType"].Text.Trim().Equals("磷化"))
  1117. //{
  1118. // DoPhosphatAdd(row);
  1119. //}
  1120. //else if (row.Cells["CoatType"].Text.Trim().Equals("镀铜"))
  1121. //{
  1122. //DoCopperPlanAdd(row);
  1123. //}
  1124. //if (row.Cells["CoatType"].Text.Trim().Equals("/"))
  1125. //{
  1126. // MessageUtil.ShowTips("不需要磷化镀铜!");
  1127. // return;
  1128. //}
  1129. DoPhosphatAdd(row);
  1130. }
  1131. /// <summary>
  1132. /// 保存磷化
  1133. /// </summary>
  1134. private void DoPhosphatAdd(UltraGridRow row)
  1135. {
  1136. string SelectCount = "0";
  1137. string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  1138. // this.phosphateContro1.UpdateData();
  1139. if (ValidInput1())
  1140. {
  1141. string Adhesion = "";
  1142. string SurfaceCondition = "";
  1143. string IsSpray = "";
  1144. PhosphateResult result = new PhosphateResult();
  1145. Adhesion = adhesion.Value == "1" ? "1" : "0";
  1146. SurfaceCondition = surface.Value == "1" ? "1" : "0";
  1147. result.WoId = row.Cells["WoId"].Text.ToString();
  1148. result.PlanNo = row.Cells["HeatPlanNo"].Text.ToString();
  1149. result.PlineCode = row.Cells["PlineCode"].Text.ToString();
  1150. result.JudgeStoveNo = row.Cells["JudgeStoveNo"].Text.ToString();
  1151. result.BatchNo = row.Cells["BatchNo"].Text.ToString();
  1152. IsSpray = spray.Value == "1" ? "1" : "0";
  1153. result.ColCount = numPieces.Value.ToString();
  1154. result.Remark = Memo.Text;
  1155. result.ColOperator = Operator.Text.ToString();
  1156. result.ColGroup = group.Value.ToString();
  1157. result.ColShft = shift.Value.ToString();
  1158. result.MembranceThick = txtEmbossed.Text == "" ? "合格" : txtEmbossed.Text;
  1159. result.Adhesion = ultraTabPageControl9.Text;
  1160. result.AntiCorrosion = anti.Text == "" ? "合格" : anti.Text;
  1161. result.ReactionTime = reaction.Text == "" ? "合格" : reaction.Text;
  1162. result.Producer = producer.Text;
  1163. result.ProducerTime = ProTime.Value.ToString();
  1164. result.ColUser = user.Text.ToString();
  1165. result.SprayCount = sprayCount.Value.ToString();
  1166. result.ColTime = dateTime.Value.ToString();
  1167. result.SprayContent = txtSpray.Text.ToString();
  1168. result.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  1169. result.Remark = Memo.Text.ToString();
  1170. //result.IfAllOutWork = row.Cells["IF_ALL_OUT_WORK"].Text.ToString();
  1171. //result.WoId = row.Cells["WoId"].Text.ToString();
  1172. ArrayList list2 = new ArrayList();
  1173. list2.Add(Adhesion);
  1174. list2.Add(SurfaceCondition);
  1175. list2.Add(IsSpray);
  1176. ArrayList list1 = new ArrayList();
  1177. foreach (UltraGridRow ugr in ultraGrid2.Rows)
  1178. {
  1179. if (Convert.ToBoolean(ugr.Cells["CHECK"].Text) == true)
  1180. {
  1181. UltraGridRow urglh = ultraGrid4.ActiveRow;
  1182. //if (urglh == null) { MessageUtil.ShowTips("无镀铜/磷化实绩!"); return; }
  1183. if (ugr.Cells["ITEM_NO"].Text.Equals(""))
  1184. {
  1185. MessageUtil.ShowTips("请选择检测项目!");
  1186. return;
  1187. }
  1188. if (ugr.Cells["DOSAGE"].Text.Equals(""))
  1189. {
  1190. MessageUtil.ShowTips("请输入加药量!");
  1191. return;
  1192. }
  1193. if (ugr.Cells["TEMPERATURE"].Text.Equals(""))
  1194. {
  1195. MessageUtil.ShowTips("请输入检测温度!");
  1196. return;
  1197. }
  1198. SelectCount = "1";
  1199. ArrayList list = new ArrayList();
  1200. list.Add(ugr.Cells["SEQ_NO"].Text.ToString());
  1201. list.Add(ugr.Cells["ITEM_NO"].Value.ToString());
  1202. list.Add(ugr.Cells["TEST_RESULT_F"].Text.ToString());
  1203. list.Add(ugr.Cells["TEST_RESULT_T"].Text.ToString());
  1204. list.Add(ugr.Cells["DOSAGE"].Value.ToString());
  1205. list.Add(ugr.Cells["TEMPERATURE"].Value.ToString());
  1206. list.Add(ugr.Cells["DETAIL_NO"].Text.ToString());
  1207. list1.Add(list);
  1208. }
  1209. }
  1210. // if (SelectCount == 0) { MessageUtil.ShowTips("请选择检测项目!"); return; }
  1211. //double PlnCount = 0;//计划个数
  1212. //double CutCount = 0;//实际个数
  1213. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { row.Cells["WoId"].Text.ToString() }, ob);
  1214. //if (dt.Rows.Count > 0)
  1215. //{
  1216. // PlnCount = Double.Parse(dt.Rows[0]["PHOS_PLN_NUM"].ToString());
  1217. // CutCount = Double.Parse(dt.Rows[0]["PHOS_OK_NUM"].ToString());
  1218. //}
  1219. //// + Double.Parse(numQualified.Value.ToString())
  1220. //if (CutCount > PlnCount)
  1221. //{
  1222. // if (MessageUtil.ShowYesNoAndQuestion("实际磷化个数超过计划磷化个数是否新增!") == DialogResult.No) { return; }
  1223. //}
  1224. if (!row.Cells["Ifsplit"].Value.Equals("1"))
  1225. {
  1226. if (Convert.ToInt32(result.ColCount) > CutPiece)
  1227. {
  1228. MessageUtil.ShowTips("磷化个数大于加工最大可切个数!");
  1229. return;
  1230. }
  1231. }
  1232. if (MessageUtil.ShowYesNoAndQuestion("是否保存?") == DialogResult.No)
  1233. {
  1234. return;
  1235. }
  1236. CoreClientParam ccp = new CoreClientParam();
  1237. try
  1238. {
  1239. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1240. if (Constant.WaitingForm == null)
  1241. {
  1242. Constant.WaitingForm = new WaitingForm();
  1243. }
  1244. Constant.WaitingForm.ShowToUser = true;
  1245. Constant.WaitingForm.Show();
  1246. Constant.WaitingForm.Update();
  1247. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1248. ccp.MethodName = "addPhosphateResult";
  1249. ccp.ServerParams = new object[] { result, list1, Process, PbGx, list2, SelectCount, row.Cells["WoId"].Text.ToString() };
  1250. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1251. this.Cursor = Cursors.Default;
  1252. Constant.WaitingForm.ShowToUser = false;
  1253. Constant.WaitingForm.Close();
  1254. Constant.WaitingForm = null;
  1255. }
  1256. catch (Exception ex)
  1257. {
  1258. this.Cursor = Cursors.Default;
  1259. Constant.WaitingForm.ShowToUser = false;
  1260. Constant.WaitingForm.Close();
  1261. Constant.WaitingForm = null;
  1262. }
  1263. if (ccp.ReturnCode == -1) return;
  1264. MessageUtil.ShowTips(ccp.ReturnInfo);
  1265. if (ccp.ReturnInfo.Equals("新增成功!"))
  1266. {
  1267. QuerySinglePlan();
  1268. }
  1269. }
  1270. }
  1271. /// <summary>
  1272. /// 验证格试
  1273. /// </summary>
  1274. public bool ValidInput1()
  1275. {
  1276. //bool p = true;
  1277. if (Convert.ToInt32(numPieces.Value)<=0)
  1278. {
  1279. MessageBox.Show("个数 请输入整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1280. return false;
  1281. }
  1282. //if (txtEmbossed.Value==null||!StringUtil.IsInt(txtEmbossed.Value.ToString()))
  1283. //{
  1284. // MessageBox.Show("膜厚 请输入整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1285. // return false;
  1286. //}
  1287. //if (anti.Value==null||!StringUtil.IsInt(anti.Value.ToString()))
  1288. //{
  1289. // MessageBox.Show("耐蚀性 请输入整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1290. // return false;
  1291. //}
  1292. //if (reaction.Value==null||!StringUtil.IsInt(reaction.Value.ToString()))
  1293. //{
  1294. // MessageBox.Show("反应时间 请输入整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1295. // return false;
  1296. //}
  1297. //if (spray.Value.Equals("1"))
  1298. //{
  1299. // if (!StringUtil.IsInt(sprayCount.Value.ToString()))
  1300. // {
  1301. // MessageBox.Show("喷标个数 请输入整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1302. // return false;
  1303. // }
  1304. //}
  1305. if (Operator.Value == null || Operator.Value.Equals(""))
  1306. {
  1307. MessageBox.Show("请选择操作工", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1308. return false;
  1309. }
  1310. if (shift.Value == null || shift.Value.Equals(""))
  1311. {
  1312. MessageBox.Show("请选择班次", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1313. return false;
  1314. }
  1315. return true;
  1316. }
  1317. /// <summary>
  1318. /// 保存镀铜
  1319. /// </summary>
  1320. private void DoCopperPlanAdd(UltraGridRow row)
  1321. {
  1322. string SelectCount ="0";
  1323. string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  1324. //this.phosphateContro1.UpdateData();
  1325. if (ValidInput1())
  1326. {
  1327. string Adhesion = "";
  1328. string SurfaceCondition = "";
  1329. string IsSpray = "";
  1330. PhosphateResult result = new PhosphateResult();
  1331. Adhesion = adhesion.Value == "0" ? "0" : "1";
  1332. SurfaceCondition = surface.Value == "0" ? "0" : "1";
  1333. result.WoId = row.Cells["WoId"].Text.ToString();
  1334. result.PlanNo = row.Cells["HeatPlanNo"].Text.ToString();
  1335. result.PlineCode = row.Cells["PlineCode"].Text.ToString();
  1336. result.JudgeStoveNo = row.Cells["JudgeStoveNo"].Text.ToString();
  1337. result.BatchNo = row.Cells["BatchNo"].Text.ToString();
  1338. IsSpray = spray.Value == "1" ? "1" : "0";
  1339. result.ColCount = numPieces.Value.ToString();
  1340. result.Remark = Memo.Text;
  1341. result.ColGroup = group.Value.ToString();
  1342. result.ColShft = shift.Value.ToString();
  1343. result.MembranceThick = txtEmbossed.Text;
  1344. result.Adhesion = ultraTabPageControl9.Text;
  1345. result.AntiCorrosion = anti.Text;
  1346. result.ReactionTime = reaction.Text;
  1347. result.SurfaceCondition = surface.Value.ToString();
  1348. result.Producer = producer.Text;
  1349. result.ProducerTime = ProTime.Value.ToString();
  1350. result.ColUser = user.Text.ToString();
  1351. result.SprayCount = sprayCount.Value.ToString();
  1352. result.ColTime = dateTime.Value.ToString();
  1353. result.SprayContent = txtSpray.Text.ToString();
  1354. result.Remark = Memo.Text.ToString();
  1355. ArrayList list2 = new ArrayList();
  1356. list2.Add(Adhesion);
  1357. list2.Add(SurfaceCondition);
  1358. list2.Add(IsSpray);
  1359. ArrayList list1 = new ArrayList();
  1360. foreach (UltraGridRow ugr in ultraGrid2.Rows)
  1361. {
  1362. if (Convert.ToBoolean(ugr.Cells["CHECK"].Text) == true)
  1363. {
  1364. UltraGridRow urgdt = ultraGrid5.ActiveRow;
  1365. if (urgdt == null) { MessageUtil.ShowTips("无镀铜实绩!"); return; }
  1366. if (ugr.Cells["ITEM_NO"].Text.Equals(""))
  1367. {
  1368. MessageUtil.ShowTips("请选择检测项目!");
  1369. return;
  1370. }
  1371. if (ugr.Cells["DOSAGE"].Text.Equals(""))
  1372. {
  1373. MessageUtil.ShowTips("请输入加药量!");
  1374. return;
  1375. }
  1376. if (ugr.Cells["TEMPERATURE"].Text.Equals(""))
  1377. {
  1378. MessageUtil.ShowTips("请输入检测温度!");
  1379. return;
  1380. }
  1381. SelectCount = "1";
  1382. ArrayList list = new ArrayList();
  1383. list.Add(ugr.Cells["SEQ_NO"].Text.ToString());
  1384. list.Add(ugr.Cells["ITEM_NO"].Value.ToString());
  1385. list.Add(ugr.Cells["TEST_RESULT_F"].Text.ToString());
  1386. list.Add(ugr.Cells["TEST_RESULT_T"].Text.ToString());
  1387. list.Add(ugr.Cells["DOSAGE"].Text.ToString());
  1388. list.Add(ugr.Cells["TEMPERATURE"].Text.ToString());
  1389. list.Add(ugr.Cells["DETAIL_NO"].Text.ToString());
  1390. list.Add(urgdt.Cells["RESULT_NO"].Text.ToString());
  1391. list.Add(row.Cells["WoId"].Text.ToString());
  1392. list.Add(row.Cells["ZY_PLAN_ID"].Text.ToString());
  1393. list1.Add(list);
  1394. }
  1395. }
  1396. //if (SelectCount == 0) { MessageUtil.ShowTips("请选择检测项目!"); return; }
  1397. double PlnCount = 0;//计划个数
  1398. double CutCount = 0;//实际个数
  1399. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { row.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
  1400. if (dt.Rows.Count > 0)
  1401. {
  1402. PlnCount = Double.Parse(dt.Rows[0]["PLT_PLN_NUM"].ToString());
  1403. CutCount = Double.Parse(dt.Rows[0]["PLT_CU_OK_NUM"].ToString());
  1404. }
  1405. // + Double.Parse(numQualified.Value.ToString())
  1406. if (CutCount > PlnCount)
  1407. {
  1408. if (MessageUtil.ShowYesNoAndQuestion("实际镀铜个数超过计划镀铜个数是否新增!") == DialogResult.No) { return; }
  1409. }
  1410. if (MessageUtil.ShowYesNoAndQuestion("是否保存?") == DialogResult.No)
  1411. {
  1412. return;
  1413. }
  1414. CoreClientParam ccp = new CoreClientParam();
  1415. try
  1416. {
  1417. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1418. if (Constant.WaitingForm == null)
  1419. {
  1420. Constant.WaitingForm = new WaitingForm();
  1421. }
  1422. Constant.WaitingForm.ShowToUser = true;
  1423. Constant.WaitingForm.Show();
  1424. Constant.WaitingForm.Update();
  1425. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1426. ccp.MethodName = "addCopperPlantResult";
  1427. ccp.ServerParams = new object[] { result, list1, Process, PbGx, list2, SelectCount };
  1428. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1429. this.Cursor = Cursors.Default;
  1430. Constant.WaitingForm.ShowToUser = false;
  1431. Constant.WaitingForm.Close();
  1432. Constant.WaitingForm = null;
  1433. }
  1434. catch (Exception ex)
  1435. {
  1436. this.Cursor = Cursors.Default;
  1437. Constant.WaitingForm.ShowToUser = false;
  1438. Constant.WaitingForm.Close();
  1439. Constant.WaitingForm = null;
  1440. }
  1441. if (ccp.ReturnCode == -1) return;
  1442. MessageUtil.ShowTips(ccp.ReturnInfo);
  1443. if (ccp.ReturnInfo.Equals("镀铜成功!"))
  1444. {
  1445. QuerySinglePlan();
  1446. }
  1447. }
  1448. }
  1449. /// <summary>
  1450. /// 修改
  1451. /// </summary>
  1452. private void DoUpdate()
  1453. {
  1454. ultraGrid2.UpdateData();
  1455. UltraGridRow row = ultraGridWoId.ActiveRow;
  1456. if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
  1457. string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
  1458. string woId = row.Cells["WoId"].Value.ToString();
  1459. if (!row.Cells["ZyBillStatus"].Value.ToString().Equals("生产中"))
  1460. {
  1461. MessageUtil.ShowTips("此工单不是生产中,不允许此操作!");
  1462. return;
  1463. }
  1464. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
  1465. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  1466. //{
  1467. // if (dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  1468. // {
  1469. // MessageUtil.ShowTips("此工单镀铜工序点已结炉,不允许此操作!");
  1470. // return;
  1471. // }
  1472. //}
  1473. //else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  1474. //{
  1475. // if (dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  1476. // {
  1477. // MessageUtil.ShowTips("此工单磷化工序点已结炉,不允许此操作!");
  1478. // return;
  1479. // }
  1480. //}
  1481. //QueryStatusGd(row.Cells["WoId"].Value.ToString(), row.Cells["ZY_PLAN_ID"].Value.ToString());
  1482. if (row.Cells["CoatType"].Text.Trim().Equals("/"))
  1483. {
  1484. MessageUtil.ShowTips("不需要磷化镀铜!");
  1485. return;
  1486. }
  1487. DoPhosphatUpdate(row);
  1488. }
  1489. /// <summary>
  1490. /// 磷化修改
  1491. /// </summary>
  1492. /// <param name="row"></param>
  1493. private void DoPhosphatUpdate(UltraGridRow row)
  1494. {
  1495. //phosphateContro1.UpdateData();
  1496. UltraGridRow rgu = ultraGrid4.ActiveRow;
  1497. if (rgu == null) { MessageUtil.ShowTips("无磷化实绩!"); return; }
  1498. //if(rgu.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("是"))
  1499. //{
  1500. // MessageUtil.ShowTips("此工序已经离线,不允许此操作!");
  1501. // return;
  1502. //}
  1503. string date=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  1504. //if (this.phosphateContro1.ValidInput1())
  1505. //{
  1506. PhosphateResult result = new PhosphateResult();
  1507. result.Adhesion = adhesion.Value == "0" ? "0" : "1";
  1508. result.SurfaceCondition = surface.Value == "0" ? "0" : "1";
  1509. result.WoId = row.Cells["WoId"].Text.ToString();
  1510. result.PlanNo = row.Cells["HeatPlanNo"].Text.ToString();
  1511. result.PlineCode = row.Cells["PlineCode"].Text.ToString();
  1512. result.JudgeStoveNo = row.Cells["JudgeStoveNo"].Text.ToString();
  1513. result.BatchNo = row.Cells["BatchNo"].Text.ToString();
  1514. result.IsSpray = spray.Value == "1" ? "1" : "0";
  1515. result.ColCount = numPieces.Value.ToString();
  1516. result.ColOperator =
  1517. result.Remark = Memo.Text;
  1518. result.ColGroup = group.Value.ToString();
  1519. result.ColShft = shift.Value.ToString();
  1520. result.MembranceThick = txtEmbossed.Text;
  1521. result.Adhesion = ultraTabPageControl9.Text;
  1522. result.AntiCorrosion = anti.Text;
  1523. result.ReactionTime = reaction.Text;
  1524. result.SurfaceCondition = surface.Value.ToString();
  1525. result.Producer = producer.Text;
  1526. result.ProducerTime = ProTime.Value.ToString();
  1527. result.ColUser = user.Text.ToString();
  1528. result.SprayCount = sprayCount.Value.ToString();
  1529. result.ColTime = dateTime.Value.ToString();
  1530. result.SprayContent = txtSpray.Text.ToString();
  1531. result.Remark = Memo.Text.ToString();
  1532. //double PlnCount = 0;//计划个数
  1533. //double CutCount = 0;//实际个数
  1534. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { row.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
  1535. //if (dt.Rows.Count > 0)
  1536. //{
  1537. // PlnCount = Double.Parse(dt.Rows[0]["PHOS_PLN_NUM"].ToString());
  1538. // CutCount = Double.Parse(dt.Rows[0]["PHOS_OK_NUM"].ToString());
  1539. //}
  1540. //// + Double.Parse(numQualified.Value.ToString())
  1541. //if (CutCount > PlnCount)
  1542. //{
  1543. // if (MessageUtil.ShowYesNoAndQuestion("实际磷化个数超过计划磷化个数是否修改!") == DialogResult.No) { return; }
  1544. //}
  1545. if (MessageUtil.ShowYesNoAndQuestion("是否修改磷化/镀铜实绩?") == DialogResult.No)
  1546. {
  1547. return;
  1548. }
  1549. CoreClientParam ccp = new CoreClientParam();
  1550. try
  1551. {
  1552. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1553. if (Constant.WaitingForm == null)
  1554. {
  1555. Constant.WaitingForm = new WaitingForm();
  1556. }
  1557. Constant.WaitingForm.ShowToUser = true;
  1558. Constant.WaitingForm.Show();
  1559. Constant.WaitingForm.Update();
  1560. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1561. ccp.MethodName = "updatePhosphateResult";
  1562. ccp.ServerParams = new object[] { result, Process, PbGx, row.Cells["WoId"].Text.Trim() };
  1563. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1564. this.Cursor = Cursors.Default;
  1565. Constant.WaitingForm.ShowToUser = false;
  1566. Constant.WaitingForm.Close();
  1567. Constant.WaitingForm = null;
  1568. }
  1569. catch (Exception ex)
  1570. {
  1571. this.Cursor = Cursors.Default;
  1572. Constant.WaitingForm.ShowToUser = false;
  1573. Constant.WaitingForm.Close();
  1574. Constant.WaitingForm = null;
  1575. }
  1576. if (ccp.ReturnCode == -1) return;
  1577. MessageUtil.ShowTips(ccp.ReturnInfo);
  1578. if (ccp.ReturnInfo.Equals("修改成功!"))
  1579. {
  1580. QuerySinglePlan();
  1581. }
  1582. //}
  1583. }
  1584. /// <summary>
  1585. /// 镀铜修改
  1586. /// </summary>
  1587. /// <param name="row"></param>
  1588. private void DoCopperPlanUpdate(UltraGridRow row)
  1589. {
  1590. //phosphateContro1.UpdateData();
  1591. UltraGridRow rgu = ultraGrid5.ActiveRow;
  1592. if (rgu == null) { MessageUtil.ShowTips("无镀铜实绩!"); return; }
  1593. if (rgu.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("是"))
  1594. {
  1595. MessageUtil.ShowTips("此工序已经离线,不允许此操作!");
  1596. return;
  1597. }
  1598. if (row.Cells["ZyBillStatus"].Value.ToString() == "生产完成")
  1599. {
  1600. MessageUtil.ShowTips("此炉次计划整体已生产完成,不允许此操作!");
  1601. return;
  1602. }
  1603. string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  1604. //if (this.phosphateContro1.ValidInput1())
  1605. //{
  1606. PhosphateResult result = new PhosphateResult();
  1607. result.Adhesion = adhesion.Value == "0" ? "0" : "1";
  1608. result.SurfaceCondition = surface.Value == "0" ? "0" : "1";
  1609. result.WoId = row.Cells["WoId"].Text.ToString();
  1610. result.PlanNo = row.Cells["HeatPlanNo"].Text.ToString();
  1611. result.PlineCode = row.Cells["PlineCode"].Text.ToString();
  1612. result.JudgeStoveNo = row.Cells["JudgeStoveNo"].Text.ToString();
  1613. result.BatchNo = row.Cells["BatchNo"].Text.ToString();
  1614. result.IsSpray = spray.Value == "1" ? "1" : "0";
  1615. result.ColCount = numPieces.Value.ToString();
  1616. result.Remark = Memo.Text;
  1617. result.ColGroup = group.Value.ToString();
  1618. result.ColShft = shift.Value.ToString();
  1619. result.MembranceThick = txtEmbossed.Text;
  1620. result.Adhesion = ultraTabPageControl9.Text;
  1621. result.AntiCorrosion = anti.Text;
  1622. result.ReactionTime = reaction.Text;
  1623. result.SurfaceCondition = surface.Value.ToString();
  1624. result.Producer = producer.Text;
  1625. result.ProducerTime = ProTime.Value.ToString();
  1626. result.ColUser = user.Text.ToString();
  1627. result.SprayCount = sprayCount.Value.ToString();
  1628. result.ColTime = dateTime.Value.ToString();
  1629. result.SprayContent = txtSpray.Text.ToString();
  1630. result.Remark = Memo.Text.ToString();
  1631. double PlnCount = 0;//计划个数
  1632. double CutCount = 0;//实际个数
  1633. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPlanJg", new Object[] { row.Cells["ZY_PLAN_ID"].Text.ToString() }, ob);
  1634. if (dt.Rows.Count > 0)
  1635. {
  1636. PlnCount = Double.Parse(dt.Rows[0]["PLT_PLN_NUM"].ToString());
  1637. CutCount = Double.Parse(dt.Rows[0]["PLT_CU_OK_NUM"].ToString());
  1638. }
  1639. // + Double.Parse(numQualified.Value.ToString())
  1640. if (CutCount > PlnCount)
  1641. {
  1642. if (MessageUtil.ShowYesNoAndQuestion("实际镀铜个数超过计划镀铜个数是否修改!") == DialogResult.No) { return; }
  1643. }
  1644. if (MessageUtil.ShowYesNoAndQuestion("是否修改镀铜实绩?") == DialogResult.No)
  1645. {
  1646. return;
  1647. }
  1648. CoreClientParam ccp = new CoreClientParam();
  1649. try
  1650. {
  1651. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1652. if (Constant.WaitingForm == null)
  1653. {
  1654. Constant.WaitingForm = new WaitingForm();
  1655. }
  1656. Constant.WaitingForm.ShowToUser = true;
  1657. Constant.WaitingForm.Show();
  1658. Constant.WaitingForm.Update();
  1659. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1660. ccp.MethodName = "updateCopperPlanResult";
  1661. ccp.ServerParams = new object[] { result, Process, PbGx };
  1662. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1663. this.Cursor = Cursors.Default;
  1664. Constant.WaitingForm.ShowToUser = false;
  1665. Constant.WaitingForm.Close();
  1666. Constant.WaitingForm = null;
  1667. }
  1668. catch (Exception ex)
  1669. {
  1670. this.Cursor = Cursors.Default;
  1671. Constant.WaitingForm.ShowToUser = false;
  1672. Constant.WaitingForm.Close();
  1673. Constant.WaitingForm = null;
  1674. }
  1675. if (ccp.ReturnCode == -1) return;
  1676. MessageUtil.ShowTips(ccp.ReturnInfo);
  1677. if (ccp.ReturnInfo.Equals("修改镀铜成功!"))
  1678. {
  1679. QuerySinglePlan();
  1680. }
  1681. //}
  1682. }
  1683. /// <summary>
  1684. /// 删除记录
  1685. /// </summary>
  1686. private void DoDelete()
  1687. {
  1688. //phosphateContro1.UpdateData();
  1689. ultraGrid2.UpdateData();
  1690. UltraGridRow row = ultraGridWoId.ActiveRow;
  1691. if (row == null) { MessageUtil.ShowTips("无工单信息!"); return; }
  1692. if (!row.Cells["ZyBillStatus"].Value.ToString().Equals("生产中"))
  1693. {
  1694. MessageUtil.ShowTips("此工单不是生产中,不允许此操作!");
  1695. return;
  1696. }
  1697. string zYgNo = row.Cells["HeatPlanNo"].Value.ToString();
  1698. string woId = row.Cells["WoId"].Value.ToString();
  1699. //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryWoIdDetails", new object[] { woId, zYgNo }, this.ob);
  1700. //if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("镀铜"))
  1701. //{
  1702. // if (dt.Rows[0]["PLT_CU_STATUS"].ToString().Equals("生产完成"))
  1703. // {
  1704. // MessageUtil.ShowTips("此工单镀铜工序点已结炉,不允许此操作!");
  1705. // return;
  1706. // }
  1707. //}
  1708. //else if (dt.Rows[0]["COAT_TYPE"].ToString().Equals("磷化"))
  1709. //{
  1710. // if (dt.Rows[0]["PHOS_STATUS"].ToString().Equals("生产完成"))
  1711. // {
  1712. // MessageUtil.ShowTips("此工单磷化工序点已结炉,不允许此操作!");
  1713. // return;
  1714. // }
  1715. //}
  1716. int DeleteCount = 0;
  1717. ArrayList list1 = new ArrayList();
  1718. UltraGridRow rowMat = ultraGrid4.ActiveRow;
  1719. if (rowMat == null) { MessageUtil.ShowTips("无磷化/镀铜实绩记录!"); return; }
  1720. if (rowMat.Cells["CONFIRM"].Value.ToString().Equals("1"))
  1721. {
  1722. MessageUtil.ShowTips("选中的磷化实绩已经确认,不允许删除!");
  1723. return;
  1724. }
  1725. foreach (UltraGridRow ugr in ultraGrid4.Rows)
  1726. {
  1727. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  1728. {
  1729. if (ugr.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("是"))
  1730. {
  1731. MessageUtil.ShowTips("此工序已经离线,不允许此操作!");
  1732. return;
  1733. }
  1734. if (ugr.Cells["OFF_NUM"].Text != "0" && ugr.Cells["OFF_NUM"].Text != "")
  1735. {
  1736. MessageUtil.ShowTips("存在离线支数,不允许此操作!");
  1737. return;
  1738. }
  1739. DeleteCount += 1;
  1740. ArrayList list = new ArrayList();
  1741. list.Add(ugr.Cells["RESULT_NO"].Text.ToString());
  1742. list.Add(ugr.Cells["COL_COUNT"].Text.ToString());
  1743. list1.Add(list);
  1744. }
  1745. }
  1746. if (DeleteCount == 0) { MessageUtil.ShowTips("请选择要删除的记录!"); return; }
  1747. if (MessageUtil.ShowYesNoAndQuestion("是否删除?") == DialogResult.No)
  1748. {
  1749. return;
  1750. }
  1751. CoreClientParam ccp = new CoreClientParam();
  1752. try
  1753. {
  1754. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1755. if (Constant.WaitingForm == null)
  1756. {
  1757. Constant.WaitingForm = new WaitingForm();
  1758. }
  1759. Constant.WaitingForm.ShowToUser = true;
  1760. Constant.WaitingForm.Show();
  1761. Constant.WaitingForm.Update();
  1762. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1763. ccp.MethodName = "deletePhosphateResult";
  1764. ccp.ServerParams = new object[] { list1, woId };
  1765. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1766. this.Cursor = Cursors.Default;
  1767. Constant.WaitingForm.ShowToUser = false;
  1768. Constant.WaitingForm.Close();
  1769. Constant.WaitingForm = null;
  1770. }
  1771. catch (Exception ex)
  1772. {
  1773. this.Cursor = Cursors.Default;
  1774. Constant.WaitingForm.ShowToUser = false;
  1775. Constant.WaitingForm.Close();
  1776. Constant.WaitingForm = null;
  1777. }
  1778. if (ccp.ReturnCode == -1) return;
  1779. MessageUtil.ShowTips(ccp.ReturnInfo);
  1780. if (ccp.ReturnInfo.Equals("删除成功!"))
  1781. {
  1782. QuerySinglePlan();
  1783. }
  1784. }
  1785. /// <summary>
  1786. /// 修改检测记录
  1787. /// </summary>
  1788. /// <param name="row"></param>
  1789. private void DoInsUpdate()
  1790. {
  1791. ultraGrid2.UpdateData();
  1792. UltraGridRow rgu = ultraGrid2.ActiveRow;
  1793. if (rgu == null) { MessageUtil.ShowTips("无检验记录!"); return; }
  1794. int update = 0;
  1795. ArrayList list1 = new ArrayList();
  1796. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  1797. {
  1798. UltraGridRow checkrow = ultraGrid2.Rows[i];
  1799. if (Convert.ToBoolean(checkrow.Cells["CHECK"].Text) == true)
  1800. {
  1801. update += 1;
  1802. ArrayList list = new ArrayList();
  1803. list.Add(checkrow.Cells["ITEM_NO"].Value.ToString());
  1804. list.Add(checkrow.Cells["TEST_RESULT_F"].Text.Trim());
  1805. list.Add(checkrow.Cells["TEST_RESULT_T"].Text.Trim());
  1806. list.Add(checkrow.Cells["DOSAGE"].Text.Trim());
  1807. list.Add(checkrow.Cells["TEMPERATURE"].Text.Trim());
  1808. list.Add(checkrow.Cells["SEQ_NO"].Text.Trim());
  1809. list.Add(checkrow.Cells["ZY_PLAN_ID"].Text.Trim());
  1810. list.Add(checkrow.Cells["DETAIL_NO"].Text.Trim());
  1811. list.Add(checkrow.Cells["RESULT_NO"].Text.Trim());
  1812. list1.Add(list);
  1813. }
  1814. }
  1815. if (update == 0) { MessageUtil.ShowTips("请选择抽检记录!"); return; }
  1816. if (MessageUtil.ShowYesNoAndQuestion("是否修改检测记录?") == DialogResult.No)
  1817. {
  1818. return;
  1819. }
  1820. CoreClientParam ccp = new CoreClientParam();
  1821. try
  1822. {
  1823. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1824. if (Constant.WaitingForm == null)
  1825. {
  1826. Constant.WaitingForm = new WaitingForm();
  1827. }
  1828. Constant.WaitingForm.ShowToUser = true;
  1829. Constant.WaitingForm.Show();
  1830. Constant.WaitingForm.Update();
  1831. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1832. ccp.MethodName = "updatePhosphateResultD";
  1833. ccp.ServerParams = new object[] { list1 };
  1834. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1835. this.Cursor = Cursors.Default;
  1836. Constant.WaitingForm.ShowToUser = false;
  1837. Constant.WaitingForm.Close();
  1838. Constant.WaitingForm = null;
  1839. }
  1840. catch (Exception ex)
  1841. {
  1842. this.Cursor = Cursors.Default;
  1843. Constant.WaitingForm.ShowToUser = false;
  1844. Constant.WaitingForm.Close();
  1845. Constant.WaitingForm = null;
  1846. }
  1847. if (ccp.ReturnCode == -1) return;
  1848. MessageUtil.ShowTips(ccp.ReturnInfo);
  1849. if (ccp.ReturnInfo.Equals("修改检验记录成功!"))
  1850. {
  1851. QuerySinglePlan();
  1852. }
  1853. } /// <summary>
  1854. /// 删除检测记录
  1855. /// </summary>
  1856. /// <param name="row"></param>
  1857. private void DoInsDelete()
  1858. {
  1859. UltraGridRow rgu = ultraGrid2.ActiveRow;
  1860. if (rgu == null) { MessageUtil.ShowTips("无检验记录!"); return; };
  1861. int update = 0;
  1862. ArrayList list1 = new ArrayList();
  1863. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  1864. {
  1865. UltraGridRow checkrow = ultraGrid2.Rows[i];
  1866. if (Convert.ToBoolean(checkrow.Cells["CHECK"].Text) == true)
  1867. {
  1868. update += 1;
  1869. ArrayList list = new ArrayList();
  1870. list.Add(checkrow.Cells["DETAIL_NO"].Text.Trim());
  1871. list.Add(checkrow.Cells["RESULT_NO"].Text.Trim());
  1872. list1.Add(list);
  1873. }
  1874. }
  1875. if (update == 0) { MessageUtil.ShowTips("请选择抽检记录!"); return; }
  1876. if (MessageUtil.ShowYesNoAndQuestion("是否删除检测记录?") == DialogResult.No)
  1877. {
  1878. return;
  1879. }
  1880. CoreClientParam ccp = new CoreClientParam();
  1881. try
  1882. {
  1883. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  1884. if (Constant.WaitingForm == null)
  1885. {
  1886. Constant.WaitingForm = new WaitingForm();
  1887. }
  1888. Constant.WaitingForm.ShowToUser = true;
  1889. Constant.WaitingForm.Show();
  1890. Constant.WaitingForm.Update();
  1891. ccp.ServerName = "com.steering.mes.mcp.coup.PhosphateResultService";
  1892. ccp.MethodName = "deletePhosphateResultD";
  1893. ccp.ServerParams = new object[] { list1 };
  1894. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1895. this.Cursor = Cursors.Default;
  1896. Constant.WaitingForm.ShowToUser = false;
  1897. Constant.WaitingForm.Close();
  1898. Constant.WaitingForm = null;
  1899. }
  1900. catch (Exception ex)
  1901. {
  1902. this.Cursor = Cursors.Default;
  1903. Constant.WaitingForm.ShowToUser = false;
  1904. Constant.WaitingForm.Close();
  1905. Constant.WaitingForm = null;
  1906. }
  1907. if (ccp.ReturnCode == -1) return;
  1908. MessageUtil.ShowTips(ccp.ReturnInfo);
  1909. if (ccp.ReturnInfo.Equals("删除检验记录成功!"))
  1910. {
  1911. QuerySinglePlan();
  1912. }
  1913. }
  1914. private void ultraGrid2_AfterRowInsert(object sender, RowEventArgs e)
  1915. {
  1916. e.Row.Cells["SEQ_NO"].Value = (e.Row.Index == 0 ? 1 : Convert.ToInt32(((Infragistics.Win.UltraWinGrid.UltraGrid)sender).Rows[e.Row.Index - 1].Cells["SEQ_NO"].Value) + 1);
  1917. }
  1918. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  1919. {
  1920. ultraGrid2.UpdateData();
  1921. UltraGridRow rgu = ultraGrid2.ActiveRow;
  1922. if (rgu == null) return;
  1923. if (e.Cell.Column.Key.Equals("ITEM_NO"))
  1924. {
  1925. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryPhosphateItem1", new object[] { rgu.Cells["ITEM_NO"].Value }, this.ob);
  1926. e.Cell.Row.Cells["SETTING_TEMPERATURE"].Value = dt.Rows[0]["SETTING_TEMPERATURE"].ToString();//设置温度
  1927. e.Cell.Row.Cells["SPAN"].Value = dt.Rows[0]["SPAN"].ToString();//范围
  1928. }
  1929. }
  1930. /// <summary>
  1931. /// 按回车键触发查询按钮
  1932. /// </summary>
  1933. /// <param name="sender"></param>
  1934. /// <param name="e"></param>
  1935. private void ContPublic_KeyDown(object sender, KeyEventArgs e)
  1936. {
  1937. if (e.KeyCode == Keys.Enter)
  1938. {
  1939. QuerySinglePlan();
  1940. }
  1941. }
  1942. private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
  1943. {
  1944. UltraGridRow row = ultraGrid4.ActiveRow;
  1945. if (row != null)
  1946. {
  1947. string zYgNo = row.Cells["RESULT_NO"].Value.ToString();
  1948. string woId = row.Cells["WO_ID"].Value.ToString();
  1949. //if (row.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("/"))
  1950. //{
  1951. // this.phosphateContro1.Value.Adhesion = row.Cells["ADHESION"].Text.Trim() == "合格" ? "0" : "1";
  1952. // this.phosphateContro1.Value.AntiCorrosion = row.Cells["ANTI_CORROSION"].Text.Trim();
  1953. // this.phosphateContro1.Value.ColCount = row.Cells["COL_COUNT"].Text.Trim();
  1954. // //this.phosphateContro1.Value.ColGroup = row.Cells["COL_GROUP"].Value.ToString();
  1955. // this.phosphateContro1.Value.ColOperator = row.Cells["COL_OPERATOR"].Text.Trim();
  1956. // //this.phosphateContro1.Value.ColShft = row.Cells["COL_SHIFT"].Value.ToString();
  1957. // this.phosphateContro1.Value.ColUser = row.Cells["COL_USER"].Text.Trim();
  1958. // this.phosphateContro1.Value.IsSpray = row.Cells["IS_SPRAY"].Text.Trim();
  1959. // this.phosphateContro1.Value.SprayContent = row.Cells["SPRAY_CONTENT"].Text.Trim();
  1960. // this.phosphateContro1.Value.SprayCount = row.Cells["SPRAY_COUNT"].Text.Trim();
  1961. // this.phosphateContro1.Value.SurfaceCondition = row.Cells["SURFACE_CONDITION"].Text.Trim() == "合格" ? "0" : "1";
  1962. // this.phosphateContro1.Value.Producer = row.Cells["PRODUCER"].Text.Trim();
  1963. // this.phosphateContro1.Value.ProducerTime = row.Cells["PRODUCER_TIME"].Text.Trim();
  1964. // this.phosphateContro1.Value.Remark = row.Cells["REMARK"].Text.Trim();
  1965. // this.phosphateContro1.Value.MembranceThick = row.Cells["MEMBRANCE_THICK"].Text.Trim();
  1966. // this.phosphateContro1.Value.ReactionTime = row.Cells["REACTION_TIME"].Text.Trim();
  1967. // this.phosphateContro1.Value.ResultNo = row.Cells["RESULT_NO"].Text.Trim();
  1968. // this.phosphateContro1.UpdateData();
  1969. //}
  1970. getCoupPhosphateResultD(zYgNo, woId);
  1971. }
  1972. else
  1973. {
  1974. this.initControl();
  1975. }
  1976. }
  1977. //private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
  1978. //{
  1979. // UltraGridRow row = ultraGrid5.ActiveRow;
  1980. // if (row != null)
  1981. // {
  1982. // string zYgNo = row.Cells["RESULT_NO"].Value.ToString();
  1983. // string woId = row.Cells["WO_ID"].Value.ToString();
  1984. // if (row.Cells["IF_ALL_OUT_WORK"].Value.ToString().Equals("否"))
  1985. // {
  1986. // this.phosphateContro1.Value.Adhesion = row.Cells["ADHESION"].Text.Trim() == "合格" ? "0" : "1";
  1987. // this.phosphateContro1.Value.AntiCorrosion = row.Cells["ANTI_CORROSION"].Text.Trim();
  1988. // this.phosphateContro1.Value.ColCount = row.Cells["COL_COUNT"].Text.Trim();
  1989. // this.phosphateContro1.Value.ColGroup = row.Cells["COL_GROUP"].Value.ToString();
  1990. // this.phosphateContro1.Value.ColOperator = row.Cells["COL_OPERATOR"].Text.Trim();
  1991. // this.phosphateContro1.Value.ColShft = row.Cells["COL_SHIFT"].Value.ToString();
  1992. // this.phosphateContro1.Value.ColUser = row.Cells["COL_USER"].Text.Trim();
  1993. // this.phosphateContro1.Value.IsSpray = row.Cells["IS_SPRAY"].Text.Trim();
  1994. // this.phosphateContro1.Value.SprayContent = row.Cells["SPRAY_CONTENT"].Text.Trim();
  1995. // this.phosphateContro1.Value.SprayCount = row.Cells["SPRAY_COUNT"].Text.Trim();
  1996. // this.phosphateContro1.Value.SurfaceCondition = row.Cells["SURFACE_CONDITION"].Text.Trim() == "合格" ? "0" : "1";
  1997. // this.phosphateContro1.Value.Producer = row.Cells["PRODUCER"].Text.Trim();
  1998. // this.phosphateContro1.Value.ProducerTime = row.Cells["PRODUCER_TIME"].Text.Trim();
  1999. // this.phosphateContro1.Value.Remark = row.Cells["REMARK"].Text.Trim();
  2000. // this.phosphateContro1.Value.MembranceThick = row.Cells["MEMBRANCE_THICK"].Text.Trim();
  2001. // this.phosphateContro1.Value.ReactionTime = row.Cells["REACTION_TIME"].Text.Trim();
  2002. // this.phosphateContro1.Value.ResultNo = row.Cells["RESULT_NO"].Text.Trim();
  2003. // this.phosphateContro1.UpdateData();
  2004. // }
  2005. // getCoupPhosphateResultD(zYgNo, woId);
  2006. // }
  2007. // else
  2008. // {
  2009. // this.initControl();
  2010. // }
  2011. //}
  2012. private void chkStarts_CheckedChanged(object sender, EventArgs e)
  2013. {
  2014. if (chkStarts.Checked) { cmbStarts.Enabled = true; } else { cmbStarts.Enabled = false; }
  2015. if (chkJuNo.Checked) { txtJudgeStoveNO.Enabled = true; } else { txtJudgeStoveNO.Enabled = false; }
  2016. if (chkPlnNo.Checked) { txtPlnNo.Enabled = true; } else { txtPlnNo.Enabled = false; }
  2017. if (chkwoId.Checked) { txtWoId.Enabled = true; } else { txtWoId.Enabled = false; }
  2018. }
  2019. private void craftImg_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  2020. {
  2021. UltraGridRow row = ultraGridWoId.ActiveRow;
  2022. if (row == null) return;
  2023. string orderNo = row.Cells["OrderNoSeq"].Text.ToString();
  2024. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilCouplingProcess2.cpt"
  2025. + "&ORDER_NO=" + orderNo;
  2026. FrmRepExcel down = new FrmRepExcel(ob, strurl);
  2027. down.Text = "接箍二级工艺";
  2028. down.Visible = false;
  2029. down.Size = new Size(740, this.Height);
  2030. down.WindowState = FormWindowState.Maximized;
  2031. down.ShowDialog();
  2032. }
  2033. private void Operator_ValueChanged(object sender, EventArgs e)
  2034. {
  2035. if (Operator.Value!=null&&Operator.Value != "")
  2036. {
  2037. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.PhosphateResultService.queryMemo", new object[] { Operator.Value }, this.ob);
  2038. if (dt.Rows.Count > 0)
  2039. {
  2040. if (dt.Rows[0]["MEMO"].ToString()=="甲")
  2041. {
  2042. group.Value = "1";
  2043. }else if(dt.Rows[0]["MEMO"].ToString() == "乙")
  2044. {
  2045. group.Value ="2";
  2046. }
  2047. else if (dt.Rows[0]["MEMO"].ToString() == "丙")
  2048. {
  2049. group.Value = "3";
  2050. }
  2051. else if (dt.Rows[0]["MEMO"].ToString() == "丁")
  2052. {
  2053. group.Value = "4";
  2054. }
  2055. }
  2056. }
  2057. }
  2058. private void spray_ValueChanged(object sender, EventArgs e)
  2059. {
  2060. if (spray.Text.Equals("是"))
  2061. {
  2062. sprayCount.Enabled = true;
  2063. txtSpray.Enabled = true;
  2064. }
  2065. else
  2066. {
  2067. sprayCount.Enabled = false;
  2068. txtSpray.Enabled = false;
  2069. }
  2070. }
  2071. private void numPieces_AfterEnterEditMode(object sender, EventArgs e)
  2072. {
  2073. this.BeginInvoke(new MethodInvoker(this.numPieces.SelectAll));
  2074. }
  2075. private void sprayCount_AfterEnterEditMode(object sender, EventArgs e)
  2076. {
  2077. this.BeginInvoke(new MethodInvoker(this.sprayCount.SelectAll));
  2078. }
  2079. private void numPieces_ValueChanged(object sender, EventArgs e)
  2080. {
  2081. if (spray.Text.Equals("是"))
  2082. {
  2083. if (numPieces.Text == null || numPieces.Text.Equals(""))
  2084. {
  2085. sprayCount.Value = "0";
  2086. }
  2087. else
  2088. {
  2089. sprayCount.Value = numPieces.Value.ToString();
  2090. }
  2091. }
  2092. else
  2093. {
  2094. sprayCount.Value = "0";
  2095. }
  2096. }
  2097. //private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  2098. //{
  2099. // UltraGridRow row = ultraGrid4.ActiveRow;
  2100. // if (row == null) return;
  2101. // string zYgNo = row.Cells["RESULT_NO"].Value.ToString();
  2102. // string woId = row.Cells["WO_ID"].Value.ToString();
  2103. // this.phosphateContro1.Value.Adhesion = row.Cells["ADHESION"].Text.Trim() == "合格" ? "0" : "1";
  2104. // this.phosphateContro1.Value.AntiCorrosion = row.Cells["ANTI_CORROSION"].Text.Trim();
  2105. // this.phosphateContro1.Value.ColCount = row.Cells["COL_COUNT"].Text.Trim();
  2106. // //this.phosphateContro1.Value.ColGroup = row.Cells["COL_GROUP"].Value.ToString();
  2107. // this.phosphateContro1.Value.ColOperator = row.Cells["COL_OPERATOR"].Text.Trim();
  2108. // //this.phosphateContro1.Value.ColShft = row.Cells["COL_SHIFT"].Value.ToString();
  2109. // this.phosphateContro1.Value.ColUser = row.Cells["COL_USER"].Text.Trim();
  2110. // this.phosphateContro1.Value.IsSpray = row.Cells["IS_SPRAY"].Text.Trim();
  2111. // this.phosphateContro1.Value.SprayContent = row.Cells["SPRAY_CONTENT"].Text.Trim();
  2112. // this.phosphateContro1.Value.SprayCount = row.Cells["SPRAY_COUNT"].Text.Trim();
  2113. // this.phosphateContro1.Value.SurfaceCondition = row.Cells["SURFACE_CONDITION"].Text.Trim() == "合格" ? "0" : "1";
  2114. // this.phosphateContro1.Value.Producer = row.Cells["PRODUCER"].Text.Trim();
  2115. // this.phosphateContro1.Value.ProducerTime = row.Cells["PRODUCER_TIME"].Text.Trim();
  2116. // this.phosphateContro1.Value.Remark = row.Cells["REMARK"].Text.Trim();
  2117. // this.phosphateContro1.Value.MembranceThick = row.Cells["MEMBRANCE_THICK"].Text.Trim();
  2118. // this.phosphateContro1.Value.ReactionTime = row.Cells["REACTION_TIME"].Text.Trim();
  2119. // this.phosphateContro1.Value.ResultNo = row.Cells["RESULT_NO"].Text.Trim();
  2120. // this.phosphateContro1.UpdateData();
  2121. //}
  2122. }
  2123. }