| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Server;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win.UltraWinEditors;
- using Core.Mes.Client.Comm.Format;
- using System.Collections;
- using Core.StlMes.Client.ZGMil.Entity;
- using Core.StlMes.Client.ZGMil.Popup;
- using Core.StlMes.Client.ZGMil.Common;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using CoreFS.SA06;
- using Core.StlMes.Client.ZGMil.NodeResultQuery;
- using System.Net;
- namespace Core.StlMes.Client.ZGMil.Result
- {
- public partial class FrmSurfaceInspectionResult : FrmBase
- {
- //TODO:...内容...
- private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
- private bool bl_Upddefect_chk = false;//是否修改之前的抽检项
- private bool bl_Upddefect_UpDown = false;//是否修改之前的抽检率
- private decimal Nud_val = 0;
- string _ScrapNum = "";
- string _OffLineNum = "";
- string _LotNo = "";
- double _MatHeight = 0;
- string Shift = "";
- string Group = "";
- private string Departm = "";//部门
- private string PlineCode = "";//产线
- private int Qa_Flag = 0; //抽检类型 一次抽检 二次抽检
- private string actJudgeStoveNo = "";
- private string proPlanId = null;//轧管订单编号
- private string gxPlanNo = null;//工序排产序号
- private string lotNo = null;//生产批号
- private string actResultNo = "";
- private string TestMethod = "";
- string PlanStatusQuery = "95";
- string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
- private string _UserName = ""; //签名 姓名
- private string _UserID = ""; //签名 签名ID
- public Infragistics.Win.UltraWinGrid.UltraGrid Grid
- {
- get { return _grid; }
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- //ultraGrid1.DisplayLayout.Bands[0].Columns["JUDGE_STOVE_NO"].SortIndicator = SortIndicator.Disabled;
- ultraGrid_Plan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGridMatSeq.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- //ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- //ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- ultraGrid3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
- //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);//自适应列宽
- //ultraGridMatSeq.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- //ultraGrid1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- //e.Layout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.Vertical;
- //e.Layout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.Select;
- Shift = UserInfo.GetUserOrder();
- Group = UserInfo.GetUserGroup();
- }
- /// <summary>
- /// 判断是否能开始当前炉次
- /// </summary>
- /// <returns></returns>
- private void IsStart()
- {
- foreach (UltraGridRow ugr in ultraGridPlan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "已开始质检")
- {
- MessageBox.Show("炉号【" + ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】正在质检,不能两炉同时开始质检");
- return;
- }
- }
- }
- /// <summary>
- /// 页面开启事件
- /// </summary>
- /// <param name="e"></param>
- protected override void OnShown(EventArgs e)
- {
- base.OnShown(e);
- //string hostname = Dns.GetHostName();
- //IPAddress ip = Dns.GetHostByName(hostname).AddressList[0];
- NativeMethodNew na = new NativeMethodNew(this.ob);
- //TestMethod = na.GetOperateResult(ip.ToString(), "1");
- //if (TestMethod == "无匹配数据")
- //{
- // MessageBox.Show("提示:该电脑不是探伤操作台电脑,不允许操作改界面", "提示", MessageBoxButtons.OK);
- // this.Dispose();
- // this.Close();
- //}
- Departm = UserInfo.GetDepartment();
- PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
- SurfaceQuery();
- foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
- {
- ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
- }
- Departm = UserInfo.GetDepartment();
- PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
- if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
- {
- this.rollingCard1.ChangCard();
- }
- Sign();
- ShowShift();
- }
- private void ShowShift()
- {
- colShowShiftGroup1.Ob = this.ob;
- colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
- colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
- colShowShiftGroup1.ShowShift();
- colShowShiftGroup1.Timer1.Enabled = true;
- }
- /// <summary>
- /// 签名
- /// </summary>
- private void Sign()
- {
- ColUserName col = new ColUserName();
- col.StationId = "9";
- col.PlineCode = PlineCode;
- col.ColGroup = Group;
- col.Ob = this.ob;
- col.ShowDialog();
- _UserID = col.getUserId();
- _UserName = col.getUserName();
- }
- /// <summary>
- /// 控件加载构造函数
- /// </summary>
- public FrmSurfaceInspectionResult()
- {
- InitializeComponent();
- GridHelper.InitCardGrid(SurfaceDataSource, ultraGrid4);//显示人工质检主信息界面
- _grid = this.ultraGrid4;
- }
- /// <summary>
- /// checkbox点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void chk_CheckedChanged(object sender, EventArgs e)
- {
- u_TxtEditor_ProNo.Enabled = u_ChkEditor_ProNo.Checked;//生产批号查询
- u_TxtEditor_StrvoNo.Enabled = u_ChkEditor_StoveNo.Checked;//炉号查询
- }
- /// <summary>
- /// ToolBar按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- SurfaceQuery();
- break;
- case "Save":
- SurfaceSave();
- break;
- case "Node":
- FeedSawResultNode();
- break;
- case "DoNodeBack":
- NodeBack();
- break;
- case "NodeQuery":
- NodeQuery();
- break;
- case "geeDefect":
- Popup.frmDefectManage frmdm = new Core.StlMes.Client.ZGMil.Popup.frmDefectManage(this.ob);
- frmdm.ShowDialog();
- break;
- case "InSpectorMana":
- Popup.frmInspector frmdm1 = new Core.StlMes.Client.ZGMil.Popup.frmInspector(this.ob);
- frmdm1.ShowDialog();
- break;
- case "DoSizeCheck":
- DoSizeCheck();
- break;
- case "DoStart":
- DoStart();
- break;
- case "DoStartBack":
- DoStartBack();
- break;
- case "DoCheck":
- DoCheck();
- break;
- case "DoCheckS":
- //DoCheck(2);
- break;
- case "DoCheckSCancel":
- DoCheckSCancel();
- break;
- case "DoPrint":
- doPrint();
- break;
- case "DoPrint1":
- doPrint1();
- break;
- case "DoPrintTest":
- doPrintTest();
- break;
- case "UpFile":
- UpFile();
- break;
- case "UpFileAgain":
- UpFileAgain();
- break;
- case "DoChangeCancel":
- DoChangeCancel();
- break;
- case "sign":
- Sign();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询上传的PDF文件
- /// </summary>
- private void SelectFile(string filePathNew)
- {
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew);
- down.DeleteButton.Visible = false;
- down.ShowDialog();
- }
- /// <summary>
- /// 上传跟队表检报告
- /// </summary>
- private void UpFileAgain()
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string date = DateTime.Now.ToString("yyyyMMdd");
- string judge = BaseMethod.getJudgeStoveNo(this.actJudgeStoveNo);
- string heatno = this.actJudgeStoveNo;
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string url = "";
- string filePathNew = ""; //探伤报告目录
- string reportNo = ""; //报告编号
- DataTable dt = new DataTable();
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo2", new object[] { judge, PlineCode, Shift, Group,"1" }, this.ob);
- if (dt.Rows.Count > 0)
- {
- reportNo = dt.Rows[0][0].ToString();
- }
- //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
-
- switch (PlineCode)
- {
- case "C008": //250
- 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;
- filePathNew = "SurReport/250/" + judge + "/";
- break;
- case "C009": //258
- 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;
- filePathNew = "SurReport/258/" + judge + "/";
- break;
- case "C010": //168
- 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;
- filePathNew = "SurReport/168/" + judge + "/";
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- 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;
- filePathNew = "SurReport/460/" + judge + "/";
- break;
- case "C072": //508
- 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;
- filePathNew = "SurReport/508/" + judge + "/";
- break;
- }
- byte[] pdf = webClient.DownloadData(url);
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(reportNo + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- bool a = FileHelper.Upload(listPdf);
- if (a)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
- ccp.MethodName = "updateSurfaceReport";
- ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, "1", proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("上传成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- SelectFile(filePathNew + reportNo + ".pdf");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- else
- {
- MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
- return;
- }
- }
- /// <summary>
- /// 上传表检报告
- /// </summary>
- private void UpFile()
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string date = DateTime.Now.ToString("yyyyMMdd");
- string judge = BaseMethod.getJudgeStoveNo(this.actJudgeStoveNo);
- string heatno = this.actJudgeStoveNo;
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string url = "";
- string filePathNew = ""; //探伤报告目录
- string reportNo = ""; //报告编号
- DataTable dt = new DataTable();
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo2", new object[] { judge, PlineCode, Shift, Group ,"0"}, this.ob);
- if (dt.Rows.Count > 0)
- {
- reportNo = dt.Rows[0][0].ToString();
- }
- //craftOrdDesign.CraftPath = filePathNew + craftOrdDesign.CraftNo + ".pdf";
-
- switch (PlineCode)
- {
- case "C008": //250
- 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;
- filePathNew = "SurReport/250/" + judge + "/";
- break;
- case "C009": //258
- 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;
- filePathNew = "SurReport/258/" + judge + "/";
- break;
- case "C010": //168
- 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;
- filePathNew = "SurReport/168/" + judge + "/";
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- 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;
- filePathNew = "SurReport/460/" + judge + "/";
- break;
- case "C072": //508
- 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;
- filePathNew = "SurReport/508/" + judge + "/";
- break;
- }
- byte[] pdf = webClient.DownloadData(url);
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(reportNo + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- bool a = FileHelper.Upload(listPdf);
- if (a)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
- ccp.MethodName = "updateSurfaceReport";
- ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, "0", proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("上传成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- SelectFile(filePathNew + reportNo + ".pdf");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- else
- {
- MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
- return;
- }
- }
- /// <summary>
- /// 自动上传报告
- /// </summary>
- private void AutoUpFile()
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string date = DateTime.Now.ToString("yyyyMMdd");
- string judge = BaseMethod.getJudgeStoveNo(this.actJudgeStoveNo);
- string heatno = this.actJudgeStoveNo;
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string url = "";
- string filePathNew = ""; //探伤报告目录
- string reportNo = ""; //报告编号
- int num = 0;
- DataTable dt = new DataTable();
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FileUpdate.getReportNo2", new object[] { judge, PlineCode, Shift, Group, "0" }, this.ob);
- if (dt.Rows.Count > 0)
- {
- reportNo = dt.Rows[0][0].ToString();
- }
- DataTable dt2 = new DataTable();
- dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getIsAgain", new object[] { judge, PlineCode }, this.ob);
- if (dt2.Rows.Count > 0)
- {
- num = int.Parse(dt2.Rows[0][0].ToString3());
- }
- switch (PlineCode)
- {
- case "C008": //250
- 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;
- filePathNew = "SurReport/250/" + judge + "/";
- break;
- case "C009": //258
- 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;
- filePathNew = "SurReport/258/" + judge + "/";
- break;
- case "C010": //168
- 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;
- filePathNew = "SurReport/168/" + judge + "/";
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- 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;
- filePathNew = "SurReport/460/" + judge + "/";
- break;
- case "C072": //508
- if (num > 1)
- {
- 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;
- }
- else
- {
- 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;
- }
- filePathNew = "SurReport/508/" + judge + "/";
- break;
- }
- byte[] pdf = webClient.DownloadData(url);
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(reportNo + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- bool a = FileHelper.Upload(listPdf);
- if (a)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FileUpdate";
- ccp.MethodName = "updateSurfaceReport";
- ccp.ServerParams = new object[] { judge, Shift, Group, PlineCode, _UserName, filePathNew, "0", proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("上传成功!"))
- {
-
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- else
- {
- MessageUtil.ShowError("系统生成PDF失败,请手动上传报告!");
- return;
- }
- }
- private String doQueryJugeNoStaus(string resultNo, string jugeNo, string plineCode)
- {
- string staus = "3";
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryResultStaus", new object[] { resultNo, jugeNo, plineCode, "8", proPlanId, gxPlanNo }, ob);
- if (ds.Rows.Count > 0)
- {
- staus = ds.Rows[0]["NODE_FUR_FLAG"].ToString();
- }
- return staus;
- }
- /// <summary>
- /// 取消交班
- /// </summary>
- public void DoChangeCancel()
- {
- UltraGridRow ugr_plan = this.ultraGrid_Plan.ActiveRow;
- if (ugr_plan == null) return;
- string Status = ugr_plan.Cells["IS_START"].Value.ToString();
- string ActiveJUDGE_STOVE_NO = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ActiveResultNo = ugr_plan.Cells["ID"].Value.ToString();
- if (Status == "已完成质检")
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成质检操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- if (Status == "未开始质检")
- {
- MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始质检操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- na.ChangeShiftBack(ActiveJUDGE_STOVE_NO, ActiveResultNo, proPlanId, gxPlanNo, PlineCode, Shift, Group, 9);
- SurfaceQuery();
- ChangeGridColor();
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void doPrint()
- {
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
- string jugeNo =uRow.Cells["JUDGE_NO"].Value.ToString()+"-01";
- if (uRow == null) return;
- string strurl = "";
- switch (PlineCode)
- {
- case "C008": //250
- 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;
- break;
- case "C009": //258
- 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;
- break;
- case "C010": //168
- 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;
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- 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;
- break;
- case "C072": //508
- 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;
- break;
- }
- FrmExcel fre = new FrmExcel(this.ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void doPrint1()
- {
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
- if (uRow == null) return;
- string strurl = "";
- switch (PlineCode)
- {
- case "C008": //250
- 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;
- break;
- case "C009": //258
- 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;
- break;
- case "C010": //168
- 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;
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- 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;
- break;
- case "C072": //508
- 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;
- break;
- }
- FrmExcel fre = new FrmExcel(this.ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 检验要点
- /// </summary>
- private void doPrintTest()
- {
- UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
- if (uRow == null) return;
- 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();
- FrmExcel fre = new FrmExcel(this.ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
-
- /// <summary>
- /// 查询按钮
- /// </summary>
- public void SurfaceQuery()
- {
- string str_Pro_NO = "";//轧制批号
- string str_STOVE_NO = "";//炉号
- milplan_ReFresh(_LotNo, actJudgeStoveNo);
- }
- /// <summary>
- /// 人工质检信息保存
- /// </summary>
- public void SurfaceSave()
- {
- MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();
- UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
- if (ugr_acr == null)
- {
- return;
- }
- string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
- string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
- string resultNo = ugr_acr.Cells["ID"].Value.ToString();
- //string IsStart = ugr_acr.Cells["IS_START"].Value.ToString();
- string IsStart = doQueryJugeNoStaus(resultNo, str_STOVE_NO,PlineCode);
- if (IsStart == "3")
- {
- MessageBox.Show("还未开始质检或者质检已完成,不能保存信息!");
- return;
- }
- ultraGrid4.UpdateData();
- En_Mil_Sur.RollLotNo = str_Pro_NO;
- En_Mil_Sur.HeatNo = str_STOVE_NO;
- En_Mil_Sur.Remark = SurfaceDataSource.Rows[0]["REMARK"].ToString();
- En_Mil_Sur.DirectorQuantity = SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"].ToString();
- En_Mil_Sur.QualifiedTons = SurfaceDataSource.Rows[0]["QUALIFIED_TONS"].ToString();
- En_Mil_Sur.WasteQuantity = SurfaceDataSource.Rows[0]["WASTE_QUANTITY"].ToString();
- En_Mil_Sur.OfflineQuantity = SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"].ToString();
- En_Mil_Sur.ExecutiveProducer = SurfaceDataSource.Rows[0]["EXECUTIVE_PRODUCER"].ToString();
- En_Mil_Sur.UnevenDegree = SurfaceDataSource.Rows[0]["UNEVEN_DEGREE"].ToString();
- En_Mil_Sur.NonRoundness = SurfaceDataSource.Rows[0]["NON_ROUNDNESS"].ToString();
- En_Mil_Sur.PipeDiamMax = SurfaceDataSource.Rows[0]["PIPE_DIAM_MAX"].ToString();
- En_Mil_Sur.PipeDiamMin = SurfaceDataSource.Rows[0]["PIPE_DIAM_MIN"].ToString();
- En_Mil_Sur.PipeThicknessMax = SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MAX"].ToString();
- En_Mil_Sur.PipeThicknessMin = SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MIN"].ToString();
- En_Mil_Sur.HeadStraight = SurfaceDataSource.Rows[0]["HEAD_STRAIGHT"].ToString();
- En_Mil_Sur.BodyStraight = SurfaceDataSource.Rows[0]["BODY_STRAIGHT"].ToString();
- En_Mil_Sur.Length = SurfaceDataSource.Rows[0]["LENGTH"].ToString();
- En_Mil_Sur.QualifiedBranch = SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString();
- En_Mil_Sur.Weight = SurfaceDataSource.Rows[0]["WEIGHT"].ToString();
- En_Mil_Sur.ProPlanId = proPlanId;
- En_Mil_Sur.GxPlanNo = gxPlanNo;
- int num = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.Save_SurFace", new object[] { En_Mil_Sur }, this.ob);
- if (num > 0)
- {
- MessageBox.Show("保存成功!");
- milplan_ReFresh(str_Pro_NO, str_STOVE_NO);
- }
- }
- /// <summary>
- /// 结炉操作
- /// </summary>
- public void FeedSawResultNode()
- {
- UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
- if (ugr_acr == null)
- {
- return;
- }
- string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
- string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
- string resultNo = ugr_acr.Cells["ID"].Value.ToString();
- string target = ugr_acr.Cells["TARGET"].Value.ToString();//去向
- string orderPk = ugr_acr.Cells["ORD_LN_DLY_PK"].Value.ToString();
- Core.StlMes.Client.ZGMil.Entity.NativeMethodNew NaMethod = new Core.StlMes.Client.ZGMil.Entity.NativeMethodNew(this.ob);
- if (!NaMethod.isBegineNode(str_STOVE_NO, 11))
- {
- MessageBox.Show("炉号【" + str_STOVE_NO + "】未开始质检,不能结炉!!!");
- return;
- }
- string IsStart = doQueryJugeNoStaus(resultNo, str_STOVE_NO, PlineCode);
- if (IsStart == "1")
- {
- MessageBox.Show("质检已完成,不能进行结炉!");
- return;
- }
- SurfaceSave();
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getTestingResult", new object[] { str_Pro_NO, str_STOVE_NO, proPlanId, gxPlanNo }, ob);
- DataTable dsurface = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getSurfaceResult", new object[] { str_Pro_NO, str_STOVE_NO, proPlanId, gxPlanNo }, ob);
- 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);
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
- {
- if (!dsurface.Rows[0]["SURFACENUM"].ToString().Equals(dsMilPlan.Rows[0]["BRANCH"].ToString()))
- {
- MessageUtil.ShowTips("表检实绩支数与返线计划支数不一致,不允许结炉!");
- return;
- }
- }
- else
- {
- if (ds.Rows.Count > 0)
- {
- if (ds.Rows[0]["NODE_FUR_FLAG"].ToString() == "0")
- {
- MessageUtil.ShowTips("探伤未结炉,质检不允许结炉!");
- return;
- }
- if (!ds.Rows[0]["QUALIFIED_NUM"].ToString().Equals(dsurface.Rows[0]["SURFACENUM"].ToString()))
- {
- MessageUtil.ShowTips("探伤合格支数与表检支数不一致,不允许结炉!");
- return;
- }
- }
- else
- {
- MessageUtil.ShowTips("无探伤实绩,不允许结炉!");
- return;
- }
- }
- //if (!isStartSurface(str_Pro_NO, str_STOVE_NO))
- //{
- // MessageBox.Show("还没开始质检,不能结炉!");
- // return;
- //}
- //else
- //{
- // }
- //查询是否完成抽检 是否完成尺寸检验
- //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { actJudgeStoveNo, actResultNo }, this.ob);
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQuerySize", new object[] { BaseMethod.getJudgeStoveNo(actJudgeStoveNo), proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- //string SizeCheck = dt.Rows[0]["SIZE_CHECK"].ToString();
- ////string DefectCheck = dt.Rows[0]["DEFECT_CHECK"].ToString();
- //int OfflineNum = int.Parse(dt.Rows[0]["OFFLINE_QUANTITY"].ToString());
- //if (SizeCheck == "0")
- //{
- // MessageBox.Show("未完成几何尺寸抽检,不能结炉。");
- // return;
- //}
- ////if (SizeCheck == "0")
- ////{
- //// MessageBox.Show("未完成缺陷项抽检,不能结炉。");
- //// return;
- ////}
- ////if (OfflineNum > 0)
- ////{
- //// if (MessageUtil.ShowYesNoAndQuestion("炉号【" + str_STOVE_NO + "】存在【" + OfflineNum + "】支下线管,是否需要生成二次委托") == DialogResult.No)
- //// {
- //// return;
- //// }
- //// //生成二次委托
- ////}
- }
- else
- {
- MessageUtil.ShowTips("未完成尺寸抽检,不允许结炉!");
- return;
- }
-
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + str_STOVE_NO + "】结炉?") == DialogResult.No)
- {
- return;
- }
- MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();//质检实体
- MilPlan milplanEntity = new MilPlan();
- En_Mil_Sur.RollLotNo = str_Pro_NO;
- En_Mil_Sur.HeatNo = str_STOVE_NO;
- En_Mil_Sur.NodeFlag = "1";
- En_Mil_Sur.ColUser = _UserName;
- En_Mil_Sur.ColGroup = UserInfo.GetUserGroup();
- En_Mil_Sur.ColShift = UserInfo.GetUserOrder();
- En_Mil_Sur.QualifiedBranch = SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString();
- En_Mil_Sur.ResultNo = resultNo;
- En_Mil_Sur.UserId = _UserID;
- En_Mil_Sur.ProPlanId = proPlanId;
- En_Mil_Sur.GxPlanNo = gxPlanNo;
- //En_Mil_Sur.Status = "96";//修改mil_plan的node_status
- milplanEntity.JudgeStoveNo = str_STOVE_NO;
- milplanEntity.LotNo = str_Pro_NO;
- milplanEntity.NodeStatus = "96";
- milplanEntity.ProPlanId = proPlanId;
- milplanEntity.GxPlanNo = gxPlanNo;
- milplanEntity.PlineCode = PlineCode;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
- ccp.MethodName = "updateMilSlab";
- ccp.ServerParams = new object[] { str_STOVE_NO, "11", proPlanId, gxPlanNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- //更新进程表,废品入库存
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
- ccp.MethodName = "updateProcessL";
- ccp.ServerParams = new object[] { str_STOVE_NO, "11", "11", proPlanId, gxPlanNo, lotNo, PlineCode };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- //if(target.Equals("A"))
- //{
- // if (doQueryPk(orderPk))
- // {
- // }
- //}
- int num = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.FeedSawResultNode", new object[] { milplanEntity, En_Mil_Sur }, this.ob);//参数96为计划表状态,参数1为结炉标识
-
- if (num > 0)
- {
- MessageBox.Show("操作成功!");
- try
- {
- Entity.NativeMethodNew en_NativeMethodNew = new Core.StlMes.Client.ZGMil.Entity.NativeMethodNew(this.ob);
- en_NativeMethodNew.InsertSTAferDoubleClick(str_STOVE_NO, 9, "1", proPlanId, gxPlanNo);
- }
- catch (Exception)
- {
- }
- AutoUpFile();
- //清空实绩信息
- //DataTable dt = new DataTable();
- //utr_SURFACE_EditGrid(dt);
- //刷新计划表
- milplan_ReFresh("", "");
- this.dataSet3.Clear();
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
- /// <summary>
- /// 查询是否需双探
- /// </summary>
- /// <param name="orderPk"></param>
- private bool doQueryPk(string orderPk)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessSeq", new object[] { orderPk }, ob);
- if (ds.Rows.Count > 0)
- {
- if (ds.Rows[0]["PROCESS_SEQ"].ToString().Equals("F"))
- {
- return true;
- }
- }
- return false;
- }
- /// <summary>
- /// 查询结炉实绩
- /// </summary>
- public void NodeQuery()
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string PliceCode = PlineCode;
- string StartTime = DateTime.Now.ToString("yyyy-MM-dd");
- string EndTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
- string Date = StartTime;
- StartTime = StartTime + " 00:00:00";
- EndTime = EndTime + " 00:00:00";
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.SurfaceResult_query", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
- NodeResultQuery.FrmNodeResultQuery frm = new NodeResultQuery.FrmNodeResultQuery(dt, 8, Date, Shift, Group, this.ob);
- frm.ShowDialog();
- }
- /// <summary>
- /// 上料表行激活事件AfterRowActivate
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid_Plan_AfterRowActivate(object sender, EventArgs e)
- {
- bl_Upddefect_chk = false;
- bl_Upddefect_UpDown = false;
- UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
- MilPlan en_MPlan = new MilPlan();
- string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
- string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
- proPlanId = ugr_acr.Cells["PRO_PLAN_ID"].Value.ToString();
- gxPlanNo = ugr_acr.Cells["GX_PLAN_NO"].Value.ToString();
- lotNo = ugr_acr.Cells["LOT_NO"].Value.ToString();
- string ResultNo = ugr_acr.Cells["ID"].Value.ToString();
- actJudgeStoveNo = str_STOVE_NO;
- actResultNo = ResultNo;
- _LotNo = str_Pro_NO;
- en_MPlan.LotNo = str_Pro_NO;
- en_MPlan.JudgeStoveNo = str_STOVE_NO;
- en_MPlan.ProPlanId = proPlanId;
- en_MPlan.GxPlanNo = gxPlanNo;
- DataTable dt_RF = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { en_MPlan }, this.ob);
- if (dt_RF.Rows.Count > 0)
- {
- GridEdit(dt_RF); //轧制计划信息-1
- }
- DataTable dt_RCard = new DataTable();
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (plinCode.Equals("C009") || plinCode.Equals("C008") || plinCode.Equals("C017") || plinCode.Equals("C072"))
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- 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")
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCardTest", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- }
- else if (plinCode.Equals("C010"))
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, ob);
- }
- 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")
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getRollCard168Test", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.getRollCard168", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- }
- else
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryRollCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, ob);
- }
- 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")
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getRollingCardTest", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- else
- {
- dt_RCard = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { str_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
- }
- }
- //if (dt_RCard.Rows.Count > 0)
- RollingCardEditGrid(dt_RCard);//流通卡信息-2
- MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();
- En_Mil_Sur.RollLotNo = str_Pro_NO;
- En_Mil_Sur.HeatNo = str_STOVE_NO;
- //string str = JSONFormat.Format(En_Mil_Sur);//实体类转换为JSON格式
- DataTable dt = new DataTable();
- dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { str_STOVE_NO, ResultNo, proPlanId, gxPlanNo }, this.ob);
- //if (dt.Rows.Count < 1)
- //{
- // if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Value.ToString2() == "9")
- // {
- // dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMilPlan", new object[] { str_STOVE_NO, ResultNo }, this.ob);
- // }
- //}
- utr_SURFACE_EditGrid(dt);//人工质检实绩信息显示-3
- //if (dt.Rows.Count > 0)
- //{
- // if (!string.IsNullOrEmpty(dt.Rows[0]["QA_TYPE"].ToString()))
- // {
- // Qa_Flag = int.Parse(dt.Rows[0]["QA_TYPE"].ToString());
- // }
- //}
- //get_Chk_Active(str_STOVE_NO);//获取上料表中选中的抽检项
- dtMatSeq_3.Clear();
- dtDefectS.Clear();
- if (isStartSurface(ResultNo, str_STOVE_NO))
- {
- GetFeedRack();//查询上料管号队列
- getDefectData();
- //SimpleQuery();//性能批显示
- //ShowMatTabPage();//管号队列Tab显示
- }
- //绑定缺陷项到下拉列表
- //dt_Defect.Rows.Clear();
- //getdtDefectComb();
- //getdtCombGenerel();
- }
- /// <summary>
- /// 管号队列Tab显示
- /// </summary>
- public void ShowMatTabPage()
- {
- switch (Qa_Flag)
- {
- //未开始抽检 显示一检管号队列TAB2 TAB2更名管号队列
- case 0:
- ultraTabControl2.Tabs[0].Visible = true;
- // ultraTabControl2.Tabs[0].Text = "管号队列";
- ultraTabControl2.Tabs[1].Visible = false;
- //ultraTabControl3.Tabs[0].Visible = true;
- //ultraTabControl3.Tabs[1].Visible = false;
- break;
- //一检完成 显示一检管号队列TAB2 TAB2更名管号队列
- case 1:
- ultraTabControl2.Tabs[0].Visible = true;
- // ultraTabControl2.Tabs[0].Text = "管号队列";
- ultraTabControl2.Tabs[1].Visible = false;
- //ultraTabControl3.Tabs[0].Visible = true;
- //ultraTabControl3.Tabs[1].Visible = false;
- break;
- //二检完成 显示终检管号队列TAB1 一检管号队列TAB2 TAB2更名一检管号队列
- case 2:
- ultraTabControl2.Tabs[0].Visible = true;
- ultraTabControl2.Tabs[1].Text = "一检管号队列";
- ultraTabControl2.Tabs[1].Visible = true;
- //ultraTabControl3.Tabs[0].Visible = false;
- //ultraTabControl3.Tabs[1].Visible = true;
- break;
- }
- }
- /// <summary>
- /// 双击组件开始质检操作
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- //private void ultraGrid_Plan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
- private void DoStart()
- {
- if (ultraGrid_Plan.Rows.Count > 0)
- {
- // IsStart();
- UltraGridRow ugr_acr = this.ultraGrid_Plan.ActiveRow;//获取激活行
- string str_Pro_NO = ugr_acr.Cells["LOT_NO"].Value.ToString();//轧制批号
- string str_STOVE_NO = ugr_acr.Cells["JUDGE_STOVE_NO"].Value.ToString();//炉号
- string ResultNo = ugr_acr.Cells["ID"].Value.ToString();//炉号
- proPlanId = ugr_acr.Cells["PRO_PLAN_ID"].Value.ToString();
- gxPlanNo = ugr_acr.Cells["GX_PLAN_NO"].Value.ToString();
- string staus = doQueryJugeNoStaus(ResultNo, str_STOVE_NO,PlineCode);
- if (isStartSurface(ResultNo, str_STOVE_NO))
- {
- MessageBox.Show("炉号【" + str_STOVE_NO + "】已经开始质检");
- return;
- }
- //增加人工质检信息
- MilSurfaceResultEntity En_Mil_Sur = new MilSurfaceResultEntity();
- En_Mil_Sur.RollLotNo = str_Pro_NO;
- En_Mil_Sur.ResultNo = ResultNo;
- En_Mil_Sur.HeatNo = str_STOVE_NO;
- En_Mil_Sur.PlineCode = ugr_acr.Cells["PLINE_CODE"].Value.ToString();//获取产线代码
- En_Mil_Sur.ProPlanId = proPlanId;
- En_Mil_Sur.GxPlanNo = gxPlanNo;
- //更新上料表Mil_Plan状态
- MilPlan QueryMainPlan = new MilPlan();//上料表实体
- QueryMainPlan.JudgeStoveNo = str_STOVE_NO;
- QueryMainPlan.LotNo = str_Pro_NO;
- QueryMainPlan.Status = "95";
- QueryMainPlan.ProPlanId = proPlanId;
- QueryMainPlan.GxPlanNo = gxPlanNo;
- string sizeFlag = "";
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryChcekSize", new object[] { BaseMethod.getJudgeStoveNo(str_STOVE_NO), proPlanId, gxPlanNo }, ob);
- if (ds.Rows.Count > 0)
- {
- sizeFlag = "1";
- }
- else
- {
- sizeFlag = "0";
- }
- int num = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.startInSurFace", new object[] { En_Mil_Sur, QueryMainPlan, sizeFlag }, this.ob);
- if (num > 0)
- {
- try
- {
- //更新质检跟踪表时间
- Entity.NativeMethodNew en_NativeMethodNew = new Core.StlMes.Client.ZGMil.Entity.NativeMethodNew(this.ob);
- en_NativeMethodNew.InsertSTAferDoubleClick(str_STOVE_NO, 9, "0", proPlanId, gxPlanNo);
- }
- catch (Exception)
- {
- }
- milplan_ReFresh(str_Pro_NO, str_STOVE_NO);
- }
- }
- }
- /// <summary>
- /// 开始回退
- /// </summary>
- private void DoStartBack()
- {
- if (ultraGrid_Plan.Rows.Count > 0)
- {
- if (this.ultraGrid_Plan.ActiveRow == null)
- {
- MessageBox.Show("请选择需要回退的炉号!!!");
- return;
- }
- UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string StartStatus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
- //string StartStatus = ugr.Cells["IS_START"].Value.ToString();
- if (StartStatus == "1")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能开始回退!!!!");
- return;
- }
- if (StartStatus == "3")
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始质检,不能开始回退!!!!");
- return;
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryOffline", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows.Count > 0)
- {
- if (int.Parse(ds.Rows[0]["OFFLINE_NUM"].ToString()) > 0)
- {
- MessageUtil.ShowTips("此炉有下线支数,请先撤销下线支数的操作!");
- return;
- }
- }
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.startBack", new object[] { JudgeStoveNo, ResultNo, 9, PlineCode, proPlanId, gxPlanNo }, this.ob);
- ChangeGridColor();
- SurfaceQuery();
- GetFeedRack();
- }
- }
- /// <summary>
- /// 结炉回退
- /// </summary>
- private void NodeBack()
- {
- if (this.ultraGrid_Plan.ActiveRow == null)
- {
- MessageBox.Show("请选择需要回退的炉号!!!");
- return;
- }
- UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string NodeFlag = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
- //string NodeFlag = ugr.Cells["IS_START"].Value.ToString();
- if (NodeFlag != "1")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未结炉,不能结炉回退!!!!");
- return;
- }
- DataTable dtMat = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryMatScrap", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
- if (dtMat.Rows.Count > 0)
- {
- if (int.Parse(dtMat.Rows[0][0].ToString()) > 0)
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】的废品已发运,不能结炉回退!!!!");
- return;
- }
- }
- DataTable dW = ServerHelper.GetData("com.steering.mes.signature.FrmDownlineManage.doQueryEntust", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (dW.Rows.Count > 0)
- {
- MessageUtil.ShowTips("已进行外委加工,不允许结炉回退!");
- return;
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- string NodeStatus = dt.Rows[0][0].ToString();
- if (int.Parse(NodeStatus) >= 99)
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】后序工序已结炉,当前工序不能结炉回退");
- return;
- }
- }
- //查询结炉班次班组
- DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 11, proPlanId, gxPlanNo }, this.ob);
- if (dtNodeGroup.Rows.Count > 0)
- {
- string NodeShift = dtNodeGroup.Rows[0][0].ToString();
- string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
- if (Shift == NodeShift && Group == NodeGroup)
- {
- }
- else
- {
- switch (NodeShift)
- {
- case "0":
- NodeShift = "白班";
- break;
- case "1":
- NodeShift = "早班";
- break;
- case "2":
- NodeShift = "中班";
- break;
- case "3":
- NodeShift = "夜班";
- break;
- }
- switch (NodeGroup)
- {
- case "1":
- NodeGroup = "甲班";
- break;
- case "2":
- NodeGroup = "乙班";
- break;
- case "3":
- NodeGroup = "丙班";
- break;
- case "4":
- NodeGroup = "丁班";
- break;
- }
- switch (this.UserInfo.GetUserOrder())
- {
- case "0":
- Shift = "白班";
- break;
- case "1":
- Shift = "早班";
- break;
- case "2":
- Shift = "中班";
- break;
- case "3":
- Shift = "夜班";
- break;
- }
- switch (this.UserInfo.GetUserGroup())
- {
- case "1":
- Group = "甲班";
- break;
- case "2":
- Group = "乙班";
- break;
- case "3":
- Group = "丙班";
- break;
- case "4":
- Group = "丁班";
- break;
- }
- if (!NodeShift.Equals(Shift) || !NodeGroup.Equals(Group))
- {
- MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeShift + "," + NodeGroup + "结炉,当班不能结炉回退");
- return;
- }
- }
- }
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.selectBackLineNum", new object[] { ResultNo, JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- if (ds.Rows.Count > 0)
- {
- MessageUtil.ShowTips("存在已返线的支数,不允许结炉回退!");
- return;
- }
- //查询当前炉次是否有交班点
- int Seq = 0;
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 9, proPlanId, gxPlanNo }, this.ob);
- if (dt1.Rows.Count > 0)
- {
- Seq = int.Parse(dt1.Rows[0][0].ToString());
- }
- 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);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.coup.FrmOffLine";
- ccp.MethodName = "insertMatScrapBack";
- ccp.ServerParams = new object[] { JudgeStoveNo, proPlanId, gxPlanNo, PlineCode, "11" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- { MessageUtil.ShowTips(ccp.ReturnInfo); }
- ChangeGridColor();
- SurfaceQuery();
- GetFeedRack();
- }
- /// <summary>
- /// 刷新计划表信息,如果参数为空字符串,选中行为控件默认的第一行
- /// </summary>
- /// <param name="strPro_No">轧制号</param>
- /// <param name="strStove">炉号</param>
- public void milplan_ReFresh(string strPro_No, string strStove)
- {
- MilPlan milplanEntity = new MilPlan();
- if (u_ChkEditor_ProNo.Checked == true)
- {
- if (this.u_TxtEditor_ProNo.Text == "")
- {
- MessageBox.Show("请输入要查询的扎批号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- milplanEntity.LotNo = this.u_TxtEditor_ProNo.Text;//获取查询区生产批号
- }
- if (u_ChkEditor_StoveNo.Checked)
- {
- if (this.u_TxtEditor_StrvoNo.Text == "")
- {
- MessageBox.Show("请输入要查询的炉号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- milplanEntity.JudgeStoveNo = this.u_TxtEditor_StrvoNo.Text;//获取查询区炉号
- }
- milplanEntity.Status = PlanStatusQuery;
- milplanEntity.StartStatus = PlanStartStatusQuery;
- milplanEntity.PlineCode = this.PlineCode;
- milplanEntity.ProPlanId = proPlanId;
- milplanEntity.GxPlanNo = gxPlanNo;
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { milplanEntity, 10 }, this.ob);//
- dtPlan.Clear();
- GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);//绑定计划表
- foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() == "1")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- }
- if (ultraGrid_Plan.Rows.Count > 0)
- {
- foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
- {
- if (ugr.Cells["IS_START"].Value.ToString() != "未开始质检" && ugr.Cells["IS_START"].Value.ToString() != "已开始质检" && ugr.Cells["IS_START"].Value.ToString() != "已完成质检")
- {
- ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
- switch (Convert.ToInt32(ugr.Cells["IS_START"].Value))
- {
- case 3:
- ugr.Cells["IS_START"].Value = "未开始质检";
- break;
- case 0:
- ugr.Cells["IS_START"].Value = "已开始质检";
- break;
- case 1:
- ugr.Cells["IS_START"].Value = "已完成质检";
- break;
- }
- }
- }
- }
- else
- {
- MessageBox.Show("没有查询到相关数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //选中活动行
- if (strPro_No == "" && strStove == "")//默认的第一行选中
- {
- return;
- }
- //for (int i = 0; i < dt.Rows.Count; i++)
- //{
- // if (ultraGrid_Plan.Rows[i].Cells["JUDGE_STOVE_NO"].Value.ToString() == strStove && ultraGrid_Plan.Rows[i].Cells["LOT_NO"].Value.ToString() == strPro_No)
- // {
- // this.ultraGrid_Plan.Rows[i].Activated = true;
- // return;
- // }
- //}
- foreach (UltraGridRow ugr in ultraGrid_Plan.Rows)
- {
- if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == strStove && ugr.Cells["LOT_NO"].Value.ToString() == strPro_No)
- {
- ugr.Activated = true;
- return;
- }
- }
- }
- /// <summary>
- /// 是否开始质检
- /// </summary>
- /// <param name="?"></param>
- /// <returns></returns>
- public bool isStartSurface(string ResultNo, string strStove)
- {
- MilSurfaceResultEntity enMilSurfaceResultEntity = new MilSurfaceResultEntity();
- //enMilSurfaceResultEntity.RollLotNo = strPro_No; //获取查询区炉号
- //enMilSurfaceResultEntity.HeatNo = strStove; //获取查询区生产批号
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetQAResult", new object[] { strStove, ResultNo, proPlanId, gxPlanNo }, this.ob);//
- if (dt.Rows.Count > 0)
- { return true; }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 离线缺陷登记
- /// </summary>
- private void DoCheck()
- {
- int MatNum = 0; //探伤合格支数
- double Diameter = 0; //外径
- double Thickness = 0; //控制壁厚
- double Length = 0; //长度
- double ZLXS = 1.0; //重量系数
- MilSurfaceResultEntity QaResultEntity = new MilSurfaceResultEntity();
- if (ultraGrid_Plan.Rows.Count > 0)
- {
- UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string LotNo = ugr.Cells["LOT_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string IsStart = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
- //string IsStart = ugr.Cells["IS_START"].Value.ToString();
- int OffLineFlag = int.Parse(JudgeStoveNo.Substring(JudgeStoveNo.Length - 2, 2).ToString());
- if (OffLineFlag > 1)
- {
- OffLineFlag = 2;
- }
- if (IsStart == "3")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始质检,不能抽检!");
- return;
- }
- if (IsStart == "1")
- {
- MessageBox.Show("炉号【" + JudgeStoveNo + "】已完成质检,不能抽检!");
- return;
- }
- string Varieties = this.rollingInfomation1.UltraGrid4.Rows[0].Cells["Varieties"].Value.ToString();
- if (Varieties == "")
- {
- MessageUtil.ShowTips("无轧制信息,请联系系统管理员!");
- return;
- }
- string[] temp = Varieties.Split(',');
- string[] WJBH = temp[2].Split('*');
- if (!string.IsNullOrEmpty(WJBH[0]))
- {
- Diameter = double.Parse(WJBH[0]);
- }
- //if (!string.IsNullOrEmpty(WJBH[1]))
- //{
- // Thickness = double.Parse(WJBH[1]);
- //}
- if (!string.IsNullOrEmpty(this.rollingInfomation1.UltraGrid4.Rows[0].Cells["ContractLength"].Value.ToString()))
- {
- Length = double.Parse(this.rollingInfomation1.UltraGrid4.Rows[0].Cells["ContractLength"].Value.ToString());
- }
- //查询控制壁厚
- DataTable dtColThick = ServerHelper.GetData("com.steering.mes.zgmil.coup.PipeSawResult.GetSawResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dtColThick.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtColThick.Rows[0]["COL_THICK"].ToString()))
- {
- Thickness = double.Parse(dtColThick.Rows[0]["COL_THICK"].ToString());
- }
- }
- ////一次抽检
- //if (QaFlag == 1)
- //{
- //探伤结炉后才能开始抽检 查询探伤结炉标识 探伤合格支数
- if (PlineCode == "C010" || PlineCode == "C012") //涡流探伤
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() != "9")
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetETResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
- {
- MatNum = int.Parse(dt.Rows[0]["QUALIFIED_NUM"].ToString()); //涡流探伤合格支数
- }
- //else
- //{
- // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
- // return;
- //}
- }
- //else
- //{
- // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
- // return;
- //}
- }
- }
- else
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() != "9")
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetMTResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
- if (ds.Rows.Count > 0)
- {
- if (ds.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
- {
- MatNum = int.Parse(ds.Rows[0]["QUALIFIED_NUM"].ToString()); //漏磁探伤合格支数
- }
- //else
- //{
- // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
- // return;
- //}
- }
- //else
- //{
- // MessageUtil.ShowWarning("炉号【" + JudgeStoveNo + "】探伤未完成, 不能开始抽检!!!");
- // return;
- //}
- }
- }
- //查询是否进行分批
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetIsSimple", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
- int Flag = int.Parse(dt1.Rows[0]["IS_BATCH"].ToString());
- DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryBackFlag", new object[] { ResultNo, JudgeStoveNo, proPlanId, gxPlanNo }, ob);
- FrmQADefect QADefect = new FrmQADefect(JudgeStoveNo, ResultNo, proPlanId, gxPlanNo, LotNo, MatNum, Diameter, Thickness, Length, 1, OffLineFlag,PlineCode,dd.Rows[0][0].ToString(), this.ob);
- QADefect.ShowDialog();
- if (QADefect.DialogResult == DialogResult.OK)
- {
- ZLXS = double.Parse(QADefect._ZLXS); //重量系数
- _ScrapNum = QADefect._ScrapNum; //废品量
- _OffLineNum = QADefect._OffLineNumF; //下线量
- //_MatHeight = QADefect._MatHeight; //单支重
- double QAHeight = double.Parse((MatNum - int.Parse(_ScrapNum) - int.Parse(_OffLineNum)).ToString()) * _MatHeight; //合格吨 = (总检量-废品支-下线支) * 单支重
- int QANum = MatNum - int.Parse(_ScrapNum) - int.Parse(_OffLineNum); //合格支
- QaResultEntity.HeatNo = JudgeStoveNo;
- QaResultEntity.ResultNo = ResultNo;
- QaResultEntity.DirectorQuantity = MatNum.ToString();
- QaResultEntity.OfflineQuantity = _OffLineNum;
- QaResultEntity.WasteQuantity = _ScrapNum;
- QaResultEntity.QualifiedTons = QAHeight.ToString();
- QaResultEntity.QualifiedBranch = QANum.ToString();
- QaResultEntity.HeightRate = ZLXS.ToString();
- QaResultEntity.DirectorQuantityF = MatNum.ToString();
- QaResultEntity.OfflineQuantityF = _OffLineNum;
- QaResultEntity.WasteQuantityF = _ScrapNum;
- QaResultEntity.QualifiedTonsF = QAHeight.ToString();
- QaResultEntity.QualifiedBranchF = QANum.ToString();
- QaResultEntity.ProPlanId = proPlanId;
- QaResultEntity.GxPlanNo = gxPlanNo;
- //更新质检实绩信息
- int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.updateSurfaceResultNumF", new object[] { QaResultEntity, 1 }, this.ob);
- 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);
-
- //抽检后质检主信息界面显示支数信息
- //SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = MatNum;
- //SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = QANum;
- SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = (int.Parse(SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"].ToString()) - int.Parse(_ScrapNum) - int.Parse(_OffLineNum)).ToString();
- //SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = QAHeight;
- SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0][0].ToString();
- SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = _ScrapNum;
- SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = _OffLineNum;
- uDSFirstQa.Rows.Add();
- //抽检后质检详细信息界面显示一次抽检支数信息
- //uDSFirstQa.Rows[0]["DIRECTOR_QUANTITY_F"] = MatNum;
- //uDSFirstQa.Rows[0]["QUALIFIED_BRANCH_F"] = QANum;
- //uDSFirstQa.Rows[0]["QUALIFIED_TONS_F"] = QAHeight;
- //uDSFirstQa.Rows[0]["WASTE_QUANTITY_F"] = _ScrapNum;
- //uDSFirstQa.Rows[0]["OFFLINE_QUANTITY_F"] = _OffLineNum;
- QADefect.Close();
- GetFeedRack();
- getDefectData();
- SurfaceQuery();
- }
- //SurfaceQuery();
- }
- }
- /// <summary>
- /// 作废二次抽检
- /// </summary>
- private void DoCheckSCancel()
- {
- if (Qa_Flag != 2)
- {
- MessageBox.Show("炉号【" + actJudgeStoveNo + "】未开始二次抽检,不能作为二次抽检");
- return;
- }
- int dt = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.CheckSCancel", new object[] { actJudgeStoveNo, actResultNo }, this.ob);
- MessageBox.Show("炉号【" + actJudgeStoveNo + "】二次抽检已作废。");
- }
- /// <summary>
- /// 几何尺寸抽检
- /// </summary>
- private void DoSizeCheck()
- {
- if (ultraGrid_Plan.Rows.Count > 0)
- {
- UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string LotNo = ugr.Cells["LOT_NO"].Value.ToString();
- string ResultNo = ugr.Cells["ID"].Value.ToString();
- string staus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
- if (staus == "3")
- {
- MessageUtil.ShowTips("炉号【" + JudgeStoveNo + "】未开始质检,不能进行几何尺寸抽检!");
- return;
- }
- //if (staus == "1")
- //{
- // MessageUtil.ShowTips("炉号【" + JudgeStoveNo + "】已完成质检,不能进行几何尺寸抽检!");
- // return;
- //}
- FrmQASizeDetail frmQaSize = new FrmQASizeDetail(JudgeStoveNo, LotNo, ResultNo, proPlanId, gxPlanNo, PlineCode, this.ob);
- if (frmQaSize.ShowDialog() == DialogResult.OK)
- {
- SurfaceQuery();
- }
- }
- }
- /// <summary>
- /// 管号队列激活事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridMatSeq_AfterRowActivate(object sender, EventArgs e)
- {
- if (Qa_Flag == 0)
- {
- return;
- }
- UltraGridRow ugr = ultraGridMatSeq.ActiveRow;
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string Seq = ugr.Cells["SEQ"].Value.ToString();
- //string ResultNo = ugr.Cells["RESULT_NO"].Value.ToString();
- string Status = ugr.Cells["STATUS"].Value.ToString();
- dtDefect.Clear();
- if (Status == "一检剔除")
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.pipeDefectQuery", new object[] { JudgeStoveNo, actResultNo, Seq, "1" }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtDefect, true);
- }
- else if (Status == "二检剔除")
- {
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.pipeDefectQuery", new object[] { JudgeStoveNo, actResultNo, Seq, "2" }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtDefect, true);
- }
- else
- {
- //查询成品管缺陷项并显示在缺陷列表中
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.pipeDefectQuery", new object[] { JudgeStoveNo, actResultNo, Seq, Qa_Flag.ToString() }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtDefect, true);
- }
- }
- /// <summary>
- /// 性能批激活事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- if (Qa_Flag == 0)
- {
- return;
- }
- //UltraGridRow ugr = ultraGrid2.ActiveRow;
- //string SimpleLotNo = ugr.Cells["SIMPLE_LOT_NO"].Value.ToString();
- dtDefectS.Clear();
- //查询性能批缺陷项并显示在缺陷列表中
- //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetSimpleCheckInfo", new object[] { actJudgeStoveNo, actResultNo, SimpleLotNo }, this.ob);
- //GridHelper.CopyDataToDatatable(ref dt, ref dtDefectS, true);
- }
- /// <summary>
- /// 更改上料管队列girdRow颜色
- /// </summary>
- public void ChangeGridColor()
- {
- foreach (UltraGridRow ugr in ultraGridMatSeq.Rows)
- {
- if (ugr.Cells["STATUS"].Value.ToString() == "剔除")
- {
- ugr.Appearance.BackColor = Color.Yellow;
- }
- if (ugr.Cells["STATUS"].Value.ToString() == "二检剔除")
- {
- ugr.Appearance.BackColor = Color.Yellow;
- }
- if (ugr.Cells["STATUS"].Value.ToString() == "最终下线")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- if (ugr.Cells["STATUS"].Value.ToString() == "下线")
- {
- ugr.Appearance.BackColor = Color.YellowGreen;
- }
- if (ugr.Cells["CHANGE_FLAG"].Value.ToString() == "待接班确认")
- {
- ugr.Appearance.BackColor = Color.LightGreen;
- }
- }
- }
- //性能批查询
- public void SimpleQuery()
- {
- //查询是否进行分批
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetIsSimple", new object[] { actJudgeStoveNo, actResultNo, proPlanId, gxPlanNo }, this.ob);
- int Flag = int.Parse(dt1.Rows[0]["IS_BATCH"].ToString());
- if (Flag == 0) //未分批
- {
- return;
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.GetSimpleInfo", new object[] { actJudgeStoveNo, actResultNo }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtSimple, true);
- }
- #region 卡片赋值: 轧制信息Grid赋值,流通卡赋值
- /// <summary>
- /// 轧制信息Grid赋值
- /// </summary>
- /// <param name="dt">轧制计划信息datatable</param>
- public void GridEdit(DataTable dt)
- {
- DataRow row1 = dt.Rows[0];
- //熔炼炉号
- this.rollingInfomation1.Value.StoveNo = row1["stove_no"].ToString();
- //炉号
- this.rollingInfomation1.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString());
- //生产批号
- this.rollingInfomation1.Value.LotNo = row1["lot_no"].ToString();
- //工序合同号
- this.rollingInfomation1.Value.ContractNo = row1["contract_no"].ToString();
- //执行工艺号
- this.rollingInfomation1.Value.ImpProcess = row1["imp_process"].ToString();
- //执行工艺号路径
- this.rollingInfomation1.Value.ImpProcessPath = row1["imp_process_path"].ToString();
- //产线代码
- this.rollingInfomation1.Value.PlineCode = row1["pline_code"].ToString();
- //状态
- this.rollingInfomation1.Value.Status = row1["STATUS"].ToString();
- //监制
- this.rollingInfomation1.Value.Producer = row1["producer"].ToString();
- //工艺状态
- this.rollingInfomation1.Value.ProcessStatus = row1["process_status"].ToString();
- //单倍长
- this.rollingInfomation1.Value.DbLength = row1["db_length"].ToString();
- //单倍重
- this.rollingInfomation1.Value.DbHeight = row1["db_height"].ToString();
- //轧制长度
- this.rollingInfomation1.Value.RollLength = row1["roll_length"].ToString();
- //分切数
- this.rollingInfomation1.Value.SawNum = row1["saw_num"].ToString();
- //目标长度
- this.rollingInfomation1.Value.TargetLength = row1["target_length"].ToString();
- //最终用户
- this.rollingInfomation1.Value.FinishUser = row1["finish_user"].ToString();
- //目标库
- this.rollingInfomation1.Value.TargetLiabrary = row1["target_liabrary"].ToString();
- //品种
- this.rollingInfomation1.Value.Varieties = row1["varieties"].ToString();
- //成品规格
- this.rollingInfomation1.Value.PipeSize = row1["pipe_size"].ToString();
- //扣型
- this.rollingInfomation1.Value.BuckleType = row1["buckle_type"].ToString();
- //长度范围
- this.rollingInfomation1.Value.LengthRange = row1["length_range"].ToString();
- //轧管判定标准
- this.rollingInfomation1.Value.RollStandrad = row1["roll_standrad"].ToString();
- //断面
- this.rollingInfomation1.Value.PipeSection = row1["pipe_section"].ToString();
- //钢种代码
- this.rollingInfomation1.Value.SteelCode = row1["steelcode"].ToString();
- //钢种名称
- this.rollingInfomation1.Value.SteelName = row1["steelname"].ToString();
- //钢级代码
- this.rollingInfomation1.Value.GradeCode = row1["gradecode"].ToString();
- //钢级名称
- this.rollingInfomation1.Value.GradeName = row1["gradename"].ToString();
- //炼钢判定标准
- this.rollingInfomation1.Value.SteelStandrad = row1["steel_standrad"].ToString();
- //去向
- this.rollingInfomation1.Value.Target = row1["target"].ToString();
- //支
- this.rollingInfomation1.Value.PlanNum = row1["BRANCH"].ToString();
- //吨
- this.rollingInfomation1.Value.PlanTon = row1["TON"].ToString();
- //切损去向
- this.rollingInfomation1.Value.CutTarget = row1["cut_target"].ToString();
- //切损长度
- this.rollingInfomation1.Value.CutLength = row1["cut_length"].ToString();
- //切损重量
- this.rollingInfomation1.Value.CutHeight = row1["CUT_WEIGHT"].ToString();
- //倍尺数
- this.rollingInfomation1.Value.DbNum = row1["DB_NUM"].ToString();
- //标准类别代码
- this.rollingInfomation1.Value.StdStyle = row1["STD_STYLE"].ToString();
- //标准类别描述
- this.rollingInfomation1.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString();
- //成品备注
- this.rollingInfomation1.Value.ReMark = row1["ReMark"].ToString();
- this.rollingInfomation1.UpdateData();
- }
- /// <summary>
- /// 流通卡赋值
- /// </summary>
- /// <param name="dt"></param>
- public void RollingCardEditGrid(DataTable dt)
- {
- clearRollCard();
- if (dt.Rows.Count > 0)
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
- {
- //上料切前剔除支数
- this.rollingCard1.Value.FeedScrapNum = "0";
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = "0";
- //据切剔除支数
- this.rollingCard1.Value.FeedScrapDBNum = "0";
- //锯切合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = "0";
- //加热炉剔除支数
- this.rollingCard1.Value.FurScrapNum = "0";
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = "0";
- //穿孔剔除支数
- this.rollingCard1.Value.PerScrapNum = "0";
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = "0";
- //连轧剔除支数
- this.rollingCard1.Value.RollingScrapNum = "0";
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = "0";
- //再加热炉剔除支数
- this.rollingCard1.Value.RefurScrapNum = "0";
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = "0";
- //定径剔除支数
- this.rollingCard1.Value.SizingScrapNum = "0";
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = "0";
- //分切前剔除支数
- this.rollingCard1.Value.SawScrapNumBE = "0";
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = "0";
- //分切剔除支数
- this.rollingCard1.Value.SawScrapNum = "0";
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = "0";
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = "0";
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = "0";
- //探伤剔除支数
- this.rollingCard1.Value.TestingScrapNum = "0";
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = "0";
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = "0";
- //表检剔除支数
- this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
- //表检合格支数
- this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
- //表检下线支数
- this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
- }
- 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")
- {
- //上料切前剔除支数
- this.rollingCard1.Value.FeedScrapNum = "0";
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = "0";
- //据切剔除支数
- this.rollingCard1.Value.FeedScrapDBNum = "0";
- //锯切合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = "0";
- //加热炉剔除支数
- this.rollingCard1.Value.FurScrapNum = "0";
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = "0";
- //穿孔剔除支数
- this.rollingCard1.Value.PerScrapNum = "0";
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = "0";
- //连轧剔除支数
- this.rollingCard1.Value.RollingScrapNum = "0";
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = "0";
- //再加热炉剔除支数
- this.rollingCard1.Value.RefurScrapNum = "0";
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = "0";
- //定径剔除支数
- this.rollingCard1.Value.SizingScrapNum = "0";
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = "0";
- //分切前剔除支数
- this.rollingCard1.Value.SawScrapNumBE = "0";
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = "0";
- //分切剔除支数
- this.rollingCard1.Value.SawScrapNum = "0";
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = "0";
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
- //探伤剔除支数
- this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
- //表检剔除支数
- this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
- //表检合格支数
- this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
- //表检下线支数
- this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
- }
- else
- {
- //上料切前剔除支数
- this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString();
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString();
- //据切剔除支数
- this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString();
- //锯切合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString();
- //加热炉剔除支数
- this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString();
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString();
- //穿孔剔除支数
- this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString();
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString();
- //连轧剔除支数
- this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString();
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString();
- //再加热炉剔除支数
- this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString();
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString();
- //定径剔除支数
- this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString();
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString();
- //分切前剔除支数
- this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString();
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString();
- //分切剔除支数
- this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString();
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString();
- //矫直剔除支数
- this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
- //探伤剔除支数
- this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
- //表检剔除支数
- this.rollingCard1.Value.SurfaceScrapNum = dt.Rows[0]["WASTE_QUANTITY"].ToString();
- //表检合格支数
- this.rollingCard1.Value.SurfaceQualifiedNum = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
- //表检下线支数
- this.rollingCard1.Value.OfflineSurface = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
- }
- this.rollingCard1.UpdateData();
- }
- else
- {
- this.rollingCard1.ClearData();
- }
- }
- public void clearRollCard()
- {
- //上料切前判废支数
- this.rollingCard1.Value.FeedScrapNum = "0";
- //上料切前合格支数
- this.rollingCard1.Value.FeedQualifiedNum = "0";
- //上料判废支数
- this.rollingCard1.Value.FeedScrapDBNum = "0";
- //上料合格支数
- this.rollingCard1.Value.FeedQualifiedDBNum = "0";
- //加热炉判废支数
- this.rollingCard1.Value.FurScrapNum = "0";
- //加热炉合格支数
- this.rollingCard1.Value.FurQualifiedNum = "0";
- //穿孔判废支数
- this.rollingCard1.Value.PerScrapNum = "0";
- //穿孔合格支数
- this.rollingCard1.Value.PerQualifiedNum = "0";
- //连轧判废支数
- this.rollingCard1.Value.RollingScrapNum = "0";
- //连轧合格支数
- this.rollingCard1.Value.RollingQualifiedNum = "0";
- //再加热炉判废支数
- this.rollingCard1.Value.RefurScrapNum = "0";
- //再加热炉合格支数
- this.rollingCard1.Value.RefurQualifiedNum = "0";
- //定径判废支数
- this.rollingCard1.Value.SizingScrapNum = "0";
- //定径合格支数
- this.rollingCard1.Value.SizingQualifiedNum = "0";
- //分切前判废支数
- this.rollingCard1.Value.SawScrapNumBE = "0";
- //分切前合格支数
- this.rollingCard1.Value.SawQualifiedNumBE = "0";
- //分切判废支数
- this.rollingCard1.Value.SawScrapNum = "0";
- //分切合格支数
- this.rollingCard1.Value.SawQualifiedNum = "0";
- //矫直判废支数
- this.rollingCard1.Value.StraightScrapNum = "0";
- //矫直合格支数
- this.rollingCard1.Value.StraightQualifiedNum = "0";
- //矫直下线支数
- this.rollingCard1.Value.OfflineStraight = "0";
- //矫直返线支数
- this.rollingCard1.Value.BacklineStraight = "0";
- //探伤判废支数
- this.rollingCard1.Value.TestingScrapNum = "0";
- //探伤合格支数
- this.rollingCard1.Value.TestingQualifiedNum = "0";
- //探伤下线支数
- this.rollingCard1.Value.OfflineTesting = "0";
- this.rollingCard1.Value.BacklineTesting = "0";
- //表检剔除支数
- this.rollingCard1.Value.SurfaceScrapNum = "0";
- //表检合格支数
- this.rollingCard1.Value.SurfaceQualifiedNum = "0";
- //表检下线支数
- this.rollingCard1.Value.OfflineSurface = "0";
- this.rollingCard1.UpdateData();
- }
- /// <summary>
- /// 获取人工质检实绩信息显示
- /// </summary>
- /// <param name="dt"></param>
- public void utr_SURFACE_EditGrid(DataTable dt)
- {
- //清空质检实绩
- if (SurfaceDataSource.Rows.Count > 0)
- {
- for (int i = 0; i < SurfaceDataSource.Rows[0].Band.Columns.Count; i++)
- {
- SurfaceDataSource.Rows[0][i] = "";
- }
- }
- //清空抽检项和抽检率
- //Nud_val = 0;
- //foreach (Control ctr in this.ultraGroupBox1.Controls)
- //{
- // if (ctr is UltraCheckEditor)
- // {
- // UltraCheckEditor ul_chk = ctr as UltraCheckEditor;
- // if (ul_chk.Checked)
- // {
- // ul_chk.Checked = false;
- // }
- // }
- //}
- //赋值质检信息和抽检率
- if (dt.Rows.Count > 0)
- {
- DataTable dt_mt = null;
- if (PlineCode == "C008" || PlineCode == "C009" || PlineCode == "C017" || PlineCode == "C072")
- {
- dt_mt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_MT_RESULT", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString() }, this.ob);
- }
- else
- {
- dt_mt = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_ET_RESULT", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString() }, this.ob);
- }
- if (dt_mt.Rows.Count > 0 && dt_mt.Rows[0]["QUALIFIED_NUM"].ToString() != "0" && dt_mt.Rows[0]["QUALIFIED_NUM"].ToString() != "")
- {
- SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = dt_mt.Rows[0]["QUALIFIED_NUM"];
- 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);
- SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = dtStatictis.Rows[0]["WASTE_QUANTITY"];
- //SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = (int.Parse(SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"].ToString()) - int.Parse(SurfaceDataSource.Rows[0]["WASTE_QUANTITY"].ToString())).ToString();
- 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());
- double[] db_chkargs = new double[4];
- double db_args = 0;
- double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(0, this.rollingInfomation1.Value.PipeSize.IndexOf('*') - 1), out db_args);//外径
- db_chkargs[0] = db_args;
- double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(this.rollingInfomation1.Value.PipeSize.IndexOf('*') + 1), out db_args);//壁厚
- db_chkargs[1] = db_args;
- double.TryParse(this.rollingInfomation1.Value.TargetLength, out db_args);//长度
- db_chkargs[2] = db_args;
- int i_ultraCheckEditor1 = 0;
- //int.TryParse(ultraCheckEditor1.Text, out i_ultraCheckEditor1);
- //db_chkargs[3] = i_ultraCheckEditor1;//系数
- 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);
- SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = dtStatictis.Rows[0]["OFFLINE_QUANTITY"];
- }
- else
- {
- if (this.ultraGrid_Plan.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Trim().ToString2() == "9")
- {
- 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);
- SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = dt_mt.Rows[0]["BRANCH"];
- 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);
- SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = dtStatictis.Rows[0]["WASTE_QUANTITY"];
- 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());
- double[] db_chkargs = new double[4];
- double db_args = 0;
- double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(0, this.rollingInfomation1.Value.PipeSize.IndexOf('*') - 1), out db_args);//外径
- db_chkargs[0] = db_args;
- double.TryParse(this.rollingInfomation1.Value.PipeSize.Substring(this.rollingInfomation1.Value.PipeSize.IndexOf('*') + 1), out db_args);//壁厚
- db_chkargs[1] = db_args;
- double.TryParse(this.rollingInfomation1.Value.TargetLength, out db_args);//长度
- db_chkargs[2] = db_args;
- int i_ultraCheckEditor1 = 0;
- //int.TryParse(ultraCheckEditor1.Text, out i_ultraCheckEditor1);
- //db_chkargs[3] = i_ultraCheckEditor1;//系数
- 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);
- SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = dtStatictis.Rows[0]["OFFLINE_QUANTITY"];
- }
- else
- {
- SurfaceDataSource.Rows[0]["DIRECTOR_QUANTITY"] = dt.Rows[0]["DIRECTOR_QUANTITY"].ToString();
- SurfaceDataSource.Rows[0]["WASTE_QUANTITY"] = dt.Rows[0]["WASTE_QUANTITY"].ToString();
- SurfaceDataSource.Rows[0]["QUALIFIED_BRANCH"] = dt.Rows[0]["QUALIFIED_BRANCH"].ToString();
- SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0]["QUALIFIED_TONS"].ToString();
- SurfaceDataSource.Rows[0]["OFFLINE_QUANTITY"] = dt.Rows[0]["OFFLINE_QUANTITY"].ToString();
- }
- }
- SurfaceDataSource.Rows[0]["REMARK"] = dt.Rows[0]["REMARK"];
- //DataTable dtMIL_BASE_INSPECTOR = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_BASE_INSPECTOR", new object[] { }, this.ob);
- //Infragistics.Win.UltraWinEditors.UltraComboEditor ultCbE = new UltraComboEditor();
- //ultCbE.Visible = false;
- //ultCbE.DataSource = dtMIL_BASE_INSPECTOR;
- //ultCbE.DisplayMember = "INSPECTOR_NAME";
- //ultCbE.ValueMember = "INSPECTOR_CODE";
- //ultraGrid4.DisplayLayout.Bands[0].Columns["COL_USER"].EditorComponent = ultCbE;
- //SurfaceDataSource.Rows[0]["COL_USER"] = dt.Rows[0]["COL_USER"];//设置绑定dt的下拉框
- 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最大最小值
- if (dd.Rows.Count > 0)
- {
- SurfaceDataSource.Rows[0]["PIPE_DIAM_MAX"] = dd.Rows[0]["M1"].ToString();
- SurfaceDataSource.Rows[0]["PIPE_DIAM_MIN"] = dd.Rows[0]["M2"].ToString();
- }
- else
- {
- SurfaceDataSource.Rows[0]["PIPE_DIAM_MAX"] = dt.Rows[0]["PIPE_DIAM_MAX"];
- SurfaceDataSource.Rows[0]["PIPE_DIAM_MIN"] = dt.Rows[0]["PIPE_DIAM_MIN"];
- }
- DataTable smaxM = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQuerySufaceS", new object[] { dt.Rows[0]["JUDGE_STOVE_NO"].ToString().Substring(0,6) }, ob);
-
- SurfaceDataSource.Rows[0]["EXECUTIVE_PRODUCER"] = _UserName;
- SurfaceDataSource.Rows[0]["UNEVEN_DEGREE"] = dt.Rows[0]["UNEVEN_DEGREE"];
- SurfaceDataSource.Rows[0]["NON_ROUNDNESS"] = dt.Rows[0]["NON_ROUNDNESS"];
- SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MAX"] = smaxM.Rows[0]["S1"];
- SurfaceDataSource.Rows[0]["PIPE_THICKNESS_MIN"] = smaxM.Rows[0]["S2"];
- SurfaceDataSource.Rows[0]["HEAD_STRAIGHT"] = dt.Rows[0]["HEAD_STRAIGHT"];
- SurfaceDataSource.Rows[0]["BODY_STRAIGHT"] = dt.Rows[0]["BODY_STRAIGHT"];
- SurfaceDataSource.Rows[0]["LENGTH"] = dt.Rows[0]["LENGTH"];
- 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);
- if (ds.Rows.Count > 0)
- {
- SurfaceDataSource.Rows[0]["QA_TYPE"] = "尺寸已抽检";
- }
- else
- {
- SurfaceDataSource.Rows[0]["QA_TYPE"] = "尺寸未抽检";
- }
- SurfaceDataSource.Rows[0]["WEIGHT"] = dt.Rows[0]["WEIGHT"];
- SurfaceDataSource.Rows[0]["START_TIME"] = dt.Rows[0]["START_TIME"];
- SurfaceDataSource.Rows[0]["END_TIME"] = dt.Rows[0]["END_TIME"];
- //int num = 0;
- //int.TryParse(dt.Rows[0]["SIMPLE_RATE"].ToString(), out num);
- //numericUpDown1.Value = num;
- //Nud_val = numericUpDown1.Value;
- }
- }
- /// <summary>
- /// 获取指定炉号的缺陷项
- /// </summary>
- private void getDefectData()
- {
- UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
- if (ugr != null)
- {
- string jugeNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getDefectData", new object[] { jugeNo }, this.ob);
- dtDefectS.Clear();
- GridHelper.CopyDataToDatatable(ref ds, ref dtDefectS, true);
- }
- }
- /// <summary>
- /// 查询上料管号队列
- /// </summary>
- public void GetFeedRack()
- {
- UltraGridRow ugr = ultraGrid_Plan.ActiveRow;
- if (ugr != null)
- {
- string OffFlag = "0";
- string JudgeStoveNo = "";
- JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getSurfaceRackSeq", new object[] { JudgeStoveNo, "1" }, this.ob);
- DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getSurfaceRackSeq", new object[] { JudgeStoveNo, "2" }, this.ob);
- dtMatSeq_3.Clear();
- dtMatSeqS.Clear();
- GridHelper.CopyDataToDatatable(ref dt1, ref dtMatSeq_3, true);
- GridHelper.CopyDataToDatatable(ref dt2, ref dtMatSeqS, true);
- }
- ChangeGridColor();
- }
- #endregion
- #region 报表
- /// <summary>
- /// 打印报表
- /// </summary>
- private void PrintResult()
- {
- Group = UserInfo.GetUserGroup();
- Shift = UserInfo.GetUserOrder();
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string StartTime = ""; // 开始时间 用于报表查询
- string EndTime = ""; // 结束时间 用于报表查询
- string strurl = "";
- switch (PlineCode)
- {
- case "C008": //250
- break;
- case "C072": //508
- break;
- case "C009": //258
- //晚班
- Time = Time.Replace(":", "");
- if (Shift == "3")
- {
- //查询晚班前一天20点40后到当天07点20前所有记录
- if (int.Parse(Time) < 072000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.ToShortDateString() + " 07:20:00";
- //string Date2 = SeverTime.ToString("yyyy-MM-dd");
- 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;
- }
- //查询当天晚班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- 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;
- }
- }
- //白班 中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- 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;
- }
- //Time = Time.Replace(":", "");
- //if (int.Parse(Time) < 070000)
- //{
- // StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
- // EndTime = SeverTime.ToShortDateString() + " 07:00:00";
- // string Date2 = SeverTime.ToString("yyyy-MM-dd");
- // 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;
- //}
- //else
- //{
- // StartTime = SeverTime.ToShortDateString() + " 07:00:00";
- // EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
- // 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;
- //}
- break;
- case "C010": //168
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- //晚班
- Time = Time.Replace(":", "");
- if (Shift == "3")
- {
- //查询晚班前一天20点40后到当天07点20前所有记录
- if (int.Parse(Time) < 072000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.ToShortDateString() + " 07:20:00";
- //string Date2 = SeverTime.ToString("yyyy-MM-dd");
- 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;
- }
- //查询当天晚班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- 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;
- }
- }
- //白班 中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- 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;
- }
- break;
- }
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 查询上个班原始记录
- /// </summary>
- private void QueryBefore()
- {
- HOTMethod hm = new HOTMethod(this.ob);
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string Date = SeverTime.ToString("yyyyMMdd");
- string StartTime = ""; // 开始时间 用于报表查询
- string EndTime = ""; // 结束时间 用于报表查询
- string StartTimeU = ""; // 开始时间 用于得到上班UserID
- string EndTimeU = ""; // 结束时间 用于得到上班UserID
- string strurl = "";
- string ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date, PlineCode);
- //if (PlineCode.Equals("C072"))
- //{
- // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group, Date);
- //}
- //else
- //{
- // ShitGroupBefore = HOTMethod.GetShiftBefore(Shift, Group);
- //}
- string UserIDBefore = "";
- switch (PlineCode)
- {
- case "C008": //250
- break;
- case "C072": //508
- break;
- case "C009": //258
- //晚班
- Time = Time.Replace(":", "");
- if (Shift == "3")
- {
- //查询晚班前一天20点40后到当天07点20前所有记录
- if (int.Parse(Time) < 072000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.ToShortDateString() + " 07:20:00";
- StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00";
- EndTimeU = SeverTime.ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
- 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;
- }
- //查询当天晚班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- StartTimeU = SeverTime.ToShortDateString() + " 13:40:00";
- EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
- 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;
- }
- }
- //白班 中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- StartTimeU = SeverTime.ToShortDateString() + " 00:00:00";
- EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
- 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;
- }
- //Time = Time.Replace(":", "");
- //if (int.Parse(Time) < 072000)
- //{
- // StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 06:40:00";
- // EndTime = SeverTime.ToShortDateString() + " 07:20:00";
- // string Date2 = SeverTime.ToString("yyyy-MM-dd");
- // 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;
- //}
- //else
- //{
- // StartTime = SeverTime.ToShortDateString() + " 06:40:00";
- // EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- // 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;
- //}
- break;
- case "C010": //168
- break;
- case "C012": //Arssel
- break;
- case "C017": //460
- //晚班
- Time = Time.Replace(":", "");
- if (Shift == "3")
- {
- //查询晚班前一天20点40后到当天07点20前所有记录
- if (int.Parse(Time) < 072000)
- {
- StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.ToShortDateString() + " 07:20:00";
- StartTimeU = SeverTime.AddDays(-1).ToShortDateString() + " 13:40:00";
- EndTimeU = SeverTime.ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
- 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;
- }
- //查询当天晚班的所有数据
- else if (int.Parse(Time) > 204000)
- {
- StartTime = SeverTime.ToShortDateString() + " 20:40:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:20:00";
- StartTimeU = SeverTime.ToShortDateString() + " 13:40:00";
- EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
- 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;
- }
- }
- //白班 中班
- else
- {
- StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- StartTimeU = SeverTime.ToShortDateString() + " 00:00:00";
- EndTimeU = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- UserIDBefore = hm.GetUserIDBefore(StartTimeU, EndTimeU, ShitGroupBefore.Substring(0, 1), ShitGroupBefore.Substring(1, 1), 0, PlineCode);
- 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;
- }
- break;
- }
- FrmRepExcel fre = new FrmRepExcel(ob, strurl);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- private void u_ChkEditor_ProNo_CheckedChanged(object sender, EventArgs e)
- {
- u_TxtEditor_ProNo.Enabled = this.u_ChkEditor_ProNo.Checked;
- }
- private void u_ChkEditor_StoveNo_CheckedChanged(object sender, EventArgs e)
- {
- u_TxtEditor_StrvoNo.Enabled = this.u_ChkEditor_StoveNo.Checked;
- }
- private void chkStatusQuery_CheckedChanged(object sender, EventArgs e)
- {
- if (this.chkHeatNo.Checked)
- {
- this.txtJudgeStoveNo.Enabled = true;
- }
- else
- {
- this.txtJudgeStoveNo.Enabled = false;
- }
- if (chkStatusQuery.Checked)
- {
- PlanStatusQuery = "99";
- PlanStartStatusQuery = "96";
- }
- else
- {
- PlanStatusQuery = "95";
- PlanStartStatusQuery = "00";
- }
- }
- private int ChangeFlag = 0; //交班结炉提示 0弹出 1不弹出
- private void ultraGridMatSeq_ClickCellButton(object sender, CellEventArgs e)
- {
- UltraGridRow ugr = this.ultraGridMatSeq.ActiveRow;
- UltraGridRow uRow = this.ultraGrid_Plan.ActiveRow;
- if (uRow == null) return;
- HOTMethod hm = new HOTMethod(this.ob);
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- int Seq = int.Parse(ugr.Cells["SEQ"].Value.ToString());
- string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
- string ResultNo = uRow.Cells["ID"].Value.ToString();
- string shif = ugr.Cells["COL_SHIFT"].Value.ToString2();
- string group = ugr.Cells["COL_GROUP"].Value.ToString2();
- if (uRow.Cells["IS_START"].Text.Trim() == "已完成质检")
- {
- MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已完成质检操作,不允许进行交班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- //交班
- if (e.Cell.Column.Key == "CHANGE_GROUP")
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string User = UserInfo.GetUserName();
- int BeforeChangeNum = 0;
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessNum", new object[] { ResultNo, JudgeStoveNo }, ob);
- if (Seq > int.Parse(ds.Rows[0][0].ToString()))
- {
- MessageUtil.ShowTips("该序号支数在前工序已被剔除,不允许进行交接班!");
- return;
- }
- //查询上个班交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 9, plinCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
- }
- }
- int Seq2 = Seq;
- if (Seq2 <= BeforeChangeNum)
- {
- MessageBox.Show("前道班次已交班,该支不能再次交班。");
- return;
- }
- hm.UpdateChangeFlag(JudgeStoveNo, ResultNo, "", 9, Seq, 0);
- }
- //接班
- if (e.Cell.Column.Key == "TAKE_OVER")
- {
- string Shift = UserInfo.GetUserOrder();
- string Group = UserInfo.GetUserGroup();
- string User = UserInfo.GetUserName();
- int BeforeChangeNum = 0;
- //查询上个班交班支数
- DataTable dtChangeNum = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getChangeSeq", new object[] { JudgeStoveNo, ResultNo, 9, plinCode, Shift, Group, proPlanId, gxPlanNo }, this.ob);
- if (dtChangeNum.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtChangeNum.Rows[0][0].ToString()))
- {
- BeforeChangeNum = int.Parse(dtChangeNum.Rows[0][0].ToString());
- }
- }
- int WaitChangeSeq = hm.GetWaitChangeSeq(JudgeStoveNo, ResultNo, "", 9, 0, proPlanId, gxPlanNo);
- if (WaitChangeSeq == 0)
- {
- MessageBox.Show("没有待交班确认的管号。");
- return;
- }
- if (WaitChangeSeq != Seq)
- {
- MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
- {
- return;
- }
- //查询是否有该班接班记录
- DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
- string Time = SeverTime.ToLongTimeString();
- string StartTime = SeverTime.ToShortDateString() + " 00:00:00";
- string EndTime = SeverTime.AddDays(1).ToShortDateString() + " 00:00:00";
- if (this.DoRelogin(DoCheck))
- {
- //插入接班确认履历表
- hm.InsertChangeRemuse(Shift, Group, _UserName, "9", plinCode);
- int Seq2 = Seq;
- 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);
- ChangeFlag = 1;
- }
- }
- if (ultraGrid_Plan.Rows == null)
- {
- return;
- }
- GetFeedRack();
- ChangeGridColor();
- }
- public string DoCheck(CoreUserInfo User)
- {
- return "";
- }
- private void ultraGrid4_CellChange(object sender, CellEventArgs e)
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- DataTable dt = new DataTable();
- if (e.Cell.Column.Key == "DIRECTOR_QUANTITY")
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryNodeS", new object[] { this.ultraGrid_Plan.ActiveRow.Cells["ID"].Value.ToString(), PlineCode }, ob);
- if (ds.Rows.Count > 0)
- {
- if (ds.Rows[0]["NODE_FUR_FLAG"].ToString() == "0")
- {
- 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();
- 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);
- SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0][0].ToString();
- }
- }
- else
- {
- 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();
- //uRow.Cells["QUALIFIED_BRANCH"].Value = "1";
- 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);
-
- SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = dt.Rows[0][0].ToString();
- }
-
- }
- if (e.Cell.Column.Key == "WASTE_QUANTITY" || e.Cell.Column.Key == "OFFLINE_QUANTITY")
- {
- if (uRow.Cells["DIRECTOR_QUANTITY"].Value.ToString3() == "0")
- {
- SurfaceDataSource.Rows[0]["QUALIFIED_num"] = "0";
- SurfaceDataSource.Rows[0]["QUALIFIED_TONS"] = "0";
-
- }
- }
- }
- }
- #endregion
- }
|