| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control;
- using Core.StlMes.Client.Mcp.VRP.Entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Mcp.VRP.Vrp
- {
- public partial class FrmVrpApplNew : FrmBase
- {
- public FrmVrpApplNew()
- {
- InitializeComponent();
- }
- private string[] arr = null;
- private string httType = "";//热处理状态
- private string minTemp = "";//最低回火温度
- private string httTech = "";//热处理工艺制度
- private string Process = "";//参数
- private void InitColumns()
- {
-
- }
- private void FrmVrpApplNew_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<MatBcMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<MatBcMEntity1>(ultraGrid2.DisplayLayout.Bands[0]);
- ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
- EntityHelper.ShowGridCaption<QcmZgJugdeApplyEntity>(ultraGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<QcmZgJugdeApplyEntity>(ultraGrid4.DisplayLayout.Bands[0]);
-
- //F1功能
- this.IsLoadUserView = true;
- if (this.CustomInfo.ToString().Equals("JGX"))
- {
- Process = "G";//参数
- arr = new string[] { "002023017007"};
- }
- else
- {
- Process = this.CustomInfo.ToString();//参数
- arr = this.ValidDataPurviewIds;
- }
- if (Process != "G")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressure"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["HoldtimeTime"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressureY"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchWatergageResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchPathResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelMin"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelMin2"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelLen"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["DriftModelLen2"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MeasuredEndPart"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MeasuredMiddlePart"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MeasuredTailPart"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchChamferingResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchTwistinglyResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchDimensionsResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchVisualResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchThreadInspectionResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchRemanenceResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchRadioactivityResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MchBevelResult"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["AngleVal"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["EdgeVal"].Hidden = true;
- ultraGrid2.DisplayLayout.Bands[0].Columns["GroupLength"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingGrade"].Header.Caption = "探伤等级";
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingType"].Header.Caption = "探伤种类";
- ultraGrid1.DisplayLayout.Bands[0].Columns["DetectResultCode"].Header.Caption = "探伤结果";
-
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingGrade"].Header.Caption = "管端探伤等级";
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingType"].Header.Caption = "管端探伤种类";
- ultraGrid1.DisplayLayout.Bands[0].Columns["DetectResultCode"].Header.Caption = "管端探伤结果";
- }
- if (Process=="E")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressure"].Hidden = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["HoldtimeTime"].Hidden = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestPressureY"].Hidden = false;
- }
-
- if (Process != "F")
- {
- ultraGrid2.DisplayLayout.Bands[0].Columns["StorageName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["HttType"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["MinTemp"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["HttTechnology"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchInfo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchLength"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchWidth"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["NotchDepth"].Hidden = true;
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingGrade"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingType"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["DetectResultCode"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["TestingStandar"].Hidden = true;
-
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryBsStorage",
- new object[] { "" },
- this.ob);//库位下拉
- if (dt.Rows.Count > 0)
- {
- txtStorage.DataSource = dt;
- txtStorage.ValueMember = "STORAGE_NO";
- txtStorage.DisplayMember = "STORAGE_NAME";
- YdmBaseClass.SetComboItemHeight(txtStorage);
- }
- }
- //加载探伤等级
- DataTable ds = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryTestingGrade", new object[] { "4022" }, ob);//快速检索码
- if (ds != null && ds.Rows.Count > 0)
- {
- ultraTestingGrade.DataSource = ds;
- ultraTestingGrade.ValueMember = "BASECODE";
- ultraTestingGrade.DisplayMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(ultraTestingGrade);
- }
- //加载探伤种类
- DataTable dType = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryTestingGrade", new object[] { "4104" }, ob);//快速检索码
- if (dType != null && ds.Rows.Count > 0)
- {
- ultraTestingType.DataSource = dType;
- ultraTestingType.ValueMember = "BASECODE";
- ultraTestingType.DisplayMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(ultraTestingType);
- }
- //加载探伤标准
- DataTable dd = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryTestingGrade", new object[] { "4021" }, ob);//快速检索码
- if (dd != null && ds.Rows.Count > 0)
- {
- ultraTestingStandar.DataSource = dd;
- ultraTestingStandar.ValueMember = "BASECODE";
- ultraTestingStandar.DisplayMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(ultraTestingStandar);
- }
- }
- private void getDeliveryNo(string ordLnPk)
- {
- DataTable dd = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryDeliveryNo", new object[] { ordLnPk }, ob);//快速检索码
- if (dd != null && dd.Rows.Count > 0)
- {
- DeliveryNoText.DataSource = dd;
- DeliveryNoText.ValueMember = "BASECODE";
- DeliveryNoText.DisplayMember = "BASENAME";
- YdmBaseClass.SetComboItemHeight(DeliveryNoText);
- }
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQueryMat":
- QueryMat();
- break;
- case "DoDecision":
- DoDecision();
- break;
- case "cancelDoDecision":
- cancelDoDecision();
- break;
- case"UpdateProWgt":
- updateProWgt();
- break;
- case "PrintReport":
- printReport();
- break;
- case "DoUpdate":
- DoUpdate();
- break;
- case "DoKpFlag":
- DoKpFlag();
- break;
- case "inspection":
- inspection();
- break;
- case "inspection2":
- inspection2();
- break;
- case "inspection3":
- inspection3();
- break;
- case "Export":
- if (this.ultraTabControl1.Tabs[0].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid1, "申请判定信息");
- }
- else if (this.ultraTabControl1.Tabs[1].Active)
- {
- GridHelper.ulGridToExcel(ultraGrid4, "申请判定信息");
- }
- break;
- case "doSaveOrdLnDlyPk":
- doSaveOrdLnDlyPk();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 报检
- /// </summary>
- private void inspection()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
- string departMentid = UserInfo.GetDeptid();
- string flag = "0"; //报检
- if (uRow1 == null)
- {
- MessageUtil.ShowTips("请选择需要报检的炉信息!");
- return;
- }
- if (!(uRow1.Cells["Target"].Value.ToString().Equals("A") || (uRow1.Cells["Target"].Value.ToString().Equals("B") && uRow1.Cells["StdName"].Text.ToUpper().Contains("JY") && (!uRow1.Cells["PlineName"].Text.Contains("168")))))
- {
- MessageUtil.ShowTips("不是成品的不能报检!");
- return;
- }
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
- string matZcTity = JSONFormat.Format(matZcEntity);
- parm.Add(matZcTity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "inspection";
- ccp.ServerParams = new object[] { parm, Process, flag, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("报检成功!"))
- {
- QueryMat();
- MatBcMEntity1bindingSource.Clear();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 报检2(必检)
- /// </summary>
- private void inspection2()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
- //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
- string departMentid = UserInfo.GetDeptid();
- string flag = "1"; //必检
- if (uRow1 == null)
- {
- MessageUtil.ShowTips("请选择需要报检的炉信息!");
- return;
- }
- if (!uRow1.Cells["Target"].Value.ToString().Equals("A"))
- {
- MessageUtil.ShowTips("不是成品的不能报检!");
- return;
- }
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- MatBcMEntity1 matZcEntity = (MatBcMEntity1)uRow.ListObject;
- string matZcTity = JSONFormat.Format(matZcEntity);
- parm.Add(matZcTity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "inspection";
- ccp.ServerParams = new object[] { parm, Process, flag };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("报检成功!"))
- {
- QueryMat();
- MatBcMEntity1bindingSource.Clear();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 免检
- /// </summary>
- private void inspection3()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow1 = this.ultraGrid1.ActiveRow;
- //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
- string departMentid = UserInfo.GetDeptid();
- string flag = "3"; //免检
- if (uRow1 == null)
- {
- MessageUtil.ShowTips("请选择需要报检的炉信息!");
- return;
- }
- if (!uRow1.Cells["Target"].Value.ToString().Equals("A"))
- {
- MessageUtil.ShowTips("不是成品的不能报检!");
- return;
- }
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- MatBcMEntity1 matZcEntity = (MatBcMEntity1)uRow.ListObject;
- string matZcTity = JSONFormat.Format(matZcEntity);
- parm.Add(matZcTity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "inspection";
- ccp.ServerParams = new object[] { parm, Process, flag };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("报检成功!"))
- {
- QueryMat();
- MatBcMEntity1bindingSource.Clear();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打印缴库单
- /// </summary>
- private void printReport()
- {
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要打印的炉批信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMags)
- {
- MatBcMEntity1 matBcEntity = (MatBcMEntity1)row.ListObject;
- if (matBcEntity.JugdeApplyCode.Equals(""))
- {
- MessageUtil.ShowTips("炉批没有进行送判,不允许打印!");
- return;
- }
-
- }
-
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要打印的信息");
- return;
- }
- string heatNo = uRow.Cells["HeatPlanNo"].Value.ToString();
- string judgeNo = uRow.Cells["JudgeStoveNo"].Value.ToString();
- string batchNo = uRow.Cells["BatchNo"].Value.ToString();
- string plineCode = uRow.Cells["PlineCode"].Value.ToString();
- string Process = uRow.Cells["ProcessCdoe"].Value.ToString();
- string Target = uRow.Cells["Target"].Value.ToString();
- var strurl = "";
- if (Process.Equals("F"))
- {
- if (Target.Equals("A"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=MchRotaCrackDetetionASemiListHeatReport.cpt&judgeNo=" + judgeNo + "&batchNo=" + batchNo + "&heatNo=" + heatNo;
- }
- else
- {
- //strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=HttRotaCrackDetetionSemiListHeatReport.cpt&judgeStoveNo=" + judgeNo + "&heatPlanNo=" + heatNo + "&plineCode=" + plineCode;
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=HttRotaCrackDetetionSemiListHeatReport.cpt&judgeStoveNo=" + judgeNo + "&heatPlanNo=" + heatNo + "&plineCode=" + plineCode;
- }
- }
- if (Process.Equals("G"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=MchRotaCrackDetetionSemiListHeatReport.cpt&judgeNo=" + judgeNo + "&batchNo=" + batchNo + "&heatNo=" + heatNo;
- }
- var 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 QueryMat()
- {
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- ArrayList list = new ArrayList();
- if (this.chkStoveNo.Checked && this.txtJudgeNo.Text.Trim() != "")
- {
- jugeNo = this.txtJudgeNo.Text.Trim();
- }
- if (chkTim2.Checked)
- {
- if (DateTime.Parse(this.StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- list.Add(startTim);
- list.Add(endTim);
- list.Add(jugeNo);
- list.Add(this.ultraOptionSet1.CheckedItem.DataValue.ToString());
- list.Add(Process);
- if (ultraTabControl1.SelectedTab.Index == 0)
- {
- MatBcMEntity1bindingSource.Clear();
- List<MatBcMEntity> listSource = EntityHelper.GetData<MatBcMEntity>(
- "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMat", new object[] { list, arr }, this.ob);
- MatBcMEntitybindingSource.DataSource = listSource;
- foreach (UltraGridRow uRow in this.ultraGrid1.Rows)
- {
- if (uRow.Cells["Target"].Text == "A" )
- {
- DataTable bj = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryPlineCodeBM", new object[] { uRow.Cells["PlineCode"].Text }, ob);
- if (bj.Rows.Count > 0)
- {
- if (int.Parse(bj.Rows[0][0].ToString3()) > 0)
- {
- if (int.Parse(uRow.Cells["Bjz"].Text.ToString3()) > 0 && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) >= int.Parse(uRow.Cells["ActCount"].Text.ToString3()) && int.Parse(uRow.Cells["Bjz"].Text.ToString3()) == int.Parse(uRow.Cells["Yjz"].Text.ToString3()) && int.Parse(uRow.Cells["Xcjz"].Text.ToString3()) == 0)
- {
- uRow.Cells["IsOk"].Value = "可送判";
- }
- else
- {
- uRow.Cells["IsOk"].Value = "不可送判";
- }
- //待报检支= 送判支+下线支-报检支+重检支
- int dbjz = int.Parse(uRow.Cells["Spz"].Text.ToString3()) + int.Parse(uRow.Cells["ActCount"].Text.ToString3()) - int.Parse(uRow.Cells["Bjz"].Text.ToString3()) + int.Parse(uRow.Cells["Ycjz"].Text.ToString3());
- if (dbjz > 0)
- {
- uRow.Cells["DBJZ"].Value = dbjz;
- }
- else
- {
- uRow.Cells["DBJZ"].Value = 0;
- }
- }
- }
-
- }
- }
- }
- else if (ultraTabControl1.SelectedTab.Index == 1)
- {
- List<QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<QcmZgJugdeApplyEntity>(
- "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, UserInfo.GetDeptid(), Process, arr }, this.ob);
- qcmZgJugdeApplyEntityBindingSource.DataSource = listSource;
- }
-
- }
- /// <summary>
- /// 回报过磅重量
- /// </summary>
- private void updateProWgt()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- string PlinCode = uRow.Cells["PlineCode"].Value.ToString();
- string JugdeApplyCode = uRow.Cells["JugdeApplyCode"].Value.ToString();
- if (!PlinCode.Equals("C018"))
- {
- //if (uRow.Cells["Target"].Value.Equals("B") || uRow.Cells["Target"].Value.Equals("C"))
- //{
- // MessageUtil.ShowTips("半成品不允许回报过磅重量!");
- // return;
- //}
- }
- if (!JugdeApplyCode.Equals(""))
- {
- MessageUtil.ShowTips("已送判,不能回报过磅重量!");
- return;
- }
- if (Process == "G")
- {
- MessageUtil.ShowTips("请走测量点回报过磅重量!");
- return;
- }
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
- return;
- }
- if (!StringUtil.IsDouble(uRow.Cells["PonderGrossWt"].Value.ToString3()))
- {
- MessageUtil.ShowTips("过磅重量应输入数字!");
- return;
- }
- if (Double.Parse(uRow.Cells["PonderGrossWt"].Value.ToString3()) <= 0)
- {
- MessageUtil.ShowTips("请输入正确的过磅重量!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
- list.Add(uRow.Cells["PonderGrossWt"].Value.ToString3());
- list.Add(uRow.Cells["BelongCode"].Value.ToString());
- list.Add(this.UserInfo.GetUserName());
-
- ArrayList ArrList = new ArrayList();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
- }
- else
- {
- foreach (UltraGridRow urg in checkMags)
- {
- ArrayList arrList = new ArrayList();
- if(!StringUtil.IsDouble(urg.Cells["PonderGrossWt"].Value.ToString3()))
- {
- MessageUtil.ShowTips("过磅重量应输入数字!");
- return;
- }
-
- if(Double.Parse(urg.Cells["PonderGrossWt"].Value.ToString3())<0)
- {
- MessageUtil.ShowTips("请输入正确的过磅重量!");
- return;
- }
- arrList.Add(urg.Cells["JudgeStoveNo"].Value.ToString());
- arrList.Add(urg.Cells["PonderGrossWt"].Value.ToString3());
- arrList.Add(urg.Cells["BelongCode"].Value.ToString());
- arrList.Add(urg.Cells["BatchNo"].Value.ToString());
- arrList.Add(urg.Cells["HeatPlanNoNext"].Value.ToString());
- arrList.Add(urg.Cells["BatchGroudNo"].Value.ToString());
- arrList.Add(urg.Cells["ProOrderNo"].Value.ToString());
- arrList.Add(urg.Cells["LotNo"].Value.ToString());
- arrList.Add(this.UserInfo.GetUserName());
- ArrList.Add(arrList);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "updateProWgt";
- ccp.ServerParams = new object[] { list,ArrList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("回报成功!"))
- {
- QueryMat();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 申请判定
- /// </summary>
- private void DoDecision()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- UltraGridRow sRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- if (sRow == null) return;
- string Process = sRow.Cells["ProcessCdoe"].Value.ToString();
- string PlinCode = sRow.Cells["PlineCode"].Value.ToString();
- string judgeNo = sRow.Cells["JudgeStoveNo"].Value.ToString();
- string batchNo = uRow.Cells["BatchNo"].Value.ToString();
- int JugdeApplyNum1 = int.Parse(sRow.Cells["ActCount"].Value.ToString());
- int JugdeApplyNum2 = 0;
- double ActWeightTep = 0.0;
- double ActWeightTep1 = 0.0;
- double ActWeightTep2 = 0.0;
- double ActWeightTep3 = 0.0;
- double ActLenTep = 0.0;
- double ActLenTep1 = 0.0;
- double ActLenTep2 = 0.0;
- double ActLenTep3 = 0.0;
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要送判的炉批信息!");
- return;
- }
- //成品没检验合格的不能送判
- if (sRow.Cells["Target"].Text == "A" )
- {
- DataTable bj = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryPlineCodeBM", new object[] { sRow.Cells["PlineCode"].Text }, ob);
- if (bj.Rows.Count > 0)
- {
- if (int.Parse(bj.Rows[0][0].ToString3()) > 0)
- {
- if (sRow.Cells["IsOk"].Text.ToString().Equals("不可送判"))
- {
- MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!");
- return;
- }
- }
- }
- }
- if (Process == "G" )
- {
- UltraGridRow uug = this.ultraGrid3.ActiveRow;
- if (uug != null)
- {
- if (uug.Cells["ProcessCode"].Value.Equals("镦拔扩"))
- {
- MessageUtil.ShowTips("镦拔扩工序有紧急放行但未判定或判定不合格,不允许申请判定!");
- return;
- }
- else if (uug.Cells["ProcessCode"].Value.Equals("热处理"))
- {
- MessageUtil.ShowTips("热处理工序有紧急放行但未判定或判定不合格,不允许申请判定!");
- return;
- }
- else if (uug.Cells["ProcessCode"].Value.Equals("扎管"))
- {
- MessageUtil.ShowTips("扎管工序有紧急放行但未判定或判定不合格,不允许申请判定!");
- return;
- }
- }
- }
-
- DataTable dtF = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getInsancyFlag",
- new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), Process },
- this.ob);
- if (dtF.Rows.Count > 0)
- {
- if (dtF.Rows[0]["INSTANCY_FLAG"].Equals("1"))
- {
- MessageUtil.ShowTips("有紧急放行但未判定或判定不合格,不允许申请判定!");
- return;
- }
- }
-
-
- //if (sRow.Cells["Target"].Text.Equals("A"))
- //{
- // if (double.Parse(sRow.Cells["PonderGrossWt"].Text.ToString3()) <= 0)
- // {
- // MessageUtil.ShowTips("A字头必须回报过磅重量!");
- // return;
- // }
- //}
- if (int.Parse(sRow.Cells["PonderGrossCount"].Text.ToString3())>0)
- {
- if (sRow.Cells["ActCount"].Text.Trim() != sRow.Cells["PonderGrossCount"].Text.Trim())
- {
- MessageUtil.ShowTips("送判炉号有部分过磅了,部分没有过磅,不允许申请判定!");
- return;
- }
- }
- if (PlinCode.Equals("C018"))
- {
- DataTable dtwt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryWt",
- new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), sRow.Cells["ActCount"].Value.ToString() },
- this.ob);
- if (dtwt.Rows.Count > 0)
- {
- if (dtwt.Rows[0]["PONDER_GROSS_WT"].Equals("0"))
- {
- MessageUtil.ShowTips("必须回报过磅重量!");
- return;
- }
- }
- }
- else
- {
- if (sRow.Cells["Target"].Text.Equals("A"))
- {
- DataTable dtwt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryWt",
- new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), sRow.Cells["ActCount"].Value.ToString() },
- this.ob);
- if (dtwt.Rows.Count > 0)
- {
- if (PlinCode.Equals("C075"))
- {
- if (dtwt.Rows[0]["PONDER_GROSS_WT"].Equals("0"))
- {
- MessageUtil.ShowTips("必须回报过磅重量!");
- return;
- }
- }
- }
- }
- }
- ArrayList parmList = new ArrayList();
- foreach(UltraGridRow row in checkMags)
- {
-
- MatBcMEntity1 matBcEntity = (MatBcMEntity1)row.ListObject;
- if (!matBcEntity.JugdeApplyCode.Equals(""))
- {
- MessageUtil.ShowTips("炉批已进行送判,不允许重复送判!");
- return;
- }
- if (!sRow.Cells["HttType"].Value.Equals(""))
- {
- matBcEntity.HttType = sRow.Cells["HttType"].Text.ToString();
- }
- if (!sRow.Cells["MinTemp"].Text.Equals(""))
- {
- matBcEntity.MinTemp = sRow.Cells["MinTemp"].Text.ToString();
- }
- if (!sRow.Cells["HttTechnology"].Text.Equals(""))
- {
- matBcEntity.HttTechnology = sRow.Cells["HttTechnology"].Text.ToString();
- }
- if (!sRow.Cells["NotchInfo"].Text.Equals(""))
- {
- matBcEntity.NotchInfo = sRow.Cells["NotchInfo"].Text.ToString();
- }
- if (!sRow.Cells["NotchLength"].Text.Equals(""))
- {
- matBcEntity.NotchLength = sRow.Cells["NotchLength"].Text.ToString();
- }
- if (!sRow.Cells["NotchWidth"].Text.Equals(""))
- {
- matBcEntity.NotchWidth = sRow.Cells["NotchWidth"].Text.ToString();
- }
- if (!sRow.Cells["NotchDepth"].Text.Equals(""))
- {
- matBcEntity.NotchDepth = sRow.Cells["NotchDepth"].Text.ToString();
- }
- if (!row.Cells["StorageName"].Value.Equals(""))
- {
- matBcEntity.StorageName = row.Cells["StorageName"].Value.ToString();
- }
- if (!string.IsNullOrWhiteSpace(sRow.Cells["TestPressure"].Value.ToString()))
- {
- matBcEntity.TestPressure = sRow.Cells["TestPressure"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["TestPressure"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的水压压力不是数字,请重新输入!");
- return;
- }
- }
- if (!string.IsNullOrWhiteSpace(sRow.Cells["HoldtimeTime"].Value.ToString()))
- {
- matBcEntity.HoldtimeTime = sRow.Cells["HoldtimeTime"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["HoldtimeTime"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的保压时间不是数字,请重新输入!");
- return;
- }
- }
- if (!string.IsNullOrWhiteSpace(sRow.Cells["TestPressureY"].Value.ToString()))
- {
- matBcEntity.TestPressureY = sRow.Cells["TestPressureY"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["TestPressureY"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的水压压力不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["MchWatergageResult"].Value.Equals(""))
- {
- matBcEntity.MchWatergageResult = sRow.Cells["MchWatergageResult"].Value.ToString();
- matBcEntity.WpressureResultCode = "40740501"; //水压结果代码
- }
- if (!sRow.Cells["MchPathResult"].Value.Equals(""))
- {
- matBcEntity.MchPathResult = sRow.Cells["MchPathResult"].Value.ToString();
- }
- if (!sRow.Cells["DriftModelMin"].Value.Equals(""))
- {
- matBcEntity.DriftModelMin = sRow.Cells["DriftModelMin"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["DriftModelMin"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的通径头最小尺寸不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["DriftModelMin2"].Value.Equals(""))
- {
- matBcEntity.DriftModelMin2 = sRow.Cells["DriftModelMin2"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["DriftModelMin2"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的通径头最小尺寸不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["DriftModelLen"].Value.Equals(""))
- {
- matBcEntity.DriftModelLen = sRow.Cells["DriftModelLen"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["DriftModelLen"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的通径头有效长度不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["DriftModelLen2"].Value.Equals(""))
- {
- matBcEntity.DriftModelLen2 = sRow.Cells["DriftModelLen2"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["DriftModelLen2"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的通径头有效长度不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["MeasuredEndPart"].Value.Equals(""))
- {
- matBcEntity.MeasuredEndPart = sRow.Cells["MeasuredEndPart"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["MeasuredEndPart"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的测量端部不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["MeasuredMiddlePart"].Value.Equals(""))
- {
- matBcEntity.MeasuredMiddlePart = sRow.Cells["MeasuredMiddlePart"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["MeasuredMiddlePart"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的测量中部不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["MeasuredTailPart"].Value.Equals(""))
- {
- matBcEntity.MeasuredTailPart = sRow.Cells["MeasuredTailPart"].Value.ToString().Trim();
- if (!StringUtil.IsNumber(sRow.Cells["MeasuredTailPart"].Value.ToString()))
- {
- MessageUtil.ShowTips("输入的测量尾部不是数字,请重新输入!");
- return;
- }
- }
- if (!sRow.Cells["MchChamferingResult"].Value.Equals(""))
- {
- matBcEntity.MchChamferingResult = sRow.Cells["MchChamferingResult"].Value.ToString();
- }
- if (!sRow.Cells["MchTwistinglyResult"].Value.Equals(""))
- {
- matBcEntity.MchTwistinglyResult = sRow.Cells["MchTwistinglyResult"].Value.ToString();
- }
- if (!sRow.Cells["MchDimensionsResult"].Value.Equals(""))
- {
- matBcEntity.MchDimensionsResult = sRow.Cells["MchDimensionsResult"].Value.ToString();
- matBcEntity.SpecResultCode = "40740301"; //公差结果代码
- }
- if (!sRow.Cells["MchVisualResult"].Value.Equals(""))
- {
- matBcEntity.MchVisualResult = sRow.Cells["MchVisualResult"].Value.ToString();
- matBcEntity.FaceResultCode = "40740601"; //表面结果代码
- }
- if (!sRow.Cells["MchThreadInspectionResult"].Value.Equals(""))
- {
- matBcEntity.MchThreadInspectionResult = sRow.Cells["MchThreadInspectionResult"].Value.ToString();
- }
- if (!sRow.Cells["MchRemanenceResult"].Value.Equals(""))
- {
- matBcEntity.MchRemanenceResult = sRow.Cells["MchRemanenceResult"].Value.ToString();
- }
- if (!sRow.Cells["MchRadioactivityResult"].Value.Equals(""))
- {
- matBcEntity.MchRadioactivityResult = sRow.Cells["MchRadioactivityResult"].Value.ToString();
- }
- if (!sRow.Cells["MchBevelResult"].Value.Equals(""))
- {
- matBcEntity.MchBevelResult = sRow.Cells["MchBevelResult"].Value.ToString();
- }
- if (!sRow.Cells["AngleVal"].Value.Equals(""))
- {
- matBcEntity.AngleVal = sRow.Cells["AngleVal"].Value.ToString();
-
- }
- if (!sRow.Cells["EdgeVal"].Value.Equals(""))
- {
- matBcEntity.EdgeVal = sRow.Cells["EdgeVal"].Value.ToString();
-
- }
- if (!sRow.Cells["TestingGrade"].Value.Equals(""))
- {
- matBcEntity.TestingGrade = sRow.Cells["TestingGrade"].Text.ToString();
- }
- if (!sRow.Cells["TestingType"].Value.Equals(""))
- {
- matBcEntity.TestingType = sRow.Cells["TestingType"].Text.ToString();
- }
- if (!sRow.Cells["DetectResultCode"].Value.Equals(""))
- {
- matBcEntity.DetectResultCode = sRow.Cells["DetectResultCode"].Value.ToString();
- }
- if (!sRow.Cells["TestingStandar"].Value.Equals(""))
- {
- matBcEntity.TestingStandar = sRow.Cells["TestingStandar"].Text.ToString();
- }
- if (matBcEntity.MinTemp.Trim() != "")
- {
- string MinTem = matBcEntity.MinTemp.Replace("℃", "");
- int a;
- if (int.TryParse(MinTem, out a))
- {
- matBcEntity.MinTemp = a + "℃";
- }
- else
- {
- MessageBox.Show("请输入正确的最低回火温度, 请输入数字,或者正确的℃单位");
- return;
- }
- }
- string matEntity = JSONFormat.Format(matBcEntity);
- parmList.Add(matEntity);
- JugdeApplyNum2 += int.Parse(row.Cells["ActCount"].Value.ToString());
- string LengthType = row.Cells["LengthType"].Value.ToString();//长度类型(0-正尺,1-长尺,2-短尺)
- string InMold = row.Cells["InMold"].Value.ToString();//入库区分(801701-非计划入,801703-按计划入)
- double ActLen1 = double.Parse(row.Cells["ActLen1"].Value.ToString3());//累计送判米
- double ActWeight1 = double.Parse(row.Cells["ActWeight1"].Value.ToString3());//累计送判吨
- double ActWeightL = double.Parse(row.Cells["ActWeightL"].Value.ToString3());//累计送判吨(长尺)
- double ActWeightS = double.Parse(row.Cells["ActWeightS"].Value.ToString3());//累计送判吨(短尺)
- double ActLen2 = double.Parse(row.Cells["ActLen2"].Value.ToString3());//累计送判米(按计划入)
- double ActWeight2 = double.Parse(row.Cells["ActWeight2"].Value.ToString3());//累计送判吨(按计划入)
- double PaydownWtMax = double.Parse(row.Cells["PaydownWtMax"].Value.ToString3());//缴库量上限
- double Orderweight = double.Parse(row.Cells["Orderweight"].Value.ToString3());//估算量
- double OrderWtMaxShort = double.Parse(row.Cells["OrderWtMaxShort"].Value.ToString3());//短尺缴库量上限
- double OrderWtMaxLong = double.Parse(row.Cells["OrderWtMaxLong"].Value.ToString3());//长尺缴库量上限
- double Kspz = double.Parse(row.Cells["Kspz"].Value.ToString3());//预计可送判支
- double Cfz = double.Parse(row.Cells["Cfz"].Value.ToString3());//拆分支
- if (sRow.Cells["Target"].Text == "A" && sRow.Cells["PlineCode"].Text != "C092" && sRow.Cells["PlineCode"].Text != "C102")
- {
- //正尺
- if (LengthType.Equals("正尺") && InMold.Equals("801703"))
- {
- if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
- {
- ActWeightTep += double.Parse(row.Cells["ActWeight"].Value.ToString());
- if (PaydownWtMax < ActWeight2 + ActWeightTep && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
- return;
- }
- }
- else
- {
- ActLenTep += double.Parse(row.Cells["ActLen"].Value.ToString());
- if (PaydownWtMax < ActLen2 + ActLenTep && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
- return;
- }
- }
-
- }
- //长尺
- if (LengthType.Equals("长尺") && InMold.Equals("801703"))
- {
- if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
- {
- ActWeightTep1 += double.Parse(row.Cells["ActWeight"].Value.ToString());
- if (OrderWtMaxLong < ActWeightL + ActWeightTep1 && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的长尺总量超出长尺缴库量上限,请分开送判");
- return;
- }
- }else
- {
- ActLenTep1 += double.Parse(row.Cells["ActLen"].Value.ToString());
- if (OrderWtMaxLong < ActLen2 + ActLenTep1 && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判");
- return;
- }
- }
-
- }
- //短尺
- if (LengthType.Equals("短尺") && InMold.Equals("801703"))
- {
- if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
- {
- ActWeightTep2 += double.Parse(row.Cells["ActWeight"].Value.ToString());
- if (OrderWtMaxShort < ActWeightS + ActWeightTep2 && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判");
- return;
- }
- }
- else
- {
- ActLenTep2 += double.Parse(row.Cells["ActLen"].Value.ToString());
- if (OrderWtMaxShort < ActWeightS + ActLenTep2 && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判");
- return;
- }
- }
-
- }
- //按计划入
- if ( InMold.Equals("801703"))
- {
- if (row.Cells["OrderUnit"].Value.ToString().Equals("吨"))
- {
- ActWeightTep3 += double.Parse(row.Cells["ActWeight"].Value.ToString());
- if (PaydownWtMax < ActWeight2 + ActWeightTep3 && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的总量超出缴库量上限,请分开送判");
- return;
- }
- }
- else
- {
- ActLenTep3 += double.Parse(row.Cells["ActLen"].Value.ToString());
- if (PaydownWtMax < ActWeight2 + ActLenTep3 && checkMags.Count() > 1)
- {
- MessageBox.Show("选中的总量超出缴库量上限,请分开送判");
- return;
- }
- }
-
- }
- //非计划入
- if (InMold.Equals("801701"))
- {
- if (Cfz > int.Parse(row.Cells["ActCount"].Value.ToString()))
- {
- MessageBox.Show("输入的拆分支数不能大于实际送判支数");
- return;
- }
- }
- }
- }
- if (JugdeApplyNum1 < JugdeApplyNum2)
- {
- MessageUtil.ShowTips("上下两部分的送判支数不一致,请把查询范围放大!");
- return;
- }
- //检查是否过测量点-提示
- if (Process == "G")
- {
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp1.MethodName = "doCheckIsMeasure";
- ccp1.ServerParams = new object[] {parmList};
- ccp1 = ob.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- if (ccp1.ReturnCode != -1)
- {
- if (ccp1.ReturnInfo.Equals("获取成功!"))
- {
- int count = int.Parse(ccp1.ReturnObject.ToString3());
- if (count > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("有" + count + "支未过测量点,请确认是否继续申请判定?") == DialogResult.No)
- return;
- }
- }
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "doDecision";
- ccp.ServerParams = new object[] { parmList,this.txtMemo.Text,UserInfo.GetUserName() ,Process,"gx"};
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("申请判定成功!"))
- {
- string applyCode = ccp.ReturnObject.ToString();
- foreach (UltraGridRow row in checkMags)
- {
- OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
- //OpeBase obPss = new OpeBase();
- //obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";
- ccp.ServerName = "com.steering.pss.judge.Bll.BllCreateGroupStoveInfo";
- ccp.MethodName = "Create";
- ccp.ServerParams = new object[] { Process, row.Cells["LotNo"].Value.ToString(),row.Cells["JudgeStoveNo"].Value.ToString(),
- row.Cells["BatchNo"].Value.ToString(),applyCode };
- ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo);
- }
- }
-
- DataTable dt = null;
- if (Process.Equals("E"))
- {
- dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcess",
- new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }else if(Process.Equals("F"))
- {
- dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessRcl",
- new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }
- else if (Process.Equals("G"))
- {
- dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessJgx",
- new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- CoreClientParam ccpNew = new CoreClientParam
- {
- ServerName = "com.steering.pss.judge.Bll.BllZcColligateJudge",
- MethodName = "getJgxResultInfo",
- ServerParams = new object[] { applyCode, sRow.Cells["JudgeStoveNo"].Value.ToString(), batchNo }
- };
- OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
- ccpNew = obPss.ExecuteQuery(ccpNew, CoreInvokeType.Internal);
- var json = ccpNew.ReturnObject.ToString2();
- var dtNew = Newtonsoft.Json.JsonConvert.DeserializeObject(json, typeof(DataTable)) as DataTable;
- if ( dtNew != null && dtNew.Rows.Count > 0)
- {
- for (int i = 0; i < dtNew.Rows.Count;i++ )
- {
- if (dtNew.Rows[i]["Result"].Equals(""))
- {
- MessageUtil.ShowWarning(dtNew.Rows[i]["Item"].ToString() + "不合,请撤销送判!");
- }
- }
- }
- }
- if (dt.Rows.Count > 0)
- {
- //if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B024"))
- if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010"))
- {
- foreach (UltraGridRow row in checkMags)
- {
- OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url };
- /* OpeBase obPss = new OpeBase();
- obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";*/
- ccp.ServerName = "com.steering.pss.judge.Bll.BllDbkSpecJudge";
- ccp.MethodName = "judge";
- ccp.ServerParams = new object[] { applyCode, row.Cells["JudgeStoveNo"].Value.ToString(), row.Cells["BatchNo"].Value.ToString() };
- ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo);
- }
- }
- }
- }
- QueryMat();
- this.txtMemo.Text = "";
- MessageUtil.ShowTips("申请判定成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销申请判定
- /// </summary>
- private void cancelDoDecision()
- {
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- if (uRow == null) return;
- string plinCode = uRow.Cells["PlineCode"].Text.ToString();
- string nextGx = uRow.Cells["NextProcessCdoe"].Text.ToString();
- string gx = uRow.Cells["ProcessCdoe"].Text.ToString();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销送判的炉批信息!");
- return;
- }
- if (nextGx.Equals("F"))
- {
- DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryPlnRclM",
- new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- if (!dtPln.Rows[0]["COUNT"].Equals("0"))
- {
- MessageUtil.ShowTips("该炉计划在下工序不是计划或下发状态,不允许撤销判定!");
- return;
- }
- }else if(nextGx.Equals("G"))
- {
- DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryPlnJgx",
- new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- //if (!dtPln.Rows[0]["COUNT"].Equals("0"))
- //{
- // MessageUtil.ShowTips("该炉计划在下工序不是计划或下发状态,不允许撤销判定!");
- // return;
- //}
- }else if(nextGx.Equals("H"))
- {
- DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryPlnJg",
- new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- if (!dtPln.Rows[0]["COUNT"].Equals("0"))
- {
- MessageUtil.ShowTips("该炉计划在下工序不是计划或下发状态,不允许撤销判定!");
- return;
- }
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMags)
- {
- string valueFlag = "";
- string instock = "";
- string processDesc = "";
- DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.SelectValueFlag",
- new object[] { row.Cells["JugdeApplyCode"].Value.ToString(), row.Cells["JugdeApplySequeno"].Value.ToString(),
- row.Cells["JudgeStoveNo"].Value.ToString(),row.Cells["BatchNo"].Value.ToString(),row.Cells["BatchGroudNo"].Value.ToString(),
- row.Cells["PlineCode"].Value.ToString() },
- this.ob);
- if(dtPln.Rows.Count>0)
- {
- valueFlag = dtPln.Rows[0]["VALIDFLAG"].ToString();
- instock = dtPln.Rows[0]["INSTOCK_FLAG"].ToString();
- }
- DataTable dtDe = null;
- if(gx.Equals("E"))
- {
- dtDe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryProcessDesc",
- new object[] { row.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }else if(gx.Equals("F"))
- {
- dtDe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryProcessRclDesc",
- new object[] { row.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }
- else if (gx.Equals("G"))
- {
- dtDe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessJgx",
- new object[] { row.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }
- if(dtDe.Rows.Count>0)
- {
- processDesc = dtDe.Rows[0]["PROCESS_CODE_C"].ToString();
- }
- if (!"B008".Equals(processDesc)
- && !"B010".Equals(processDesc) && !"B024".Equals(processDesc))
- {
- if (!valueFlag.Equals("00") && !valueFlag.Equals("10"))
- {
- MessageUtil.ShowTips("该炉批已不是初始状态/撤判状态,不允许撤销申请判定!");
- return;
- }
- if (instock.Equals("1"))
- {
- MessageUtil.ShowTips("质保部已经接收不允许撤销!");
- return;
- }
- }
-
- MatBcMEntity1 matBcEntity = (MatBcMEntity1)row.ListObject;
- if (matBcEntity.JugdeApplyCode.Equals(""))
- {
- MessageUtil.ShowTips("炉批未送判,不允许撤销申请判定!");
- return;
- }
- string matEntity = JSONFormat.Format(matBcEntity);
- parmList.Add(matEntity);
- }
- DataTable dt = null;
- if (gx.Equals("E"))
- {
- dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcess",
- new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }
- else if (gx.Equals("F"))
- {
- dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessRcl",
- new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }
- else if (gx.Equals("G"))
- {
- dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessJgx",
- new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- this.ob);
- }
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B024"))
- {
- foreach (UltraGridRow row in checkMags)
- {
- OpeBase obPss = new OpeBase();
- obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "com.steering.pss.judge.Bll.BllDbkSpecJudge";
- ccp1.MethodName = "cancelJudge";
- ccp1.ServerParams = new object[] { uRow.Cells["JugdeApplyCode"].Value.ToString(), row.Cells["JudgeStoveNo"].Value.ToString(), row.Cells["BatchNo"].Value.ToString() };
- ccp1 = obPss.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- //if (ccp.ReturnInfo != "")
- //{
- // MessageUtil.ShowWarning(ccp.ReturnInfo);
- // return;
- //}
- }
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "cancelDoDecision";
- ccp.ServerParams = new object[] { parmList, gx };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- string applyCode = ccp.ReturnObject.ToString();
- // DataTable dt = null;
- // if (gx.Equals("E"))
- // {
- // dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcess",
- // new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- // this.ob);
- // }else if(gx.Equals("F"))
- // {
- // dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryProcessRcl",
- //new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString() },
- //this.ob);
- // }
- // if (dt.Rows.Count > 0)
- // {
- // if (dt.Rows[0]["PROCESS_CODE_C"].Equals("B008") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B010") || dt.Rows[0]["PROCESS_CODE_C"].Equals("B024"))
- // {
- // foreach (UltraGridRow row in checkMags)
- // {
- // OpeBase obPss = new OpeBase();
- // obPss.MainUrl = "http://172.16.2.130:8081/PSSServer/remoting/HessianRemoting";
- // ccp.ServerName = "com.steering.pss.judge.Bll.BllDbkSpecJudge";
- // ccp.MethodName = "cancelJudge";
- // ccp.ServerParams = new object[] { applyCode, row.Cells["JudgeStoveNo"].Value.ToString(), row.Cells["BatchNo"].Value.ToString() };
- // ccp = obPss.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- // if(ccp.ReturnInfo != "")
- // {
- // MessageUtil.ShowWarning(ccp.ReturnInfo);
- // return;
- // }
- // }
- // }
- // }
- QueryMat();
- this.txtMemo.Text = "";
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void txtMemo_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraTextEditor textEditor = (UltraTextEditor)sender;
- PopupTextBox popupText = new PopupTextBox(textEditor.Text, 500);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- textEditor.Text = popupText.TextInfo.Trim();
- }
- }
- private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJudgeNo.Enabled = this.chkStoveNo.Checked;
- }
- private void chkTim2_CheckedChanged(object sender, EventArgs e)
- {
- this.StartTime.Enabled = this.EndTime.Enabled = this.chkTim2.Checked;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- return;
- }
-
- doQueryRemark(uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text);
-
-
- doQueryJudgeBath(uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["JugdeApplyCode"].Text);
- if (uRow.Cells["ProcessCdoe"].Value.ToString() == "G")
- {
- //加工水压结果
- if (uRow.Cells["TestPressure"].Value == "" || uRow.Cells["HoldtimeTime"].Value == "" || uRow.Cells["TestPressureY"].Value == "" || uRow.Cells["MchWatergageResult"].Value == "")
- {
- DataTable dtWater = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryWicValue",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- if (dtWater.Rows.Count > 0)
- {
- uRow.Cells["TestPressure"].Value = dtWater.Rows[0]["TEST_PRESSURE"].ToString();
- uRow.Cells["HoldtimeTime"].Value = dtWater.Rows[0]["HOLDTIME_TIME"].ToString();
- uRow.Cells["TestPressureY"].Value = dtWater.Rows[0]["TEST_PRESSURE_Y"].ToString();
- uRow.Cells["MchWatergageResult"].Value = "合格";
- }
- }
- if (uRow.Cells["MchPathResult"].Value == "") //加工通径结果
- {
- DataTable dtPath = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMchPathResult",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- if (dtPath.Rows.Count > 0)
- {
- if (dtPath.Rows[0]["ACOUNT"].ToString() != "0")
- {
- uRow.Cells["MchPathResult"].Value = "合格";
- }
- uRow.Cells["DriftModelMin"].Value = dtPath.Rows[0]["DRIFT_MODEL_MIN"].ToString();
- uRow.Cells["DriftModelMin2"].Value = dtPath.Rows[0]["DRIFT_MODEL_MIN2"].ToString();
- uRow.Cells["DriftModelLen"].Value = dtPath.Rows[0]["DRIFT_MODEL_LEN"].ToString();
- uRow.Cells["DriftModelLen2"].Value = dtPath.Rows[0]["DRIFT_MODEL_LEN2"].ToString();
- uRow.Cells["MeasuredEndPart"].Value = dtPath.Rows[0]["MEASURED_END_PART"].ToString();
- uRow.Cells["MeasuredMiddlePart"].Value = dtPath.Rows[0]["MEASURED_MIDDLE_PART"].ToString();
- uRow.Cells["MeasuredTailPart"].Value = dtPath.Rows[0]["MEASURED_TAIL_PART"].ToString();
- }
- }
- if (uRow.Cells["MchChamferingResult"].Value == "") //加工倒棱结果
- {
- DataTable dtChamfering = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMchChamferingResult",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- if (dtChamfering.Rows.Count > 0)
- {
- if (!dtChamfering.Rows[0]["ANGLE_VAL"].ToString().Equals("")) //角度不为空,结果才是合格
- {
- //uRow.Cells["MchChamferingResult"].Value = "合格";
- uRow.Cells["MchBevelResult"].Value = "合格";
- uRow.Cells["AngleVal"].Value = dtChamfering.Rows[0]["ANGLE_VAL"].ToString();
- uRow.Cells["EdgeVal"].Value = dtChamfering.Rows[0]["EDGE_VAL"].ToString();
- }
- }
- }
- if (uRow.Cells["MchTwistinglyResult"].Value == "") //加工拧接结果
- {
- DataTable dtTwistingly = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryMchTwistinglyResult",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- if (dtTwistingly.Rows.Count > 0)
- {
- uRow.Cells["MchTwistinglyResult"].Value = "合格";
- }
- }
- if (uRow.Cells["TestingType"].Value == "") //加工探伤结果
- {
- DataTable dtMTs = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttCrackDetectionEt",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, "G" }, this.ob);
- if (dtMTs.Rows.Count > 0)
- {
- uRow.Cells["DetectResultCode"].Value = "40740401";
- uRow.Cells["TestingType"].Value = dtMTs.Rows[0]["TESTING_TYPE"].ToString();
- uRow.Cells["TestingGrade"].Value = dtMTs.Rows[0]["TESTING_GRADE"].ToString();
- }
- }
- }
- if (uRow.Cells["HttType"].Value == "")
- {
- DataTable dtHtt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttType",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["PlineCode"].Text },
- this.ob); //热处理类型
- if (dtHtt.Rows.Count > 0)
- {
- uRow.Cells["HttType"].Value = dtHtt.Rows[0]["SORT_CODE"].ToString();
- }
- }
- if (uRow.Cells["MinTemp"].Value == "" && uRow.Cells["JugdeApplyCode"].Value == "")
- {
- DataTable dtHttTe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttTemp",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["PlineCode"].Text },
- this.ob); //热处理最低回火温度,工艺制度
- if (dtHttTe.Rows.Count > 0)
- {
- uRow.Cells["MinTemp"].Value = dtHttTe.Rows[0]["LHEAT_EXIT_TEMP"].ToString();
- uRow.Cells["HttTechnology"].Value = dtHttTe.Rows[0]["HEAT_EXIT_TEMP"].ToString();
- }
- }else if(uRow.Cells["MinTemp"].Value == "" && uRow.Cells["JugdeApplyCode"].Value != "")
- {
- DataTable dtHttTe = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttTempTech",
- new object[] { uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["PlineCode"].Text },
- this.ob); //热处理最低回火温度,工艺制度
- if (dtHttTe.Rows.Count > 0)
- {
- uRow.Cells["MinTemp"].Value = dtHttTe.Rows[0]["MIN_TEMP"].ToString();
- uRow.Cells["HttTechnology"].Value = dtHttTe.Rows[0]["HTT_TECHNOLOGY"].ToString();
- }
- }
- if (uRow.Cells["NotchLength"].Value == "")
- {
- DataTable dtHttDa = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryHttData",
- new object[] {uRow.Cells["HeatPlanNoOld"].Text, uRow.Cells["PlineCode"].Text}, this.ob);
- if (dtHttDa.Rows.Count > 0)
- {
- uRow.Cells["NotchLength"].Value = dtHttDa.Rows[0]["NOTCH_LENGTH"].ToString();
- uRow.Cells["NotchWidth"].Value = dtHttDa.Rows[0]["NOTCH_WIDTH"].ToString();
- uRow.Cells["NotchDepth"].Value = dtHttDa.Rows[0]["NOTCH_DEPTH"].ToString();
- }
- }
- /* }*/
- foreach (UltraGridRow urg in ultraGrid2.Rows)
- {
- DataTable dtStorage = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryStorage",
- new object[] { urg.Cells["JudgeStoveNo"].Text, urg.Cells["BatchNo"].Text },
- this.ob);//储存位置
- if (dtStorage.Rows.Count > 0)
- {
- urg.Cells["StorageName"].Value = dtStorage.Rows[0]["STORAGE_NAME"].ToString();
- urg.Cells["StorageNo"].Value = dtStorage.Rows[0]["STORAGE_NO"].ToString();
- }
- }
- }
- /// <summary>
- /// 查询炉批信息
- /// </summary>
- private void doQueryJudgeBath(string heatPlanNo, string judgeNo, string jugdeApplyCode)
- {
- List<MatBcMEntity1> listSource = EntityHelper.GetData<MatBcMEntity1>(
- "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryJudgeBath", new object[] { heatPlanNo, judgeNo, jugdeApplyCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
- if (listSource.Count > 0)
- {
- this.getDeliveryNo(listSource[0].OrdLnPk.ToString());
- }
- MatBcMEntity1bindingSource.DataSource = listSource;
- foreach(UltraGridRow row in this.ultraGrid2.Rows)
- {
- row.Cells["CHK"].Value = "True";
- row.Update();
- }
-
- }
- private void doSaveOrdLnDlyPk()
- {
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要修改的数据!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMags)
- {
- MatBcMEntity1 matBcEntity1 = (MatBcMEntity1)row.ListObject;
- string OrdLnDlyPk = row.Cells["OrderSeqNo"].Value.ToString();
- string OrderSeqNo = row.Cells["OrderSeqNo"].Text.ToString();
- if (OrdLnDlyPk.Equals(OrderSeqNo))
- {
- return;
- }
- matBcEntity1.OrdLnDlyPk = OrdLnDlyPk;
- matBcEntity1.OrderSeqNo = OrderSeqNo;
- string matEntity = JSONFormat.Format(matBcEntity1);
- parmList.Add(matEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "doSaveOrdLnDlyPk";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void doQueryRemark(string heatPlanNo, string judgeNo)
- {
- DataTable ds = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryRemark", new object[] { judgeNo, heatPlanNo}, ob);
- txtMemo.Text = ds.Rows[0]["Remark"].ToString();
- }
- private void ultraGrid2_CellChange(object sender, CellEventArgs e)
- {
- UltraGridRow urg = ultraGrid1.ActiveRow;
- e.Cell.Row.Update();//选中的有铅笔形状会和勾选的不一样
- double wt = 0.0;
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- wt += Convert.ToDouble(row.Cells["PonderGrossWt"].Value);
- }
- urg.Cells["PonderGrossWt"].Value = wt;
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- string heatPlanNo = "";
- string judgeNo = "";
- UltraGridRow urg = ultraGrid1.ActiveRow;
- if(urg==null)
- {
- return;
- }
- else
- {
- heatPlanNo = urg.Cells["HeatPlanNo"].Value.ToString();
- judgeNo = urg.Cells["JudgeStoveNo"].Value.ToString();
- }
- ultraGrid1.UpdateData();
- if (e.Cell.Column.Key.Equals("PonderGrossWt") && urg.Cells["PonderGrossWt"].Text != "")
- {
- string count = "";
- DataTable dtHtt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryJudgeBathCount",
- new object[] {heatPlanNo, judgeNo, this.ultraOptionSet1.CheckedItem.DataValue.ToString()},
- this.ob); //热处理类型
- if (dtHtt.Rows.Count > 0)
- {
- count =
- (Convert.ToDouble(urg.Cells["PonderGrossWt"].Text.ToString())/
- Convert.ToDouble(urg.Cells["ActCount"].Text.ToString())).ToString("f6");
- }
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- // row.Cells["PonderGrossWt"].Value = (Convert.ToDouble(count) * Convert.ToInt32(dtHtt.Rows[i]["COUNT"].ToString())).ToString("f3");
- row.Cells["PonderGrossWt"].Value =
- (Convert.ToDouble(count)*Convert.ToInt32(row.Cells["ActCount"].Text.ToString())).ToString("f3");
- row.Cells["CHK"].Value = "True";
- row.Update();
- }
- }
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- if (uRow == null)
- {
- return;
- }
- //doQueryJudgeBath(uRow.Cells["HeatPlanNo"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["JugdeApplyCode"].Text);
- if (uRow.Cells["ProcessCdoe"].Value.ToString() == "G" || uRow.Cells["ProcessCdoe"].Value.ToString() == "F")
- {
- //Box.Visible = false;
- List<QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<QcmZgJugdeApplyEntity>(
- "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryQcmZgApplyData", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- QcmZgApplyEntitybindingSource1.DataSource = listSource;
- //DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.doQueryQcmZgApplyData2",
- // new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- if (listSource.Count > 0)
- {
- ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- row.Cells["isFlag"].Value = "是";
- }
-
- }
- else
- {
- ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- row.Cells["isFlag"].Value = "否";
- }
- }
- }
- //else
- //{
- // Box.Visible = false;
- //}
- foreach(UltraGridRow urg in ultraGrid3.Rows)
- {
- if (urg.Cells["ProcessCode"].Value.Equals("D"))
- {
- urg.Cells["ProcessCode"].Value = "扎管";
- }
- else if (urg.Cells["ProcessCode"].Value.Equals("E"))
- {
- urg.Cells["ProcessCode"].Value = "镦拔扩";
- }
- else if (urg.Cells["ProcessCode"].Value.Equals("F"))
- {
- urg.Cells["ProcessCode"].Value = "热处理";
- }
- }
- ultraGrid2.UpdateData();
- }
- private void ultraGrid4_ClickCellButton(object sender, CellEventArgs e)
- {
- this.ultraGrid4.UpdateData();
- if (e.Cell.Column.Key == "JugdeApplyCode")
- {
- string jugdeApplyCode = ultraGrid4.ActiveRow.Cells["JugdeApplyCode"].Value.ToString();
- string judgeStoveNo = ultraGrid4.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- string ordenNo = ultraGrid4.ActiveRow.Cells["ProOrderNo"].Value.ToString();
- FrmQcmAddAsk orderZg = new FrmQcmAddAsk(jugdeApplyCode, judgeStoveNo, ordenNo, this.ob);
- orderZg.ShowDialog();
- }
- }
- private void DoUpdate()
- {
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- UltraGridRow sRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- if (sRow == null) return;
- string Process = sRow.Cells["ProcessCdoe"].Value.ToString();
- MatBcMEntity matBcEntity = (MatBcMEntity)ultraGrid1.ActiveRow.ListObject;
- if (!sRow.Cells["TestingGrade"].Value.Equals(""))
- {
- matBcEntity.TestingGrade = sRow.Cells["TestingGrade"].Text.ToString();
- }
- if (!sRow.Cells["TestingType"].Value.Equals(""))
- {
- matBcEntity.TestingType = sRow.Cells["TestingType"].Text.ToString();
- }
- if (!sRow.Cells["DetectResultCode"].Value.Equals(""))
- {
- matBcEntity.DetectResultCode = sRow.Cells["DetectResultCode"].Value.ToString();
- }
- if (!sRow.Cells["TestingStandar"].Value.Equals(""))
- {
- matBcEntity.TestingStandar = sRow.Cells["TestingStandar"].Text.ToString();
- }
- string matEntity = JSONFormat.Format(matBcEntity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "DoUpdateJudge";
- ccp.ServerParams = new object[] { matEntity };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- QueryMat();
- MessageUtil.ShowTips("修改成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 标识空跑
- /// </summary>
- private void DoKpFlag()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow uRow = this.ultraGrid4.ActiveRow;
- if (uRow == null) return;
- IQueryable<UltraGridRow> checkMags = this.ultraGrid4.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要送判的炉批信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMags)
- {
- QcmZgJugdeApplyEntity matBcEntity = (QcmZgJugdeApplyEntity)row.ListObject;
- string matEntity = JSONFormat.Format(matBcEntity);
- parmList.Add(matEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
- ccp.MethodName = "DoKpFlag";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("标识成功!"))
- {
- QueryMat();
- MessageUtil.ShowTips("标识成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
- }
|