ZcColligateJudgeFrm.cs 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.Judge.Commons;
  5. using Core.StlMes.Client.Judge.Controls;
  6. using CoreFS.CA06;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Windows.Forms;
  13. namespace Core.StlMes.Client.Judge.Forms
  14. {
  15. public partial class ZcColligateJudgeFrm : FrmBase
  16. {
  17. private QcmZcColligateJudgeApplyCtrl _zcJudgeApplyCtrl;
  18. private QcmZcJudgeCtrl _zcJudgeCtrl;
  19. private QcmZcPassApplyCtrl _zcPassApply;
  20. private QcmZcAllChemPhyCtrl _zcAllChemPhyCtrl;
  21. private QcmZcPassFlowCtrl _zcPassFlowCtrl;
  22. private Dal _d;
  23. public ZcColligateJudgeFrm()
  24. {
  25. InitializeComponent();
  26. IsLoadUserView = true;
  27. }
  28. private void labelDateTimePicker1_CheckBox_CheckedChanged(object sender, EventArgs e)
  29. {
  30. labelDateTimePicker2.DateTimePicker.Enabled = labelDateTimePicker1.Checked;
  31. }
  32. protected override void OnLoad(EventArgs e)
  33. {
  34. base.OnLoad(e);
  35. if (_zcAllChemPhyCtrl == null) return;
  36. _zcAllChemPhyCtrl.SetChemPhyResultError();
  37. ultraLabel2.Appearance.BackColor = labelComboBox2.BackColor;
  38. ultraLabel3.Appearance.BackColor = labelComboBox2.BackColor;
  39. }
  40. // private string processCode = "";
  41. private string passInfo = "";
  42. private DataTable _dtPline = null;
  43. private void SteelMakingColligateJudgeFrm_Load(object sender, EventArgs e)
  44. {
  45. passInfo = CustomInfo;
  46. _zcJudgeApplyCtrl = new QcmZcColligateJudgeApplyCtrl(splitContainer3.Panel1, ob, JudgeType.SteelMakingColligate,UserInfo);
  47. _zcJudgeApplyCtrl.UltraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
  48. _zcJudgeApplyCtrl.UltraGrid1.AfterRowActivate += gpJudgeApplyCtrl_AfterRowActivate;
  49. _zcAllChemPhyCtrl = new QcmZcAllChemPhyCtrl(ultraExpandableGroupBoxPanel2, ob, _zcJudgeApplyCtrl.UltraGrid1, "", "zcJudge");
  50. _zcJudgeCtrl = new QcmZcJudgeCtrl(ultraTabPageControl6, ob);
  51. _zcJudgeCtrl.EntityGrid1.StyleGrid.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
  52. _zcJudgeCtrl.EntityGrid1.StyleGrid.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;
  53. _zcPassApply = new QcmZcPassApplyCtrl(splitContainer2.Panel1, ob, UserInfo.GetDeptid());
  54. _zcPassApply.UltraGrid1.AfterRowActivate += gpPassApply_AfterRowActivate;
  55. _zcPassFlowCtrl = new QcmZcPassFlowCtrl(splitContainer2.Panel2, ob);
  56. _d = new Dal(ob);
  57. dataTable1.Clear();
  58. dataTable1.Rows.Add("00", "编制中");
  59. dataTable1.Rows.Add("10", "已下发");
  60. dataTable1.Rows.Add("20", "生产中");
  61. dataTable1.Rows.Add("30", "已生产");
  62. dataTable1.Rows.Add("40", "关闭");
  63. _dtPline = _d.GetTableByXmlId("JudgeBaseInfo.Query", new object[] { new string[] { "D", "E", "F", "G", "H" } });
  64. DataTable dtDeptPline = _d.GetTableByXmlId("JdgComBasePline.getPlineByDept", new object[] { this.ValidDataPurviewIds });
  65. for (int i = _dtPline.Rows.Count - 1; i >= 0; i--)
  66. {
  67. if (dtDeptPline.Select("plinecode = '" + _dtPline.Rows[i]["plinecode"].ToString() + "'").Length == 0)
  68. {
  69. _dtPline.Rows[i].Delete();
  70. }
  71. }
  72. _dtPline.AcceptChanges();
  73. string strPlineNames = string.Join(",", _dtPline.Rows.Cast<DataRow>().Select(a => a["plineName"].ToString()).ToArray());
  74. string strPineCodes = string.Join(",", _dtPline.Rows.Cast<DataRow>().Select(a => a["plineCode"].ToString()).ToArray());
  75. ultraTextEditor1.Text = strPlineNames;
  76. ultraTextEditor1.Tag = strPineCodes;
  77. ultraTextEditor2.Text = strPlineNames;
  78. ultraTextEditor2.Tag = strPineCodes;
  79. ClsBaseInfo.FillComBaseInfo(labelComboBox2.ComboBox, "407407", ob, false);
  80. //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
  81. DataTable dt = (DataTable)labelComboBox2.ComboBox.DataSource;
  82. DataRow dr = dt.NewRow();
  83. dr["BASECODE"] = "1";
  84. dr["BASENAME"] = "已判";
  85. dt.Rows.InsertAt(dr, 0);
  86. dr = dt.NewRow();
  87. dr["BASECODE"] = "0";
  88. dr["BASENAME"] = "未判";
  89. dt.Rows.InsertAt(dr, 0);
  90. dt.AcceptChanges();
  91. ClsBaseInfo.SetComboItemHeight(labelComboBox2.ComboBox);
  92. DataTable dtCmb2 = (DataTable)labelComboBox2.ComboBox.DataSource;
  93. dtCmb2.DefaultView.RowFilter = "BASECODE IN ('0', '1', '40740701', '40740704', '40740709')";
  94. labelComboBox2.ComboBox.DropDownListWidth = -1;
  95. ClsBaseInfo.FillComBaseInfo(labelComboBox3.ComboBox, "407407", ob, false);
  96. ClsBaseInfo.SetComboItemHeight(labelComboBox3.ComboBox);
  97. labelDateTimePicker1.DateTimePicker.Value = DateTime.Now.Date.AddDays(-3);
  98. labelDateTimePicker2.DateTimePicker.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  99. labelDateTimePicker4.Checked = true;
  100. labelDateTimePicker4.DateTimePicker.Value = DateTime.Now.Date.AddDays(-3);
  101. labelDateTimePicker3.DateTimePicker.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  102. labelDateTimePicker6.Checked = true;
  103. labelDateTimePicker6.DateTimePicker.Value = DateTime.Now.Date.AddDays(-3);
  104. labelDateTimePicker5.DateTimePicker.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  105. ultraComboEditor3.SelectedIndex = 0;
  106. labelComboBox1.Checked = true;
  107. labelComboBox1.ComboBox.SelectedIndex = 1;
  108. if (passInfo.Contains("Quality") || passInfo.Contains("Urgent"))
  109. {
  110. ultraTabControl2.Tabs[1].Visible = false;
  111. if (passInfo.Contains("Quality"))
  112. {
  113. labelComboBox2.ComboBox.Items[3].CheckState = CheckState.Checked;
  114. labelComboBox2.Checked = true;
  115. }
  116. if (passInfo.Contains("Urgent"))
  117. {
  118. labelComboBox2.ComboBox.Items[0].CheckState = CheckState.Checked;
  119. labelComboBox2.Checked = true;
  120. }
  121. }
  122. else
  123. {
  124. labelComboBox2.Checked = true;
  125. labelComboBox2.ComboBox.Items[0].CheckState = CheckState.Checked;
  126. }
  127. }
  128. void gpPassApply_AfterRowActivate(object sender, EventArgs e)
  129. {
  130. try
  131. {
  132. this.Cursor = Cursors.WaitCursor;
  133. var row = _zcPassApply.UltraGrid1.ActiveRow;
  134. _zcPassFlowCtrl.Query(row.GetValue("passApplyNo"));
  135. }
  136. finally
  137. {
  138. this.Cursor = Cursors.Default;
  139. }
  140. }
  141. public override void ToolBar_Click(object sender, string ToolbarKey)
  142. {
  143. base.ToolBar_Click(sender, ToolbarKey);
  144. switch (ToolbarKey)
  145. {
  146. case "Query":
  147. Query();
  148. break;
  149. case "Judge":
  150. Judge();
  151. break;
  152. case "PassApply":
  153. PassApply();
  154. break;
  155. case "DeletePassApply":
  156. DeletePassApply();
  157. break;
  158. case "DeleteJudge":
  159. DeleteJudge();
  160. break;
  161. case "ReviewGpCertificate":
  162. ReviewGpCertificate();
  163. break;
  164. case "UpdateMemo":
  165. UpdateMemo();
  166. break;
  167. case "FoldQuery":
  168. FoldQuery();
  169. break;
  170. case "RefreshZbs":
  171. RefreshZbs("0");
  172. break;
  173. case "RefreshZbsJG":
  174. RefreshZbs("1");
  175. break;
  176. case "ZbsLock":
  177. UpdateZbsLock();
  178. break;
  179. case "RefreshCraft":
  180. RefreshCraft();
  181. break;
  182. case "CopyZgData":
  183. CopyZgData();
  184. break;
  185. case "CopyRclData":
  186. CopyRclData();
  187. break;
  188. case "BatchDownload":
  189. BatchDownload();
  190. break;
  191. case "Export":
  192. if (ultraTabControl2.ActiveTab.Index == 0)
  193. {
  194. GridHelper.ulGridToExcel(_zcJudgeApplyCtrl.UltraGrid1, "成品判定信息");
  195. }
  196. else if (ultraTabControl2.ActiveTab.Index == 1)
  197. {
  198. GridHelper.ulGridToExcel(_zcJudgeCtrl.EntityGrid1, "成品判定记录");
  199. }
  200. else if (ultraTabControl2.ActiveTab.Index == 2)
  201. {
  202. GridHelper.ulGridToExcel(_zcJudgeApplyCtrl.UltraGrid1, "放行记录");
  203. }
  204. break;
  205. }
  206. }
  207. private void BatchDownload()
  208. {
  209. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  210. if (chkRows.Count() == 0)
  211. {
  212. MessageUtil.ShowWarning("请选择需要导出的记录!");
  213. return;
  214. }
  215. WaitingForm2 wf = new WaitingForm2("文件检索中....");
  216. List<string> judgeStoveNos = new List<string>();
  217. List<string> pathList = new List<string>();
  218. string key = _zcAllChemPhyCtrl.ultraTabControl1.ActiveTab.Key;
  219. string key1 = "";
  220. switch (key)
  221. {
  222. case "A":
  223. key1 = _zcAllChemPhyCtrl.ZgChemPhyLgCtrl.ultraTabControl2.ActiveTab.Key;
  224. break;
  225. case "D":
  226. key1 = _zcAllChemPhyCtrl.ZgChemPhyZgCtrl.ultraTabControl2.ActiveTab.Key;
  227. break;
  228. case "E":
  229. key1 = _zcAllChemPhyCtrl.ZgChemPhyDbkCtrl.ultraTabControl2.ActiveTab.Key;
  230. break;
  231. case "F":
  232. key1 = _zcAllChemPhyCtrl.ZgChemPhyRclCtrl.ultraTabControl2.ActiveTab.Key;
  233. break;
  234. case "G":
  235. key1 = _zcAllChemPhyCtrl.ZgChemPhyJgxCtrl.ultraTabControl2.ActiveTab.Key;
  236. break;
  237. case "H":
  238. key1 = _zcAllChemPhyCtrl.ZgChemPhyJgCtrl.ultraTabControl2.ActiveTab.Key;
  239. break;
  240. }
  241. foreach (var row in chkRows)
  242. {
  243. DataTable dt = null;
  244. switch (key1)
  245. {
  246. case "water":
  247. if (key == "G")
  248. {
  249. dt = _d.GetTableByXmlId("JdgMchWatergageResult.getInfo", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  250. }
  251. else
  252. {
  253. dt = _d.GetTableByXmlId("JdgMchWatergageResult.getZgInfo", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), key);
  254. }
  255. for (int i = 0; i < dt.Rows.Count; i++)
  256. {
  257. pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
  258. }
  259. break;
  260. case "finalCheck":
  261. dt = _d.GetTableByXmlId("JdgMchFinalChekResult.getInfo", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), key);
  262. for (int i = 0; i < dt.Rows.Count; i++)
  263. {
  264. pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
  265. }
  266. break;
  267. case "jgDetect":
  268. dt = _d.GetTableByXmlId("JdgCouplingInSpectionResult.Query", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("proOrderId"));
  269. for (int i = 0; i < dt.Rows.Count; i++)
  270. {
  271. pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
  272. }
  273. break;
  274. case "detec":
  275. CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.getDetectInfo",
  276. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), key, "");
  277. if (ccp.ReturnInfo.ToString2() != "")
  278. {
  279. MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
  280. return;
  281. }
  282. dt = JsonHelper.toTable(ccp.ReturnObject.ToString2());
  283. for (int i = 0; i < dt.Rows.Count; i++)
  284. {
  285. pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
  286. }
  287. break;
  288. default:
  289. dt = _d.GetTableByXmlId("QcmZgJugdeApplyDAL.getReportPath", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  290. for(int i = 0 ; i<dt.Rows.Count ;i++){
  291. pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i][0].ToString2());
  292. }
  293. break;
  294. }
  295. }
  296. wf.Close();
  297. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, pathList, "2", judgeStoveNos);
  298. down.DeleteButton.Visible = false;
  299. down.ShowDialog();
  300. //打开下载后的文件夹
  301. if (down.Pic != "")
  302. System.Diagnostics.Process.Start("Explorer.exe", down.Pic);
  303. }
  304. private void CopyZgData()
  305. {
  306. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  307. if (chkRows.Count() == 0)
  308. {
  309. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  310. return;
  311. }
  312. string applyCode = "";
  313. string judgeStoveNo = "";
  314. string batchNo = "";
  315. foreach (var row in chkRows)
  316. {
  317. string lotNo = row.GetValue("lotNo");
  318. judgeStoveNo = row.GetValue("judgeStoveNo");
  319. batchNo = row.GetValue("batchNo");
  320. applyCode = row.GetValue("jugdeApplyCode");
  321. var result = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligateJudge.CopyZgJhyData",
  322. applyCode, judgeStoveNo, batchNo, null);
  323. if (result.ReturnInfo.ToString2() != "")
  324. {
  325. MessageUtil.ShowWarning(result.ReturnInfo);
  326. return;
  327. }
  328. }
  329. MessageUtil.ShowTips("复制成功!");
  330. Relocate(applyCode, judgeStoveNo, batchNo);
  331. }
  332. private void UpdateZbsLock()
  333. {
  334. var row = _zcJudgeApplyCtrl.UltraGrid1.ActiveRow;
  335. if (row == null)
  336. {
  337. MessageUtil.ShowWarning("请选择申请判定记录!");
  338. return;
  339. }
  340. string judgeStoveNo = row.GetValue("judgeStoveNo");
  341. string batchNo = row.GetValue("batchNo");
  342. string applyCode = row.GetValue("jugdeApplyCode");
  343. string zbsLockFlag = row.GetValue("zbsLockFlag").Equals("1")?"0":"1";
  344. var result = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.UpdateZbsLock",
  345. applyCode, judgeStoveNo, batchNo, zbsLockFlag);
  346. if (result.ReturnInfo.ToString2() != "")
  347. {
  348. MessageUtil.ShowWarning(result.ReturnInfo);
  349. return;
  350. }
  351. if ("0".Equals(zbsLockFlag))
  352. {
  353. MessageUtil.ShowTips("解锁成功!");
  354. }else{
  355. MessageUtil.ShowTips("锁定成功!");
  356. }
  357. Query();
  358. }
  359. private void CopyRclData()
  360. {
  361. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  362. if (chkRows.Count() == 0)
  363. {
  364. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  365. return;
  366. }
  367. string applyCode = "";
  368. string judgeStoveNo = "";
  369. string batchNo = "";
  370. foreach (var row in chkRows)
  371. {
  372. string lotNo = row.GetValue("lotNo");
  373. judgeStoveNo = row.GetValue("judgeStoveNo");
  374. batchNo = row.GetValue("batchNo");
  375. applyCode = row.GetValue("jugdeApplyCode");
  376. var result = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligateJudge.CopyRclJhyData",
  377. applyCode, judgeStoveNo, batchNo, "");
  378. if (result.ReturnInfo.ToString2() != "")
  379. {
  380. MessageUtil.ShowWarning(result.ReturnInfo);
  381. return;
  382. }
  383. }
  384. MessageUtil.ShowTips("复制成功!");
  385. Relocate(applyCode, judgeStoveNo, batchNo);
  386. }
  387. private void UpdateMemo()
  388. {
  389. if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
  390. {
  391. MessageUtil.ShowWarning("没有需要修改的记录!");
  392. return;
  393. }
  394. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  395. if (chkRows.Count() == 0)
  396. {
  397. if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
  398. {
  399. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1);
  400. }
  401. else
  402. {
  403. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  404. }
  405. return;
  406. }
  407. string judgeApplyCode = "";
  408. string judgeStoveNo = "";
  409. string batchNo = "";
  410. List<string[]> parms = new List<string[]>();
  411. foreach (var row in chkRows)
  412. {
  413. judgeApplyCode = row.GetValue("jugdeApplyCode");
  414. judgeStoveNo = row.GetValue("judgeStoveNo");
  415. batchNo = row.GetValue("batchNo");
  416. parms.Add(new string[] { judgeApplyCode, judgeStoveNo, batchNo, row.GetValue("processCode"), row.GetValue("memo"), row.GetValue("judgeMemo") });
  417. }
  418. if (MessageUtil.ShowYesNoAndQuestion("是否确认修改备注?") == System.Windows.Forms.DialogResult.No)
  419. {
  420. return;
  421. }
  422. var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.UpdateMemo", parms);
  423. if (ccp.ReturnInfo != "")
  424. {
  425. MessageUtil.ShowError(ccp.ReturnInfo);
  426. return;
  427. }
  428. else
  429. {
  430. MessageUtil.ShowTips("操作成功!");
  431. }
  432. Relocate(judgeApplyCode, judgeStoveNo, batchNo);
  433. }
  434. private void DeleteJudge()
  435. {
  436. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  437. if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
  438. {
  439. MessageUtil.ShowWarning("没有需要撤销的记录!");
  440. return;
  441. }
  442. if (chkRows.Count() == 0)
  443. {
  444. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  445. return;
  446. }
  447. string judgeApplyCode = "";
  448. string judgeStoveNo = "";
  449. string bathcNo = "";
  450. bool deleteJudgeTiped = false;
  451. foreach (var row in chkRows)
  452. {
  453. judgeApplyCode = row.GetValue("jugdeApplyCode");
  454. judgeStoveNo = row.GetValue("judgeStoveNo");
  455. bathcNo = row.GetValue("batchNo");
  456. DataRow drGpApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
  457. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  458. DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
  459. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"));
  460. if (drGpApply != null && drGpApply["judgeResultCode"].ToString() == "40740704"
  461. && drPassApply != null && drPassApply["TYPE"].ToString() == "0")
  462. {
  463. if (drPassApply["auditResult"].ToString() == "407502" || drPassApply["auditResult"].ToString() == "407503")
  464. {
  465. deleteJudgeTiped = true;
  466. if (MessageUtil.ShowYesNoAndQuestion("炉号" + judgeStoveNo + " 放行处置结果为让步接收,是否确认撤销判定?") == System.Windows.Forms.DialogResult.No)
  467. {
  468. return;
  469. }
  470. }
  471. }
  472. }
  473. if (deleteJudgeTiped == false)
  474. {
  475. if (MessageUtil.ShowYesNoAndQuestion("是否确认进行撤销判定?") == System.Windows.Forms.DialogResult.No)
  476. {
  477. return;
  478. }
  479. }
  480. List<string> judgeStoveNos = new List<string>();
  481. foreach (var row in chkRows)
  482. {
  483. if (judgeStoveNos.Contains(row.GetValue("judgeStoveNo"))) continue;
  484. judgeStoveNos.Add(row.GetValue("judgeStoveNo"));
  485. var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.deleteJudge", row.GetValue("jugdeApplyCode"),
  486. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"), UserInfo.GetUserName());
  487. if (ccp.ReturnInfo != "")
  488. {
  489. MessageUtil.ShowWarning(ccp.ReturnInfo);
  490. return;
  491. }
  492. }
  493. MessageUtil.ShowTips("操作成功!");
  494. Relocate(judgeApplyCode, judgeStoveNo, bathcNo);
  495. }
  496. private void DeletePassApply()
  497. {
  498. var chkRows = _zcPassApply.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  499. if (chkRows.Count() == 0)
  500. {
  501. MessageUtil.ShowWarning("请选择一行记录");
  502. return;
  503. }
  504. List<string> passApplyNos = new List<string>();
  505. string passApplyNo = "";
  506. string passApplySeq = "";
  507. foreach (var row in chkRows)
  508. {
  509. DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByPassApplyNo", row.GetValue("passApplyNo"));
  510. if (drPassApply == null)
  511. {
  512. MessageUtil.ShowWarning("此炉号不需要删除放行申请单!");
  513. return;
  514. }
  515. if (drPassApply["type"].ToString() == "0")
  516. {
  517. DataRow drZgJudgeApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
  518. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  519. if (drZgJudgeApply["judgeTolresultCode"].ToString() != "40740704" && drZgJudgeApply["judgeTolresultCode"].ToString() != "40740708")
  520. {
  521. MessageUtil.ShowWarning("只能删除判定不合格状态的放行申请单!", _zcJudgeApplyCtrl.UltraGrid1, row);
  522. return;
  523. }
  524. if (drZgJudgeApply["auditTolresult"].ToString() == "407504" || drZgJudgeApply["auditTolresult"].ToString() == "407505"
  525. || drZgJudgeApply["auditTolresult"].ToString() == "407506")
  526. {
  527. MessageUtil.ShowWarning("此炉号已退回炼钢,不能删除!", _zcJudgeApplyCtrl.UltraGrid1, row);
  528. return;
  529. }
  530. }
  531. else
  532. {
  533. if (drPassApply["auditResult"].ToString() == "1")
  534. {
  535. MessageUtil.ShowWarning("此炉号已经通过紧急放行,不能删除申请放行单!");
  536. return;
  537. }
  538. }
  539. passApplyNos.Add(row.GetValue("PassApplyNo"));
  540. passApplyNo = row.GetValue("PassApplyNo");
  541. passApplySeq = row.GetValue("passApplySeq");
  542. }
  543. if (MessageUtil.ShowYesNoAndQuestion("是否确认删除申请放行?") == System.Windows.Forms.DialogResult.No)
  544. {
  545. return;
  546. }
  547. var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligatePassApply.delete", passApplyNos, UserInfo.GetUserName());
  548. if (ccp.ReturnInfo != "")
  549. {
  550. MessageUtil.ShowError(ccp.ReturnInfo);
  551. return;
  552. }
  553. else
  554. {
  555. MessageUtil.ShowTips("操作成功!");
  556. }
  557. Query();
  558. var rowRelocate = _zcPassApply.UltraGrid1.Rows.Where(a => a.GetValue("PassApplyNo") == passApplyNo
  559. && a.GetValue("passApplySeq") == passApplySeq).FirstOrDefault();
  560. if (rowRelocate != null)
  561. {
  562. rowRelocate.Activate();
  563. }
  564. }
  565. private void PassApply()
  566. {
  567. if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
  568. {
  569. MessageUtil.ShowWarning("没有需要放行申请的记录!");
  570. return;
  571. }
  572. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  573. if (chkRows.Count() == 0)
  574. {
  575. if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
  576. {
  577. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1);
  578. }
  579. else
  580. {
  581. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  582. }
  583. return;
  584. }
  585. List<string[]> parms = new List<string[]>();
  586. string judgeApplyCode = "";
  587. string judgeStoveNo = "";
  588. string batchNo = "";
  589. foreach (var row in chkRows)
  590. {
  591. judgeApplyCode = row.GetValue("jugdeApplyCode");
  592. judgeStoveNo = row.GetValue("judgeStoveNo");
  593. batchNo = row.GetValue("batchNo");
  594. DataRow drZgJudgeApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
  595. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  596. if (passInfo == "Quality")
  597. {
  598. if (drZgJudgeApply["judgeTolresultCode"].ToString() != "40740704" && drZgJudgeApply["judgeTolresultCode"].ToString() != "40740708")
  599. {
  600. MessageUtil.ShowWarning("只有判定不合格的记录,才能申请质量放行!", _zcJudgeApplyCtrl.UltraGrid1, row);
  601. return;
  602. }
  603. }
  604. else if (passInfo == "Urgent")
  605. {
  606. if (drZgJudgeApply["judgeTolresultCode"].ToString() != "")
  607. {
  608. MessageUtil.ShowWarning("只有未判定的记录,才能申请紧急放行!", _zcJudgeApplyCtrl.UltraGrid1, row);
  609. return;
  610. }
  611. }
  612. DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
  613. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"));
  614. if (drPassApply != null)
  615. {
  616. MessageUtil.ShowWarning("该记录已生成放行申请单,不能重复生成!", _zcJudgeApplyCtrl.UltraGrid1, row);
  617. return;
  618. }
  619. string[] parm = new string[] { judgeApplyCode, judgeStoveNo, batchNo, row.GetValue("processCode") };
  620. parms.Add(parm);
  621. }
  622. PopupSubmit popupSubmit = new PopupSubmit("是否确认放行申请?", true, "请输入放行申请原因!");
  623. if (popupSubmit.ShowDialog() != System.Windows.Forms.DialogResult.Yes)
  624. {
  625. return;
  626. }
  627. string passType = passInfo == "Quality" ? "0" : "1";
  628. var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.passApply", parms,
  629. UserInfo.GetUserName(), UserInfo.GetDeptid(), UserInfo.GetDepartment(), popupSubmit.TxtAudit.Text.Trim(), passType);
  630. if (ccp.ReturnInfo != "")
  631. {
  632. MessageUtil.ShowError(ccp.ReturnInfo);
  633. return;
  634. }
  635. else
  636. {
  637. MessageUtil.ShowTips("操作成功!");
  638. }
  639. Relocate(judgeApplyCode, judgeStoveNo, batchNo);
  640. }
  641. private void Judge()
  642. {
  643. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  644. if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
  645. {
  646. MessageUtil.ShowWarning("没有需要判定的记录!");
  647. return;
  648. }
  649. if (chkRows.Count() == 0)
  650. {
  651. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  652. return;
  653. }
  654. if (chkRows.Count() > 1)
  655. {
  656. MessageUtil.ShowWarning("只允许勾选一条记录进行判定!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  657. return;
  658. }
  659. string judgeApplyCode = "";
  660. string judgeStoveNo = "";
  661. string batchNo = "";
  662. string processCode = "";
  663. string oldJudgeTolResult = "";
  664. foreach (var row in chkRows)
  665. {
  666. judgeApplyCode = row.GetValue("jugdeApplyCode");
  667. judgeStoveNo = row.GetValue("judgeStoveNo");
  668. batchNo = row.GetValue("batchNo");
  669. processCode = row.GetValue("processCode");
  670. DataRow drZgJudgeApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
  671. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  672. oldJudgeTolResult = drZgJudgeApply["judgeTolresultCode"].ToString();
  673. if (drZgJudgeApply["judgeResultCode"].ToString() == "" && drZgJudgeApply["isAllScrap"].ToString() != "4")
  674. {
  675. DataRow drProcess = _d.GetRowByXmlId("JdgComBaseProcess.Query", drZgJudgeApply["processCode"].ToString());
  676. string processDesc = drProcess["processDesc"].ToString();
  677. MessageUtil.ShowWarning("末工序" + processDesc + "还未进行综合判定,不能操作成品判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  678. return;
  679. }
  680. if (drZgJudgeApply["isAllScrap"].ToString() != "4" && drZgJudgeApply["judgeTolresultCode"].ToString() != "40740709")
  681. {
  682. if (drZgJudgeApply["instockFlag"].ToString() == "1")
  683. {
  684. MessageUtil.ShowWarning("该炉批已缴库,不能操作成品判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  685. return;
  686. }
  687. }
  688. DataRow drExistJudge = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.existJudgeQualifiedZc", row.GetValue("jugdeApplyCode"),
  689. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"));
  690. if (drExistJudge["judgeTolresultCode"].ToString() == "40740701" || drExistJudge["judgeTolresultCode"].ToString() == "40740702"
  691. || drExistJudge["judgeTolresultCode"].ToString() == "40740706") //如果已经判定则不判。 AND T.JUDGE_RESULT_CODE IN ('40740701', '40740702')
  692. {
  693. MessageUtil.ShowWarning("该记录已经" + drExistJudge["judgeTolresult"].ToString() + ",不允许重复判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  694. return;
  695. }
  696. if ((!string.IsNullOrWhiteSpace(drExistJudge["lengthType"].ToString()) && !drExistJudge["lengthType"].ToString().Equals("0"))
  697. || !row.GetValue("lengthType").Equals("正尺")) // 判断是否包含长短尺
  698. {
  699. if (MessageUtil.ShowYesNoAndQuestion("该记录包含长短尺,请确认是否继续?") == System.Windows.Forms.DialogResult.No)
  700. {
  701. return;
  702. }
  703. }
  704. CoreClientParam ccpDetect = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligateJudge.checkDetect", row.GetValue("jugdeApplyCode"),
  705. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  706. if (ccpDetect.ReturnInfo.ToString2() != "")
  707. {
  708. MessageUtil.ShowWarning(ccpDetect.ReturnInfo.ToString2());
  709. return;
  710. }
  711. else
  712. {
  713. if (ccpDetect.ReturnObject.ToString2() != "")
  714. {
  715. if (MessageUtil.ShowYesNoAndQuestion(ccpDetect.ReturnObject.ToString2() + "\r\n是否继续判定?") == System.Windows.Forms.DialogResult.No)
  716. {
  717. return;
  718. }
  719. }
  720. }
  721. //有放行申请单的不允许判定。
  722. DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
  723. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
  724. if (drPassApply != null)
  725. {
  726. if (drPassApply["TYPE"].ToString() == "0")
  727. {
  728. if (drPassApply["auditResult"].ToString() == "")
  729. {
  730. MessageUtil.ShowWarning("该炉号处于放行审核状态,不允许判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  731. return;
  732. }
  733. if (drPassApply["auditResult"].ToString() == "407504")
  734. {
  735. MessageUtil.ShowWarning("该炉号放行处置结果为降级/改判,请操作撤销判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  736. return;
  737. }
  738. if (drPassApply["auditResult"].ToString() == "407505")
  739. {
  740. MessageUtil.ShowWarning("该炉号放行处置结果为报废,请操作撤销判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  741. return;
  742. }
  743. if (drPassApply["auditResult"].ToString() == "407506")
  744. {
  745. MessageUtil.ShowWarning("该炉号放行处置结果为返工,请操作撤销判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
  746. return;
  747. }
  748. }
  749. }
  750. }
  751. string zbsFlag = "";
  752. if (processCode == "D" || processCode == "E" || oldJudgeTolResult == "40740709")
  753. {
  754. zbsFlag = "1";
  755. if (MessageUtil.ShowYesNoAndQuestion("是否确认进行判定?") == System.Windows.Forms.DialogResult.No)
  756. {
  757. return;
  758. }
  759. }
  760. else
  761. {
  762. ZbsChoiceFrm zbsChoice = new ZbsChoiceFrm();
  763. if (zbsChoice.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  764. {
  765. zbsFlag = zbsChoice.ZbsFlag;
  766. }
  767. else
  768. {
  769. return;
  770. }
  771. }
  772. List<string> judgeStoveNos = new List<string>();
  773. foreach (var row in chkRows)
  774. {
  775. if (judgeStoveNos.Contains(row.GetValue("judgeStoveNo"))) continue;
  776. judgeStoveNos.Add(row.GetValue("judgeStoveNo"));
  777. //人工修改利库炉号判定结果
  778. List<string> checkDetailJsons = RolledTubeColligateJudgeFrm.GetCheckDetailsJsons(_zcAllChemPhyCtrl);
  779. var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.judge", row.GetValue("jugdeApplyCode"),
  780. row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"), UserInfo.GetUserName(), UserInfo.GetUserOrderText(),
  781. UserInfo.GetUserGroupText(), row.GetValue("memo"), row.GetValue("judgeMemo"), zbsFlag, checkDetailJsons);
  782. if (ccp.ReturnInfo != "")
  783. {
  784. MessageUtil.ShowWarning(ccp.ReturnInfo);
  785. return;
  786. }
  787. }
  788. MessageUtil.ShowTips("判定成功!");
  789. Relocate(judgeApplyCode, judgeStoveNo, batchNo);
  790. }
  791. private void ReviewGpCertificate()
  792. {
  793. try
  794. {
  795. this.Cursor = Cursors.WaitCursor;
  796. var row = _zcJudgeApplyCtrl.UltraGrid1.ActiveRow;
  797. if (row == null)
  798. {
  799. MessageUtil.ShowWarning("请选择一行记录!");
  800. return;
  801. }
  802. string judgeApplyCode = row.Cells["jugdeApplyCode"].Value.ToString();
  803. string judgeApplySeq = row.Cells["jugdeApplySqe"].Value.ToString();
  804. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  805. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepGpCertificate.cpt&_bypagesize__=false" + "&JUGDE_APPLY_CODE="
  806. + judgeApplyCode + judgeApplySeq + "&JUDGE_STOVE_NO=" + judgeStoveNo;
  807. FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strurl);
  808. fBug.AutoSize = true;
  809. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  810. fBug.WindowState = FormWindowState.Maximized;
  811. fBug.Text = "管坯判定书";
  812. fBug.Show();
  813. }
  814. finally
  815. {
  816. this.Cursor = Cursors.Default;
  817. }
  818. }
  819. private void Relocate(string judgeApplyCode, string judgeStoveNo, string batchNo)
  820. {
  821. if (_gpApplyQuery)
  822. {
  823. Query();
  824. var rowJudgeApply = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("jugdeApplyCode") == judgeApplyCode
  825. && a.GetValue("judgeStoveNo") == judgeStoveNo && a.GetValue("batchNo") == batchNo).FirstOrDefault();
  826. if (rowJudgeApply != null)
  827. {
  828. rowJudgeApply.Activate();
  829. }
  830. }
  831. else
  832. {
  833. //ultraTextEditor2_EditorButtonClick(null, null);
  834. //var rowSteelMaking = _meltingStoveNoCtrl.UltraGrid1.Rows.Where(a => a.GetValue("stoveNo") == stoveNo).FirstOrDefault();
  835. //if (rowSteelMaking != null)
  836. //{
  837. // rowSteelMaking.Activate();
  838. //}
  839. }
  840. }
  841. private void ClearData()
  842. {
  843. _zcJudgeApplyCtrl.Clear();
  844. _zcAllChemPhyCtrl.ClearChemPhyData();
  845. }
  846. private bool _gpApplyQuery = true;
  847. private void Query()
  848. {
  849. try
  850. {
  851. this.Cursor = Cursors.WaitCursor;
  852. ClearData();
  853. //测试代码
  854. //_d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.Test", "084897", "26001", "001", "G", "796A250A209A0022E053AC10026C9519004001");
  855. //现货测试
  856. //_d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.saveSpotInfo", "194430", "09001", "001", "D", "8741E3DC0CA001A4E053AC10026B1844001001");
  857. string timeType = ultraComboEditor3.Value.ToString2();
  858. string timeB = labelDateTimePicker1.Checked ? labelDateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  859. string timeE = labelDateTimePicker1.Checked ? labelDateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  860. string[] judgeStates;
  861. if (labelComboBox2.ComboBox.Value == null || !labelComboBox2.Checked)
  862. {
  863. judgeStates = new string[0];
  864. }
  865. else
  866. {
  867. judgeStates = ((List<object>)labelComboBox2.ComboBox.Value).Select(a => a.ToString()).ToArray();
  868. }
  869. string stoveNo = labelTextBox1.Checked ? labelTextBox1.Text.Trim() : "";
  870. string judgeStoveNo = labelTextBox4.Checked ? labelTextBox4.Text.Trim() : "";
  871. string lotNo = labelTextBox1.Checked ? labelTextBox1.Text.Trim() : "";
  872. string orderMngNo = labelTextBox10.Checked ? labelTextBox10.Text.Trim() : "";
  873. string[] plines = ultraTextEditor1.Tag.ToString2().Split(',');
  874. string judgeCondition = labelComboBox1.Checked ? labelComboBox1.SelecteValue.ToString2() : "";
  875. string[] judgeType;
  876. if (labelComboBox4.ComboBox.Value == null || !labelComboBox4.Checked)
  877. {
  878. judgeType = new string[0];
  879. }
  880. else
  881. {
  882. judgeType = ((List<object>)labelComboBox4.ComboBox.Value).Select(a => a.ToString()).ToArray();
  883. }
  884. switch (ultraTabControl2.SelectedTab.Text)
  885. {
  886. case "综合判定":
  887. _gpApplyQuery = true;
  888. _zcJudgeApplyCtrl.QueryZcColligate(lotNo, judgeStoveNo, judgeStates, timeB, timeE, plines, orderMngNo, timeType, judgeCondition, judgeType);
  889. break;
  890. case "判定记录":
  891. string batchNo2 = labelTextBox3.Checked ? labelTextBox3.Text.Trim() : "";
  892. string judgeStoveNo2 = labelTextBox7.Checked ? labelTextBox7.Text.Trim() : "";
  893. string judgeResult = labelComboBox3.Checked ? labelComboBox3.SelecteValue.ToString2() : "";
  894. string timeBegin = labelDateTimePicker4.Checked ? labelDateTimePicker4.DateTimePicker.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  895. string timeEnd = labelDateTimePicker3.Checked ? labelDateTimePicker3.DateTimePicker.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  896. string[] plines2 = ultraTextEditor2.Tag.ToString2().Split(',');
  897. _zcJudgeCtrl.Query(batchNo2, judgeStoveNo2, judgeResult, timeBegin, timeEnd, plines2);
  898. break;
  899. case "不合格评审记录":
  900. string batchNo3 = labelTextBox5.Checked ? labelTextBox5.Text.Trim() : "";
  901. string judgeStoveNo3 = labelTextBox6.Checked ? labelTextBox6.Text.Trim() : "";
  902. string timeB3 = labelDateTimePicker6.Checked ? labelDateTimePicker6.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  903. string timeE3 = labelDateTimePicker6.Checked ? labelDateTimePicker5.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  904. string validflag = labelCheckBox1.Checked ? "0" : "1";
  905. //_zgJudgeApplyDtlCtrl2.Clear();
  906. _zcPassFlowCtrl.Clear();
  907. _zcPassApply.AllQuery(judgeStoveNo3, batchNo3, timeB3, timeE3, passInfo, validflag);
  908. break;
  909. }
  910. }
  911. finally
  912. {
  913. this.Cursor = Cursors.Default;
  914. }
  915. }
  916. void gpJudgeApplyCtrl_AfterRowActivate(object sender, EventArgs e)
  917. {
  918. try
  919. {
  920. this.Cursor = Cursors.WaitCursor;
  921. _zcAllChemPhyCtrl.UltraTabControl2_SelectedTabChanged(null, null);
  922. }
  923. finally
  924. {
  925. this.Cursor = Cursors.Default;
  926. }
  927. }
  928. public string[] GetChemJudgeStoveNos(string matNo, string curProcess)
  929. {
  930. if (curProcess.ToCharArray()[0] < 'D')
  931. {
  932. DataRow drTrack = _d.GetRowByXmlId("JdgMatBcQcmTrack.getByMatNoFirstRow", matNo, "D");
  933. return new string[] { drTrack["judgeStoveNo"].ToString(), "A" };
  934. }
  935. else
  936. {
  937. DataRow drTrack = _d.GetRowByXmlId("JdgMatBcQcmTrack.getByMatNoFirstRow", matNo, curProcess);
  938. if (drTrack != null)
  939. {
  940. DataRow drJudge = _d.GetRowByXmlId("JdgQcmBcJudge.getByJudgeId", drTrack["jugdeConvicted"].ToString());
  941. if (drJudge["chemResult"].ToString() != "")
  942. {
  943. return new string[] { drTrack["judgeStoveNo"].ToString(), curProcess };
  944. }
  945. else
  946. {
  947. curProcess = ((char)(curProcess.ToCharArray()[0] - 1)).ToString();
  948. return GetChemJudgeStoveNos(matNo, curProcess);
  949. }
  950. }
  951. else
  952. {
  953. curProcess = ((char)(curProcess.ToCharArray()[0] - 1)).ToString();
  954. return GetChemJudgeStoveNos(matNo, curProcess);
  955. }
  956. }
  957. }
  958. private void labelDateTimePicker4_CheckBox_CheckedChanged(object sender, EventArgs e)
  959. {
  960. labelDateTimePicker3.DateTimePicker.Enabled = labelDateTimePicker4.Checked;
  961. }
  962. private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  963. {
  964. if (toolMenu == null || toolMenu.Toolbars.Count == 0) return;
  965. switch (ultraTabControl2.ActiveTab.Index)
  966. {
  967. case 0:
  968. if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = true;
  969. if (this.toolMenu.Toolbars[0].Tools.Exists("PassApply")) this.toolMenu.Toolbars[0].Tools["PassApply"].SharedProps.Visible = true;
  970. if (this.toolMenu.Toolbars[0].Tools.Exists("UrgentPassApply")) this.toolMenu.Toolbars[0].Tools["UrgentPassApply"].SharedProps.Visible = true;
  971. if (this.toolMenu.Toolbars[0].Tools.Exists("DeletePassApply")) this.toolMenu.Toolbars[0].Tools["DeletePassApply"].SharedProps.Visible = false;
  972. if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteJudge")) this.toolMenu.Toolbars[0].Tools["DeleteJudge"].SharedProps.Visible = true;
  973. if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = true;
  974. if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
  975. if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshZbs")) this.toolMenu.Toolbars[0].Tools["RefreshZbs"].SharedProps.Visible = true;
  976. if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshCraft")) this.toolMenu.Toolbars[0].Tools["RefreshCraft"].SharedProps.Visible = true;
  977. if (this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Visible = true;
  978. if (this.toolMenu.Toolbars[0].Tools.Exists("ReviewGpCertificate")) this.toolMenu.Toolbars[0].Tools["ReviewGpCertificate"].SharedProps.Visible = true;
  979. break;
  980. case 1:
  981. if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = false;
  982. if (this.toolMenu.Toolbars[0].Tools.Exists("PassApply")) this.toolMenu.Toolbars[0].Tools["PassApply"].SharedProps.Visible = false;
  983. if (this.toolMenu.Toolbars[0].Tools.Exists("UrgentPassApply")) this.toolMenu.Toolbars[0].Tools["UrgentPassApply"].SharedProps.Visible = false;
  984. if (this.toolMenu.Toolbars[0].Tools.Exists("DeletePassApply")) this.toolMenu.Toolbars[0].Tools["DeletePassApply"].SharedProps.Visible = false;
  985. if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteJudge")) this.toolMenu.Toolbars[0].Tools["DeleteJudge"].SharedProps.Visible = false;
  986. if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = false;
  987. if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
  988. if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshZbs")) this.toolMenu.Toolbars[0].Tools["RefreshZbs"].SharedProps.Visible = false;
  989. if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshCraft")) this.toolMenu.Toolbars[0].Tools["RefreshCraft"].SharedProps.Visible = false;
  990. if (this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Visible = false;
  991. if (this.toolMenu.Toolbars[0].Tools.Exists("ReviewGpCertificate")) this.toolMenu.Toolbars[0].Tools["ReviewGpCertificate"].SharedProps.Visible = false;
  992. break;
  993. case 2:
  994. if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = false;
  995. if (this.toolMenu.Toolbars[0].Tools.Exists("PassApply")) this.toolMenu.Toolbars[0].Tools["PassApply"].SharedProps.Visible = false;
  996. if (this.toolMenu.Toolbars[0].Tools.Exists("UrgentPassApply")) this.toolMenu.Toolbars[0].Tools["UrgentPassApply"].SharedProps.Visible = false;
  997. if (this.toolMenu.Toolbars[0].Tools.Exists("DeletePassApply")) this.toolMenu.Toolbars[0].Tools["DeletePassApply"].SharedProps.Visible = true;
  998. if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteJudge")) this.toolMenu.Toolbars[0].Tools["DeleteJudge"].SharedProps.Visible = false;
  999. if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = false;
  1000. if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
  1001. if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshZbs")) this.toolMenu.Toolbars[0].Tools["RefreshZbs"].SharedProps.Visible = false;
  1002. if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshCraft")) this.toolMenu.Toolbars[0].Tools["RefreshCraft"].SharedProps.Visible = false;
  1003. if (this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Visible = false;
  1004. if (this.toolMenu.Toolbars[0].Tools.Exists("ReviewGpCertificate")) this.toolMenu.Toolbars[0].Tools["ReviewGpCertificate"].SharedProps.Visible = false;
  1005. break;
  1006. }
  1007. }
  1008. private void SteelMakingColligateJudgeFrm_Shown(object sender, EventArgs e)
  1009. {
  1010. ultraTabControl2_SelectedTabChanged(null, null);
  1011. FoldQuery();
  1012. }
  1013. private void labelDateTimePicker6_CheckBox_CheckedChanged(object sender, EventArgs e)
  1014. {
  1015. labelDateTimePicker5.DateTimeEnabled = labelDateTimePicker6.Checked;
  1016. }
  1017. private void labelTextBox4_TextBox_KeyDown(object sender, KeyEventArgs e)
  1018. {
  1019. if (e.KeyData == Keys.Enter)
  1020. {
  1021. Query();
  1022. }
  1023. }
  1024. private void labelTextBox6_TextBox_KeyDown(object sender, KeyEventArgs e)
  1025. {
  1026. if (e.KeyData == Keys.Enter)
  1027. {
  1028. Query();
  1029. }
  1030. }
  1031. private void labelTextBox7_TextBox_KeyDown(object sender, KeyEventArgs e)
  1032. {
  1033. if (e.KeyData == Keys.Enter)
  1034. {
  1035. Query();
  1036. }
  1037. }
  1038. private void ultraExpandableGroupBox2_ExpandedStateChanged(object sender, EventArgs e)
  1039. {
  1040. if (!ultraExpandableGroupBox2.Expanded)
  1041. {
  1042. ultraExpandableGroupBox2.Dock = DockStyle.Bottom;
  1043. splitContainer3.Panel1.Controls.Add(ultraExpandableGroupBox2);
  1044. ultraExpandableGroupBox2.BringToFront();
  1045. splitContainer3.Panel2Collapsed = true;
  1046. }
  1047. else
  1048. {
  1049. ultraExpandableGroupBox2.Dock = DockStyle.Fill;
  1050. splitContainer3.Panel2.Controls.Add(ultraExpandableGroupBox2);
  1051. splitContainer3.Panel2Collapsed = false;
  1052. }
  1053. }
  1054. private void FoldQuery()
  1055. {
  1056. if (!this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) return;
  1057. panel2.Visible = !panel2.Visible;
  1058. if (panel2.Visible)
  1059. {
  1060. this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "折叠查询区域";
  1061. }
  1062. else
  1063. {
  1064. this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "展开查询区域";
  1065. }
  1066. }
  1067. private void RefreshZbs(string flag)
  1068. {
  1069. WaitingForm2 wf = new WaitingForm2("正在刷新,请稍后....");
  1070. try
  1071. {
  1072. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  1073. string processCode = "";
  1074. if (chkRows.Count() == 0)
  1075. {
  1076. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  1077. return;
  1078. }
  1079. else
  1080. {
  1081. processCode = chkRows.FirstOrDefault().GetValue("processCode");
  1082. }
  1083. string zbsFlag = "";//空表示不修改质保书打印方式
  1084. foreach (var row in chkRows)
  1085. {
  1086. string judgeApplyCode = row.GetValue("jugdeApplyCode");
  1087. string judgeStoveNo = row.GetValue("judgeStoveNo");
  1088. string batchNo = row.GetValue("batchNo");
  1089. CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.Create", judgeApplyCode, judgeStoveNo, batchNo, zbsFlag, flag);
  1090. if (ccp.ReturnInfo.ToString2() != "")
  1091. {
  1092. MessageUtil.ShowWarning("炉号:" + judgeStoveNo + "批号:" + batchNo + " " + ccp.ReturnInfo);
  1093. return;
  1094. }
  1095. }
  1096. }
  1097. finally
  1098. {
  1099. wf.Close();
  1100. }
  1101. MessageUtil.ShowTips("刷新成功!");
  1102. }
  1103. private void RefreshCraft()
  1104. {
  1105. WaitingForm2 wf = new WaitingForm2("正在刷新,请稍后....");
  1106. try
  1107. {
  1108. var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  1109. string processCode = "";
  1110. if (chkRows.Count() == 0)
  1111. {
  1112. MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  1113. return;
  1114. }
  1115. else
  1116. {
  1117. processCode = chkRows.FirstOrDefault().GetValue("processCode");
  1118. }
  1119. foreach (var row in chkRows)
  1120. {
  1121. string judgeApplyCode = row.GetValue("jugdeApplyCode");
  1122. string judgeStoveNo = row.GetValue("judgeStoveNo");
  1123. string batchNo = row.GetValue("batchNo");
  1124. CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.refreshCraft", judgeApplyCode, judgeStoveNo, batchNo);
  1125. if (ccp.ReturnInfo.ToString2() != "")
  1126. {
  1127. MessageUtil.ShowWarning("炉号:" + judgeStoveNo + "批号:" + batchNo + " " + ccp.ReturnInfo);
  1128. return;
  1129. }
  1130. }
  1131. }
  1132. finally
  1133. {
  1134. wf.Close();
  1135. }
  1136. MessageUtil.ShowTips("获取成功!");
  1137. }
  1138. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1139. {
  1140. ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraTextEditor1.Tag.ToString2(), _d.Ob);
  1141. if (frm.ShowDialog() == DialogResult.OK)
  1142. {
  1143. ultraTextEditor1.Text = frm.ChoicePlineName;
  1144. ultraTextEditor1.Tag = frm.ChoicePlineCode;
  1145. }
  1146. }
  1147. private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1148. {
  1149. ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraTextEditor2.Tag.ToString2(), _d.Ob);
  1150. if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  1151. {
  1152. ultraTextEditor2.Text = frm.ChoicePlineName;
  1153. ultraTextEditor2.Tag = frm.ChoicePlineCode;
  1154. }
  1155. }
  1156. }
  1157. }