FrmApplyDecision.cs 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649
  1. using com.steering.mes.zgmil.entity;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using Core.StlMes.Client.ZGMil.Common;
  6. using Core.StlMes.Client.ZGMil.Entity;
  7. using Core.StlMes.Client.ZGMil.NodeResultQuery;
  8. using Core.StlMes.Client.ZGMil.Popup;
  9. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  10. using CoreFS.CA06;
  11. using Infragistics.Win.UltraWinGrid;
  12. using System;
  13. using System.Collections;
  14. using System.Collections.Generic;
  15. using System.ComponentModel;
  16. using System.Data;
  17. using System.Drawing;
  18. using System.Linq;
  19. using System.Text;
  20. using System.Windows.Forms;
  21. namespace Core.StlMes.Client.ZGMil.Signature
  22. {
  23. public partial class FrmApplyDecision : FrmBase
  24. {
  25. private string[] plineCodes = { };
  26. public FrmApplyDecision()
  27. {
  28. InitializeComponent();
  29. }
  30. private void FrmApplyDecision_Load(object sender, EventArgs e)
  31. {
  32. DateTime now = DateTime.Now;
  33. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  34. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  35. this.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  36. this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  37. EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid6.DisplayLayout.Bands[0]);
  38. EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid7.DisplayLayout.Bands[0]);
  39. EntityHelper.ShowGridCaption<QcmZgJugdeApplyEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  40. plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
  41. if (this.CustomInfo.Equals("WG"))
  42. {
  43. this.ultraGrid6.DisplayLayout.Bands[0].Columns["Bjz"].Hidden = true;
  44. this.ultraGrid6.DisplayLayout.Bands[0].Columns["Yjz"].Hidden = true;
  45. this.ultraGrid6.DisplayLayout.Bands[0].Columns["Xcjz"].Hidden = true;
  46. this.ultraGrid6.DisplayLayout.Bands[0].Columns["Ycjz"].Hidden = true;
  47. this.ultraGrid6.DisplayLayout.Bands[0].Columns["InspectionFlag"].Hidden = true;
  48. this.ultraGrid6.DisplayLayout.Bands[0].Columns["IsOk"].Hidden = true;
  49. }
  50. InitBindColumn();
  51. }
  52. private void WriteTextToGrid()
  53. {
  54. foreach(UltraGridRow row in ultraGrid6.Rows)
  55. {
  56. if (row.Cells["ChemResultCode"].Value.ToString() == "")
  57. {
  58. row.Cells["ChemResultCode"].Value = "合格";
  59. row.Cells["ChemResultCode"].ActiveAppearance.TextHAlign = Infragistics.Win.HAlign.Center;
  60. }
  61. else
  62. {
  63. if (row.Cells["ChemResultCode"].Value.ToString() == "40740101")
  64. {
  65. row.Cells["ChemResultCode"].Value = "内控合格";
  66. }
  67. else if (row.Cells["ChemResultCode"].Value.ToString() == "40740102")
  68. {
  69. row.Cells["ChemResultCode"].Value = "内控不合格";
  70. }
  71. else if (row.Cells["ChemResultCode"].Value.ToString() == "40740103")
  72. {
  73. row.Cells["ChemResultCode"].Value = "交付合格";
  74. }
  75. else if (row.Cells["ChemResultCode"].Value.ToString() == "40740104")
  76. {
  77. row.Cells["ChemResultCode"].Value = "交付不合格";
  78. }
  79. }
  80. }
  81. ultraGrid6.UpdateData();
  82. }
  83. private void WriteTextToGrid2()
  84. {
  85. foreach (UltraGridRow row in ultraGrid7.Rows)
  86. {
  87. if (row.Cells["PhyResultCode"].Value.ToString() == "")
  88. {
  89. row.Cells["PhyResultCode"].Value = "合格";
  90. row.Cells["PhyResultCode"].ActiveAppearance.TextHAlign = Infragistics.Win.HAlign.Center;
  91. }
  92. else
  93. {
  94. if (row.Cells["PhyResultCode"].Value.ToString() == "40740201")
  95. {
  96. row.Cells["PhyResultCode"].Value = "内控合格";
  97. }
  98. else if (row.Cells["PhyResultCode"].Value.ToString() == "40740202")
  99. {
  100. row.Cells["PhyResultCode"].Value = "国标合格";
  101. }
  102. else if (row.Cells["PhyResultCode"].Value.ToString() == "40740203")
  103. {
  104. row.Cells["PhyResultCode"].Value = "待判";
  105. }
  106. else if (row.Cells["PhyResultCode"].Value.ToString() == "40740204")
  107. {
  108. row.Cells["PhyResultCode"].Value = "次品";
  109. }
  110. else if (row.Cells["PhyResultCode"].Value.ToString() == "40740205")
  111. {
  112. row.Cells["PhyResultCode"].Value = "废品";
  113. }
  114. }
  115. }
  116. ultraGrid7.UpdateData();
  117. }
  118. private void InitBindColumn()
  119. {
  120. //材料状态
  121. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
  122. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料产出(已判定)");
  123. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料已编计划");
  124. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料待处理");
  125. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料加工");
  126. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  127. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  128. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  129. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  130. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
  131. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  132. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  133. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  134. //材料类别
  135. this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  136. this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  137. this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  138. //探伤结果
  139. this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740401", "内控合格");
  140. this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740402", "国标合格");
  141. this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740403", "待判");
  142. this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740404", "废品");
  143. //表检结果
  144. this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740601", "合格");
  145. this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740602", "不合格");
  146. this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740603", "判废");
  147. this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740604", "待判");
  148. //综合判定结果
  149. this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740701", "合同内合格");
  150. this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740702", "改判合格");
  151. this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740703", "待判");
  152. this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740704", "次品");
  153. this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740705", "废品");
  154. //成分结果
  155. this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740101", "内控合格");
  156. this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740102", "内控不合格");
  157. this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740103", "交付合格");
  158. this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740104", "交付不合格");
  159. //性能结果
  160. this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740201", "内控合格");
  161. this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740202", "国标合格");
  162. this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740203", "待判");
  163. this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740204", "次品");
  164. this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740205", "废品");
  165. //材料状态
  166. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
  167. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料产出(已判定)");
  168. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料已编计划");
  169. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料待处理");
  170. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料加工");
  171. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  172. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  173. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  174. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  175. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
  176. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  177. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  178. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  179. //材料类别
  180. this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  181. this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  182. this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  183. }
  184. public override void ToolBar_Click(object sender, string ToolbarKey)
  185. {
  186. switch (ToolbarKey)
  187. {
  188. case "DoQueryMat":
  189. if (ultraTabControl1.SelectedTab.Index == 0)
  190. {
  191. QueryMat();
  192. }
  193. else if (ultraTabControl1.SelectedTab.Index == 1)
  194. {
  195. QueryZgJugdeApply();
  196. }
  197. break;
  198. case "DoDecision":
  199. DoDecision();
  200. break;
  201. case "cancelDoDecision":
  202. cancelDoDecision();
  203. break;
  204. case "insertProssWt":
  205. insertProssWt();
  206. break;
  207. case "updateProssWt":
  208. updateProssWt();
  209. break;
  210. case"insertTestingResult":
  211. insertTestingResult();
  212. break;
  213. case "updateTarget":
  214. updateTarget();
  215. break;
  216. case "inspection":
  217. inspection();
  218. break;
  219. case "inspection2":
  220. inspection2();
  221. break;
  222. case "Print":
  223. printPipe();
  224. break;
  225. case "Print1":
  226. printPipe1();
  227. break;
  228. case "Print2":
  229. printPipe2();
  230. break;
  231. case "Print3":
  232. printPipe3();
  233. break;
  234. case "inspection3":
  235. inspection3();
  236. break;
  237. case "doSaveOrdLnDlyPk":
  238. doSaveOrdLnDlyPk();
  239. break;
  240. case "Close":
  241. this.Close();
  242. break;
  243. }
  244. }
  245. private void getDeliveryNo(string ordLnPk)
  246. {
  247. DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDeliveryNo", new object[] { ordLnPk }, ob);//快速检索码
  248. if (dd != null && dd.Rows.Count > 0)
  249. {
  250. DeliveryNoText.DataSource = dd;
  251. DeliveryNoText.ValueMember = "BASECODE";
  252. DeliveryNoText.DisplayMember = "BASENAME";
  253. }
  254. }
  255. /// <summary>
  256. /// 报检
  257. /// </summary>
  258. private void inspection()
  259. {
  260. this.ultraGrid6.UpdateData();
  261. this.ultraGrid7.UpdateData();
  262. UltraGridRow uRow1 = this.ultraGrid6.ActiveRow;
  263. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  264. string departMentid = UserInfo.GetDeptid();
  265. string flag = "0"; //报检
  266. if (uRow1 == null)
  267. {
  268. MessageUtil.ShowTips("请选择需要报检的炉信息!");
  269. return;
  270. }
  271. if (!(uRow1.Cells["Target"].Value.ToString().Equals("A")||(uRow1.Cells["Target"].Value.ToString().Equals("B")&& uRow1.Cells["StdName"].Text.ToUpper().Contains("JY")&& (!uRow1.Cells["PlineName"].Text.Contains("168")))))
  272. {
  273. MessageUtil.ShowTips("不是成品的不能报检!");
  274. return;
  275. }
  276. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  277. ArrayList parm = new ArrayList();
  278. foreach (UltraGridRow uRow in checkMagRows)
  279. {
  280. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  281. string matZcTity = JSONFormat.Format(matZcEntity);
  282. parm.Add(matZcTity);
  283. }
  284. CoreClientParam ccp = new CoreClientParam();
  285. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  286. ccp.MethodName = "inspection";
  287. ccp.ServerParams = new object[] { parm, "D", flag , this.UserInfo.GetUserName()};
  288. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  289. if (ccp.ReturnCode != -1)
  290. {
  291. if (ccp.ReturnInfo.Equals("报检成功!"))
  292. {
  293. QueryMat();
  294. MatZcMEntity2bindingSource.Clear();
  295. MessageUtil.ShowTips(ccp.ReturnInfo);
  296. }
  297. else
  298. {
  299. MessageUtil.ShowTips(ccp.ReturnInfo);
  300. }
  301. }
  302. }
  303. /// <summary>
  304. /// 报检2(必检)
  305. /// </summary>
  306. private void inspection2()
  307. {
  308. this.ultraGrid6.UpdateData();
  309. this.ultraGrid7.UpdateData();
  310. UltraGridRow uRow1 = this.ultraGrid6.ActiveRow;
  311. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  312. string departMentid = UserInfo.GetDeptid();
  313. string flag = "1"; //必检
  314. if (uRow1 == null)
  315. {
  316. MessageUtil.ShowTips("请选择需要报检的炉信息!");
  317. return;
  318. }
  319. if (!uRow1.Cells["Target"].Value.ToString().Equals("A"))
  320. {
  321. MessageUtil.ShowTips("不是成品的不能报检!");
  322. return;
  323. }
  324. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  325. ArrayList parm = new ArrayList();
  326. foreach (UltraGridRow uRow in checkMagRows)
  327. {
  328. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  329. string matZcTity = JSONFormat.Format(matZcEntity);
  330. parm.Add(matZcTity);
  331. }
  332. CoreClientParam ccp = new CoreClientParam();
  333. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  334. ccp.MethodName = "inspection";
  335. ccp.ServerParams = new object[] { parm, "D", flag, this.UserInfo.GetUserName() };
  336. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  337. if (ccp.ReturnCode != -1)
  338. {
  339. if (ccp.ReturnInfo.Equals("报检成功!"))
  340. {
  341. QueryMat();
  342. MatZcMEntity2bindingSource.Clear();
  343. MessageUtil.ShowTips(ccp.ReturnInfo);
  344. }
  345. else
  346. {
  347. MessageUtil.ShowTips(ccp.ReturnInfo);
  348. }
  349. }
  350. }
  351. /// <summary>
  352. /// 报检3(免检)
  353. /// </summary>
  354. public void inspection3()
  355. {
  356. this.ultraGrid6.UpdateData();
  357. this.ultraGrid6.UpdateData();
  358. UltraGridRow uRow1 = this.ultraGrid6.ActiveRow;
  359. string departMentid = UserInfo.GetDeptid();
  360. string flag = "3"; //免检
  361. if (uRow1 == null)
  362. {
  363. MessageUtil.ShowTips("请选择需要报检的炉信息!");
  364. return;
  365. }
  366. if (!uRow1.Cells["Target"].Value.ToString().Equals("A"))
  367. {
  368. MessageUtil.ShowTips("不是成品的不能报检!");
  369. return;
  370. }
  371. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  372. ArrayList parm = new ArrayList();
  373. foreach (UltraGridRow uRow in checkMagRows)
  374. {
  375. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  376. string matZcTity = JSONFormat.Format(matZcEntity);
  377. parm.Add(matZcTity);
  378. }
  379. CoreClientParam ccp = new CoreClientParam();
  380. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  381. ccp.MethodName = "inspection";
  382. ccp.ServerParams = new object[] { parm, "D", flag, this.UserInfo.GetUserName() };
  383. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  384. if (ccp.ReturnCode != -1)
  385. {
  386. if (ccp.ReturnInfo.Equals("报检成功!"))
  387. {
  388. QueryMat();
  389. MatZcMEntity2bindingSource.Clear();
  390. MessageUtil.ShowTips(ccp.ReturnInfo);
  391. }
  392. else
  393. {
  394. MessageUtil.ShowTips(ccp.ReturnInfo);
  395. }
  396. }
  397. }
  398. /// <summary>
  399. /// 修改产品标识
  400. /// </summary>
  401. private void updateTarget()
  402. {
  403. this.ultraGrid6.UpdateData();
  404. UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  405. if (uRow == null)
  406. {
  407. return;
  408. }
  409. ArrayList parm = new ArrayList();
  410. MatZcMEntity matZctity = (MatZcMEntity)uRow.ListObject;
  411. string matZcTity = JSONFormat.Format(matZctity);
  412. parm.Add(matZcTity);
  413. if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No) return;
  414. CoreClientParam ccp = new CoreClientParam();
  415. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  416. ccp.MethodName = "updateTarget";
  417. ccp.ServerParams = new object[] { parm };
  418. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  419. if (ccp.ReturnCode != -1)
  420. {
  421. if (ccp.ReturnInfo.Equals("修改成功!"))
  422. {
  423. QueryMat();
  424. MessageUtil.ShowTips(ccp.ReturnInfo);
  425. }
  426. else
  427. {
  428. MessageUtil.ShowTips(ccp.ReturnInfo);
  429. }
  430. }
  431. }
  432. /// <summary>
  433. /// 获取探伤实绩
  434. /// </summary>
  435. private void insertTestingResult()
  436. {
  437. string testingType = "";
  438. string testingGrade = "";
  439. UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  440. if (uRow == null)
  441. {
  442. MessageUtil.ShowTips("请选择炉信息!");
  443. return;
  444. }
  445. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  446. string departMentid = UserInfo.GetDeptid();
  447. NativeMethodNew na = new NativeMethodNew(this.ob);
  448. string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  449. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryTestingResult", new object[] { uRow.Cells["JudgeStoveNo"].Text + "-01",plinCode }, ob);
  450. if(ds.Rows.Count>0)
  451. {
  452. if (plinCode.Equals("C008") || plinCode.Equals("C009") || plinCode.Equals("C017"))
  453. {
  454. if (ds.Rows[0]["LO_SURFACE"].ToString() == "")
  455. {
  456. MessageUtil.ShowTips("探伤实绩的参数信息为录入,不允许进行申请判定!");
  457. return;
  458. }
  459. else
  460. {
  461. testingGrade = ds.Rows[0]["LO_SURFACE"].ToString();
  462. if (testingGrade.Equals("/"))
  463. {
  464. testingType = "";
  465. }
  466. else
  467. {
  468. testingType = "EMI";
  469. }
  470. }
  471. }
  472. else if (plinCode.Equals("C010"))
  473. {
  474. if (ds.Rows[0]["ACCEPTANCE_GRADE"].ToString() == "")
  475. {
  476. MessageUtil.ShowTips("探伤实绩的参数信息未录入,不允许进行申请判定!");
  477. return;
  478. }
  479. else
  480. {
  481. testingGrade = ds.Rows[0]["ACCEPTANCE_GRADE"].ToString();
  482. if (testingGrade.Equals("/"))
  483. {
  484. testingType = "";
  485. }
  486. else
  487. {
  488. testingType = "ET";
  489. }
  490. }
  491. }
  492. }else
  493. {
  494. MessageUtil.ShowTips("探伤工序点未录入实绩,不允许进行申请判定!");
  495. return;
  496. }
  497. CoreClientParam ccp = new CoreClientParam();
  498. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  499. ccp.MethodName = "updateTestingResult";
  500. ccp.ServerParams = new object[] { uRow.Cells["JudgeStoveNo"].Text, testingGrade, testingType };
  501. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  502. if (ccp.ReturnCode != -1)
  503. {
  504. if (ccp.ReturnInfo.Equals("获取成功!"))
  505. {
  506. QueryMat();
  507. MessageUtil.ShowTips(ccp.ReturnInfo);
  508. }
  509. else
  510. {
  511. MessageUtil.ShowTips(ccp.ReturnInfo);
  512. }
  513. }
  514. }
  515. /// <summary>
  516. /// 判定单打印
  517. /// </summary>
  518. private void printPipe3()
  519. {
  520. this.ultraGrid7.UpdateData();
  521. this.ultraGrid1.UpdateData();
  522. string jugeNo = "";
  523. string applyNo = "";
  524. UltraGrid ultraGrid = null;
  525. if (ultraTabControl1.SelectedTab.Index == 0)
  526. {
  527. ultraGrid = ultraGrid7;
  528. foreach (UltraGridRow ugr in ultraGrid.Rows)
  529. {
  530. string applyNo1 = ugr.Cells["JugdeApplyCode"].Text.Trim();
  531. if (applyNo == "")
  532. {
  533. applyNo = applyNo1;
  534. }
  535. else
  536. {
  537. if (!applyNo.Contains(applyNo1))
  538. { applyNo = applyNo + "','" + applyNo1; }
  539. }
  540. }
  541. }
  542. else if (ultraTabControl1.SelectedTab.Index == 1)
  543. {
  544. ultraGrid = ultraGrid1;
  545. applyNo = ultraGrid.ActiveRow.Cells["JugdeApplyCode"].Text.Trim();
  546. }
  547. UltraGridRow uRow = ultraGrid.ActiveRow;
  548. if (uRow == null)
  549. {
  550. MessageUtil.ShowTips("请选择需要打印的判定信息!");
  551. return;
  552. }
  553. string userGroup = this.UserInfo.GetUserGroup();
  554. string userOrder = this.UserInfo.GetUserOrder();
  555. string userName = this.UserInfo.GetUserName();
  556. //string applyNo = uRow.Cells["JugdeApplyCode"].Text.Trim();
  557. if (applyNo == "")
  558. {
  559. MessageUtil.ShowTips("未申请判定,不允许判定单的打印!");
  560. }
  561. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilApplyCard.cpt&format=pdf&APPLY_CODE=" + applyNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder + "&USER_ID="+ userName;
  562. FrmExcel fre = new FrmExcel(this.ob, strurl);
  563. fre.AutoSize = true;
  564. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  565. fre.WindowState = FormWindowState.Maximized;
  566. fre.Show();
  567. }
  568. /// <summary>
  569. /// 整炉打印
  570. /// </summary>
  571. private void printPipe2()
  572. {
  573. this.ultraGrid6.UpdateData();
  574. this.ultraGrid1.UpdateData();
  575. string jugeNo = "";
  576. string plineCode = "";
  577. UltraGrid ultraGrid = null;
  578. if (ultraTabControl1.SelectedTab.Index == 0)
  579. {
  580. ultraGrid = ultraGrid6;
  581. }
  582. else if (ultraTabControl1.SelectedTab.Index == 1)
  583. {
  584. ultraGrid = ultraGrid1;
  585. }
  586. UltraGridRow uRow = ultraGrid.ActiveRow;
  587. if (uRow == null)
  588. {
  589. MessageUtil.ShowTips("请选择需要打印的炉信息!");
  590. return;
  591. }
  592. jugeNo = uRow.Cells["JudgeStoveNo"].Value.ToString();
  593. plineCode = uRow.Cells["PlineCode"].Value.ToString();
  594. string userGroup = this.UserInfo.GetUserGroup();
  595. string userOrder = this.UserInfo.GetUserOrder();
  596. string strurl = "";
  597. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  598. string departMentid = UserInfo.GetDeptid();
  599. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryApplyCodeNull", new object[] { BaseMethod.getJudgeStoveNo(jugeNo), departMentid, plineCode }, this.ob);
  600. //if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  601. //{
  602. // MessageUtil.ShowTips("有未申请判定的数据,不允许进行缴库单打印!");
  603. // return;
  604. //}
  605. if (plineCode.Equals("C072"))
  606. {
  607. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryTH.cpt&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder;
  608. }
  609. else
  610. {
  611. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYMTest1.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder;
  612. }
  613. FrmExcel fre = new FrmExcel(this.ob, strurl);
  614. fre.AutoSize = true;
  615. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  616. fre.WindowState = FormWindowState.Maximized;
  617. fre.Show();
  618. }
  619. /// <summary>
  620. /// 打印缴库单
  621. /// </summary>
  622. private void printPipe()
  623. {
  624. this.ultraGrid7.UpdateData();
  625. this.ultraGrid1.UpdateData();
  626. string jugeNo = "";
  627. string jugeNo2 = "";
  628. string plineCode = "";
  629. UltraGrid ultraGrid = null;
  630. if (ultraTabControl1.SelectedTab.Index == 0)
  631. {
  632. ultraGrid = ultraGrid7;
  633. }
  634. else if (ultraTabControl1.SelectedTab.Index == 1)
  635. {
  636. ultraGrid = ultraGrid1;
  637. }
  638. UltraGridRow uRow = ultraGrid.ActiveRow;
  639. if (uRow == null)
  640. {
  641. MessageUtil.ShowTips("请选择需要打印的炉信息!");
  642. return;
  643. }
  644. jugeNo = uRow.Cells["JudgeStoveNo"].Value.ToString()+"-01";
  645. jugeNo2 = uRow.Cells["JudgeStoveNo"].Value.ToString();
  646. plineCode = uRow.Cells["PlineCode"].Value.ToString();
  647. string strurl = "";
  648. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  649. string departMentid = UserInfo.GetDeptid();
  650. string userGroup = this.UserInfo.GetUserGroup();
  651. string userOrder = this.UserInfo.GetUserOrder();
  652. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryApplyCodeNull", new object[] { jugeNo.Substring(0,6), departMentid, plineCode }, this.ob);
  653. //if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  654. //{
  655. // MessageUtil.ShowTips("有未申请判定的数据,不允许进行缴库单打印!");
  656. // return;
  657. //}
  658. //string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYM.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo;
  659. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYMTest.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder;
  660. FrmExcel fre = new FrmExcel(this.ob, strurl);
  661. fre.AutoSize = true;
  662. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  663. fre.WindowState = FormWindowState.Maximized;
  664. fre.Show();
  665. }
  666. /// <summary>
  667. /// 打印缴库单
  668. /// </summary>
  669. private void printPipe1()
  670. {
  671. this.ultraGrid7.UpdateData();
  672. string jugeNo = "";
  673. string plineCode = "";
  674. UltraGrid ultraGrid = null;
  675. if (ultraTabControl1.SelectedTab.Index == 0)
  676. {
  677. ultraGrid = ultraGrid7;
  678. }
  679. else if (ultraTabControl1.SelectedTab.Index == 1)
  680. {
  681. ultraGrid = ultraGrid1;
  682. }
  683. UltraGridRow uRow = ultraGrid.ActiveRow;
  684. if (uRow == null)
  685. {
  686. MessageUtil.ShowTips("请选择需要打印的炉信息!");
  687. return;
  688. }
  689. jugeNo = uRow.Cells["JudgeStoveNo"].Value.ToString();
  690. plineCode = uRow.Cells["PlineCode"].Value.ToString();
  691. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  692. string departMentid = UserInfo.GetDeptid();
  693. string userGroup = this.UserInfo.GetUserGroup();
  694. string userOrder = this.UserInfo.GetUserOrder();
  695. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryApplyCodeNull", new object[] { jugeNo, departMentid, plineCode }, this.ob);
  696. //if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  697. //{
  698. // MessageUtil.ShowTips("有未申请判定的数据,不允许进行缴库单打印!");
  699. // return;
  700. //}
  701. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYMTestAgain.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder;
  702. FrmExcel fre = new FrmExcel(this.ob, strurl);
  703. fre.AutoSize = true;
  704. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  705. fre.WindowState = FormWindowState.Maximized;
  706. fre.Show();
  707. }
  708. /// <summary>
  709. /// 回填过磅重量
  710. /// </summary>
  711. private void insertProssWt()
  712. {
  713. this.ultraGrid6.UpdateData();
  714. UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  715. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  716. string departMentid = UserInfo.GetDeptid();
  717. if (uRow == null)
  718. {
  719. MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
  720. return;
  721. }
  722. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlanPrt", new object[] { uRow.Cells["JudgeStoveNo"].Text + "-01" }, ob);
  723. if(!uRow.Cells["PlineCode"].Text.ToString().Equals("C072"))
  724. {
  725. if (ds.Rows[0][0].ToString() == "0" || ds.Rows[0][0].ToString() == "")
  726. {
  727. MessageUtil.ShowTips("此炉不允许回报过磅重量!");
  728. return;
  729. }
  730. }
  731. if (Double.Parse(uRow.Cells["PonderGrossWt"].Value.ToString3()) <= 0)
  732. {
  733. MessageUtil.ShowTips("请输入正确的过磅重量!");
  734. return;
  735. }
  736. ArrayList list = new ArrayList();
  737. list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
  738. list.Add(uRow.Cells["PonderGrossWt"].Value.ToString3());
  739. list.Add(uRow.Cells["LotNo"].Value.ToString());
  740. list.Add(uRow.Cells["BelongCode"].Value.ToString());
  741. list.Add(this.UserInfo.GetUserName());
  742. CoreClientParam ccp = new CoreClientParam();
  743. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  744. ccp.MethodName = "insertProssWt";
  745. ccp.ServerParams = new object[] { list, departMentid };
  746. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  747. if (ccp.ReturnCode != -1)
  748. {
  749. if (ccp.ReturnInfo.Equals("回报成功!"))
  750. {
  751. QueryMat();
  752. MatZcMEntity2bindingSource.Clear();
  753. MessageUtil.ShowTips(ccp.ReturnInfo);
  754. }
  755. else
  756. {
  757. MessageUtil.ShowTips(ccp.ReturnInfo);
  758. }
  759. }
  760. }
  761. /// <summary>
  762. /// 撤销申请判定
  763. /// </summary>
  764. private void cancelDoDecision()
  765. {
  766. this.ultraGrid7.UpdateData();
  767. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  768. if (checkMagRows.Count() == 0)
  769. {
  770. MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!");
  771. return;
  772. }
  773. ArrayList parm = new ArrayList();
  774. foreach (UltraGridRow uRow in checkMagRows)
  775. {
  776. MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject;
  777. string matTity = JSONFormat.Format(matZcTity);
  778. parm.Add(matTity);
  779. }
  780. if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
  781. CoreClientParam ccp = new CoreClientParam();
  782. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  783. ccp.MethodName = "cancelDoDecision";
  784. ccp.ServerParams = new object[] { parm,this.UserInfo.GetUserName() };
  785. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  786. if (ccp.ReturnCode != -1)
  787. {
  788. if (ccp.ReturnInfo.Equals("撤销成功!"))
  789. {
  790. QueryMat();
  791. MessageUtil.ShowTips(ccp.ReturnInfo);
  792. }
  793. else
  794. {
  795. MessageUtil.ShowTips(ccp.ReturnInfo);
  796. }
  797. }
  798. }
  799. /// <summary>
  800. /// 申请判定
  801. /// </summary>
  802. private void DoDecision()
  803. {
  804. this.ultraGrid7.UpdateData();
  805. int m = 0;
  806. int n = 0;
  807. int z = 0;
  808. string target = "";//去向
  809. //string departMentid = UserInfo.GetDeptid();
  810. //NativeMethodNew na = new NativeMethodNew(this.ob);
  811. //string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  812. UltraGridRow row = this.ultraGrid6.ActiveRow;
  813. int JugdeApplyNum1 = int.Parse(row.Cells["ActCount"].Value.ToString());
  814. int JugdeApplyNum2 = 0;
  815. double ActWeightTep = 0.0;
  816. double ActWeightTep1 = 0.0;
  817. double ActWeightTep2 = 0.0;
  818. double ActWeightTep3 = 0.0;
  819. double ActLenTep = 0.0;
  820. double ActLenTep1 = 0.0;
  821. double ActLenTep2 = 0.0;
  822. double ActLenTep3 = 0.0;
  823. if (row == null) return;
  824. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  825. if (checkMagRows.Count() == 0)
  826. {
  827. MessageUtil.ShowTips("请选择需要申请判定的主信息!");
  828. return;
  829. }
  830. if (this.CustomInfo.Equals("ZG"))
  831. {
  832. //成品没检验合格的不能送判
  833. if (row.Cells["Target"].Text == "A" && row.Cells["PlineCode"].Text != "C072")
  834. {
  835. //DataTable bj = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBjCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), row.Cells["PlineCode"].Text }, ob);
  836. //if (bj.Rows.Count > 0)
  837. //{
  838. // if (int.Parse(bj.Rows[0][0].ToString3()) < int.Parse(row.Cells["ActCount"].Text.ToString3()))
  839. // {
  840. // MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!");
  841. // return;
  842. // }
  843. //}
  844. if (row.Cells["IsOk"].Text.ToString().Equals("不可送判"))
  845. {
  846. MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!");
  847. return;
  848. }
  849. }
  850. if (row.Cells["Target"].Text == "B" && row.Cells["PlineCode"].Text != "C072")
  851. {
  852. //DataTable bj = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBjCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), row.Cells["PlineCode"].Text }, ob);
  853. //if (bj.Rows.Count > 0)
  854. //{
  855. // if (int.Parse(bj.Rows[0][0].ToString3()) < int.Parse(row.Cells["ActCount"].Text.ToString3()))
  856. // {
  857. // MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!");
  858. // return;
  859. // }
  860. //}
  861. if (row.Cells["IsOk"].Text.ToString().Equals("不可送判"))
  862. {
  863. MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!");
  864. return;
  865. }
  866. }
  867. if (row.Cells["Target"].Text == "C" && row.Cells["PlineCode"].Text != "C072")
  868. {
  869. //DataTable dc = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOfflineCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob);
  870. //if (dc.Rows.Count > 0)
  871. //{
  872. // MessageUtil.ShowTips("该炉有存在待处理品,不允许申请判定!");
  873. // return;
  874. //}
  875. DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgContratNo", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob);
  876. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgJugdeCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), dd.Rows[0][0].ToString() }, ob);
  877. if (ds.Rows.Count > 0)
  878. {
  879. if (!ds.Rows[0][0].Equals("0") )
  880. {
  881. MessageUtil.ShowTips("炉为C字头,该合同已申请判定过,不允许申请判定!");
  882. // return;
  883. }
  884. }
  885. MilPlan milPlan3 = new MilPlan();
  886. milPlan3.JudgeStoveNo = row.Cells["JudgeStoveNo"].Text.Trim();
  887. milPlan3.LotNo = row.Cells["LotNo"].Text.Trim();
  888. milPlan3.PlineCode = row.Cells["PlineCode"].Text.Trim();
  889. milPlan3.ProPlanId = row.Cells["ProOrderId"].Text.Trim();
  890. milPlan3.GxPlanNo = row.Cells["GxPlanNo"].Text.Trim();
  891. int num = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.updateProcess", new object[] { milPlan3 }, this.ob);
  892. DataTable dtc = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilProcess", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), row.Cells["ProOrderId"].Text.Trim(), row.Cells["GxPlanNo"].Text.Trim() }, ob);
  893. if (dtc.Rows.Count > 0)
  894. {
  895. if (!dtc.Rows[0][0].Equals("0"))
  896. {
  897. MessageUtil.ShowTips("炉为C字头,有待处理的数据,不允许申请判定!");
  898. // return;
  899. }
  900. }
  901. }
  902. DataTable ddPrtFlag = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgPrtFlag", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob);
  903. DataTable ddPonderGrossWT = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgPonderGrossWT", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob);
  904. if (ddPrtFlag.Rows.Count > 0)
  905. {
  906. if (ddPrtFlag.Rows[0][0].Equals("1") && ddPonderGrossWT.Rows[0][0].Equals("0"))
  907. {
  908. MessageUtil.ShowTips("该炉需要过磅,没过磅不允许申请判定!");
  909. return;
  910. }
  911. }
  912. }
  913. ArrayList parm = new ArrayList();
  914. switch (this.CustomInfo)
  915. {
  916. case "ZG":
  917. if (!doQueryNode(this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString()))
  918. {
  919. MessageUtil.ShowTips("该炉在交库点未结炉,不允许申请判定!");
  920. return;
  921. }
  922. //DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Text + "-01", "", "" }, ob);
  923. //target = dd.Rows[0]["TARGET"].ToString();
  924. foreach (UltraGridRow uRow in checkMagRows)
  925. {
  926. if (uRow.Cells["QcmStaus"].Text.Trim() == "判废" || uRow.Cells["QcmStaus"].Text.Trim() == "待处理")
  927. {
  928. m = m + 1;
  929. }
  930. if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "")
  931. {
  932. n = n + 1;
  933. }
  934. //DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryResult", new object[] { uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["BatchNo"].Text, uRow.Cells["BatchGroudNo"].Text, target }, ob);
  935. //if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  936. //{
  937. // z = z + 1;
  938. //}
  939. if (int.Parse(uRow.Cells["PonderGrossCount"].Text.ToString3())>0)
  940. {
  941. if (uRow.Cells["ActCount"].Text.Trim() != uRow.Cells["PonderGrossCount"].Text.Trim())
  942. {
  943. MessageUtil.ShowTips("还有未过磅的管子,不允许申请判定!");
  944. return;
  945. }
  946. }
  947. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  948. matZcEntity.Target = this.ultraGrid6.ActiveRow.Cells["Target"].Value.ToString();
  949. if (row.Cells["MchDimensionsResult"].Text.Trim() == "")
  950. {
  951. matZcEntity.MchDimensionsResult = "合格";
  952. }
  953. else {
  954. matZcEntity.MchDimensionsResult = row.Cells["MchDimensionsResult"].Text.Trim();
  955. }
  956. if (row.Cells["MchVisualResult"].Text.Trim() == "")
  957. {
  958. matZcEntity.MchVisualResult = "合格";
  959. }
  960. else
  961. {
  962. matZcEntity.MchVisualResult = row.Cells["MchVisualResult"].Text.Trim();
  963. }
  964. string matZcTity = JSONFormat.Format(matZcEntity);
  965. parm.Add(matZcTity);
  966. JugdeApplyNum2 += int.Parse(uRow.Cells["ActCount"].Value.ToString());
  967. string LengthType = uRow.Cells["LengthType"].Value.ToString();//长度类型(0-正尺,1-长尺,2-短尺)
  968. string InMold = uRow.Cells["InMold"].Value.ToString();//入库区分(801701-非计划入,801703-按计划入)
  969. double ActLen1 = double.Parse(uRow.Cells["ActLen1"].Value.ToString3());//累计送判米
  970. double ActWeight1 = double.Parse(uRow.Cells["ActWeight1"].Value.ToString3());//累计送判吨
  971. double ActWeightL = double.Parse(uRow.Cells["ActWeightL"].Value.ToString3());//累计送判吨(长尺)
  972. double ActWeightS = double.Parse(uRow.Cells["ActWeightS"].Value.ToString3());//累计送判吨(短尺)
  973. double ActLen2 = double.Parse(uRow.Cells["ActLen2"].Value.ToString3());//累计送判米(按计划入)
  974. double ActWeight2 = double.Parse(uRow.Cells["ActWeight2"].Value.ToString3());//累计送判吨(按计划入)
  975. double PaydownWtMax = double.Parse(uRow.Cells["PaydownWtMax"].Value.ToString3());//缴库量上限
  976. double Orderweight = double.Parse(uRow.Cells["Orderweight"].Value.ToString3());//估算量
  977. double OrderWtMaxShort = double.Parse(uRow.Cells["OrderWtMaxShort"].Value.ToString3());//短尺缴库量上限
  978. double OrderWtMaxLong = double.Parse(uRow.Cells["OrderWtMaxLong"].Value.ToString3());//长尺缴库量上限
  979. double Kspz = double.Parse(uRow.Cells["Kspz"].Value.ToString3());//预计可送判支
  980. double Cfz = double.Parse(row.Cells["Cfz"].Value.ToString3());//拆分支
  981. if (row.Cells["Target"].Text == "A" && row.Cells["PlineCode"].Text != "C072")
  982. {
  983. //正尺
  984. if (LengthType.Equals("正尺") && InMold.Equals("801703"))
  985. {
  986. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  987. {
  988. ActWeightTep += double.Parse(uRow.Cells["ActWeight"].Value.ToString());
  989. if (PaydownWtMax < ActWeight2 + ActWeightTep && checkMagRows.Count() > 1 )
  990. {
  991. MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
  992. return;
  993. }
  994. }
  995. else
  996. {
  997. ActLenTep += double.Parse(uRow.Cells["ActLen"].Value.ToString());
  998. if (PaydownWtMax < ActLen2 + ActLenTep && checkMagRows.Count() > 1)
  999. {
  1000. MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
  1001. return;
  1002. }
  1003. }
  1004. }
  1005. //长尺
  1006. if (LengthType.Equals("长尺") && InMold.Equals("801703"))
  1007. {
  1008. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  1009. {
  1010. ActWeightTep1 += double.Parse(uRow.Cells["ActWeight"].Value.ToString());
  1011. if (OrderWtMaxLong < ActWeightL + ActWeightTep1 && checkMagRows.Count() > 1)
  1012. {
  1013. MessageBox.Show("选中的长尺总量超出长尺缴库量上限,请分开送判");
  1014. return;
  1015. }
  1016. }
  1017. else
  1018. {
  1019. ActLenTep1 += double.Parse(uRow.Cells["ActLen"].Value.ToString());
  1020. if (OrderWtMaxLong < ActWeightL + ActLenTep1 && checkMagRows.Count() > 1)
  1021. {
  1022. MessageBox.Show("选中的长尺总量超出长尺缴库量上限,请分开送判");
  1023. return;
  1024. }
  1025. }
  1026. }
  1027. //短尺
  1028. if (LengthType.Equals("短尺") && InMold.Equals("801703"))
  1029. {
  1030. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  1031. {
  1032. ActWeightTep2 += double.Parse(uRow.Cells["ActWeight"].Value.ToString());
  1033. if (OrderWtMaxShort < ActWeightS + ActWeightTep2 && checkMagRows.Count() > 1)
  1034. {
  1035. MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判");
  1036. return;
  1037. }
  1038. }
  1039. else
  1040. {
  1041. ActLenTep2 += double.Parse(uRow.Cells["ActLen"].Value.ToString());
  1042. if (OrderWtMaxShort < ActWeightS + ActLenTep2 && checkMagRows.Count() > 1)
  1043. {
  1044. MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判");
  1045. return;
  1046. }
  1047. }
  1048. }
  1049. //按计划入
  1050. if (InMold.Equals("801703"))
  1051. {
  1052. if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
  1053. {
  1054. ActWeightTep3 += double.Parse(uRow.Cells["ActWeight"].Value.ToString());
  1055. if (PaydownWtMax < ActWeight2 + ActWeightTep3 && checkMagRows.Count() > 1)
  1056. {
  1057. MessageBox.Show("选中的总量超出缴库量上限,请分开送判");
  1058. return;
  1059. }
  1060. }
  1061. else
  1062. {
  1063. ActLenTep3 += double.Parse(uRow.Cells["ActLen"].Value.ToString());
  1064. if (PaydownWtMax < ActWeight2 + ActLenTep3 && checkMagRows.Count() > 1)
  1065. {
  1066. MessageBox.Show("选中的总量超出缴库量上限,请分开送判");
  1067. return;
  1068. }
  1069. }
  1070. }
  1071. //非计划入
  1072. if (InMold.Equals("801701"))
  1073. {
  1074. if (Cfz > int.Parse(row.Cells["ActCount"].Value.ToString()))
  1075. {
  1076. MessageBox.Show("输入的拆分支数不能大于实际送判支数");
  1077. return;
  1078. }
  1079. }
  1080. }
  1081. }
  1082. if (z > 0)
  1083. {
  1084. //if (MessageUtil.ShowYesNoAndQuestion("炉批组下探伤种类没有的信息,是否继续进行申请判定?") == DialogResult.No) return;
  1085. MessageUtil.ShowTips("炉批组下探伤种类没有的信息,不能进行申请判定!");
  1086. return;
  1087. }
  1088. if (m > 0)
  1089. {
  1090. MessageUtil.ShowTips("废品/待处理的炉批组信息,不允许申请判定!");
  1091. return;
  1092. }
  1093. break;
  1094. case "WG":
  1095. foreach (UltraGridRow uRow in checkMagRows)
  1096. {
  1097. if (uRow.Cells["Target"].Text.Trim().Equals("A"))
  1098. {
  1099. if (uRow.Cells["ActCount"].Text.Trim() != uRow.Cells["PonderGrossCount"].Text.Trim())
  1100. {
  1101. MessageUtil.ShowTips("还有未过磅的管子,不允许申请判定!");
  1102. return;
  1103. }
  1104. }
  1105. if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "")
  1106. {
  1107. n = n + 1;
  1108. }
  1109. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  1110. string matZcTity = JSONFormat.Format(matZcEntity);
  1111. parm.Add(matZcTity);
  1112. JugdeApplyNum2 += int.Parse(uRow.Cells["ActCount"].Value.ToString());
  1113. }
  1114. break;
  1115. }
  1116. if (n > 0)
  1117. {
  1118. MessageUtil.ShowTips("正在进行判定的炉批组信息,不允许重复申请判定!");
  1119. return;
  1120. }
  1121. if (JugdeApplyNum1 < JugdeApplyNum2)
  1122. {
  1123. MessageUtil.ShowTips("上下两部分的送判支数不一致,请把查询范围放大!");
  1124. return;
  1125. }
  1126. CoreClientParam ccp = new CoreClientParam();
  1127. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1128. ccp.MethodName = "doDecision";
  1129. ccp.ServerParams = new object[] { parm, this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["ProductFlag"].Value.ToString(), UserInfo.GetUserName(), this.txtMemo.Text.Trim(), this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString(), this.CustomInfo };
  1130. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1131. if (ccp.ReturnCode != -1)
  1132. {
  1133. if (ccp.ReturnInfo.Equals("申请判定成功!"))
  1134. {
  1135. string zpMLh = "";
  1136. string zpColl = "";
  1137. string jugdeApplyCode = "";
  1138. DataTable dtZp = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZpJudgeStoveNo", new object[] { this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(),this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString() }, ob);
  1139. if (dtZp.Rows.Count > 0)
  1140. {
  1141. if (!dtZp.Rows[0][0].Equals("0") )
  1142. {
  1143. DataTable dtZp2 = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZpMLh", new object[] { this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString() }, ob);
  1144. if (dtZp2.Rows.Count > 0)
  1145. {
  1146. zpMLh = dtZp2.Rows[0]["ZP_M_LH"].ToString();
  1147. zpColl = dtZp2.Rows[0]["ZP_COLL"].ToString();
  1148. jugdeApplyCode = dtZp2.Rows[0]["JUGDE_APPLY_CODE"].ToString();
  1149. }
  1150. foreach (UltraGridRow Crow in checkMagRows)
  1151. {
  1152. OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
  1153. ccp.ServerName = "com.steering.pss.judge.Bll.BllCreateGroupStoveInfo";
  1154. ccp.MethodName = "Create";
  1155. ccp.ServerParams = new object[] { "D", Crow.Cells["LotNo"].Value.ToString(),Crow.Cells["JudgeStoveNo"].Value.ToString(),
  1156. Crow.Cells["BatchNo"].Value.ToString(),jugdeApplyCode };
  1157. ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1158. if (ccp.ReturnInfo != "")
  1159. {
  1160. MessageUtil.ShowWarning(ccp.ReturnInfo);
  1161. }
  1162. }
  1163. }
  1164. }
  1165. QueryMat();
  1166. this.txtMemo.Text = "";
  1167. MessageUtil.ShowTips("申请判定成功!");
  1168. }
  1169. else
  1170. {
  1171. MessageUtil.ShowTips(ccp.ReturnInfo);
  1172. }
  1173. }
  1174. }
  1175. /// <summary>
  1176. /// 查询送判数据
  1177. /// </summary>
  1178. private void QueryZgJugdeApply()
  1179. {
  1180. string plinCode = "";
  1181. string jugeNo = "";
  1182. string startTim = "";
  1183. string endTim = "";
  1184. string departMentid = UserInfo.GetDeptid();
  1185. NativeMethodNew na = new NativeMethodNew(this.ob);
  1186. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1187. if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
  1188. {
  1189. jugeNo = this.txtHeatNo2.Text.Trim();
  1190. }
  1191. if (chkTim2.Checked)
  1192. {
  1193. if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
  1194. {
  1195. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1196. return;
  1197. }
  1198. else
  1199. {
  1200. startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1201. endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1202. }
  1203. }
  1204. List<QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<QcmZgJugdeApplyEntity>(
  1205. "com.steering.mes.signature.FrmInOnlineStore.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  1206. qcmZgJugdeApplyEntityBindingSource.DataSource = listSource;
  1207. WriteTextToGrid();
  1208. }
  1209. /// <summary>
  1210. /// 查询炉信息
  1211. /// </summary>
  1212. private void QueryMat()
  1213. {
  1214. //查询前清空炉批组信息
  1215. this.MatZcMEntity2bindingSource.Clear();
  1216. string plinCode = "";
  1217. string jugeNo = "";
  1218. string startTim = "";
  1219. string endTim = "";
  1220. ArrayList list = new ArrayList();
  1221. List<MatZcMEntity> listSource = null;
  1222. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  1223. switch (this.CustomInfo)
  1224. {
  1225. case "WG":
  1226. if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
  1227. {
  1228. jugeNo = this.txtHeatNo2.Text.Trim();
  1229. }
  1230. if (chkTim2.Checked)
  1231. {
  1232. if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
  1233. {
  1234. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1235. return;
  1236. }
  1237. else
  1238. {
  1239. startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1240. endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1241. }
  1242. }
  1243. list.Add(jugeNo);
  1244. listSource = EntityHelper.GetData<MatZcMEntity>(
  1245. "com.steering.mes.signature.FrmInOnlineStore.doQueryMatWG", new object[] { list, startTim, endTim, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  1246. MatZcMEntity1bindingSource.DataSource = listSource;
  1247. break;
  1248. case "ZG":
  1249. string departMentid = UserInfo.GetDeptid();
  1250. NativeMethodNew na = new NativeMethodNew(this.ob);
  1251. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1252. if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
  1253. {
  1254. jugeNo = this.txtHeatNo2.Text.Trim();
  1255. }
  1256. if (chkTim2.Checked)
  1257. {
  1258. if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
  1259. {
  1260. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1261. return;
  1262. }
  1263. else
  1264. {
  1265. startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1266. endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1267. }
  1268. }
  1269. list.Add(jugeNo);
  1270. list.Add(plinCode);
  1271. listSource = EntityHelper.GetData<MatZcMEntity>(
  1272. "com.steering.mes.signature.FrmInOnlineStore.doQueryMat", new object[] { list, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString(), plineCodes }, this.ob);
  1273. MatZcMEntity1bindingSource.DataSource = listSource;
  1274. foreach (UltraGridRow uRow in this.ultraGrid6.Rows)//StdName
  1275. {
  1276. if (uRow.Cells["Target"].Text == "A" && uRow.Cells["PlineCode"].Text != "C072")
  1277. {
  1278. if (int.Parse(uRow.Cells["Bjz"].Text.ToString3()) > 0 && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) >= int.Parse(uRow.Cells["ActCount"].Text.ToString3()) && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) == int.Parse(uRow.Cells["Yjz"].Text.ToString3()) && int.Parse(uRow.Cells["Xcjz"].Text.ToString3()) == 0)
  1279. {
  1280. uRow.Cells["IsOk"].Value = "可送判";
  1281. }
  1282. else
  1283. {
  1284. uRow.Cells["IsOk"].Value = "不可送判";
  1285. }
  1286. //待报检支= 送判支+下线支-报检支+重检支
  1287. int dbjz = int.Parse(uRow.Cells["Spz"].Text.ToString3()) + int.Parse(uRow.Cells["ActCount"].Text.ToString3()) - int.Parse(uRow.Cells["Bjz"].Text.ToString3()) + int.Parse(uRow.Cells["Ycjz"].Text.ToString3());
  1288. if(dbjz > 0 )
  1289. {
  1290. uRow.Cells["DBJZ"].Value = dbjz;
  1291. }else{
  1292. uRow.Cells["DBJZ"].Value = 0;
  1293. }
  1294. }
  1295. if (uRow.Cells["Target"].Text == "B" && uRow.Cells["PlineCode"].Text != "C072"&& uRow.Cells["StdName"].Text.ToUpper().Contains("JY") &&(! uRow.Cells["PlineName"].Text.Contains("168")))
  1296. {
  1297. if (int.Parse(uRow.Cells["Bjz"].Text.ToString3()) > 0 && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) >= int.Parse(uRow.Cells["ActCount"].Text.ToString3()) && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) == int.Parse(uRow.Cells["Yjz"].Text.ToString3()) && int.Parse(uRow.Cells["Xcjz"].Text.ToString3()) == 0)
  1298. {
  1299. uRow.Cells["IsOk"].Value = "可送判";
  1300. }
  1301. else
  1302. {
  1303. uRow.Cells["IsOk"].Value = "不可送判";
  1304. }
  1305. //待报检支= 送判支+下线支-报检支+重检支
  1306. int dbjz = int.Parse(uRow.Cells["Spz"].Text.ToString3()) + int.Parse(uRow.Cells["ActCount"].Text.ToString3()) - int.Parse(uRow.Cells["Bjz"].Text.ToString3()) + int.Parse(uRow.Cells["Ycjz"].Text.ToString3());
  1307. if (dbjz > 0)
  1308. {
  1309. uRow.Cells["DBJZ"].Value = dbjz;
  1310. }
  1311. else
  1312. {
  1313. uRow.Cells["DBJZ"].Value = 0;
  1314. }
  1315. }
  1316. }
  1317. break;
  1318. }
  1319. WriteTextToGrid();
  1320. }
  1321. /// <summary>
  1322. /// 查询是否该炉已交库结炉
  1323. /// </summary>
  1324. /// <param name="jugeNo"></param>
  1325. /// <param name="plineCode"></param>
  1326. /// <returns></returns>
  1327. private Boolean doQueryNode(string jugeNo,string plineCode)
  1328. {
  1329. bool node = true;
  1330. string nodeStaus = "";
  1331. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryNode", new object[] { jugeNo, plineCode }, ob);
  1332. if (int.Parse(ds.Rows[0][0].ToString())>0)
  1333. {
  1334. node = false;
  1335. }
  1336. return node;
  1337. }
  1338. /// <summary>
  1339. /// 查询炉批组信息
  1340. /// </summary>
  1341. /// <param name="sender"></param>
  1342. /// <param name="e"></param>
  1343. private void chkTim2_CheckedChanged(object sender, EventArgs e)
  1344. {
  1345. this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked;
  1346. }
  1347. private void chkHeatNo2_CheckedChanged(object sender, EventArgs e)
  1348. {
  1349. this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked;
  1350. }
  1351. private void ultraGrid6_ClickCellButton(object sender, CellEventArgs e)
  1352. {
  1353. if (e.Cell.Column.Key == "ChemResultCode")
  1354. {
  1355. updateChemResult(this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString());
  1356. }
  1357. }
  1358. /// <summary>
  1359. /// 修改成分结果
  1360. /// </summary>
  1361. /// <param name="jugeNo"></param>
  1362. private void updateChemResult(string jugeNo)
  1363. {
  1364. CoreClientParam ccp = new CoreClientParam();
  1365. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1366. ccp.MethodName = "updateChemResult";
  1367. ccp.ServerParams = new object[] { jugeNo };
  1368. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1369. if (ccp.ReturnCode != -1)
  1370. {
  1371. if (ccp.ReturnInfo.Equals("修改成功!"))
  1372. {
  1373. QueryMat();
  1374. }
  1375. else
  1376. {
  1377. MessageUtil.ShowTips(ccp.ReturnInfo);
  1378. }
  1379. }
  1380. }
  1381. private void updatePhyResult(string jugeNo,string bathNo)
  1382. {
  1383. CoreClientParam ccp = new CoreClientParam();
  1384. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1385. ccp.MethodName = "updatePhyResult";
  1386. ccp.ServerParams = new object[] { jugeNo, bathNo };
  1387. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1388. if (ccp.ReturnCode != -1)
  1389. {
  1390. if (ccp.ReturnInfo.Equals("修改成功!"))
  1391. {
  1392. QueryMat();
  1393. }
  1394. else
  1395. {
  1396. MessageUtil.ShowTips(ccp.ReturnInfo);
  1397. }
  1398. }
  1399. }
  1400. private void doSaveOrdLnDlyPk()
  1401. {
  1402. IQueryable<UltraGridRow> checkMags = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  1403. if (checkMags.Count() == 0)
  1404. {
  1405. MessageUtil.ShowTips("请选择需要修改的数据!");
  1406. return;
  1407. }
  1408. ArrayList parmList = new ArrayList();
  1409. foreach (UltraGridRow row in checkMags)
  1410. {
  1411. MatZcMEntity matBcEntity1 = (MatZcMEntity)row.ListObject;
  1412. string OrdLnDlyPk = row.Cells["OrderSeqNo"].Value.ToString();
  1413. string OrderSeqNo = row.Cells["OrderSeqNo"].Text.ToString();
  1414. if (OrdLnDlyPk.Equals(OrderSeqNo))
  1415. {
  1416. return;
  1417. }
  1418. matBcEntity1.OrdLnDlyPk = OrdLnDlyPk;
  1419. matBcEntity1.OrderSeqNo = OrderSeqNo;
  1420. string matEntity = JSONFormat.Format(matBcEntity1);
  1421. parmList.Add(matEntity);
  1422. }
  1423. CoreClientParam ccp = new CoreClientParam();
  1424. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1425. ccp.MethodName = "doSaveOrdLnDlyPk";
  1426. ccp.ServerParams = new object[] { parmList };
  1427. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1428. if (ccp.ReturnCode != -1)
  1429. {
  1430. if (ccp.ReturnInfo.Equals("保存成功!"))
  1431. {
  1432. MessageUtil.ShowTips(ccp.ReturnInfo);
  1433. }
  1434. else
  1435. {
  1436. MessageUtil.ShowTips(ccp.ReturnInfo);
  1437. }
  1438. }
  1439. }
  1440. /// <summary>
  1441. /// 查询炉次计划号详细炉批组
  1442. /// </summary>
  1443. /// <param name="sender"></param>
  1444. /// <param name="e"></param>
  1445. private void ultraGrid6_AfterRowActivate(object sender, EventArgs e)
  1446. {
  1447. UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  1448. this.MatZcMEntity2bindingSource.Clear();
  1449. List<MatZcMEntity> listSource = null;
  1450. switch (this.CustomInfo)
  1451. {
  1452. case "ZG":
  1453. listSource = EntityHelper.GetData<MatZcMEntity>(
  1454. "com.steering.mes.signature.FrmInOnlineStore.doQueryMatData", new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  1455. MatZcMEntity2bindingSource.DataSource = listSource;
  1456. break;
  1457. case "WG":
  1458. listSource = EntityHelper.GetData<MatZcMEntity>(
  1459. "com.steering.mes.signature.FrmInOnlineStore.doQueryMatDataWG", new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  1460. MatZcMEntity2bindingSource.DataSource = listSource;
  1461. break;
  1462. }
  1463. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryJugeMemo", new object[] { uRow.Cells["JudgeStoveNo"].Text }, ob);
  1464. if (listSource.Count > 0)
  1465. {
  1466. this.getDeliveryNo(listSource[0].OrdLnPk.ToString());
  1467. }
  1468. this.txtMemo.Text = "";
  1469. if (ds.Rows.Count > 0)
  1470. {
  1471. this.txtMemo.Text = ds.Rows[0]["MEMO"].ToString();
  1472. }
  1473. foreach (UltraGridRow ugr in this.ultraGrid7.Rows)
  1474. {
  1475. ugr.Cells["CHK"].Value = true;
  1476. }
  1477. WriteTextToGrid2();
  1478. }
  1479. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1480. {
  1481. UltraGridRow row = ultraGrid6.ActiveRow;
  1482. if (e.Button.Key.ToLower().Equals("select"))
  1483. {
  1484. if (ultraGrid6.ActiveCell.Column.Key == "DetectResultPath")
  1485. {
  1486. //探伤报告
  1487. string filePath = row.GetValue("DetectResultPath");
  1488. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
  1489. down.DeleteButton.Visible = false;
  1490. down.ShowDialog();
  1491. }
  1492. else if (ultraGrid6.ActiveCell.Column.Key == "FaceResultPath")
  1493. {
  1494. //表检报告
  1495. string filePath = row.GetValue("FaceResultPath") ;
  1496. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
  1497. down.DeleteButton.Visible = false;
  1498. down.ShowDialog();
  1499. }
  1500. }
  1501. }
  1502. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  1503. {
  1504. if (toolMenu == null) return;
  1505. if (ultraTabControl1.SelectedTab.Index == 0)
  1506. {
  1507. chkTim2.Text = "入库日期";
  1508. }
  1509. else if (ultraTabControl1.SelectedTab.Index == 1)
  1510. {
  1511. chkTim2.Text = "送判日期";
  1512. }
  1513. }
  1514. private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
  1515. {
  1516. this.ultraGrid1.UpdateData();
  1517. if (e.Cell.Column.Key == "JugdeApplyCode")
  1518. {
  1519. string jugdeApplyCode = ultraGrid1.ActiveRow.Cells["JugdeApplyCode"].Value.ToString();
  1520. string judgeStoveNo = ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
  1521. string ordenNo = ultraGrid1.ActiveRow.Cells["ProOrderNo"].Value.ToString();
  1522. FrmQcmAddAsk orderZg = new FrmQcmAddAsk(jugdeApplyCode, judgeStoveNo, ordenNo,this.ob);
  1523. orderZg.ShowDialog();
  1524. }
  1525. }
  1526. /// <summary>
  1527. /// 获取测量点重量
  1528. /// </summary>
  1529. private void updateProssWt()
  1530. {
  1531. this.ultraGrid7.UpdateData();
  1532. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  1533. if (checkMagRows.Count() == 0)
  1534. {
  1535. MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!");
  1536. return;
  1537. }
  1538. ArrayList parm = new ArrayList();
  1539. foreach (UltraGridRow uRow in checkMagRows)
  1540. {
  1541. MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject;
  1542. string matTity = JSONFormat.Format(matZcTity);
  1543. parm.Add(matTity);
  1544. }
  1545. //if (MessageUtil.ShowYesNoAndQuestion("是否确认获取测量点重量?") == DialogResult.No) return;
  1546. CoreClientParam ccp = new CoreClientParam();
  1547. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1548. ccp.MethodName = "updateProssWt";
  1549. ccp.ServerParams = new object[] { parm, this.UserInfo.GetUserName() };
  1550. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1551. if (ccp.ReturnCode != -1)
  1552. {
  1553. if (ccp.ReturnInfo.Equals("获取测量点重量成功!"))
  1554. {
  1555. QueryMat();
  1556. MessageUtil.ShowTips(ccp.ReturnInfo);
  1557. }
  1558. else
  1559. {
  1560. MessageUtil.ShowTips(ccp.ReturnInfo);
  1561. }
  1562. }
  1563. }
  1564. }
  1565. }