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(ultraGrid1.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行"; EntityHelper.ShowGridCaption(ultraGrid3.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(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); } } /// /// 重写基类方法 /// /// /// 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; } } /// /// 报检 /// 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 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); } } } /// /// 报检2(必检) /// 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 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); } } } /// /// 免检 /// 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 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); } } } /// /// 打印缴库单 /// private void printReport() { IQueryable 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(); } /// /// 查询 /// 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 listSource = EntityHelper.GetData( "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 listSource = EntityHelper.GetData( "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, UserInfo.GetDeptid(), Process, arr }, this.ob); qcmZgJugdeApplyEntityBindingSource.DataSource = listSource; } } /// /// 回报过磅重量 /// 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 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); } } } /// /// 申请判定 /// 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 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); } } } /// /// 撤销申请判定 /// 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 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(); } } } /// /// 查询炉批信息 /// private void doQueryJudgeBath(string heatPlanNo, string judgeNo, string jugdeApplyCode) { List listSource = EntityHelper.GetData( "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 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 listSource = EntityHelper.GetData( "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); } } } /// /// 标识空跑 /// private void DoKpFlag() { this.ultraGrid4.UpdateData(); UltraGridRow uRow = this.ultraGrid4.ActiveRow; if (uRow == null) return; IQueryable 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); } } } } }