FrmSurfaceInspectionResult.cs 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Control;
  10. using Core.Mes.Client.Comm.Tool;
  11. using CoreFS.CA06;
  12. using com.steering.mes.zgmil.entity;
  13. using Core.Mes.Client.Comm.Server;
  14. using Infragistics.Win.UltraWinGrid;
  15. using Infragistics.Win.UltraWinEditors;
  16. using Core.Mes.Client.Comm.Format;
  17. using System.Collections;
  18. using Core.StlMes.Client.ZGMil.Entity;
  19. using Core.StlMes.Client.ZGMil.Popup;
  20. using Core.StlMes.Client.ZGMil.Common;
  21. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  22. using CoreFS.SA06;
  23. using Core.StlMes.Client.ZGMil.NodeResultQuery;
  24. using System.Net;
  25. namespace Core.StlMes.Client.ZGMil.Result
  26. {
  27. public partial class FrmSurfaceInspectionResult : FrmBase
  28. {
  29. //TODO:...内容...
  30. private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
  31. private bool bl_Upddefect_chk = false;//是否修改之前的抽检项
  32. private bool bl_Upddefect_UpDown = false;//是否修改之前的抽检率
  33. private decimal Nud_val = 0;
  34. string _ScrapNum = "";
  35. string _OffLineNum = "";
  36. string _LotNo = "";
  37. double _MatHeight = 0;
  38. string Shift = "";
  39. string Group = "";
  40. private string Departm = "";//部门
  41. private string PlineCode = "";//产线
  42. private int Qa_Flag = 0; //抽检类型 一次抽检 二次抽检
  43. private string actJudgeStoveNo = "";
  44. private string proPlanId = null;//轧管订单编号
  45. private string gxPlanNo = null;//工序排产序号
  46. private string lotNo = null;//生产批号
  47. private string actResultNo = "";
  48. private string TestMethod = "";
  49. string PlanStatusQuery = "95";
  50. string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
  51. private string _UserName = ""; //签名 姓名
  52. private string _UserID = ""; //签名 签名ID
  53. public Infragistics.Win.UltraWinGrid.UltraGrid Grid
  54. {
  55. get { return _grid; }
  56. }
  57. protected override void OnLoad(EventArgs e)
  58. {
  59. base.OnLoad(e);
  60. //ultraGrid1.DisplayLayout.Bands[0].Columns["JUDGE_STOVE_NO"].SortIndicator = SortIndicator.Disabled;
  61. ultraGrid_Plan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  62. rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  63. rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  64. ultraGridMatSeq.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  65. //ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  66. //ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  67. ultraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  68. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);//自适应列宽
  69. //ultraGridMatSeq.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  70. //ultraGrid1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  71. //e.Layout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.Vertical;
  72. //e.Layout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.Select;
  73. Shift = UserInfo.GetUserOrder();
  74. Group = UserInfo.GetUserGroup();
  75. }
  76. /// <summary>
  77. /// 判断是否能开始当前炉次
  78. /// </summary>
  79. /// <returns></returns>
  80. private void IsStart()
  81. {
  82. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  83. {
  84. if (ugr.Cells["IS_START"].Value.ToString() == "已开始质检")
  85. {
  86. MessageBox.Show("炉号【" + ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】正在质检,不能两炉同时开始质检");
  87. return;
  88. }
  89. }
  90. }
  91. /// <summary>
  92. /// 页面开启事件
  93. /// </summary>
  94. /// <param name="e"></param>
  95. protected override void OnShown(EventArgs e)
  96. {
  97. base.OnShown(e);
  98. //string hostname = Dns.GetHostName();
  99. //IPAddress ip = Dns.GetHostByName(hostname).AddressList[0];
  100. NativeMethodNew na = new NativeMethodNew(this.ob);
  101. //TestMethod = na.GetOperateResult(ip.ToString(), "1");
  102. //if (TestMethod == "无匹配数据")
  103. //{
  104. // MessageBox.Show("提示:该电脑不是探伤操作台电脑,不允许操作改界面", "提示", MessageBoxButtons.OK);
  105. // this.Dispose();
  106. // this.Close();
  107. //}
  108. Departm = UserInfo.GetDepartment();
  109. PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
  110. SurfaceQuery();
  111. foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
  112. {
  113. ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  114. }
  115. Departm = UserInfo.GetDepartment();
  116. PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
  117. if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  118. {
  119. this.rollingCard1.ChangCard();
  120. }
  121. Sign();
  122. ShowShift();
  123. }
  124. private void ShowShift()
  125. {
  126. colShowShiftGroup1.Ob = this.ob;
  127. colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
  128. colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
  129. colShowShiftGroup1.ShowShift();
  130. colShowShiftGroup1.Timer1.Enabled = true;
  131. }
  132. /// <summary>
  133. /// 签名
  134. /// </summary>
  135. private void Sign()
  136. {
  137. ColUserName col = new ColUserName();
  138. col.StationId = "9";
  139. col.PlineCode = PlineCode;
  140. col.ColGroup = Group;
  141. col.Ob = this.ob;
  142. col.ShowDialog();
  143. _UserID = col.getUserId();
  144. _UserName = col.getUserName();
  145. }
  146. /// <summary>
  147. /// 控件加载构造函数
  148. /// </summary>
  149. public FrmSurfaceInspectionResult()
  150. {
  151. InitializeComponent();
  152. GridHelper.InitCardGrid(SurfaceDataSource, ultraGrid4);//显示人工质检主信息界面
  153. _grid = this.ultraGrid4;
  154. }
  155. /// <summary>
  156. /// checkbox点击事件
  157. /// </summary>
  158. /// <param name="sender"></param>
  159. /// <param name="e"></param>
  160. private void chk_CheckedChanged(object sender, EventArgs e)
  161. {
  162. u_TxtEditor_ProNo.Enabled = u_ChkEditor_ProNo.Checked;//生产批号查询
  163. u_TxtEditor_StrvoNo.Enabled = u_ChkEditor_StoveNo.Checked;//炉号查询
  164. }
  165. /// <summary>
  166. /// ToolBar按钮
  167. /// </summary>
  168. /// <param name="sender"></param>
  169. /// <param name="ToolbarKey"></param>
  170. public override void ToolBar_Click(object sender, string ToolbarKey)
  171. {
  172. switch (ToolbarKey)
  173. {
  174. case "Query":
  175. SurfaceQuery();
  176. break;
  177. case "Save":
  178. SurfaceSave();
  179. break;
  180. case "Node":
  181. FeedSawResultNode();
  182. break;
  183. case "DoNodeBack":
  184. NodeBack();
  185. break;
  186. case "NodeQuery":
  187. NodeQuery();
  188. break;
  189. case "geeDefect":
  190. Popup.frmDefectManage frmdm = new Core.StlMes.Client.ZGMil.Popup.frmDefectManage(this.ob);
  191. frmdm.ShowDialog();
  192. break;
  193. case "InSpectorMana":
  194. Popup.frmInspector frmdm1 = new Core.StlMes.Client.ZGMil.Popup.frmInspector(this.ob);
  195. frmdm1.ShowDialog();
  196. break;
  197. case "DoSizeCheck":
  198. DoSizeCheck();
  199. break;
  200. case "DoStart":
  201. DoStart();
  202. break;
  203. case "DoStartBack":
  204. DoStartBack();
  205. break;
  206. case "DoCheck":
  207. DoCheck();
  208. break;
  209. case "DoCheckS":
  210. //DoCheck(2);
  211. break;
  212. case "DoCheckSCancel":
  213. DoCheckSCancel();
  214. break;
  215. case "DoPrint":
  216. doPrint();
  217. break;
  218. case "DoPrint1":
  219. doPrint1();
  220. break;
  221. case "DoPrintTest":
  222. doPrintTest();
  223. break;
  224. case "UpFile":
  225. UpFile();
  226. break;
  227. case "UpFileAgain":
  228. UpFileAgain();
  229. break;
  230. case "DoChangeCancel":
  231. DoChangeCancel();
  232. break;
  233. case "sign":
  234. Sign();
  235. break;
  236. case "Close":
  237. this.Close();
  238. break;
  239. }
  240. }
  241. /// <summary>
  242. /// 查询上传的PDF文件
  243. /// </summary>
  244. private void SelectFile(string filePathNew)
  245. {
  246. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew);
  247. down.DeleteButton.Visible = false;
  248. down.ShowDialog();
  249. }
  250. /// <summary>
  251. /// 上传跟队表检报告
  252. /// </summary>
  253. private void UpFileAgain()
  254. {
  255. WebClient webClient = new WebClient();
  256. List<FileBean> listPdf = new List<FileBean>();
  257. string date = DateTime.Now.ToString("yyyyMMdd");
  258. string judge = BaseMethod.getJudgeStoveNo(this.actJudgeStoveNo);
  259. string heatno = this.actJudgeStoveNo;
  260. string Shift = UserInfo.GetUserOrder();
  261. string Group = UserInfo.GetUserGroup();
  262. string url = "";
  263. string filePathNew = ""; //探伤报告目录
  264. string reportNo = ""; //报告编号
  265. DataTable dt = new DataTable();
  266. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo2", new object[] { judge, PlineCode, Shift, Group,"1" }, this.ob);
  267. if (dt.Rows.Count > 0)
  268. {
  269. reportNo = dt.Rows[0][0].ToString();
  270. }
  271. //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
  272. switch (PlineCode)
  273. {
  274. case "C008": //250
  275. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain250.cpt&format=pdf&JUDGE_STOVE_NO=" + judge + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift+ "&USER_ID=" + _UserID;
  276. filePathNew = "SurReport/250/" + judge + "/";
  277. break;
  278. case "C009": //258
  279. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain258.cpt&format=pdf&JUDGE_STOVE_NO=" + judge + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  280. filePathNew = "SurReport/258/" + judge + "/";
  281. break;
  282. case "C010": //168
  283. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain168.cpt&format=pdf&JUDGE_STOVE_NO=" + judge + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  284. filePathNew = "SurReport/168/" + judge + "/";
  285. break;
  286. case "C012": //Arssel
  287. break;
  288. case "C017": //460
  289. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain460.cpt&format=pdf&JUDGE_STOVE_NO=" + judge + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  290. filePathNew = "SurReport/460/" + judge + "/";
  291. break;
  292. case "C072": //508
  293. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain508.cpt&format=pdf&JUDGE_STOVE_NO=" + this.actJudgeStoveNo + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  294. filePathNew = "SurReport/508/" + judge + "/";
  295. break;
  296. }
  297. byte[] pdf = webClient.DownloadData(url);
  298. FileBean fileBean = new FileBean();
  299. fileBean.setFile(pdf);
  300. fileBean.setFileName(reportNo + ".pdf");
  301. fileBean.setPathName(filePathNew);
  302. listPdf.Add(fileBean);
  303. webClient.Dispose();
  304. bool a = FileHelper.Upload(listPdf);
  305. if (a)
  306. {
  307. CoreClientParam ccp = new CoreClientParam();
  308. ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
  309. ccp.MethodName = "updateSurfaceReport";
  310. ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, "1", proPlanId, gxPlanNo };
  311. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  312. if (ccp.ReturnCode != -1)
  313. {
  314. if (ccp.ReturnInfo.Equals("上传成功!"))
  315. {
  316. MessageUtil.ShowTips(ccp.ReturnInfo);
  317. SelectFile(filePathNew + reportNo + ".pdf");
  318. }
  319. else
  320. {
  321. MessageUtil.ShowTips(ccp.ReturnInfo);
  322. }
  323. }
  324. }
  325. else
  326. {
  327. MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
  328. return;
  329. }
  330. }
  331. /// <summary>
  332. /// 上传表检报告
  333. /// </summary>
  334. private void UpFile()
  335. {
  336. WebClient webClient = new WebClient();
  337. List<FileBean> listPdf = new List<FileBean>();
  338. string date = DateTime.Now.ToString("yyyyMMdd");
  339. string judge = BaseMethod.getJudgeStoveNo(this.actJudgeStoveNo);
  340. string heatno = this.actJudgeStoveNo;
  341. string Shift = UserInfo.GetUserOrder();
  342. string Group = UserInfo.GetUserGroup();
  343. string url = "";
  344. string filePathNew = ""; //探伤报告目录
  345. string reportNo = ""; //报告编号
  346. DataTable dt = new DataTable();
  347. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo2", new object[] { judge, PlineCode, Shift, Group ,"0"}, this.ob);
  348. if (dt.Rows.Count > 0)
  349. {
  350. reportNo = dt.Rows[0][0].ToString();
  351. }
  352. //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
  353. switch (PlineCode)
  354. {
  355. case "C008": //250
  356. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation250.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  357. filePathNew = "SurReport/250/" + judge + "/";
  358. break;
  359. case "C009": //258
  360. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation258.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  361. filePathNew = "SurReport/258/" + judge + "/";
  362. break;
  363. case "C010": //168
  364. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation168.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  365. filePathNew = "SurReport/168/" + judge + "/";
  366. break;
  367. case "C012": //Arssel
  368. break;
  369. case "C017": //460
  370. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation460.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  371. filePathNew = "SurReport/460/" + judge + "/";
  372. break;
  373. case "C072": //508
  374. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation508.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift;
  375. filePathNew = "SurReport/508/" + judge + "/";
  376. break;
  377. }
  378. byte[] pdf = webClient.DownloadData(url);
  379. FileBean fileBean = new FileBean();
  380. fileBean.setFile(pdf);
  381. fileBean.setFileName(reportNo + ".pdf");
  382. fileBean.setPathName(filePathNew);
  383. listPdf.Add(fileBean);
  384. webClient.Dispose();
  385. bool a = FileHelper.Upload(listPdf);
  386. if (a)
  387. {
  388. CoreClientParam ccp = new CoreClientParam();
  389. ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
  390. ccp.MethodName = "updateSurfaceReport";
  391. ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, "0", proPlanId, gxPlanNo };
  392. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  393. if (ccp.ReturnCode != -1)
  394. {
  395. if (ccp.ReturnInfo.Equals("上传成功!"))
  396. {
  397. MessageUtil.ShowTips(ccp.ReturnInfo);
  398. SelectFile(filePathNew + reportNo + ".pdf");
  399. }
  400. else
  401. {
  402. MessageUtil.ShowTips(ccp.ReturnInfo);
  403. }
  404. }
  405. }
  406. else
  407. {
  408. MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
  409. return;
  410. }
  411. }
  412. /// <summary>
  413. /// 自动上传报告
  414. /// </summary>
  415. private void AutoUpFile()
  416. {
  417. WebClient webClient = new WebClient();
  418. List<FileBean> listPdf = new List<FileBean>();
  419. string date = DateTime.Now.ToString("yyyyMMdd");
  420. string judge = BaseMethod.getJudgeStoveNo(this.actJudgeStoveNo);
  421. string heatno = this.actJudgeStoveNo;
  422. string Shift = UserInfo.GetUserOrder();
  423. string Group = UserInfo.GetUserGroup();
  424. string url = "";
  425. string filePathNew = ""; //探伤报告目录
  426. string reportNo = ""; //报告编号
  427. int num = 0;
  428. DataTable dt = new DataTable();
  429. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo2", new object[] { judge, PlineCode, Shift, Group, "0" }, this.ob);
  430. if (dt.Rows.Count > 0)
  431. {
  432. reportNo = dt.Rows[0][0].ToString();
  433. }
  434. DataTable dt2 = new DataTable();
  435. dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getIsAgain", new object[] { judge, PlineCode }, this.ob);
  436. if (dt2.Rows.Count > 0)
  437. {
  438. num = int.Parse(dt2.Rows[0][0].ToString3());
  439. }
  440. switch (PlineCode)
  441. {
  442. case "C008": //250
  443. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation250.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  444. filePathNew = "SurReport/250/" + judge + "/";
  445. break;
  446. case "C009": //258
  447. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation258.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  448. filePathNew = "SurReport/258/" + judge + "/";
  449. break;
  450. case "C010": //168
  451. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation168.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  452. filePathNew = "SurReport/168/" + judge + "/";
  453. break;
  454. case "C012": //Arssel
  455. break;
  456. case "C017": //460
  457. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation460.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  458. filePathNew = "SurReport/460/" + judge + "/";
  459. break;
  460. case "C072": //508
  461. if (num > 1)
  462. {
  463. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain508.cpt&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  464. }
  465. else
  466. {
  467. url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation508.cp&format=pdf&JUDGE_STOVE_NO=" + heatno + "&COL_GROUP=" + Group + "&COL_SHIFT=" + Shift + "&USER_ID=" + _UserID;
  468. }
  469. filePathNew = "SurReport/508/" + judge + "/";
  470. break;
  471. }
  472. byte[] pdf = webClient.DownloadData(url);
  473. FileBean fileBean = new FileBean();
  474. fileBean.setFile(pdf);
  475. fileBean.setFileName(reportNo + ".pdf");
  476. fileBean.setPathName(filePathNew);
  477. listPdf.Add(fileBean);
  478. webClient.Dispose();
  479. bool a = FileHelper.Upload(listPdf);
  480. if (a)
  481. {
  482. CoreClientParam ccp = new CoreClientParam();
  483. ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
  484. ccp.MethodName = "updateSurfaceReport";
  485. ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, "0", proPlanId, gxPlanNo };
  486. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  487. if (ccp.ReturnCode != -1)
  488. {
  489. if (ccp.ReturnInfo.Equals("上传成功!"))
  490. {
  491. }
  492. else
  493. {
  494. MessageUtil.ShowTips(ccp.ReturnInfo);
  495. }
  496. }
  497. }
  498. else
  499. {
  500. MessageUtil.ShowError("系统生成PDF失败,请手动上传报告!");
  501. return;
  502. }
  503. }
  504. private String doQueryJugeNoStaus(string resultNo, string jugeNo, string plineCode)
  505. {
  506. string staus = "3";
  507. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryResultStaus", new object[] { resultNo, jugeNo, plineCode, "8", proPlanId, gxPlanNo }, ob);
  508. if (ds.Rows.Count > 0)
  509. {
  510. staus = ds.Rows[0]["NODE_FUR_FLAG"].ToString();
  511. }
  512. return staus;
  513. }
  514. /// <summary>
  515. /// 取消交班
  516. /// </summary>
  517. public void DoChangeCancel()
  518. {
  519. UltraGridRow ugr_plan = this.ultraGrid_Plan.ActiveRow;
  520. if (ugr_plan == null) return;
  521. string Status = ugr_plan.Cells["IS_START"].Value.ToString();
  522. string ActiveJUDGE_STOVE_NO = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
  523. string ActiveResultNo = ugr_plan.Cells["ID"].Value.ToString();
  524. if (Status == "已完成质检")
  525. {
  526. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成质检操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  527. return;
  528. }
  529. if (Status == "未开始质检")
  530. {
  531. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始质检操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  532. return;
  533. }
  534. string Shift = UserInfo.GetUserOrder();
  535. string Group = UserInfo.GetUserGroup();
  536. NativeMethodNew na = new NativeMethodNew(this.ob);
  537. na.ChangeShiftBack(ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo, PlineCode, Shift, Group, 9);
  538. SurfaceQuery();
  539. ChangeGridColor();
  540. }
  541. /// <summary>
  542. /// 打印
  543. /// </summary>
  544. private void doPrint()
  545. {
  546. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  547. string Time = SeverTime.ToLongTimeString();
  548. UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
  549. string jugeNo =uRow.Cells["JUDGE_NO"].Value.ToString()+"-01";
  550. if (uRow == null) return;
  551. string strurl = "";
  552. switch (PlineCode)
  553. {
  554. case "C008": //250
  555. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + jugeNo + "&USER_ID=" + _UserID;
  556. break;
  557. case "C009": //258
  558. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + jugeNo + "&USER_ID=" + _UserID;
  559. break;
  560. case "C010": //168
  561. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + jugeNo + "&USER_ID=" + _UserID;
  562. break;
  563. case "C012": //Arssel
  564. break;
  565. case "C017": //460
  566. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + jugeNo + "&USER_ID=" + _UserID;
  567. break;
  568. case "C072": //508
  569. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + jugeNo + "&USER_ID=" + _UserID;
  570. break;
  571. }
  572. FrmExcel fre = new FrmExcel(this.ob, strurl);
  573. fre.AutoSize = true;
  574. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  575. fre.WindowState = FormWindowState.Maximized;
  576. fre.Show();
  577. }
  578. /// <summary>
  579. /// 打印
  580. /// </summary>
  581. private void doPrint1()
  582. {
  583. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  584. string Time = SeverTime.ToLongTimeString();
  585. UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
  586. if (uRow == null) return;
  587. string strurl = "";
  588. switch (PlineCode)
  589. {
  590. case "C008": //250
  591. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + uRow.Cells["JUDGE_NO"].Value.ToString().Substring(0, 6) + "&USER_ID=" + _UserID;
  592. break;
  593. case "C009": //258
  594. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + BaseMethod.getJudgeStoveNo(uRow.Cells["JUDGE_NO"].Value.ToString()) + "&USER_ID=" + _UserID;
  595. break;
  596. case "C010": //168
  597. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + BaseMethod.getJudgeStoveNo(uRow.Cells["JUDGE_NO"].Value.ToString()) + "&USER_ID=" + _UserID;
  598. break;
  599. case "C012": //Arssel
  600. break;
  601. case "C017": //460
  602. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + BaseMethod.getJudgeStoveNo(uRow.Cells["JUDGE_NO"].Value.ToString()) + "&USER_ID=" + _UserID;
  603. break;
  604. case "C072": //508
  605. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluationAgain508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&JUDGE_STOVE_NO=" + uRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "&USER_ID=" + _UserID;
  606. break;
  607. }
  608. FrmExcel fre = new FrmExcel(this.ob, strurl);
  609. fre.AutoSize = true;
  610. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  611. fre.WindowState = FormWindowState.Maximized;
  612. fre.Show();
  613. }
  614. /// <summary>
  615. /// 检验要点
  616. /// </summary>
  617. private void doPrintTest()
  618. {
  619. UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
  620. if (uRow == null) return;
  621. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilTestKey.cpt&format=pdf&PLINE_CODE=" + PlineCode + "&LOT_NO=" + uRow.Cells["LOT_NO"].Value.ToString() + "&JUDGE_STOVE_NO=" + uRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  622. FrmExcel fre = new FrmExcel(this.ob, strurl);
  623. fre.AutoSize = true;
  624. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  625. fre.WindowState = FormWindowState.Maximized;
  626. fre.Show();
  627. }
  628. /// <summary>
  629. /// 查询按钮
  630. /// </summary>
  631. public void SurfaceQuery()
  632. {
  633. string str_Pro_NO = "";//轧制批号
  634. string str_STOVE_NO = "";//炉号
  635. milplan_ReFresh(_LotNo, actJudgeStoveNo);
  636. }
  637. /// <summary>
  638. /// 人工质检信息保存
  639. /// </summary>
  640. public void SurfaceSave()
  641. {
  642. MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();
  643. UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
  644. if (ugr_acr == null)
  645. {
  646. return;
  647. }
  648. string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
  649. string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
  650. string resultNo = ugr_acr.Cells["ID"].Value.ToString();
  651. //string IsStart = ugr_acr.Cells["IS_START"].Value.ToString();
  652. string IsStart = doQueryJugeNoStaus(resultNo, str_STOVE_NO,PlineCode);
  653. if (IsStart == "3")
  654. {
  655. MessageBox.Show("还未开始质检或者质检已完成,不能保存信息!");
  656. return;
  657. }
  658. ultraGrid4.UpdateData();
  659. En_Mil_Sur.RollLotNo = str_Pro_NO;
  660. En_Mil_Sur.HeatNo = str_STOVE_NO;
  661. En_Mil_Sur.Remark = SurfaceDataSource.Rows[0]["REMARK"].ToString();
  662. En_Mil_Sur.DirectorQuantity = SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"].ToString();
  663. En_Mil_Sur.QualifiedTons = SurfaceDataSource.Rows[0]["QUALIFIED_TONS"].ToString();
  664. En_Mil_Sur.WasteQuantity = SurfaceDataSource.Rows[0]["WASTE_QUANTITY"].ToString();
  665. En_Mil_Sur.OfflineQuantity = SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"].ToString();
  666. En_Mil_Sur.ExecutiveProducer = SurfaceDataSource.Rows[0]["EXECUTIVE_PRODUCER"].ToString();
  667. En_Mil_Sur.UnevenDegree = SurfaceDataSource.Rows[0]["UNEVEN_DEGREE"].ToString();
  668. En_Mil_Sur.NonRoundness = SurfaceDataSource.Rows[0]["NON_ROUNDNESS"].ToString();
  669. En_Mil_Sur.PipeDiamMax = SurfaceDataSource.Rows[0]["PIPE_DIAM_MAX"].ToString();
  670. En_Mil_Sur.PipeDiamMin = SurfaceDataSource.Rows[0]["PIPE_DIAM_MIN"].ToString();
  671. En_Mil_Sur.PipeThicknessMax = SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MAX"].ToString();
  672. En_Mil_Sur.PipeThicknessMin = SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MIN"].ToString();
  673. En_Mil_Sur.HeadStraight = SurfaceDataSource.Rows[0]["HEAD_STRAIGHT"].ToString();
  674. En_Mil_Sur.BodyStraight = SurfaceDataSource.Rows[0]["BODY_STRAIGHT"].ToString();
  675. En_Mil_Sur.Length = SurfaceDataSource.Rows[0]["LENGTH"].ToString();
  676. En_Mil_Sur.QualifiedBranch = SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString();
  677. En_Mil_Sur.Weight = SurfaceDataSource.Rows[0]["WEIGHT"].ToString();
  678. En_Mil_Sur.ProPlanId = proPlanId;
  679. En_Mil_Sur.GxPlanNo = gxPlanNo;
  680. int num = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.Save_SurFace", new object[] { En_Mil_Sur }, this.ob);
  681. if (num > 0)
  682. {
  683. MessageBox.Show("保存成功!");
  684. milplan_ReFresh(str_Pro_NO, str_STOVE_NO);
  685. }
  686. }
  687. /// <summary>
  688. /// 结炉操作
  689. /// </summary>
  690. public void FeedSawResultNode()
  691. {
  692. UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
  693. if (ugr_acr == null)
  694. {
  695. return;
  696. }
  697. string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
  698. string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
  699. string resultNo = ugr_acr.Cells["ID"].Value.ToString();
  700. string target = ugr_acr.Cells["TARGET"].Value.ToString();//去向
  701. string orderPk = ugr_acr.Cells["ORD_LN_DLY_PK"].Value.ToString();
  702. Core.StlMes.Client.ZGMil.Entity.NativeMethodNew NaMethod = new Core.StlMes.Client.ZGMil.Entity.NativeMethodNew(this.ob);
  703. if (!NaMethod.isBegineNode(str_STOVE_NO, 11))
  704. {
  705. MessageBox.Show("炉号【" + str_STOVE_NO + "】未开始质检,不能结炉!!!");
  706. return;
  707. }
  708. string IsStart = doQueryJugeNoStaus(resultNo, str_STOVE_NO, PlineCode);
  709. if (IsStart == "1")
  710. {
  711. MessageBox.Show("质检已完成,不能进行结炉!");
  712. return;
  713. }
  714. SurfaceSave();
  715. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getTestingResult", new object[] { str_Pro_NO, str_STOVE_NO, proPlanId, gxPlanNo }, ob);
  716. DataTable dsurface = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getSurfaceResult", new object[] { str_Pro_NO, str_STOVE_NO, proPlanId, gxPlanNo }, ob);
  717. DataTable dsMilPlan = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMilPlan", new object[] { str_STOVE_NO, this.ultraGrid_Plan.ActiveRow.Cells["ID"].Value.ToString2(), proPlanId, gxPlanNo }, ob);
  718. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
  719. {
  720. if (!dsurface.Rows[0]["SURFACENUM"].ToString().Equals(dsMilPlan.Rows[0]["BRANCH"].ToString()))
  721. {
  722. MessageUtil.ShowTips("表检实绩支数与返线计划支数不一致,不允许结炉!");
  723. return;
  724. }
  725. }
  726. else
  727. {
  728. if (ds.Rows.Count > 0)
  729. {
  730. if (ds.Rows[0]["NODE_FUR_FLAG"].ToString() == "0")
  731. {
  732. MessageUtil.ShowTips("探伤未结炉,质检不允许结炉!");
  733. return;
  734. }
  735. if (!ds.Rows[0]["QUALIFIED_NUM"].ToString().Equals(dsurface.Rows[0]["SURFACENUM"].ToString()))
  736. {
  737. MessageUtil.ShowTips("探伤合格支数与表检支数不一致,不允许结炉!");
  738. return;
  739. }
  740. }
  741. else
  742. {
  743. MessageUtil.ShowTips("无探伤实绩,不允许结炉!");
  744. return;
  745. }
  746. }
  747. //if (!isStartSurface(str_Pro_NO, str_STOVE_NO))
  748. //{
  749. // MessageBox.Show("还没开始质检,不能结炉!");
  750. // return;
  751. //}
  752. //else
  753. //{
  754. // }
  755. //查询是否完成抽检 是否完成尺寸检验
  756. //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { actJudgeStoveNo, actResultNo }, this.ob);
  757. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQuerySize", new object[] { BaseMethod.getJudgeStoveNo(actJudgeStoveNo), proPlanId, gxPlanNo }, this.ob);
  758. if (dt.Rows.Count > 0)
  759. {
  760. //string SizeCheck = dt.Rows[0]["SIZE_CHECK"].ToString();
  761. ////string DefectCheck = dt.Rows[0]["DEFECT_CHECK"].ToString();
  762. //int OfflineNum = int.Parse(dt.Rows[0]["OFFLINE_QUANTITY"].ToString());
  763. //if (SizeCheck == "0")
  764. //{
  765. // MessageBox.Show("未完成几何尺寸抽检,不能结炉。");
  766. // return;
  767. //}
  768. ////if (SizeCheck == "0")
  769. ////{
  770. //// MessageBox.Show("未完成缺陷项抽检,不能结炉。");
  771. //// return;
  772. ////}
  773. ////if (OfflineNum > 0)
  774. ////{
  775. //// if (MessageUtil.ShowYesNoAndQuestion("炉号【" + str_STOVE_NO + "】存在【" + OfflineNum + "】支下线管,是否需要生成二次委托") == DialogResult.No)
  776. //// {
  777. //// return;
  778. //// }
  779. //// //生成二次委托
  780. ////}
  781. }
  782. else
  783. {
  784. MessageUtil.ShowTips("未完成尺寸抽检,不允许结炉!");
  785. return;
  786. }
  787. if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + str_STOVE_NO + "】结炉?") == DialogResult.No)
  788. {
  789. return;
  790. }
  791. MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();//质检实体
  792. MilPlan milplanEntity = new MilPlan();
  793. En_Mil_Sur.RollLotNo = str_Pro_NO;
  794. En_Mil_Sur.HeatNo = str_STOVE_NO;
  795. En_Mil_Sur.NodeFlag = "1";
  796. En_Mil_Sur.ColUser = _UserName;
  797. En_Mil_Sur.ColGroup = UserInfo.GetUserGroup();
  798. En_Mil_Sur.ColShift = UserInfo.GetUserOrder();
  799. En_Mil_Sur.QualifiedBranch = SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString();
  800. En_Mil_Sur.ResultNo = resultNo;
  801. En_Mil_Sur.UserId = _UserID;
  802. En_Mil_Sur.ProPlanId = proPlanId;
  803. En_Mil_Sur.GxPlanNo = gxPlanNo;
  804. //En_Mil_Sur.Status = "96";//修改mil_plan的node_status
  805. milplanEntity.JudgeStoveNo = str_STOVE_NO;
  806. milplanEntity.LotNo = str_Pro_NO;
  807. milplanEntity.NodeStatus = "96";
  808. milplanEntity.ProPlanId = proPlanId;
  809. milplanEntity.GxPlanNo = gxPlanNo;
  810. milplanEntity.PlineCode = PlineCode;
  811. CoreClientParam ccp = new CoreClientParam();
  812. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  813. ccp.MethodName = "updateMilSlab";
  814. ccp.ServerParams = new object[] { str_STOVE_NO, "11", proPlanId, gxPlanNo };
  815. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  816. if (ccp.ReturnCode != -1)
  817. {
  818. if (ccp.ReturnInfo.Equals("修改成功!"))
  819. {
  820. //更新进程表,废品入库存
  821. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  822. ccp.MethodName = "updateProcessL";
  823. ccp.ServerParams = new object[] { str_STOVE_NO, "11", "11", proPlanId, gxPlanNo, lotNo, PlineCode };
  824. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  825. if (ccp.ReturnCode != -1)
  826. {
  827. if (ccp.ReturnInfo.Equals("修改成功!"))
  828. {
  829. //if(target.Equals("A"))
  830. //{
  831. // if (doQueryPk(orderPk))
  832. // {
  833. // }
  834. //}
  835. int num = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.FeedSawResultNode", new object[] { milplanEntity, En_Mil_Sur }, this.ob);//参数96为计划表状态,参数1为结炉标识
  836. if (num > 0)
  837. {
  838. MessageBox.Show("操作成功!");
  839. try
  840. {
  841. Entity.NativeMethodNew en_NativeMethodNew = new Core.StlMes.Client.ZGMil.Entity.NativeMethodNew(this.ob);
  842. en_NativeMethodNew.InsertSTAferDoubleClick(str_STOVE_NO, 9, "1", proPlanId, gxPlanNo);
  843. }
  844. catch (Exception)
  845. {
  846. }
  847. AutoUpFile();
  848. //清空实绩信息
  849. //DataTable dt = new DataTable();
  850. //utr_SURFACE_EditGrid(dt);
  851. //刷新计划表
  852. milplan_ReFresh("", "");
  853. this.dataSet3.Clear();
  854. }
  855. }
  856. else
  857. {
  858. MessageUtil.ShowTips(ccp.ReturnInfo);
  859. }
  860. }
  861. else
  862. {
  863. MessageUtil.ShowTips(ccp.ReturnInfo);
  864. }
  865. }
  866. }
  867. }
  868. /// <summary>
  869. /// 查询是否需双探
  870. /// </summary>
  871. /// <param name="orderPk"></param>
  872. private bool doQueryPk(string orderPk)
  873. {
  874. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessSeq", new object[] { orderPk }, ob);
  875. if (ds.Rows.Count > 0)
  876. {
  877. if (ds.Rows[0]["PROCESS_SEQ"].ToString().Equals("F"))
  878. {
  879. return true;
  880. }
  881. }
  882. return false;
  883. }
  884. /// <summary>
  885. /// 查询结炉实绩
  886. /// </summary>
  887. public void NodeQuery()
  888. {
  889. string Shift = UserInfo.GetUserOrder();
  890. string Group = UserInfo.GetUserGroup();
  891. string PliceCode = PlineCode;
  892. string StartTime = DateTime.Now.ToString("yyyy-MM-dd");
  893. string EndTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
  894. string Date = StartTime;
  895. StartTime = StartTime + " 00:00:00";
  896. EndTime = EndTime + " 00:00:00";
  897. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.SurfaceResult_query", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
  898. NodeResultQuery.FrmNodeResultQuery frm = new NodeResultQuery.FrmNodeResultQuery(dt, 8, Date, Shift, Group, this.ob);
  899. frm.ShowDialog();
  900. }
  901. /// <summary>
  902. /// 上料表行激活事件AfterRowActivate
  903. /// </summary>
  904. /// <param name="sender"></param>
  905. /// <param name="e"></param>
  906. private void ultraGrid_Plan_AfterRowActivate(object sender, EventArgs e)
  907. {
  908. bl_Upddefect_chk = false;
  909. bl_Upddefect_UpDown = false;
  910. UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
  911. MilPlan en_MPlan = new MilPlan();
  912. string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
  913. string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
  914. proPlanId = ugr_acr.Cells["PRO_PLAN_ID"].Value.ToString();
  915. gxPlanNo = ugr_acr.Cells["GX_PLAN_NO"].Value.ToString();
  916. lotNo = ugr_acr.Cells["LOT_NO"].Value.ToString();
  917. string ResultNo = ugr_acr.Cells["ID"].Value.ToString();
  918. actJudgeStoveNo = str_STOVE_NO;
  919. actResultNo = ResultNo;
  920. _LotNo = str_Pro_NO;
  921. en_MPlan.LotNo = str_Pro_NO;
  922. en_MPlan.JudgeStoveNo = str_STOVE_NO;
  923. en_MPlan.ProPlanId = proPlanId;
  924. en_MPlan.GxPlanNo = gxPlanNo;
  925. DataTable dt_RF = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { en_MPlan }, this.ob);
  926. if (dt_RF.Rows.Count > 0)
  927. {
  928. GridEdit(dt_RF); //轧制计划信息-1
  929. }
  930. DataTable dt_RCard = new DataTable();
  931. NativeMethodNew na = new NativeMethodNew(this.ob);
  932. string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  933. if (plinCode.Equals("C009") || plinCode.Equals("C008") || plinCode.Equals("C017") || plinCode.Equals("C072"))
  934. {
  935. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
  936. {
  937. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  938. }
  939. else if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  940. {
  941. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCardTest", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  942. }
  943. else
  944. {
  945. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  946. }
  947. }
  948. else if (plinCode.Equals("C010"))
  949. {
  950. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
  951. {
  952. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, ob);
  953. }
  954. else if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  955. {
  956. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getRollCard168Test", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  957. }
  958. else
  959. {
  960. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getRollCard168", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  961. }
  962. }
  963. else
  964. {
  965. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
  966. {
  967. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, ob);
  968. }
  969. else if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  970. {
  971. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getRollingCardTest", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  972. }
  973. else
  974. {
  975. dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  976. }
  977. }
  978. //if (dt_RCard.Rows.Count > 0)
  979. RollingCardEditGrid(dt_RCard);//流通卡信息-2
  980. MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();
  981. En_Mil_Sur.RollLotNo = str_Pro_NO;
  982. En_Mil_Sur.HeatNo = str_STOVE_NO;
  983. //string str = JSONFormat.Format(En_Mil_Sur);//实体类转换为JSON格式
  984. DataTable dt = new DataTable();
  985. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { str_STOVE_NO, ResultNo, proPlanId, gxPlanNo }, this.ob);
  986. //if (dt.Rows.Count < 1)
  987. //{
  988. // if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Value.ToString2() == "9")
  989. // {
  990. // dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMilPlan", new object[] { str_STOVE_NO, ResultNo }, this.ob);
  991. // }
  992. //}
  993. utr_SURFACE_EditGrid(dt);//人工质检实绩信息显示-3
  994. //if (dt.Rows.Count > 0)
  995. //{
  996. // if (!string.IsNullOrEmpty(dt.Rows[0]["QA_TYPE"].ToString()))
  997. // {
  998. // Qa_Flag = int.Parse(dt.Rows[0]["QA_TYPE"].ToString());
  999. // }
  1000. //}
  1001. //get_Chk_Active(str_STOVE_NO);//获取上料表中选中的抽检项
  1002. dtMatSeq_3.Clear();
  1003. dtDefectS.Clear();
  1004. if (isStartSurface(ResultNo, str_STOVE_NO))
  1005. {
  1006. GetFeedRack();//查询上料管号队列
  1007. getDefectData();
  1008. //SimpleQuery();//性能批显示
  1009. //ShowMatTabPage();//管号队列Tab显示
  1010. }
  1011. //绑定缺陷项到下拉列表
  1012. //dt_Defect.Rows.Clear();
  1013. //getdtDefectComb();
  1014. //getdtCombGenerel();
  1015. }
  1016. /// <summary>
  1017. /// 管号队列Tab显示
  1018. /// </summary>
  1019. public void ShowMatTabPage()
  1020. {
  1021. switch (Qa_Flag)
  1022. {
  1023. //未开始抽检 显示一检管号队列TAB2 TAB2更名管号队列
  1024. case 0:
  1025. ultraTabControl2.Tabs[0].Visible = true;
  1026. // ultraTabControl2.Tabs[0].Text = "管号队列";
  1027. ultraTabControl2.Tabs[1].Visible = false;
  1028. //ultraTabControl3.Tabs[0].Visible = true;
  1029. //ultraTabControl3.Tabs[1].Visible = false;
  1030. break;
  1031. //一检完成 显示一检管号队列TAB2 TAB2更名管号队列
  1032. case 1:
  1033. ultraTabControl2.Tabs[0].Visible = true;
  1034. // ultraTabControl2.Tabs[0].Text = "管号队列";
  1035. ultraTabControl2.Tabs[1].Visible = false;
  1036. //ultraTabControl3.Tabs[0].Visible = true;
  1037. //ultraTabControl3.Tabs[1].Visible = false;
  1038. break;
  1039. //二检完成 显示终检管号队列TAB1 一检管号队列TAB2 TAB2更名一检管号队列
  1040. case 2:
  1041. ultraTabControl2.Tabs[0].Visible = true;
  1042. ultraTabControl2.Tabs[1].Text = "一检管号队列";
  1043. ultraTabControl2.Tabs[1].Visible = true;
  1044. //ultraTabControl3.Tabs[0].Visible = false;
  1045. //ultraTabControl3.Tabs[1].Visible = true;
  1046. break;
  1047. }
  1048. }
  1049. /// <summary>
  1050. /// 双击组件开始质检操作
  1051. /// </summary>
  1052. /// <param name="sender"></param>
  1053. /// <param name="e"></param>
  1054. //private void ultraGrid_Plan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
  1055. private void DoStart()
  1056. {
  1057. if (ultraGrid_Plan.Rows.Count > 0)
  1058. {
  1059. // IsStart();
  1060. UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
  1061. string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
  1062. string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
  1063. string ResultNo = ugr_acr.Cells["ID"].Value.ToString();//炉号
  1064. proPlanId = ugr_acr.Cells["PRO_PLAN_ID"].Value.ToString();
  1065. gxPlanNo = ugr_acr.Cells["GX_PLAN_NO"].Value.ToString();
  1066. string staus = doQueryJugeNoStaus(ResultNo, str_STOVE_NO,PlineCode);
  1067. if (isStartSurface(ResultNo, str_STOVE_NO))
  1068. {
  1069. MessageBox.Show("炉号【" + str_STOVE_NO + "】已经开始质检");
  1070. return;
  1071. }
  1072. //增加人工质检信息
  1073. MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();
  1074. En_Mil_Sur.RollLotNo = str_Pro_NO;
  1075. En_Mil_Sur.ResultNo = ResultNo;
  1076. En_Mil_Sur.HeatNo = str_STOVE_NO;
  1077. En_Mil_Sur.PlineCode = ugr_acr.Cells["PLINE_CODE"].Value.ToString();//获取产线代码
  1078. En_Mil_Sur.ProPlanId = proPlanId;
  1079. En_Mil_Sur.GxPlanNo = gxPlanNo;
  1080. //更新上料表Mil_Plan状态
  1081. MilPlan QueryMainPlan = new MilPlan();//上料表实体
  1082. QueryMainPlan.JudgeStoveNo = str_STOVE_NO;
  1083. QueryMainPlan.LotNo = str_Pro_NO;
  1084. QueryMainPlan.Status = "95";
  1085. QueryMainPlan.ProPlanId = proPlanId;
  1086. QueryMainPlan.GxPlanNo = gxPlanNo;
  1087. string sizeFlag = "";
  1088. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryChcekSize", new object[] { BaseMethod.getJudgeStoveNo(str_STOVE_NO), proPlanId, gxPlanNo }, ob);
  1089. if (ds.Rows.Count > 0)
  1090. {
  1091. sizeFlag = "1";
  1092. }
  1093. else
  1094. {
  1095. sizeFlag = "0";
  1096. }
  1097. int num = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.startInSurFace", new object[] { En_Mil_Sur, QueryMainPlan, sizeFlag }, this.ob);
  1098. if (num > 0)
  1099. {
  1100. try
  1101. {
  1102. //更新质检跟踪表时间
  1103. Entity.NativeMethodNew en_NativeMethodNew = new Core.StlMes.Client.ZGMil.Entity.NativeMethodNew(this.ob);
  1104. en_NativeMethodNew.InsertSTAferDoubleClick(str_STOVE_NO, 9, "0", proPlanId, gxPlanNo);
  1105. }
  1106. catch (Exception)
  1107. {
  1108. }
  1109. milplan_ReFresh(str_Pro_NO, str_STOVE_NO);
  1110. }
  1111. }
  1112. }
  1113. /// <summary>
  1114. /// 开始回退
  1115. /// </summary>
  1116. private void DoStartBack()
  1117. {
  1118. if (ultraGrid_Plan.Rows.Count > 0)
  1119. {
  1120. if (this.ultraGrid_Plan.ActiveRow == null)
  1121. {
  1122. MessageBox.Show("请选择需要回退的炉号!!!");
  1123. return;
  1124. }
  1125. UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
  1126. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1127. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1128. string StartStatus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
  1129. //string StartStatus = ugr.Cells["IS_START"].Value.ToString();
  1130. if (StartStatus == "1")
  1131. {
  1132. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能开始回退!!!!");
  1133. return;
  1134. }
  1135. if (StartStatus == "3")
  1136. {
  1137. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始质检,不能开始回退!!!!");
  1138. return;
  1139. }
  1140. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryOffline", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1141. if (ds.Rows.Count > 0)
  1142. {
  1143. if (int.Parse(ds.Rows[0]["OFFLINE_NUM"].ToString()) > 0)
  1144. {
  1145. MessageUtil.ShowTips("此炉有下线支数,请先撤销下线支数的操作!");
  1146. return;
  1147. }
  1148. }
  1149. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.startBack", new object[] { JudgeStoveNo, ResultNo, 9, PlineCode, proPlanId, gxPlanNo }, this.ob);
  1150. ChangeGridColor();
  1151. SurfaceQuery();
  1152. GetFeedRack();
  1153. }
  1154. }
  1155. /// <summary>
  1156. /// 结炉回退
  1157. /// </summary>
  1158. private void NodeBack()
  1159. {
  1160. if (this.ultraGrid_Plan.ActiveRow == null)
  1161. {
  1162. MessageBox.Show("请选择需要回退的炉号!!!");
  1163. return;
  1164. }
  1165. UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
  1166. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1167. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1168. string NodeFlag = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
  1169. //string NodeFlag = ugr.Cells["IS_START"].Value.ToString();
  1170. if (NodeFlag != "1")
  1171. {
  1172. MessageBox.Show("炉号【" + JudgeStoveNo + "】未结炉,不能结炉回退!!!!");
  1173. return;
  1174. }
  1175. DataTable dtMat = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryMatScrap", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
  1176. if (dtMat.Rows.Count > 0)
  1177. {
  1178. if (int.Parse(dtMat.Rows[0][0].ToString()) > 0)
  1179. {
  1180. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】的废品已发运,不能结炉回退!!!!");
  1181. return;
  1182. }
  1183. }
  1184. DataTable dW = ServerHelper.GetData("com.steering.mes.signature.FrmDownlineManage.doQueryEntust", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1185. if (dW.Rows.Count > 0)
  1186. {
  1187. MessageUtil.ShowTips("已进行外委加工,不允许结炉回退!");
  1188. return;
  1189. }
  1190. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
  1191. if (dt.Rows.Count > 0)
  1192. {
  1193. string NodeStatus = dt.Rows[0][0].ToString();
  1194. if (int.Parse(NodeStatus) >= 99)
  1195. {
  1196. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】后序工序已结炉,当前工序不能结炉回退");
  1197. return;
  1198. }
  1199. }
  1200. //查询结炉班次班组
  1201. DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 11, proPlanId, gxPlanNo }, this.ob);
  1202. if (dtNodeGroup.Rows.Count > 0)
  1203. {
  1204. string NodeShift = dtNodeGroup.Rows[0][0].ToString();
  1205. string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
  1206. if (Shift == NodeShift && Group == NodeGroup)
  1207. {
  1208. }
  1209. else
  1210. {
  1211. switch (NodeShift)
  1212. {
  1213. case "0":
  1214. NodeShift = "白班";
  1215. break;
  1216. case "1":
  1217. NodeShift = "早班";
  1218. break;
  1219. case "2":
  1220. NodeShift = "中班";
  1221. break;
  1222. case "3":
  1223. NodeShift = "夜班";
  1224. break;
  1225. }
  1226. switch (NodeGroup)
  1227. {
  1228. case "1":
  1229. NodeGroup = "甲班";
  1230. break;
  1231. case "2":
  1232. NodeGroup = "乙班";
  1233. break;
  1234. case "3":
  1235. NodeGroup = "丙班";
  1236. break;
  1237. case "4":
  1238. NodeGroup = "丁班";
  1239. break;
  1240. }
  1241. switch (this.UserInfo.GetUserOrder())
  1242. {
  1243. case "0":
  1244. Shift = "白班";
  1245. break;
  1246. case "1":
  1247. Shift = "早班";
  1248. break;
  1249. case "2":
  1250. Shift = "中班";
  1251. break;
  1252. case "3":
  1253. Shift = "夜班";
  1254. break;
  1255. }
  1256. switch (this.UserInfo.GetUserGroup())
  1257. {
  1258. case "1":
  1259. Group = "甲班";
  1260. break;
  1261. case "2":
  1262. Group = "乙班";
  1263. break;
  1264. case "3":
  1265. Group = "丙班";
  1266. break;
  1267. case "4":
  1268. Group = "丁班";
  1269. break;
  1270. }
  1271. if (!NodeShift.Equals(Shift) || !NodeGroup.Equals(Group))
  1272. {
  1273. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeShift + "," + NodeGroup + "结炉,当班不能结炉回退");
  1274. return;
  1275. }
  1276. }
  1277. }
  1278. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.selectBackLineNum", new object[] { ResultNo, JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1279. if (ds.Rows.Count > 0)
  1280. {
  1281. MessageUtil.ShowTips("存在已返线的支数,不允许结炉回退!");
  1282. return;
  1283. }
  1284. //查询当前炉次是否有交班点
  1285. int Seq = 0;
  1286. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 9, proPlanId, gxPlanNo }, this.ob);
  1287. if (dt1.Rows.Count > 0)
  1288. {
  1289. Seq = int.Parse(dt1.Rows[0][0].ToString());
  1290. }
  1291. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 9, PlineCode, Seq, 0, 11, proPlanId, gxPlanNo, lotNo }, this.ob);
  1292. CoreClientParam ccp = new CoreClientParam();
  1293. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmOffLine";
  1294. ccp.MethodName = "insertMatScrapBack";
  1295. ccp.ServerParams = new object[] { JudgeStoveNo, proPlanId, gxPlanNo, PlineCode, "11" };
  1296. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1297. if (ccp.ReturnCode != -1)
  1298. { MessageUtil.ShowTips(ccp.ReturnInfo); }
  1299. ChangeGridColor();
  1300. SurfaceQuery();
  1301. GetFeedRack();
  1302. }
  1303. /// <summary>
  1304. /// 刷新计划表信息,如果参数为空字符串,选中行为控件默认的第一行
  1305. /// </summary>
  1306. /// <param name="strPro_No">轧制号</param>
  1307. /// <param name="strStove">炉号</param>
  1308. public void milplan_ReFresh(string strPro_No, string strStove)
  1309. {
  1310. MilPlan milplanEntity = new MilPlan();
  1311. if (u_ChkEditor_ProNo.Checked == true)
  1312. {
  1313. if (this.u_TxtEditor_ProNo.Text == "")
  1314. {
  1315. MessageBox.Show("请输入要查询的扎批号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1316. return;
  1317. }
  1318. milplanEntity.LotNo = this.u_TxtEditor_ProNo.Text;//获取查询区生产批号
  1319. }
  1320. if (u_ChkEditor_StoveNo.Checked)
  1321. {
  1322. if (this.u_TxtEditor_StrvoNo.Text == "")
  1323. {
  1324. MessageBox.Show("请输入要查询的炉号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1325. return;
  1326. }
  1327. milplanEntity.JudgeStoveNo = this.u_TxtEditor_StrvoNo.Text;//获取查询区炉号
  1328. }
  1329. milplanEntity.Status = PlanStatusQuery;
  1330. milplanEntity.StartStatus = PlanStartStatusQuery;
  1331. milplanEntity.PlineCode = this.PlineCode;
  1332. milplanEntity.ProPlanId = proPlanId;
  1333. milplanEntity.GxPlanNo = gxPlanNo;
  1334. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { milplanEntity, 10 }, this.ob);//
  1335. dtPlan.Clear();
  1336. GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);//绑定计划表
  1337. foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
  1338. {
  1339. if (ugr.Cells["IS_START"].Value.ToString() == "1")
  1340. {
  1341. ugr.Appearance.BackColor = Color.YellowGreen;
  1342. }
  1343. }
  1344. if (ultraGrid_Plan.Rows.Count > 0)
  1345. {
  1346. foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
  1347. {
  1348. if (ugr.Cells["IS_START"].Value.ToString() != "未开始质检" && ugr.Cells["IS_START"].Value.ToString() != "已开始质检" && ugr.Cells["IS_START"].Value.ToString() != "已完成质检")
  1349. {
  1350. ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  1351. switch (Convert.ToInt32(ugr.Cells["IS_START"].Value))
  1352. {
  1353. case 3:
  1354. ugr.Cells["IS_START"].Value = "未开始质检";
  1355. break;
  1356. case 0:
  1357. ugr.Cells["IS_START"].Value = "已开始质检";
  1358. break;
  1359. case 1:
  1360. ugr.Cells["IS_START"].Value = "已完成质检";
  1361. break;
  1362. }
  1363. }
  1364. }
  1365. }
  1366. else
  1367. {
  1368. MessageBox.Show("没有查询到相关数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1369. return;
  1370. }
  1371. //选中活动行
  1372. if (strPro_No == "" && strStove == "")//默认的第一行选中
  1373. {
  1374. return;
  1375. }
  1376. //for (int i = 0; i < dt.Rows.Count; i++)
  1377. //{
  1378. // if (ultraGrid_Plan.Rows[i].Cells["JUDGE_STOVE_NO"].Value.ToString() == strStove && ultraGrid_Plan.Rows[i].Cells["LOT_NO"].Value.ToString() == strPro_No)
  1379. // {
  1380. // this.ultraGrid_Plan.Rows[i].Activated = true;
  1381. // return;
  1382. // }
  1383. //}
  1384. foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
  1385. {
  1386. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == strStove && ugr.Cells["LOT_NO"].Value.ToString() == strPro_No)
  1387. {
  1388. ugr.Activated = true;
  1389. return;
  1390. }
  1391. }
  1392. }
  1393. /// <summary>
  1394. /// 是否开始质检
  1395. /// </summary>
  1396. /// <param name="?"></param>
  1397. /// <returns></returns>
  1398. public bool isStartSurface(string ResultNo, string strStove)
  1399. {
  1400. MilSurfaceResultEntity enMilSurfaceResultEntity = new MilSurfaceResultEntity();
  1401. //enMilSurfaceResultEntity.RollLotNo = strPro_No; //获取查询区炉号
  1402. //enMilSurfaceResultEntity.HeatNo = strStove; //获取查询区生产批号
  1403. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { strStove, ResultNo, proPlanId, gxPlanNo }, this.ob);//
  1404. if (dt.Rows.Count > 0)
  1405. { return true; }
  1406. else
  1407. {
  1408. return false;
  1409. }
  1410. }
  1411. /// <summary>
  1412. /// 离线缺陷登记
  1413. /// </summary>
  1414. private void DoCheck()
  1415. {
  1416. int MatNum = 0; //探伤合格支数
  1417. double Diameter = 0; //外径
  1418. double Thickness = 0; //控制壁厚
  1419. double Length = 0; //长度
  1420. double ZLXS = 1.0; //重量系数
  1421. MilSurfaceResultEntity QaResultEntity = new MilSurfaceResultEntity();
  1422. if (ultraGrid_Plan.Rows.Count > 0)
  1423. {
  1424. UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
  1425. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1426. string LotNo = ugr.Cells["LOT_NO"].Value.ToString();
  1427. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1428. string IsStart = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
  1429. //string IsStart = ugr.Cells["IS_START"].Value.ToString();
  1430. int OffLineFlag = int.Parse(JudgeStoveNo.Substring(JudgeStoveNo.Length - 2, 2).ToString());
  1431. if (OffLineFlag > 1)
  1432. {
  1433. OffLineFlag = 2;
  1434. }
  1435. if (IsStart == "3")
  1436. {
  1437. MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始质检,不能抽检!");
  1438. return;
  1439. }
  1440. if (IsStart == "1")
  1441. {
  1442. MessageBox.Show("炉号【" + JudgeStoveNo + "】已完成质检,不能抽检!");
  1443. return;
  1444. }
  1445. string Varieties = this.rollingInfomation1.UltraGrid4.Rows[0].Cells["Varieties"].Value.ToString();
  1446. if (Varieties == "")
  1447. {
  1448. MessageUtil.ShowTips("无轧制信息,请联系系统管理员!");
  1449. return;
  1450. }
  1451. string[] temp = Varieties.Split(',');
  1452. string[] WJBH = temp[2].Split('*');
  1453. if (!string.IsNullOrEmpty(WJBH[0]))
  1454. {
  1455. Diameter = double.Parse(WJBH[0]);
  1456. }
  1457. //if (!string.IsNullOrEmpty(WJBH[1]))
  1458. //{
  1459. // Thickness = double.Parse(WJBH[1]);
  1460. //}
  1461. if (!string.IsNullOrEmpty(this.rollingInfomation1.UltraGrid4.Rows[0].Cells["ContractLength"].Value.ToString()))
  1462. {
  1463. Length = double.Parse(this.rollingInfomation1.UltraGrid4.Rows[0].Cells["ContractLength"].Value.ToString());
  1464. }
  1465. //查询控制壁厚
  1466. DataTable dtColThick = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipeSawResult.GetSawResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1467. if (dtColThick.Rows.Count > 0)
  1468. {
  1469. if (!string.IsNullOrEmpty(dtColThick.Rows[0]["COL_THICK"].ToString()))
  1470. {
  1471. Thickness = double.Parse(dtColThick.Rows[0]["COL_THICK"].ToString());
  1472. }
  1473. }
  1474. ////一次抽检
  1475. //if (QaFlag == 1)
  1476. //{
  1477. //探伤结炉后才能开始抽检 查询探伤结炉标识 探伤合格支数
  1478. if (PlineCode == "C010" || PlineCode == "C012") //涡流探伤
  1479. {
  1480. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() != "9")
  1481. {
  1482. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1483. if (dt.Rows.Count > 0)
  1484. {
  1485. if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
  1486. {
  1487. MatNum = int.Parse(dt.Rows[0]["QUALIFIED_NUM"].ToString()); //涡流探伤合格支数
  1488. }
  1489. //else
  1490. //{
  1491. // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
  1492. // return;
  1493. //}
  1494. }
  1495. //else
  1496. //{
  1497. // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
  1498. // return;
  1499. //}
  1500. }
  1501. }
  1502. else
  1503. {
  1504. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() != "9")
  1505. {
  1506. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1507. if (ds.Rows.Count > 0)
  1508. {
  1509. if (ds.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
  1510. {
  1511. MatNum = int.Parse(ds.Rows[0]["QUALIFIED_NUM"].ToString()); //漏磁探伤合格支数
  1512. }
  1513. //else
  1514. //{
  1515. // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
  1516. // return;
  1517. //}
  1518. }
  1519. //else
  1520. //{
  1521. // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
  1522. // return;
  1523. //}
  1524. }
  1525. }
  1526. //查询是否进行分批
  1527. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetIsSimple", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
  1528. int Flag = int.Parse(dt1.Rows[0]["IS_BATCH"].ToString());
  1529. DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryBackFlag", new object[] { ResultNo, JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1530. FrmQADefect QADefect = new FrmQADefect(JudgeStoveNo, ResultNo, proPlanId, gxPlanNo, LotNo, MatNum, Diameter, Thickness, Length, 1, OffLineFlag,PlineCode,dd.Rows[0][0].ToString(), this.ob);
  1531. QADefect.ShowDialog();
  1532. if (QADefect.DialogResult == DialogResult.OK)
  1533. {
  1534. ZLXS = double.Parse(QADefect._ZLXS); //重量系数
  1535. _ScrapNum = QADefect._ScrapNum; //废品量
  1536. _OffLineNum = QADefect._OffLineNumF; //下线量
  1537. //_MatHeight = QADefect._MatHeight; //单支重
  1538. double QAHeight = double.Parse((MatNum - int.Parse(_ScrapNum) - int.Parse(_OffLineNum)).ToString()) * _MatHeight; //合格吨 = (总检量-废品支-下线支) * 单支重
  1539. int QANum = MatNum - int.Parse(_ScrapNum) - int.Parse(_OffLineNum); //合格支
  1540. QaResultEntity.HeatNo = JudgeStoveNo;
  1541. QaResultEntity.ResultNo = ResultNo;
  1542. QaResultEntity.DirectorQuantity = MatNum.ToString();
  1543. QaResultEntity.OfflineQuantity = _OffLineNum;
  1544. QaResultEntity.WasteQuantity = _ScrapNum;
  1545. QaResultEntity.QualifiedTons = QAHeight.ToString();
  1546. QaResultEntity.QualifiedBranch = QANum.ToString();
  1547. QaResultEntity.HeightRate = ZLXS.ToString();
  1548. QaResultEntity.DirectorQuantityF = MatNum.ToString();
  1549. QaResultEntity.OfflineQuantityF = _OffLineNum;
  1550. QaResultEntity.WasteQuantityF = _ScrapNum;
  1551. QaResultEntity.QualifiedTonsF = QAHeight.ToString();
  1552. QaResultEntity.QualifiedBranchF = QANum.ToString();
  1553. QaResultEntity.ProPlanId = proPlanId;
  1554. QaResultEntity.GxPlanNo = gxPlanNo;
  1555. //更新质检实绩信息
  1556. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.updateSurfaceResultNumF", new object[] { QaResultEntity, 1 }, this.ob);
  1557. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryPortWgt", new object[] { this.ultraGrid_Plan.ActiveRow.Cells["ID"].Value.ToString(), (int.Parse(SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString()) - int.Parse(_ScrapNum) - int.Parse(_OffLineNum)).ToString(), proPlanId, gxPlanNo }, ob);
  1558. //抽检后质检主信息界面显示支数信息
  1559. //SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = MatNum;
  1560. //SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = QANum;
  1561. SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = (int.Parse(SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString()) - int.Parse(_ScrapNum) - int.Parse(_OffLineNum)).ToString();
  1562. //SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = QAHeight;
  1563. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0][0].ToString();
  1564. SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = _ScrapNum;
  1565. SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = _OffLineNum;
  1566. uDSFirstQa.Rows.Add();
  1567. //抽检后质检详细信息界面显示一次抽检支数信息
  1568. //uDSFirstQa.Rows[0]["DIRECTOR_QUANTITY_F"] = MatNum;
  1569. //uDSFirstQa.Rows[0]["QUALIFIED_BRANCH_F"] = QANum;
  1570. //uDSFirstQa.Rows[0]["QUALIFIED_TONS_F"] = QAHeight;
  1571. //uDSFirstQa.Rows[0]["WASTE_QUANTITY_F"] = _ScrapNum;
  1572. //uDSFirstQa.Rows[0]["OFFLINE_QUANTITY_F"] = _OffLineNum;
  1573. QADefect.Close();
  1574. GetFeedRack();
  1575. getDefectData();
  1576. SurfaceQuery();
  1577. }
  1578. //SurfaceQuery();
  1579. }
  1580. }
  1581. /// <summary>
  1582. /// 作废二次抽检
  1583. /// </summary>
  1584. private void DoCheckSCancel()
  1585. {
  1586. if (Qa_Flag != 2)
  1587. {
  1588. MessageBox.Show("炉号【" + actJudgeStoveNo + "】未开始二次抽检,不能作为二次抽检");
  1589. return;
  1590. }
  1591. int dt = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.CheckSCancel", new object[] { actJudgeStoveNo, actResultNo }, this.ob);
  1592. MessageBox.Show("炉号【" + actJudgeStoveNo + "】二次抽检已作废。");
  1593. }
  1594. /// <summary>
  1595. /// 几何尺寸抽检
  1596. /// </summary>
  1597. private void DoSizeCheck()
  1598. {
  1599. if (ultraGrid_Plan.Rows.Count > 0)
  1600. {
  1601. UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
  1602. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1603. string LotNo = ugr.Cells["LOT_NO"].Value.ToString();
  1604. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1605. string staus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
  1606. if (staus == "3")
  1607. {
  1608. MessageUtil.ShowTips("炉号【" + JudgeStoveNo + "】未开始质检,不能进行几何尺寸抽检!");
  1609. return;
  1610. }
  1611. //if (staus == "1")
  1612. //{
  1613. // MessageUtil.ShowTips("炉号【" + JudgeStoveNo + "】已完成质检,不能进行几何尺寸抽检!");
  1614. // return;
  1615. //}
  1616. FrmQASizeDetail frmQaSize = new FrmQASizeDetail(JudgeStoveNo, LotNo, ResultNo, proPlanId, gxPlanNo, PlineCode, this.ob);
  1617. if (frmQaSize.ShowDialog() == DialogResult.OK)
  1618. {
  1619. SurfaceQuery();
  1620. }
  1621. }
  1622. }
  1623. /// <summary>
  1624. /// 管号队列激活事件
  1625. /// </summary>
  1626. /// <param name="sender"></param>
  1627. /// <param name="e"></param>
  1628. private void ultraGridMatSeq_AfterRowActivate(object sender, EventArgs e)
  1629. {
  1630. if (Qa_Flag == 0)
  1631. {
  1632. return;
  1633. }
  1634. UltraGridRow ugr = ultraGridMatSeq.ActiveRow;
  1635. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1636. string Seq = ugr.Cells["SEQ"].Value.ToString();
  1637. //string ResultNo = ugr.Cells["RESULT_NO"].Value.ToString();
  1638. string Status = ugr.Cells["STATUS"].Value.ToString();
  1639. dtDefect.Clear();
  1640. if (Status == "一检剔除")
  1641. {
  1642. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.pipeDefectQuery", new object[] { JudgeStoveNo, actResultNo, Seq, "1" }, this.ob);
  1643. GridHelper.CopyDataToDatatable(ref dt, ref dtDefect, true);
  1644. }
  1645. else if (Status == "二检剔除")
  1646. {
  1647. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.pipeDefectQuery", new object[] { JudgeStoveNo, actResultNo, Seq, "2" }, this.ob);
  1648. GridHelper.CopyDataToDatatable(ref dt, ref dtDefect, true);
  1649. }
  1650. else
  1651. {
  1652. //查询成品管缺陷项并显示在缺陷列表中
  1653. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.pipeDefectQuery", new object[] { JudgeStoveNo, actResultNo, Seq, Qa_Flag.ToString() }, this.ob);
  1654. GridHelper.CopyDataToDatatable(ref dt, ref dtDefect, true);
  1655. }
  1656. }
  1657. /// <summary>
  1658. /// 性能批激活事件
  1659. /// </summary>
  1660. /// <param name="sender"></param>
  1661. /// <param name="e"></param>
  1662. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1663. {
  1664. if (Qa_Flag == 0)
  1665. {
  1666. return;
  1667. }
  1668. //UltraGridRow ugr = ultraGrid2.ActiveRow;
  1669. //string SimpleLotNo = ugr.Cells["SIMPLE_LOT_NO"].Value.ToString();
  1670. dtDefectS.Clear();
  1671. //查询性能批缺陷项并显示在缺陷列表中
  1672. //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetSimpleCheckInfo", new object[] { actJudgeStoveNo, actResultNo, SimpleLotNo }, this.ob);
  1673. //GridHelper.CopyDataToDatatable(ref dt, ref dtDefectS, true);
  1674. }
  1675. /// <summary>
  1676. /// 更改上料管队列girdRow颜色
  1677. /// </summary>
  1678. public void ChangeGridColor()
  1679. {
  1680. foreach (UltraGridRow ugr in ultraGridMatSeq.Rows)
  1681. {
  1682. if (ugr.Cells["STATUS"].Value.ToString() == "剔除")
  1683. {
  1684. ugr.Appearance.BackColor = Color.Yellow;
  1685. }
  1686. if (ugr.Cells["STATUS"].Value.ToString() == "二检剔除")
  1687. {
  1688. ugr.Appearance.BackColor = Color.Yellow;
  1689. }
  1690. if (ugr.Cells["STATUS"].Value.ToString() == "最终下线")
  1691. {
  1692. ugr.Appearance.BackColor = Color.YellowGreen;
  1693. }
  1694. if (ugr.Cells["STATUS"].Value.ToString() == "下线")
  1695. {
  1696. ugr.Appearance.BackColor = Color.YellowGreen;
  1697. }
  1698. if (ugr.Cells["CHANGE_FLAG"].Value.ToString() == "待接班确认")
  1699. {
  1700. ugr.Appearance.BackColor = Color.LightGreen;
  1701. }
  1702. }
  1703. }
  1704. //性能批查询
  1705. public void SimpleQuery()
  1706. {
  1707. //查询是否进行分批
  1708. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetIsSimple", new object[] { actJudgeStoveNo, actResultNo, proPlanId, gxPlanNo }, this.ob);
  1709. int Flag = int.Parse(dt1.Rows[0]["IS_BATCH"].ToString());
  1710. if (Flag == 0) //未分批
  1711. {
  1712. return;
  1713. }
  1714. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetSimpleInfo", new object[] { actJudgeStoveNo, actResultNo }, this.ob);
  1715. GridHelper.CopyDataToDatatable(ref dt, ref dtSimple, true);
  1716. }
  1717. #region 卡片赋值: 轧制信息Grid赋值,流通卡赋值
  1718. /// <summary>
  1719. /// 轧制信息Grid赋值
  1720. /// </summary>
  1721. /// <param name="dt">轧制计划信息datatable</param>
  1722. public void GridEdit(DataTable dt)
  1723. {
  1724. DataRow row1 = dt.Rows[0];
  1725. //熔炼炉号
  1726. this.rollingInfomation1.Value.StoveNo = row1["stove_no"].ToString();
  1727. //炉号
  1728. this.rollingInfomation1.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString());
  1729. //生产批号
  1730. this.rollingInfomation1.Value.LotNo = row1["lot_no"].ToString();
  1731. //工序合同号
  1732. this.rollingInfomation1.Value.ContractNo = row1["contract_no"].ToString();
  1733. //执行工艺号
  1734. this.rollingInfomation1.Value.ImpProcess = row1["imp_process"].ToString();
  1735. //执行工艺号路径
  1736. this.rollingInfomation1.Value.ImpProcessPath = row1["imp_process_path"].ToString();
  1737. //产线代码
  1738. this.rollingInfomation1.Value.PlineCode = row1["pline_code"].ToString();
  1739. //状态
  1740. this.rollingInfomation1.Value.Status = row1["STATUS"].ToString();
  1741. //监制
  1742. this.rollingInfomation1.Value.Producer = row1["producer"].ToString();
  1743. //工艺状态
  1744. this.rollingInfomation1.Value.ProcessStatus = row1["process_status"].ToString();
  1745. //单倍长
  1746. this.rollingInfomation1.Value.DbLength = row1["db_length"].ToString();
  1747. //单倍重
  1748. this.rollingInfomation1.Value.DbHeight = row1["db_height"].ToString();
  1749. //轧制长度
  1750. this.rollingInfomation1.Value.RollLength = row1["roll_length"].ToString();
  1751. //分切数
  1752. this.rollingInfomation1.Value.SawNum = row1["saw_num"].ToString();
  1753. //目标长度
  1754. this.rollingInfomation1.Value.TargetLength = row1["target_length"].ToString();
  1755. //最终用户
  1756. this.rollingInfomation1.Value.FinishUser = row1["finish_user"].ToString();
  1757. //目标库
  1758. this.rollingInfomation1.Value.TargetLiabrary = row1["target_liabrary"].ToString();
  1759. //品种
  1760. this.rollingInfomation1.Value.Varieties = row1["varieties"].ToString();
  1761. //成品规格
  1762. this.rollingInfomation1.Value.PipeSize = row1["pipe_size"].ToString();
  1763. //扣型
  1764. this.rollingInfomation1.Value.BuckleType = row1["buckle_type"].ToString();
  1765. //长度范围
  1766. this.rollingInfomation1.Value.LengthRange = row1["length_range"].ToString();
  1767. //轧管判定标准
  1768. this.rollingInfomation1.Value.RollStandrad = row1["roll_standrad"].ToString();
  1769. //断面
  1770. this.rollingInfomation1.Value.PipeSection = row1["pipe_section"].ToString();
  1771. //钢种代码
  1772. this.rollingInfomation1.Value.SteelCode = row1["steelcode"].ToString();
  1773. //钢种名称
  1774. this.rollingInfomation1.Value.SteelName = row1["steelname"].ToString();
  1775. //钢级代码
  1776. this.rollingInfomation1.Value.GradeCode = row1["gradecode"].ToString();
  1777. //钢级名称
  1778. this.rollingInfomation1.Value.GradeName = row1["gradename"].ToString();
  1779. //炼钢判定标准
  1780. this.rollingInfomation1.Value.SteelStandrad = row1["steel_standrad"].ToString();
  1781. //去向
  1782. this.rollingInfomation1.Value.Target = row1["target"].ToString();
  1783. //支
  1784. this.rollingInfomation1.Value.PlanNum = row1["BRANCH"].ToString();
  1785. //吨
  1786. this.rollingInfomation1.Value.PlanTon = row1["TON"].ToString();
  1787. //切损去向
  1788. this.rollingInfomation1.Value.CutTarget = row1["cut_target"].ToString();
  1789. //切损长度
  1790. this.rollingInfomation1.Value.CutLength = row1["cut_length"].ToString();
  1791. //切损重量
  1792. this.rollingInfomation1.Value.CutHeight = row1["CUT_WEIGHT"].ToString();
  1793. //倍尺数
  1794. this.rollingInfomation1.Value.DbNum = row1["DB_NUM"].ToString();
  1795. //标准类别代码
  1796. this.rollingInfomation1.Value.StdStyle = row1["STD_STYLE"].ToString();
  1797. //标准类别描述
  1798. this.rollingInfomation1.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString();
  1799. //成品备注
  1800. this.rollingInfomation1.Value.ReMark = row1["ReMark"].ToString();
  1801. this.rollingInfomation1.UpdateData();
  1802. }
  1803. /// <summary>
  1804. /// 流通卡赋值
  1805. /// </summary>
  1806. /// <param name="dt"></param>
  1807. public void RollingCardEditGrid(DataTable dt)
  1808. {
  1809. clearRollCard();
  1810. if (dt.Rows.Count > 0)
  1811. {
  1812. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
  1813. {
  1814. //上料切前剔除支数
  1815. this.rollingCard1.Value.FeedScrapNum = "0";
  1816. //上料切前合格支数
  1817. this.rollingCard1.Value.FeedQualifiedNum = "0";
  1818. //据切剔除支数
  1819. this.rollingCard1.Value.FeedScrapDBNum = "0";
  1820. //锯切合格支数
  1821. this.rollingCard1.Value.FeedQualifiedDBNum = "0";
  1822. //加热炉剔除支数
  1823. this.rollingCard1.Value.FurScrapNum = "0";
  1824. //加热炉合格支数
  1825. this.rollingCard1.Value.FurQualifiedNum = "0";
  1826. //穿孔剔除支数
  1827. this.rollingCard1.Value.PerScrapNum = "0";
  1828. //穿孔合格支数
  1829. this.rollingCard1.Value.PerQualifiedNum = "0";
  1830. //连轧剔除支数
  1831. this.rollingCard1.Value.RollingScrapNum = "0";
  1832. //连轧合格支数
  1833. this.rollingCard1.Value.RollingQualifiedNum = "0";
  1834. //再加热炉剔除支数
  1835. this.rollingCard1.Value.RefurScrapNum = "0";
  1836. //再加热炉合格支数
  1837. this.rollingCard1.Value.RefurQualifiedNum = "0";
  1838. //定径剔除支数
  1839. this.rollingCard1.Value.SizingScrapNum = "0";
  1840. //定径合格支数
  1841. this.rollingCard1.Value.SizingQualifiedNum = "0";
  1842. //分切前剔除支数
  1843. this.rollingCard1.Value.SawScrapNumBE = "0";
  1844. //分切前合格支数
  1845. this.rollingCard1.Value.SawQualifiedNumBE = "0";
  1846. //分切剔除支数
  1847. this.rollingCard1.Value.SawScrapNum = "0";
  1848. //分切合格支数
  1849. this.rollingCard1.Value.SawQualifiedNum = "0";
  1850. //矫直剔除支数
  1851. this.rollingCard1.Value.StraightScrapNum = "0";
  1852. //矫直合格支数
  1853. this.rollingCard1.Value.StraightQualifiedNum = "0";
  1854. //探伤剔除支数
  1855. this.rollingCard1.Value.TestingScrapNum = "0";
  1856. //探伤合格支数
  1857. this.rollingCard1.Value.TestingQualifiedNum = "0";
  1858. //探伤下线支数
  1859. this.rollingCard1.Value.OfflineTesting = "0";
  1860. //表检剔除支数
  1861. this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
  1862. //表检合格支数
  1863. this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
  1864. //表检下线支数
  1865. this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
  1866. }
  1867. else if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "8" || this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "7")
  1868. {
  1869. //上料切前剔除支数
  1870. this.rollingCard1.Value.FeedScrapNum = "0";
  1871. //上料切前合格支数
  1872. this.rollingCard1.Value.FeedQualifiedNum = "0";
  1873. //据切剔除支数
  1874. this.rollingCard1.Value.FeedScrapDBNum = "0";
  1875. //锯切合格支数
  1876. this.rollingCard1.Value.FeedQualifiedDBNum = "0";
  1877. //加热炉剔除支数
  1878. this.rollingCard1.Value.FurScrapNum = "0";
  1879. //加热炉合格支数
  1880. this.rollingCard1.Value.FurQualifiedNum = "0";
  1881. //穿孔剔除支数
  1882. this.rollingCard1.Value.PerScrapNum = "0";
  1883. //穿孔合格支数
  1884. this.rollingCard1.Value.PerQualifiedNum = "0";
  1885. //连轧剔除支数
  1886. this.rollingCard1.Value.RollingScrapNum = "0";
  1887. //连轧合格支数
  1888. this.rollingCard1.Value.RollingQualifiedNum = "0";
  1889. //再加热炉剔除支数
  1890. this.rollingCard1.Value.RefurScrapNum = "0";
  1891. //再加热炉合格支数
  1892. this.rollingCard1.Value.RefurQualifiedNum = "0";
  1893. //定径剔除支数
  1894. this.rollingCard1.Value.SizingScrapNum = "0";
  1895. //定径合格支数
  1896. this.rollingCard1.Value.SizingQualifiedNum = "0";
  1897. //分切前剔除支数
  1898. this.rollingCard1.Value.SawScrapNumBE = "0";
  1899. //分切前合格支数
  1900. this.rollingCard1.Value.SawQualifiedNumBE = "0";
  1901. //分切剔除支数
  1902. this.rollingCard1.Value.SawScrapNum = "0";
  1903. //分切合格支数
  1904. this.rollingCard1.Value.SawQualifiedNum = "0";
  1905. //矫直剔除支数
  1906. this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
  1907. //矫直合格支数
  1908. this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
  1909. //探伤剔除支数
  1910. this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
  1911. //探伤合格支数
  1912. this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
  1913. //探伤下线支数
  1914. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  1915. //表检剔除支数
  1916. this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
  1917. //表检合格支数
  1918. this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
  1919. //表检下线支数
  1920. this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
  1921. }
  1922. else
  1923. {
  1924. //上料切前剔除支数
  1925. this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString();
  1926. //上料切前合格支数
  1927. this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString();
  1928. //据切剔除支数
  1929. this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString();
  1930. //锯切合格支数
  1931. this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString();
  1932. //加热炉剔除支数
  1933. this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString();
  1934. //加热炉合格支数
  1935. this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString();
  1936. //穿孔剔除支数
  1937. this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString();
  1938. //穿孔合格支数
  1939. this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString();
  1940. //连轧剔除支数
  1941. this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString();
  1942. //连轧合格支数
  1943. this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString();
  1944. //再加热炉剔除支数
  1945. this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString();
  1946. //再加热炉合格支数
  1947. this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString();
  1948. //定径剔除支数
  1949. this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString();
  1950. //定径合格支数
  1951. this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString();
  1952. //分切前剔除支数
  1953. this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString();
  1954. //分切前合格支数
  1955. this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString();
  1956. //分切剔除支数
  1957. this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString();
  1958. //分切合格支数
  1959. this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString();
  1960. //矫直剔除支数
  1961. this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
  1962. //矫直合格支数
  1963. this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
  1964. //探伤剔除支数
  1965. this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
  1966. //探伤合格支数
  1967. this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
  1968. //探伤下线支数
  1969. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  1970. //表检剔除支数
  1971. this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
  1972. //表检合格支数
  1973. this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
  1974. //表检下线支数
  1975. this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
  1976. }
  1977. this.rollingCard1.UpdateData();
  1978. }
  1979. else
  1980. {
  1981. this.rollingCard1.ClearData();
  1982. }
  1983. }
  1984. public void clearRollCard()
  1985. {
  1986. //上料切前判废支数
  1987. this.rollingCard1.Value.FeedScrapNum = "0";
  1988. //上料切前合格支数
  1989. this.rollingCard1.Value.FeedQualifiedNum = "0";
  1990. //上料判废支数
  1991. this.rollingCard1.Value.FeedScrapDBNum = "0";
  1992. //上料合格支数
  1993. this.rollingCard1.Value.FeedQualifiedDBNum = "0";
  1994. //加热炉判废支数
  1995. this.rollingCard1.Value.FurScrapNum = "0";
  1996. //加热炉合格支数
  1997. this.rollingCard1.Value.FurQualifiedNum = "0";
  1998. //穿孔判废支数
  1999. this.rollingCard1.Value.PerScrapNum = "0";
  2000. //穿孔合格支数
  2001. this.rollingCard1.Value.PerQualifiedNum = "0";
  2002. //连轧判废支数
  2003. this.rollingCard1.Value.RollingScrapNum = "0";
  2004. //连轧合格支数
  2005. this.rollingCard1.Value.RollingQualifiedNum = "0";
  2006. //再加热炉判废支数
  2007. this.rollingCard1.Value.RefurScrapNum = "0";
  2008. //再加热炉合格支数
  2009. this.rollingCard1.Value.RefurQualifiedNum = "0";
  2010. //定径判废支数
  2011. this.rollingCard1.Value.SizingScrapNum = "0";
  2012. //定径合格支数
  2013. this.rollingCard1.Value.SizingQualifiedNum = "0";
  2014. //分切前判废支数
  2015. this.rollingCard1.Value.SawScrapNumBE = "0";
  2016. //分切前合格支数
  2017. this.rollingCard1.Value.SawQualifiedNumBE = "0";
  2018. //分切判废支数
  2019. this.rollingCard1.Value.SawScrapNum = "0";
  2020. //分切合格支数
  2021. this.rollingCard1.Value.SawQualifiedNum = "0";
  2022. //矫直判废支数
  2023. this.rollingCard1.Value.StraightScrapNum = "0";
  2024. //矫直合格支数
  2025. this.rollingCard1.Value.StraightQualifiedNum = "0";
  2026. //矫直下线支数
  2027. this.rollingCard1.Value.OfflineStraight = "0";
  2028. //矫直返线支数
  2029. this.rollingCard1.Value.BacklineStraight = "0";
  2030. //探伤判废支数
  2031. this.rollingCard1.Value.TestingScrapNum = "0";
  2032. //探伤合格支数
  2033. this.rollingCard1.Value.TestingQualifiedNum = "0";
  2034. //探伤下线支数
  2035. this.rollingCard1.Value.OfflineTesting = "0";
  2036. this.rollingCard1.Value.BacklineTesting = "0";
  2037. //表检剔除支数
  2038. this.rollingCard1.Value.SurfaceScrapNum = "0";
  2039. //表检合格支数
  2040. this.rollingCard1.Value.SurfaceQualifiedNum = "0";
  2041. //表检下线支数
  2042. this.rollingCard1.Value.OfflineSurface = "0";
  2043. this.rollingCard1.UpdateData();
  2044. }
  2045. /// <summary>
  2046. /// 获取人工质检实绩信息显示
  2047. /// </summary>
  2048. /// <param name="dt"></param>
  2049. public void utr_SURFACE_EditGrid(DataTable dt)
  2050. {
  2051. //清空质检实绩
  2052. if (SurfaceDataSource.Rows.Count > 0)
  2053. {
  2054. for (int i = 0; i < SurfaceDataSource.Rows[0].Band.Columns.Count; i++)
  2055. {
  2056. SurfaceDataSource.Rows[0][i] = "";
  2057. }
  2058. }
  2059. //清空抽检项和抽检率
  2060. //Nud_val = 0;
  2061. //foreach (Control ctr in this.ultraGroupBox1.Controls)
  2062. //{
  2063. // if (ctr is UltraCheckEditor)
  2064. // {
  2065. // UltraCheckEditor ul_chk = ctr as UltraCheckEditor;
  2066. // if (ul_chk.Checked)
  2067. // {
  2068. // ul_chk.Checked = false;
  2069. // }
  2070. // }
  2071. //}
  2072. //赋值质检信息和抽检率
  2073. if (dt.Rows.Count > 0)
  2074. {
  2075. DataTable dt_mt = null;
  2076. if (PlineCode == "C008" || PlineCode == "C009" || PlineCode == "C017" || PlineCode == "C072")
  2077. {
  2078. dt_mt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_MT_RESULT", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString() }, this.ob);
  2079. }
  2080. else
  2081. {
  2082. dt_mt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_ET_RESULT", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString() }, this.ob);
  2083. }
  2084. if (dt_mt.Rows.Count > 0 && dt_mt.Rows[0]["QUALIFIED_NUM"].ToString() != "0" && dt_mt.Rows[0]["QUALIFIED_NUM"].ToString() != "")
  2085. {
  2086. SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = dt_mt.Rows[0]["QUALIFIED_NUM"];
  2087. DataTable dtStatictis = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString(), actResultNo, proPlanId, gxPlanNo }, this.ob);
  2088. SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = dtStatictis.Rows[0]["WASTE_QUANTITY"];
  2089. //SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = (int.Parse(SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"].ToString()) - int.Parse(SurfaceDataSource.Rows[0]["WASTE_QUANTITY"].ToString())).ToString();
  2090. SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = int.Parse(SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"].ToString2()) - int.Parse(dtStatictis.Rows[0]["WASTE_QUANTITY"].ToString3()) - int.Parse(dtStatictis.Rows[0]["OFFLINE_QUANTITY"].ToString3());
  2091. double[] db_chkargs = new double[4];
  2092. double db_args = 0;
  2093. double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(0, this.rollingInfomation1.Value.PipeSize.IndexOf('*') - 1), out db_args);//外径
  2094. db_chkargs[0] = db_args;
  2095. double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(this.rollingInfomation1.Value.PipeSize.IndexOf('*') + 1), out db_args);//壁厚
  2096. db_chkargs[1] = db_args;
  2097. double.TryParse(this.rollingInfomation1.Value.TargetLength, out db_args);//长度
  2098. db_chkargs[2] = db_args;
  2099. int i_ultraCheckEditor1 = 0;
  2100. //int.TryParse(ultraCheckEditor1.Text, out i_ultraCheckEditor1);
  2101. //db_chkargs[3] = i_ultraCheckEditor1;//系数
  2102. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = Math.Round(double.Parse(SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString()) * ((db_chkargs[0] - db_chkargs[1]) * db_chkargs[1] * 0.02466 * db_chkargs[2] / 1000), 3);
  2103. SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = dtStatictis.Rows[0]["OFFLINE_QUANTITY"];
  2104. }
  2105. else
  2106. {
  2107. if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
  2108. {
  2109. dt_mt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMilPlan", new object[] { this.ultraGrid_Plan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString2(), actResultNo, proPlanId, gxPlanNo }, this.ob);
  2110. SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = dt_mt.Rows[0]["BRANCH"];
  2111. DataTable dtStatictis = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString(), actResultNo, proPlanId, gxPlanNo }, this.ob);
  2112. SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = dtStatictis.Rows[0]["WASTE_QUANTITY"];
  2113. SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = int.Parse(dt_mt.Rows[0]["BRANCH"].ToString3()) - int.Parse(dtStatictis.Rows[0]["WASTE_QUANTITY"].ToString3()) - int.Parse(dtStatictis.Rows[0]["OFFLINE_QUANTITY"].ToString3());
  2114. double[] db_chkargs = new double[4];
  2115. double db_args = 0;
  2116. double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(0, this.rollingInfomation1.Value.PipeSize.IndexOf('*') - 1), out db_args);//外径
  2117. db_chkargs[0] = db_args;
  2118. double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(this.rollingInfomation1.Value.PipeSize.IndexOf('*') + 1), out db_args);//壁厚
  2119. db_chkargs[1] = db_args;
  2120. double.TryParse(this.rollingInfomation1.Value.TargetLength, out db_args);//长度
  2121. db_chkargs[2] = db_args;
  2122. int i_ultraCheckEditor1 = 0;
  2123. //int.TryParse(ultraCheckEditor1.Text, out i_ultraCheckEditor1);
  2124. //db_chkargs[3] = i_ultraCheckEditor1;//系数
  2125. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = Math.Round(double.Parse(SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString()) * ((db_chkargs[0] - db_chkargs[1]) * db_chkargs[1] * 0.02466 * db_chkargs[2] / 1000), 3);
  2126. SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = dtStatictis.Rows[0]["OFFLINE_QUANTITY"];
  2127. }
  2128. else
  2129. {
  2130. SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = dt.Rows[0]["DIRECTOR_QUANTITY"].ToString();
  2131. SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = dt.Rows[0]["WASTE_QUANTITY"].ToString();
  2132. SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
  2133. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0]["QUALIFIED_TONS"].ToString();
  2134. SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
  2135. }
  2136. }
  2137. SurfaceDataSource.Rows[0]["REMARK"] = dt.Rows[0]["REMARK"];
  2138. //DataTable dtMIL_BASE_INSPECTOR = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_BASE_INSPECTOR", new object[] { }, this.ob);
  2139. //Infragistics.Win.UltraWinEditors.UltraComboEditor ultCbE = new UltraComboEditor();
  2140. //ultCbE.Visible = false;
  2141. //ultCbE.DataSource = dtMIL_BASE_INSPECTOR;
  2142. //ultCbE.DisplayMember = "INSPECTOR_NAME";
  2143. //ultCbE.ValueMember = "INSPECTOR_CODE";
  2144. //ultraGrid4.DisplayLayout.Bands[0].Columns["COL_USER"].EditorComponent = ultCbE;
  2145. //SurfaceDataSource.Rows[0]["COL_USER"] = dt.Rows[0]["COL_USER"];//设置绑定dt的下拉框
  2146. DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQuerySufaceD", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString().Substring(0,6) }, ob);//获取D1\D2最大最小值
  2147. if (dd.Rows.Count > 0)
  2148. {
  2149. SurfaceDataSource.Rows[0]["PIPE_DIAM_MAX"] = dd.Rows[0]["M1"].ToString();
  2150. SurfaceDataSource.Rows[0]["PIPE_DIAM_MIN"] = dd.Rows[0]["M2"].ToString();
  2151. }
  2152. else
  2153. {
  2154. SurfaceDataSource.Rows[0]["PIPE_DIAM_MAX"] = dt.Rows[0]["PIPE_DIAM_MAX"];
  2155. SurfaceDataSource.Rows[0]["PIPE_DIAM_MIN"] = dt.Rows[0]["PIPE_DIAM_MIN"];
  2156. }
  2157. DataTable smaxM = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQuerySufaceS", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString().Substring(0,6) }, ob);
  2158. SurfaceDataSource.Rows[0]["EXECUTIVE_PRODUCER"] = _UserName;
  2159. SurfaceDataSource.Rows[0]["UNEVEN_DEGREE"] = dt.Rows[0]["UNEVEN_DEGREE"];
  2160. SurfaceDataSource.Rows[0]["NON_ROUNDNESS"] = dt.Rows[0]["NON_ROUNDNESS"];
  2161. SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MAX"] = smaxM.Rows[0]["S1"];
  2162. SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MIN"] = smaxM.Rows[0]["S2"];
  2163. SurfaceDataSource.Rows[0]["HEAD_STRAIGHT"] = dt.Rows[0]["HEAD_STRAIGHT"];
  2164. SurfaceDataSource.Rows[0]["BODY_STRAIGHT"] = dt.Rows[0]["BODY_STRAIGHT"];
  2165. SurfaceDataSource.Rows[0]["LENGTH"] = dt.Rows[0]["LENGTH"];
  2166. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQuerySize", new object[] { BaseMethod.getJudgeStoveNo(dt.Rows[0]["JUDGE_STOVE_NO"].ToString()), proPlanId, gxPlanNo }, ob);
  2167. if (ds.Rows.Count > 0)
  2168. {
  2169. SurfaceDataSource.Rows[0]["QA_TYPE"] = "尺寸已抽检";
  2170. }
  2171. else
  2172. {
  2173. SurfaceDataSource.Rows[0]["QA_TYPE"] = "尺寸未抽检";
  2174. }
  2175. SurfaceDataSource.Rows[0]["WEIGHT"] = dt.Rows[0]["WEIGHT"];
  2176. SurfaceDataSource.Rows[0]["START_TIME"] = dt.Rows[0]["START_TIME"];
  2177. SurfaceDataSource.Rows[0]["END_TIME"] = dt.Rows[0]["END_TIME"];
  2178. //int num = 0;
  2179. //int.TryParse(dt.Rows[0]["SIMPLE_RATE"].ToString(), out num);
  2180. //numericUpDown1.Value = num;
  2181. //Nud_val = numericUpDown1.Value;
  2182. }
  2183. }
  2184. /// <summary>
  2185. /// 获取指定炉号的缺陷项
  2186. /// </summary>
  2187. private void getDefectData()
  2188. {
  2189. UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
  2190. if (ugr != null)
  2191. {
  2192. string jugeNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2193. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getDefectData", new object[] { jugeNo }, this.ob);
  2194. dtDefectS.Clear();
  2195. GridHelper.CopyDataToDatatable(ref ds, ref dtDefectS, true);
  2196. }
  2197. }
  2198. /// <summary>
  2199. /// 查询上料管号队列
  2200. /// </summary>
  2201. public void GetFeedRack()
  2202. {
  2203. UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
  2204. if (ugr != null)
  2205. {
  2206. string OffFlag = "0";
  2207. string JudgeStoveNo = "";
  2208. JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2209. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getSurfaceRackSeq", new object[] { JudgeStoveNo, "1" }, this.ob);
  2210. DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getSurfaceRackSeq", new object[] { JudgeStoveNo, "2" }, this.ob);
  2211. dtMatSeq_3.Clear();
  2212. dtMatSeqS.Clear();
  2213. GridHelper.CopyDataToDatatable(ref dt1, ref dtMatSeq_3, true);
  2214. GridHelper.CopyDataToDatatable(ref dt2, ref dtMatSeqS, true);
  2215. }
  2216. ChangeGridColor();
  2217. }
  2218. #endregion
  2219. #region 报表
  2220. /// <summary>
  2221. /// 打印报表
  2222. /// </summary>
  2223. private void PrintResult()
  2224. {
  2225. Group = UserInfo.GetUserGroup();
  2226. Shift = UserInfo.GetUserOrder();
  2227. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  2228. string Time = SeverTime.ToLongTimeString();
  2229. string StartTime = ""; // 开始时间 用于报表查询
  2230. string EndTime = ""; // 结束时间 用于报表查询
  2231. string strurl = "";
  2232. switch (PlineCode)
  2233. {
  2234. case "C008": //250
  2235. break;
  2236. case "C072": //508
  2237. break;
  2238. case "C009": //258
  2239. //晚班
  2240. Time = Time.Replace(":", "");
  2241. if (Shift == "3")
  2242. {
  2243. //查询晚班前一天20点40后到当天07点20前所有记录
  2244. if (int.Parse(Time) < 072000)
  2245. {
  2246. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
  2247. EndTime = SeverTime.ToShortDateString() + " 07:20:00";
  2248. //string Date2 = SeverTime.ToString("yyyy-MM-dd");
  2249. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2250. }
  2251. //查询当天晚班的所有数据
  2252. else if (int.Parse(Time) > 204000)
  2253. {
  2254. StartTime = SeverTime.ToShortDateString() + " 20:40:00";
  2255. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
  2256. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2257. }
  2258. }
  2259. //白班 中班
  2260. else
  2261. {
  2262. StartTime = SeverTime.ToShortDateString() + " 00:00:00";
  2263. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2264. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2265. }
  2266. //Time = Time.Replace(":", "");
  2267. //if (int.Parse(Time) < 070000)
  2268. //{
  2269. // StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  2270. // EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  2271. // string Date2 = SeverTime.ToString("yyyy-MM-dd");
  2272. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2273. //}
  2274. //else
  2275. //{
  2276. // StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  2277. // EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  2278. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2279. //}
  2280. break;
  2281. case "C010": //168
  2282. break;
  2283. case "C012": //Arssel
  2284. break;
  2285. case "C017": //460
  2286. //晚班
  2287. Time = Time.Replace(":", "");
  2288. if (Shift == "3")
  2289. {
  2290. //查询晚班前一天20点40后到当天07点20前所有记录
  2291. if (int.Parse(Time) < 072000)
  2292. {
  2293. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
  2294. EndTime = SeverTime.ToShortDateString() + " 07:20:00";
  2295. //string Date2 = SeverTime.ToString("yyyy-MM-dd");
  2296. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2297. }
  2298. //查询当天晚班的所有数据
  2299. else if (int.Parse(Time) > 204000)
  2300. {
  2301. StartTime = SeverTime.ToShortDateString() + " 20:40:00";
  2302. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
  2303. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2304. }
  2305. }
  2306. //白班 中班
  2307. else
  2308. {
  2309. StartTime = SeverTime.ToShortDateString() + " 00:00:00";
  2310. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2311. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2312. }
  2313. break;
  2314. }
  2315. FrmRepExcel fre = new FrmRepExcel(ob, strurl);
  2316. fre.AutoSize = true;
  2317. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  2318. fre.WindowState = FormWindowState.Maximized;
  2319. fre.Show();
  2320. }
  2321. /// <summary>
  2322. /// 查询上个班原始记录
  2323. /// </summary>
  2324. private void QueryBefore()
  2325. {
  2326. HOTMethod hm = new HOTMethod(this.ob);
  2327. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  2328. string Time = SeverTime.ToLongTimeString();
  2329. string Date = SeverTime.ToString("yyyyMMdd");
  2330. string StartTime = ""; // 开始时间 用于报表查询
  2331. string EndTime = ""; // 结束时间 用于报表查询
  2332. string StartTimeU = ""; // 开始时间 用于得到上班UserID
  2333. string EndTimeU = ""; // 结束时间 用于得到上班UserID
  2334. string strurl = "";
  2335. string ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date, PlineCode);
  2336. //if (PlineCode.Equals("C072"))
  2337. //{
  2338. // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date);
  2339. //}
  2340. //else
  2341. //{
  2342. // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group);
  2343. //}
  2344. string UserIDBefore = "";
  2345. switch (PlineCode)
  2346. {
  2347. case "C008": //250
  2348. break;
  2349. case "C072": //508
  2350. break;
  2351. case "C009": //258
  2352. //晚班
  2353. Time = Time.Replace(":", "");
  2354. if (Shift == "3")
  2355. {
  2356. //查询晚班前一天20点40后到当天07点20前所有记录
  2357. if (int.Parse(Time) < 072000)
  2358. {
  2359. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
  2360. EndTime = SeverTime.ToShortDateString() + " 07:20:00";
  2361. StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00";
  2362. EndTimeU = SeverTime.ToShortDateString() + " 00:00:00";
  2363. UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
  2364. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
  2365. }
  2366. //查询当天晚班的所有数据
  2367. else if (int.Parse(Time) > 204000)
  2368. {
  2369. StartTime = SeverTime.ToShortDateString() + " 20:40:00";
  2370. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
  2371. StartTimeU = SeverTime.ToShortDateString() + " 13:40:00";
  2372. EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2373. UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
  2374. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
  2375. }
  2376. }
  2377. //白班 中班
  2378. else
  2379. {
  2380. StartTime = SeverTime.ToShortDateString() + " 00:00:00";
  2381. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2382. StartTimeU = SeverTime.ToShortDateString() + " 00:00:00";
  2383. EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2384. UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
  2385. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
  2386. }
  2387. //Time = Time.Replace(":", "");
  2388. //if (int.Parse(Time) < 072000)
  2389. //{
  2390. // StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 06:40:00";
  2391. // EndTime = SeverTime.ToShortDateString() + " 07:20:00";
  2392. // string Date2 = SeverTime.ToString("yyyy-MM-dd");
  2393. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2394. //}
  2395. //else
  2396. //{
  2397. // StartTime = SeverTime.ToShortDateString() + " 06:40:00";
  2398. // EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
  2399. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  2400. //}
  2401. break;
  2402. case "C010": //168
  2403. break;
  2404. case "C012": //Arssel
  2405. break;
  2406. case "C017": //460
  2407. //晚班
  2408. Time = Time.Replace(":", "");
  2409. if (Shift == "3")
  2410. {
  2411. //查询晚班前一天20点40后到当天07点20前所有记录
  2412. if (int.Parse(Time) < 072000)
  2413. {
  2414. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
  2415. EndTime = SeverTime.ToShortDateString() + " 07:20:00";
  2416. StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00";
  2417. EndTimeU = SeverTime.ToShortDateString() + " 00:00:00";
  2418. UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
  2419. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
  2420. }
  2421. //查询当天晚班的所有数据
  2422. else if (int.Parse(Time) > 204000)
  2423. {
  2424. StartTime = SeverTime.ToShortDateString() + " 20:40:00";
  2425. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
  2426. StartTimeU = SeverTime.ToShortDateString() + " 13:40:00";
  2427. EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2428. UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
  2429. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
  2430. }
  2431. }
  2432. //白班 中班
  2433. else
  2434. {
  2435. StartTime = SeverTime.ToShortDateString() + " 00:00:00";
  2436. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2437. StartTimeU = SeverTime.ToShortDateString() + " 00:00:00";
  2438. EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2439. UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
  2440. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilSizingResult460.cpt&SHIFT=" + ShitGroupBefore.Substring(0, 1) + "&GROUP=" + ShitGroupBefore.Substring(1, 1) + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + UserIDBefore;
  2441. }
  2442. break;
  2443. }
  2444. FrmRepExcel fre = new FrmRepExcel(ob, strurl);
  2445. fre.AutoSize = true;
  2446. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  2447. fre.WindowState = FormWindowState.Maximized;
  2448. fre.Show();
  2449. }
  2450. private void u_ChkEditor_ProNo_CheckedChanged(object sender, EventArgs e)
  2451. {
  2452. u_TxtEditor_ProNo.Enabled = this.u_ChkEditor_ProNo.Checked;
  2453. }
  2454. private void u_ChkEditor_StoveNo_CheckedChanged(object sender, EventArgs e)
  2455. {
  2456. u_TxtEditor_StrvoNo.Enabled = this.u_ChkEditor_StoveNo.Checked;
  2457. }
  2458. private void chkStatusQuery_CheckedChanged(object sender, EventArgs e)
  2459. {
  2460. if (this.chkHeatNo.Checked)
  2461. {
  2462. this.txtJudgeStoveNo.Enabled = true;
  2463. }
  2464. else
  2465. {
  2466. this.txtJudgeStoveNo.Enabled = false;
  2467. }
  2468. if (chkStatusQuery.Checked)
  2469. {
  2470. PlanStatusQuery = "99";
  2471. PlanStartStatusQuery = "96";
  2472. }
  2473. else
  2474. {
  2475. PlanStatusQuery = "95";
  2476. PlanStartStatusQuery = "00";
  2477. }
  2478. }
  2479. private int ChangeFlag = 0; //交班结炉提示 0弹出 1不弹出
  2480. private void ultraGridMatSeq_ClickCellButton(object sender, CellEventArgs e)
  2481. {
  2482. UltraGridRow ugr = this.ultraGridMatSeq.ActiveRow;
  2483. UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
  2484. if (uRow == null) return;
  2485. HOTMethod hm = new HOTMethod(this.ob);
  2486. NativeMethodNew na = new NativeMethodNew(this.ob);
  2487. string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  2488. int Seq = int.Parse(ugr.Cells["SEQ"].Value.ToString());
  2489. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2490. string ResultNo = uRow.Cells["ID"].Value.ToString();
  2491. string shif = ugr.Cells["COL_SHIFT"].Value.ToString2();
  2492. string group = ugr.Cells["COL_GROUP"].Value.ToString2();
  2493. if (uRow.Cells["IS_START"].Text.Trim() == "已完成质检")
  2494. {
  2495. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成质检操作,不允许进行交班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2496. return;
  2497. }
  2498. //交班
  2499. if (e.Cell.Column.Key == "CHANGE_GROUP")
  2500. {
  2501. string Shift = UserInfo.GetUserOrder();
  2502. string Group = UserInfo.GetUserGroup();
  2503. string User = UserInfo.GetUserName();
  2504. int BeforeChangeNum = 0;
  2505. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessNum", new object[] { ResultNo, JudgeStoveNo }, ob);
  2506. if (Seq > int.Parse(ds.Rows[0][0].ToString()))
  2507. {
  2508. MessageUtil.ShowTips("该序号支数在前工序已被剔除,不允许进行交接班!");
  2509. return;
  2510. }
  2511. //查询上个班交班支数
  2512. DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 9, plinCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
  2513. if (dtChangeNum.Rows.Count > 0)
  2514. {
  2515. if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
  2516. {
  2517. BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
  2518. }
  2519. }
  2520. int Seq2 = Seq;
  2521. if (Seq2 <= BeforeChangeNum)
  2522. {
  2523. MessageBox.Show("前道班次已交班,该支不能再次交班。");
  2524. return;
  2525. }
  2526. hm.UpdateChangeFlag(JudgeStoveNo, ResultNo, "", 9, Seq, 0);
  2527. }
  2528. //接班
  2529. if (e.Cell.Column.Key == "TAKE_OVER")
  2530. {
  2531. string Shift = UserInfo.GetUserOrder();
  2532. string Group = UserInfo.GetUserGroup();
  2533. string User = UserInfo.GetUserName();
  2534. int BeforeChangeNum = 0;
  2535. //查询上个班交班支数
  2536. DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 9, plinCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
  2537. if (dtChangeNum.Rows.Count > 0)
  2538. {
  2539. if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
  2540. {
  2541. BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
  2542. }
  2543. }
  2544. int WaitChangeSeq = hm.GetWaitChangeSeq(JudgeStoveNo, ResultNo, "", 9, 0, proPlanId, gxPlanNo);
  2545. if (WaitChangeSeq == 0)
  2546. {
  2547. MessageBox.Show("没有待交班确认的管号。");
  2548. return;
  2549. }
  2550. if (WaitChangeSeq != Seq)
  2551. {
  2552. MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
  2553. return;
  2554. }
  2555. if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
  2556. {
  2557. return;
  2558. }
  2559. //查询是否有该班接班记录
  2560. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  2561. string Time = SeverTime.ToLongTimeString();
  2562. string StartTime = SeverTime.ToShortDateString() + " 00:00:00";
  2563. string EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
  2564. if (this.DoRelogin(DoCheck))
  2565. {
  2566. //插入接班确认履历表
  2567. hm.InsertChangeRemuse(Shift, Group, _UserName, "9", plinCode);
  2568. int Seq2 = Seq;
  2569. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.changeNum", new object[] { JudgeStoveNo, ResultNo, Seq2, BeforeChangeNum, 0, plinCode, Shift, Group, _UserName, 9, 0, proPlanId, gxPlanNo }, this.ob);
  2570. ChangeFlag = 1;
  2571. }
  2572. }
  2573. if (ultraGrid_Plan.Rows == null)
  2574. {
  2575. return;
  2576. }
  2577. GetFeedRack();
  2578. ChangeGridColor();
  2579. }
  2580. public string DoCheck(CoreUserInfo User)
  2581. {
  2582. return "";
  2583. }
  2584. private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  2585. {
  2586. this.ultraGrid4.UpdateData();
  2587. UltraGridRow uRow = this.ultraGrid4.ActiveRow;
  2588. DataTable dt = new DataTable();
  2589. if (e.Cell.Column.Key == "DIRECTOR_QUANTITY")
  2590. {
  2591. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryNodeS", new object[] { this.ultraGrid_Plan.ActiveRow.Cells["ID"].Value.ToString(), PlineCode }, ob);
  2592. if (ds.Rows.Count > 0)
  2593. {
  2594. if (ds.Rows[0]["NODE_FUR_FLAG"].ToString() == "0")
  2595. {
  2596. SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = (int.Parse(uRow.Cells["DIRECTOR_QUANTITY"].Value.ToString3()) - int.Parse(uRow.Cells["OFFLINE_QUANTITY"].Value.ToString3()) - int.Parse(uRow.Cells["WASTE_QUANTITY"].Value.ToString3())).ToString();
  2597. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryPortWgt", new object[] { this.ultraGrid_Plan.ActiveRow.Cells["ID"].Value.ToString(), SurfaceDataSource.Rows[0]["QUALIFIED_num"].ToString(), proPlanId, gxPlanNo }, ob);
  2598. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0][0].ToString();
  2599. }
  2600. }
  2601. else
  2602. {
  2603. SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = (int.Parse(uRow.Cells["DIRECTOR_QUANTITY"].Value.ToString3()) - int.Parse(uRow.Cells["OFFLINE_QUANTITY"].Value.ToString3()) - int.Parse(uRow.Cells["WASTE_QUANTITY"].Value.ToString3())).ToString();
  2604. //uRow.Cells["QUALIFIED_BRANCH"].Value = "1";
  2605. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryPortWgt", new object[] { this.ultraGrid_Plan.ActiveRow.Cells["ID"].Value.ToString(), SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString(), proPlanId, gxPlanNo }, ob);
  2606. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0][0].ToString();
  2607. }
  2608. }
  2609. if (e.Cell.Column.Key == "WASTE_QUANTITY" || e.Cell.Column.Key == "OFFLINE_QUANTITY")
  2610. {
  2611. if (uRow.Cells["DIRECTOR_QUANTITY"].Value.ToString3() == "0")
  2612. {
  2613. SurfaceDataSource.Rows[0]["QUALIFIED_num"] = "0";
  2614. SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = "0";
  2615. }
  2616. }
  2617. }
  2618. }
  2619. #endregion
  2620. }