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.VRP.Entity; using CoreFS.CA06; 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 FrmBaoJianResult : FrmBase { public FrmBaoJianResult() { InitializeComponent(); } private string Processcode = "";//参数 private DataTable _dtPline = null; private void FrmBaoJianResult_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]);//中文注释替换字段名 EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); this.BeginTime.Value = System.DateTime.Now.AddDays(-1);//设置开始日期为前一天 this.EndTime.Value = System.DateTime.Now.AddDays(0);//设置结束日期为当前日期 Processcode = this.CustomInfo.ToString();//参数 _dtPline = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmBaoJianResult.doQueryPlineCode", new object[] { Processcode }, ob); } /// /// 设置条件参数的可选状态随选中按钮变化 /// /// /// private void checkBox2_CheckedChanged(object sender, EventArgs e) { this.PlcodeEditor.Enabled = this.ChkPlcode.Checked; } private void checkBox4_CheckedChanged(object sender, EventArgs e) { this.InsflagOptionSet.Enabled = this.ChkInsflag.Checked; } private void checkBox5_CheckedChanged(object sender, EventArgs e) { this.ResultOptionSet.Enabled = this.ChkResult.Checked; } private void checkBox3_CheckedChanged(object sender, EventArgs e) { this.JudstNoEditor.Enabled = this.ChkJudstNo.Checked; } private void Chkdealflag_CheckedChanged(object sender, EventArgs e) { this.DealflagOptionSet.Enabled = this.Chkdealflag.Checked; } /// /// 设置关键字与产销软件对应 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": doQuery(); break; case "Save": doSave(); break; case "Chuzhi": doChuzhi(); break; case "RevokeChuzhi": doRevokeChuzhi(); break; case "Del": doDel(); break; case "RevokeDel": doRevokeDel(); break; case "UpdateActCount": doUpdateActCount(); break; case "PrintReport": doPrintReport(); break; case "PrintReportZG": doPrintReportZG(); break; case "PrintReportCP": doPrintReportCP(); break; case "PrintReportTestKey": doPrintReportTestKey(); break; case "Close": this.Close(); break; case "Export": Export(); break; case "UpdateInsflag1": doUpdateInsflag1(); break; case "UpdateInsflag2": doUpdateInsflag2(); break; } } /// /// 查询报检主表 /// public void doQuery() { string begintime = ""; string endtime = ""; string plinecode = ""; string inspectionflag = ""; string result = ""; string judgestoveno = ""; string validflag = ""; string disposalflag = ""; ArrayList list = new ArrayList(); if(ChkTime.Checked){ if(DateTime.Parse(this.BeginTime.Value.ToString())>DateTime.Parse(this.EndTime.Value.ToString())){ MessageUtil.ShowTips("开始时间不能大于结束时间!"); return; } else { begintime = this.BeginTime.Value.ToString("yyyy-MM-dd 07:00:00"); endtime = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } } if(this.ChkPlcode.Checked && this.PlcodeEditor.Text.Trim() != ""){ string pc = PlcodeEditor.Tag.ToString(); plinecode = PlcodeEditor.Tag.ToString().Replace(",", "', '"); } if(this.ChkInsflag.Checked){ inspectionflag = this.InsflagOptionSet.CheckedItem.DataValue.ToString(); } if(this.ChkResult.Checked){ result = this.ResultOptionSet.CheckedItem.DataValue.ToString(); } if(this.ChkJudstNo.Checked && this.JudstNoEditor.Text.Trim() !=""){ judgestoveno = this.JudstNoEditor.Text.Trim(); } if (this.ChkValid.Checked) { validflag = "0"; } if (this.Chkdealflag.Checked) { disposalflag = this.DealflagOptionSet.CheckedItem.DataValue.ToString(); } list.Add(begintime); list.Add(endtime); list.Add(plinecode); list.Add(inspectionflag); list.Add(result); list.Add(judgestoveno); list.Add(Processcode); list.Add(validflag); list.Add(disposalflag); //WaitingForm2 wf = new WaitingForm2("正在加载,请稍候...."); List listSourcemain = EntityHelper.GetData( "com.steering.mes.mcp.Vrp.FrmBaoJianResult.QueryMain", new object[] { list }, this.ob); baoJiaoResultMainEntityBindingSource.DataSource = listSourcemain; } /// /// 查询报检子表 /// /// /// private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { string inspectionno = ""; string inspectionnum = ""; ArrayList list = new ArrayList(); inspectionno = this.ultraGrid1.ActiveRow.Cells["inspectionNo"].Value.ToString(); inspectionnum = this.ultraGrid1.ActiveRow.Cells["inspectionNum"].Value.ToString(); list.Add(inspectionno); list.Add(inspectionnum); List listSourcedetail = EntityHelper.GetData( "com.steering.mes.mcp.Vrp.FrmBaoJianResult.QueryDetail", new object[] { list }, this.ob); baoJiaoResultDetailEntityBindingSource.DataSource = listSourcedetail; List listSourcemain = EntityHelper.GetData( "com.steering.mes.mcp.Vrp.FrmBaoJianResult.QueryMain1", new object[] { list }, this.ob); var list1 = listSourcemain.ToList(); var recheck = list1.Select(p => p.Recheck).ToList(); foreach(var item in recheck){ if(item.Equals("已重检")){ this.ultraGrid2.Enabled = false; } } string disposalflag = this.ultraGrid1.ActiveRow.Cells["disposalFlag"].Value.ToString(); string validflag = this.ultraGrid1.ActiveRow.Cells["validFlag"].Value.ToString(); if (disposalflag.Equals("已完成") || validflag.Equals("无效")) { this.ultraGrid2.Enabled = false; } else { this.ultraGrid2.Enabled = true; } foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["validflag"].Text.ToString().Equals("无效")) { ugr.Appearance.ForeColor = Color.Red; } else { ugr.Appearance.ForeColor = Color.Black; } } } /// /// 修改报检子表字段信息 /// public void doSave() { if(!ultraGrid1.ActiveRow.Cells["inspectionflag"].Text.ToString().Equals("待检") && !ultraGrid1.ActiveRow.Cells["inspectionflag"].Text.ToString().Equals("已检")) { MessageUtil.ShowTips("抽检状态不符,无法修改!"); return; } string flag = "1"; foreach (UltraGridRow ugr1 in ultraGrid2.Rows) { if (ugr1 == null) { MessageUtil.ShowTips("无数据!"); return; } string s = ugr1.Cells["result"].Text.ToString(); if (ugr1.Cells["result"].Text.ToString().Equals("")) { MessageUtil.ShowTips("检验结果项不能为空!请重试!"); return; } } if (MessageUtil.ShowYesNoAndQuestion("确认保存?") == DialogResult.No) { return; } foreach(UltraGridRow ugr in ultraGrid2.Rows){ ArrayList list = new ArrayList(); string Result = ugr.Cells["result"].Text.ToString(); string Reasons = ugr.Cells["reasons"].Text.ToString(); string Mome = ugr.Cells["mome"].Text.ToString(); string detectiondode = ugr.Cells["detectionCode"].Text.ToString(); string Guid = ugr.Cells["guid"].Text.ToString(); list.Add(Result); list.Add(Reasons); list.Add(Mome); list.Add(detectiondode); list.Add(Guid); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "SaveDetail"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if(ccp.ReturnCode == -1){ flag = "0"; MessageUtil.ShowTips(ccp.ReturnInfo); } } if(flag == "1"){ UpdateMain(); doQuery(); MessageUtil.ShowTips("修改成功!"); } } /// /// 根据子表result更新主表inspectionresult /// public void UpdateMain() { UltraGridRow mainrow = ultraGrid1.ActiveRow; BaoJiaoResultMainEntity baojianresultmainentity = (BaoJiaoResultMainEntity)ultraGrid1.ActiveRow.ListObject; baojianresultmainentity.InspectionNo = mainrow.Cells["Inspectionno"].Text.ToString(); baojianresultmainentity.InspectionNum = decimal.Parse(mainrow.Cells["Inspectionnum"].Text.ToString()); baojianresultmainentity.InspectionTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); baojianresultmainentity.InspectionName = this.UserInfo.GetUserName(); baojianresultmainentity.UnqualifiedReasons = ""; baojianresultmainentity.InspectionResult = ""; foreach (UltraGridRow ugr in this.ultraGrid2.Rows) { string result = ugr.Cells["result"].Text.ToString(); if (result=="不合格") { baojianresultmainentity.InspectionResult = "不合格"; baojianresultmainentity.UnqualifiedReasons += //ugr.Cells["projectCategory"].Text.ToString() + "-" + ugr.Cells["projectName"].Text.ToString() + "-" + ugr.Cells["reasons"].Text.ToString() +"\n"; baojianresultmainentity.DisposalFlag = "0"; } } if(baojianresultmainentity.InspectionResult.Equals("")){ baojianresultmainentity.InspectionResult = "合格"; baojianresultmainentity.DisposalFlag = ""; } if (!baojianresultmainentity.UnqualifiedReasons.Equals("")) { baojianresultmainentity.UnqualifiedReasons = baojianresultmainentity.UnqualifiedReasons.Substring(0, baojianresultmainentity.UnqualifiedReasons.Length - 1); } string jsonstr = JSONFormat.Format(baojianresultmainentity); CoreClientParam ccp1 = new CoreClientParam(); ccp1.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp1.MethodName = "UpdateMain"; ccp1.ServerParams = new object[] { jsonstr }; ccp1 = ob.ExecuteNonQuery(ccp1, CoreInvokeType.Internal); } /// /// 处置 /// public void doChuzhi() { UltraGridRow mainrow = ultraGrid1.ActiveRow; if (mainrow.Cells["validflag"].Text.ToString().Equals("无效")) { MessageUtil.ShowTips("无效数据!无法进行操作!"); return; } if (mainrow.Cells["inspectionResult"].Text.ToString().Equals("合格") || mainrow.Cells["inspectionResult"].Text.ToString().Equals("")) { MessageUtil.ShowTips("报检结果不符,不能处置!"); return; } if (mainrow.Cells["disposalMethod"].Text.ToString().Equals("")) { MessageUtil.ShowTips("处置方式不能为空!请重试!"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认处置?") == DialogResult.No) { return; } BaoJiaoResultMainEntity baojianresultmainentity = (BaoJiaoResultMainEntity)ultraGrid1.ActiveRow.ListObject; baojianresultmainentity.InspectionNo = mainrow.Cells["inspectionNo"].Text.ToString(); baojianresultmainentity.InspectionNum = decimal.Parse(mainrow.Cells["Inspectionnum"].Text.ToString()); baojianresultmainentity.DisposalMethod = mainrow.Cells["disposalMethod"].Text.ToString(); baojianresultmainentity.DisposalFlag = "1"; baojianresultmainentity.DisposalTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); baojianresultmainentity.DisposalName = this.UserInfo.GetUserName(); string jsonstr = JSONFormat.Format(baojianresultmainentity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "Chuzhi"; ccp.ServerParams = new object[]{ jsonstr }; ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal); if(ccp.ReturnCode != -1){ if(ccp.ReturnInfo.Equals("处置成功!")){ doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销处置 /// public void doRevokeChuzhi() { UltraGridRow mainrow = ultraGrid1.ActiveRow; if (mainrow.Cells["validflag"].Text.ToString().Equals("无效")) { MessageUtil.ShowTips("无效数据!无法进行操作!"); return; } if (!mainrow.Cells["disposalFlag"].Text.ToString().Equals("已完成")) { MessageUtil.ShowTips("还未进行处置,不能撤销!"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认撤销处置?") == DialogResult.No) { return; } BaoJiaoResultMainEntity baojianresultmainentity = (BaoJiaoResultMainEntity)ultraGrid1.ActiveRow.ListObject; baojianresultmainentity.InspectionNo = mainrow.Cells["inspectionNo"].Text.ToString(); baojianresultmainentity.InspectionNum = decimal.Parse(mainrow.Cells["Inspectionnum"].Text.ToString()); baojianresultmainentity.DisposalMethod = ""; baojianresultmainentity.DisposalFlag = "0"; baojianresultmainentity.DisposalTime = ""; baojianresultmainentity.DisposalName = ""; string jsonstr = JSONFormat.Format(baojianresultmainentity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "RevokeChuzhi"; ccp.ServerParams = new object[] { jsonstr }; ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal); if(ccp.ReturnCode != -1){ if(ccp.ReturnInfo.Equals("撤销成功!")){ doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 废除 /// public void doDel() { UltraGridRow mainrow = ultraGrid1.ActiveRow; if (mainrow.Cells["validflag"].Text.ToString().Equals("无效")) { MessageUtil.ShowTips("已经退回的数据无法再废除!"); return; } ArrayList list = new ArrayList(); string inspectionNo = ""; string inspectionNum = ""; inspectionNo = mainrow.Cells["inspectionNo"].Text.ToString(); inspectionNum = mainrow.Cells["inspectionNum"].Text.ToString(); list.Add(inspectionNo); list.Add(inspectionNum); if(MessageUtil.ShowYesNoAndQuestion("确认退回?") == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "DelMain"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal); int returncode = ccp.ReturnCode; if(returncode != -1){ if (ccp.ReturnInfo.Equals("退回成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } /// /// 撤销废除 /// public void doRevokeDel() { UltraGridRow mainrow = ultraGrid1.ActiveRow; if (mainrow.Cells["validflag"].Text.ToString().Equals("有效")) { MessageUtil.ShowTips("有效数据,无法撤销废除!"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认撤销废除?") == DialogResult.No) { return; } ArrayList list = new ArrayList(); string inspectionno = mainrow.Cells["inspectionNo"].Text.ToString(); string inspectionnum = mainrow.Cells["inspectionNum"].Text.ToString(); list.Add(inspectionno); list.Add(inspectionnum); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "RevokeDel"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal); if(ccp.ReturnCode != -1){ if(ccp.ReturnInfo.Equals("撤销废除成功!")){ doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } #region 抽检doChoujian() /// /// 抽检 /// public void doChoujian() { ArrayList listPT = new ArrayList(); foreach(UltraGridRow ugr in this.ultraGrid1.Rows){ if (ugr.Cells["gradecode"].Text.ToString() == "20" && ugr.Cells["stdCode"].Text.ToString() == "8162" || ugr.Cells["stdCode"].Text.ToString() == "8163" && ugr.Cells["InspectionFlag"].Text.ToString().Equals("待抽") && ugr.Cells["validflag"].Text.ToString().Equals("有效")) { string idcode = ugr.Cells["idcode"].Text.ToString(); listPT.Add(idcode); } else { if (ugr.Cells["validflag"].Text.ToString().Equals("无效")) { return; } if (ugr.Cells["inspectionFlag"].Text.ToString().Equals("待抽")) { ArrayList listTS = new ArrayList(); string idcode = ugr.Cells["idcode"].Text.ToString(); listTS.Add(idcode); CoreClientParam ccpTS = new CoreClientParam(); ccpTS.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccpTS.MethodName = "ChoujianTS"; ccpTS.ServerParams = new object[] { listTS }; ccpTS = ob.ExecuteNonQuery(ccpTS, CoreInvokeType.Internal); if(ccpTS.ReturnCode == -1){ MessageUtil.ShowTips(ccpTS.ReturnInfo); return; } } } } CoreClientParam ccpPT = new CoreClientParam(); ccpPT.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccpPT.MethodName = "ChoujianPT"; ccpPT.ServerParams = new object[] { listPT }; ccpPT = ob.ExecuteNonQuery(ccpPT, CoreInvokeType.Internal); if(ccpPT.ReturnCode != -1){ if(ccpPT.ReturnInfo.Equals("已抽检!")){ doQuery(); MessageUtil.ShowTips(ccpPT.ReturnInfo); } } else { MessageUtil.ShowTips(ccpPT.ReturnInfo); } } #endregion /// /// 修改支数 /// public void doUpdateActCount() { UltraGridRow ugr = ultraGrid1.ActiveRow; if(!ugr.Cells["inspectionFlag"].Text.ToString().Equals("待检")){ MessageUtil.ShowTips("抽检状态不符,不能修改支数!"); return; } ArrayList list = new ArrayList(); string inspectionno = ugr.Cells["inspectionNo"].Text.ToString(); string inspectionum = ugr.Cells["inspectionNum"].Text.ToString(); decimal countpre = decimal.Parse(ugr.Cells["actCount"].Value.ToString()); decimal count = decimal.Parse(ugr.Cells["actCount"].Text.ToString()); if(count>countpre){ MessageUtil.ShowTips("修改后的支数不能大于原支数!"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认修改?") == DialogResult.No) { return; } string countnew = count.ToString(); decimal weightpre = decimal.Parse(ugr.Cells["actWeight"].Text.ToString()); decimal eachweight = (weightpre / countpre); string weightnew = Math.Round((eachweight * count),2).ToString(); string scarpnum = (countpre - count).ToString(); string scarpwt = (weightpre - decimal.Parse(weightnew)).ToString(); list.Add(inspectionno); list.Add(inspectionum); list.Add(countnew); list.Add(weightnew); list.Add(scarpnum); list.Add(scarpwt); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "UpdateActCount"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal); if(ccp.ReturnCode != -1){ if(ccp.ReturnInfo.Equals("修改成功!")){ doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } /// /// 打印报检单 /// public void doPrintReport() { UltraGridRow ugr = ultraGrid1.ActiveRow; if (ugr == null) { MessageUtil.ShowTips("未查询到数据!"); return; } string inspectionno = ugr.Cells["inspectionno"].Text.ToString(); string inspectionnum = ugr.Cells["inspectionnum"].Text.ToString(); string heatplanno = ugr.Cells["heatplanno"].Text.ToString(); string judgestoveno = ugr.Cells["judgestoveno"].Text.ToString(); string plinecode = ugr.Cells["plinecode"].Text.ToString(); string processcode = ugr.Cells["processcode"].Text.ToString(); var strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeBj.cpt&INSPECTION_NO=" + inspectionno + "&INSPECTION_NUM=" + inspectionnum + "&HEAT_PLAN_NO=" + heatplanno + "&JUDGE_STOVE_NO=" + judgestoveno + "&PLINE_CODE=" + plinecode + "&PROCESS_CODE=" + processcode; 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(); } /// /// 打印整改单 /// public void doPrintReportZG() { UltraGridRow ugr = ultraGrid1.ActiveRow; if (ugr == null) { MessageUtil.ShowTips("未查询到数据!"); return; } string inspectionno = ugr.Cells["inspectionNo"].Text.ToString(); string inspectionum = ugr.Cells["inspectionNum"].Text.ToString(); string plinename = ugr.Cells["plineName"].Text.ToString(); string judgestoveno = ugr.Cells["judgeStoveNo"].Text.ToString(); string betchno = ugr.Cells["batchNo"].Text.ToString(); string gradename = ugr.Cells["gradename"].Text.ToString(); string steelname = ugr.Cells["steelname"].Text.ToString(); string specname = ugr.Cells["specName"].Text.ToString(); string craftfileno = ugr.Cells["craftFileNo"].Text.ToString(); string unqreason = ugr.Cells["unqualifiedReasons"].Text.ToString(); string inspectiontime = ugr.Cells["inspectionTime"].Text.ToString(); string inspectionname = ugr.Cells["inspectionName"].Text.ToString(); string disposalmethod = ugr.Cells["disposalMethod"].Text.ToString(); string disposaltime = ugr.Cells["disposalTime"].Text.ToString(); string disposalname = ugr.Cells["disposalName"].Text.ToString(); var strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeBjUnqualifiedProductsZG.cpt&INSPECTION_NO=" + inspectionno + "&INSPECTION_NUM=" + inspectionum; 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(); } /// /// 打印成品钢管报检单 /// public void doPrintReportCP() { UltraGridRow ugr = ultraGrid1.ActiveRow; if(ugr == null){ MessageUtil.ShowTips("未查询到数据!"); return; } string inspectionno = ugr.Cells["inspectionno"].Text.ToString(); string inspectionnum = ugr.Cells["inspectionnum"].Text.ToString(); string heatplanno = ugr.Cells["heatplanno"].Text.ToString(); string judgestoveno = ugr.Cells["judgestoveno"].Text.ToString(); string plinecode = ugr.Cells["plinecode"].Text.ToString(); string processcode = ugr.Cells["processcode"].Text.ToString(); string batchno = ugr.Cells["batchno"].Text.ToString(); var strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeBjCheck.cpt&INSPECTION_NO=" + inspectionno + "&INSPECTION_NUM=" + inspectionnum + "&HEAT_PLAN_NO=" + heatplanno + "&JUDGE_STOVE_NO=" + judgestoveno + "&PLINE_CODE=" + plinecode + "&PROCESS_CODE=" + processcode + "&BATCH_NO=" + batchno; 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(); } /// /// 打印检验要点 /// public void doPrintReportTestKey() { UltraGridRow ugr = ultraGrid1.ActiveRow; if(ugr == null){ MessageUtil.ShowTips("未查询到数据!"); return; } string PROCESS_CODE = ugr.Cells["processCode"].Text.ToString(); string ORDER_NO = ugr.Cells["orderNo"].Text.ToString() + "/" + ugr.Cells["orderSeq"].Text.ToString(); var strurl = ""; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilTestKey2.cpt&PROCESS_CODE=" + "D" + "&ORDER_NO=" + ORDER_NO; 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 PlcodeEditor_EditorButtonClick_1(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, this.ob); //frm.ShowDialog(); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { PlcodeEditor.Tag = frm.ChoicePlineCode; PlcodeEditor.Text = frm.ChoicePlineName; } } /// /// 工艺文件查看 /// /// /// private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraGridRow row = ultraGrid1.ActiveRow; if (row == null) return; string CraftPath = row.Cells["CraftPath"].Text.ToString(); FormFileDown askDown = new FormFileDown(this.ob, CraftPath); askDown.CtrlFileDown1.Button3.Visible = false; askDown.Show(); } /// /// 导出 /// private void Export() { string title = ""; title += "报检实绩[轧管]"; GridHelper.ulGridToExcel(ultraGrid1, title); } /// /// 20钢抽检改待检 /// public void doUpdateInsflag1() { string inspectionNo = ""; string inspectionNum = ""; string insflag = "1"; if (!this.ultraGrid1.ActiveRow.Cells["inspectionFlag"].Text.ToString().Equals("待抽")) { MessageUtil.ShowTips("此操作只对状态为待抽的数据有效,请重试!"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认修改?") == DialogResult.No) { return; } ArrayList list = new ArrayList(); inspectionNo = this.ultraGrid1.ActiveRow.Cells["inspectionNo"].Text.ToString(); inspectionNum = this.ultraGrid1.ActiveRow.Cells["inspectionNum"].Text.ToString(); list.Add(inspectionNo); list.Add(inspectionNum); list.Add(insflag); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "UpdateInsflag"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } /// /// 20钢抽检改免检 /// public void doUpdateInsflag2() { string inspectionNo = ""; string inspectionNum = ""; string insflag = "3"; if (!this.ultraGrid1.ActiveRow.Cells["inspectionFlag"].Text.ToString().Equals("待抽")) { MessageUtil.ShowTips("此操作只对状态为待抽的数据有效,请重试!"); return; } if (MessageUtil.ShowYesNoAndQuestion("确认修改?") == DialogResult.No) { return; } ArrayList list = new ArrayList(); inspectionNo = this.ultraGrid1.ActiveRow.Cells["inspectionNo"].Text.ToString(); inspectionNum = this.ultraGrid1.ActiveRow.Cells["inspectionNum"].Text.ToString(); list.Add(inspectionNo); list.Add(inspectionNum); list.Add(insflag); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult"; ccp.MethodName = "UpdateInsflag"; ccp.ServerParams = new object[] { list }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } }