using com.steering.mes.zgmil.entity; using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.ZGMil.Common; using Core.StlMes.Client.ZGMil.Entity; using Core.StlMes.Client.ZGMil.NodeResultQuery; using Core.StlMes.Client.ZGMil.Popup; using Core.StlMes.Client.ZGMil.ResultConrtrol; 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.ZGMil.Signature { public partial class FrmApplyDecision : FrmBase { private string[] plineCodes = { }; public FrmApplyDecision() { InitializeComponent(); } private void FrmApplyDecision_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.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00"); this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59"); EntityHelper.ShowGridCaption(ultraGrid6.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid7.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob); if (this.CustomInfo.Equals("WG")) { this.ultraGrid6.DisplayLayout.Bands[0].Columns["Bjz"].Hidden = true; this.ultraGrid6.DisplayLayout.Bands[0].Columns["Yjz"].Hidden = true; this.ultraGrid6.DisplayLayout.Bands[0].Columns["Xcjz"].Hidden = true; this.ultraGrid6.DisplayLayout.Bands[0].Columns["Ycjz"].Hidden = true; this.ultraGrid6.DisplayLayout.Bands[0].Columns["InspectionFlag"].Hidden = true; this.ultraGrid6.DisplayLayout.Bands[0].Columns["IsOk"].Hidden = true; } InitBindColumn(); } private void WriteTextToGrid() { foreach(UltraGridRow row in ultraGrid6.Rows) { if (row.Cells["ChemResultCode"].Value.ToString() == "") { row.Cells["ChemResultCode"].Value = "合格"; row.Cells["ChemResultCode"].ActiveAppearance.TextHAlign = Infragistics.Win.HAlign.Center; } else { if (row.Cells["ChemResultCode"].Value.ToString() == "40740101") { row.Cells["ChemResultCode"].Value = "内控合格"; } else if (row.Cells["ChemResultCode"].Value.ToString() == "40740102") { row.Cells["ChemResultCode"].Value = "内控不合格"; } else if (row.Cells["ChemResultCode"].Value.ToString() == "40740103") { row.Cells["ChemResultCode"].Value = "交付合格"; } else if (row.Cells["ChemResultCode"].Value.ToString() == "40740104") { row.Cells["ChemResultCode"].Value = "交付不合格"; } } } ultraGrid6.UpdateData(); } private void WriteTextToGrid2() { foreach (UltraGridRow row in ultraGrid7.Rows) { if (row.Cells["PhyResultCode"].Value.ToString() == "") { row.Cells["PhyResultCode"].Value = "合格"; row.Cells["PhyResultCode"].ActiveAppearance.TextHAlign = Infragistics.Win.HAlign.Center; } else { if (row.Cells["PhyResultCode"].Value.ToString() == "40740201") { row.Cells["PhyResultCode"].Value = "内控合格"; } else if (row.Cells["PhyResultCode"].Value.ToString() == "40740202") { row.Cells["PhyResultCode"].Value = "国标合格"; } else if (row.Cells["PhyResultCode"].Value.ToString() == "40740203") { row.Cells["PhyResultCode"].Value = "待判"; } else if (row.Cells["PhyResultCode"].Value.ToString() == "40740204") { row.Cells["PhyResultCode"].Value = "次品"; } else if (row.Cells["PhyResultCode"].Value.ToString() == "40740205") { row.Cells["PhyResultCode"].Value = "废品"; } } } ultraGrid7.UpdateData(); } private void InitBindColumn() { //材料状态 this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料产出(已判定)"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料已编计划"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料待处理"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料加工"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单"); this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂"); //材料类别 this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品"); this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品"); this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品"); //探伤结果 this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740401", "内控合格"); this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740402", "国标合格"); this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740403", "待判"); this.ultraGrid7.DisplayLayout.ValueLists[2].ValueListItems.Add("40740404", "废品"); //表检结果 this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740601", "合格"); this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740602", "不合格"); this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740603", "判废"); this.ultraGrid7.DisplayLayout.ValueLists[3].ValueListItems.Add("40740604", "待判"); //综合判定结果 this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740701", "合同内合格"); this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740702", "改判合格"); this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740703", "待判"); this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740704", "次品"); this.ultraGrid7.DisplayLayout.ValueLists[4].ValueListItems.Add("40740705", "废品"); //成分结果 this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740101", "内控合格"); this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740102", "内控不合格"); this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740103", "交付合格"); this.ultraGrid7.DisplayLayout.ValueLists[5].ValueListItems.Add("40740104", "交付不合格"); //性能结果 this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740201", "内控合格"); this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740202", "国标合格"); this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740203", "待判"); this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740204", "次品"); this.ultraGrid7.DisplayLayout.ValueLists[6].ValueListItems.Add("40740205", "废品"); //材料状态 this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料产出(已判定)"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料已编计划"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料待处理"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料加工"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单"); this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂"); //材料类别 this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品"); this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品"); this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品"); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "DoQueryMat": if (ultraTabControl1.SelectedTab.Index == 0) { QueryMat(); } else if (ultraTabControl1.SelectedTab.Index == 1) { QueryZgJugdeApply(); } break; case "DoDecision": DoDecision(); break; case "cancelDoDecision": cancelDoDecision(); break; case "insertProssWt": insertProssWt(); break; case "updateProssWt": updateProssWt(); break; case"insertTestingResult": insertTestingResult(); break; case "updateTarget": updateTarget(); break; case "inspection": inspection(); break; case "inspection2": inspection2(); break; case "Print": printPipe(); break; case "Print1": printPipe1(); break; case "Print2": printPipe2(); break; case "Print3": printPipe3(); break; case "inspection3": inspection3(); break; case "doSaveOrdLnDlyPk": doSaveOrdLnDlyPk(); break; case "Close": this.Close(); break; } } private void getDeliveryNo(string ordLnPk) { DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDeliveryNo", new object[] { ordLnPk }, ob);//快速检索码 if (dd != null && dd.Rows.Count > 0) { DeliveryNoText.DataSource = dd; DeliveryNoText.ValueMember = "BASECODE"; DeliveryNoText.DisplayMember = "BASENAME"; } } /// /// 报检 /// private void inspection() { this.ultraGrid6.UpdateData(); this.ultraGrid7.UpdateData(); UltraGridRow uRow1 = this.ultraGrid6.ActiveRow; //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); 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.ultraGrid7.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, "D", flag , this.UserInfo.GetUserName()}; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("报检成功!")) { QueryMat(); MatZcMEntity2bindingSource.Clear(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 报检2(必检) /// private void inspection2() { this.ultraGrid6.UpdateData(); this.ultraGrid7.UpdateData(); UltraGridRow uRow1 = this.ultraGrid6.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.ultraGrid7.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, "D", flag, this.UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("报检成功!")) { QueryMat(); MatZcMEntity2bindingSource.Clear(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 报检3(免检) /// public void inspection3() { this.ultraGrid6.UpdateData(); this.ultraGrid6.UpdateData(); UltraGridRow uRow1 = this.ultraGrid6.ActiveRow; 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.ultraGrid7.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, "D", flag, this.UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("报检成功!")) { QueryMat(); MatZcMEntity2bindingSource.Clear(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 修改产品标识 /// private void updateTarget() { this.ultraGrid6.UpdateData(); UltraGridRow uRow = this.ultraGrid6.ActiveRow; if (uRow == null) { return; } ArrayList parm = new ArrayList(); MatZcMEntity matZctity = (MatZcMEntity)uRow.ListObject; string matZcTity = JSONFormat.Format(matZctity); parm.Add(matZcTity); if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "updateTarget"; ccp.ServerParams = new object[] { parm }; 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 insertTestingResult() { string testingType = ""; string testingGrade = ""; UltraGridRow uRow = this.ultraGrid6.ActiveRow; if (uRow == null) { MessageUtil.ShowTips("请选择炉信息!"); return; } //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentid = UserInfo.GetDeptid(); NativeMethodNew na = new NativeMethodNew(this.ob); string plinCode = na.GetPCode(this.UserInfo.GetDepartment()); DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryTestingResult", new object[] { uRow.Cells["JudgeStoveNo"].Text + "-01",plinCode }, ob); if(ds.Rows.Count>0) { if (plinCode.Equals("C008") || plinCode.Equals("C009") || plinCode.Equals("C017")) { if (ds.Rows[0]["LO_SURFACE"].ToString() == "") { MessageUtil.ShowTips("探伤实绩的参数信息为录入,不允许进行申请判定!"); return; } else { testingGrade = ds.Rows[0]["LO_SURFACE"].ToString(); if (testingGrade.Equals("/")) { testingType = ""; } else { testingType = "EMI"; } } } else if (plinCode.Equals("C010")) { if (ds.Rows[0]["ACCEPTANCE_GRADE"].ToString() == "") { MessageUtil.ShowTips("探伤实绩的参数信息未录入,不允许进行申请判定!"); return; } else { testingGrade = ds.Rows[0]["ACCEPTANCE_GRADE"].ToString(); if (testingGrade.Equals("/")) { testingType = ""; } else { testingType = "ET"; } } } }else { MessageUtil.ShowTips("探伤工序点未录入实绩,不允许进行申请判定!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "updateTestingResult"; ccp.ServerParams = new object[] { uRow.Cells["JudgeStoveNo"].Text, testingGrade, testingType }; 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 printPipe3() { this.ultraGrid7.UpdateData(); this.ultraGrid1.UpdateData(); string jugeNo = ""; string applyNo = ""; UltraGrid ultraGrid = null; if (ultraTabControl1.SelectedTab.Index == 0) { ultraGrid = ultraGrid7; foreach (UltraGridRow ugr in ultraGrid.Rows) { string applyNo1 = ugr.Cells["JugdeApplyCode"].Text.Trim(); if (applyNo == "") { applyNo = applyNo1; } else { if (!applyNo.Contains(applyNo1)) { applyNo = applyNo + "','" + applyNo1; } } } } else if (ultraTabControl1.SelectedTab.Index == 1) { ultraGrid = ultraGrid1; applyNo = ultraGrid.ActiveRow.Cells["JugdeApplyCode"].Text.Trim(); } UltraGridRow uRow = ultraGrid.ActiveRow; if (uRow == null) { MessageUtil.ShowTips("请选择需要打印的判定信息!"); return; } string userGroup = this.UserInfo.GetUserGroup(); string userOrder = this.UserInfo.GetUserOrder(); string userName = this.UserInfo.GetUserName(); //string applyNo = uRow.Cells["JugdeApplyCode"].Text.Trim(); if (applyNo == "") { MessageUtil.ShowTips("未申请判定,不允许判定单的打印!"); } string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilApplyCard.cpt&format=pdf&APPLY_CODE=" + applyNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder + "&USER_ID="+ userName; FrmExcel fre = new FrmExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 整炉打印 /// private void printPipe2() { this.ultraGrid6.UpdateData(); this.ultraGrid1.UpdateData(); string jugeNo = ""; string plineCode = ""; UltraGrid ultraGrid = null; if (ultraTabControl1.SelectedTab.Index == 0) { ultraGrid = ultraGrid6; } else if (ultraTabControl1.SelectedTab.Index == 1) { ultraGrid = ultraGrid1; } UltraGridRow uRow = ultraGrid.ActiveRow; if (uRow == null) { MessageUtil.ShowTips("请选择需要打印的炉信息!"); return; } jugeNo = uRow.Cells["JudgeStoveNo"].Value.ToString(); plineCode = uRow.Cells["PlineCode"].Value.ToString(); string userGroup = this.UserInfo.GetUserGroup(); string userOrder = this.UserInfo.GetUserOrder(); string strurl = ""; //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentid = UserInfo.GetDeptid(); DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryApplyCodeNull", new object[] { BaseMethod.getJudgeStoveNo(jugeNo), departMentid, plineCode }, this.ob); //if (int.Parse(ds.Rows[0][0].ToString()) > 0) //{ // MessageUtil.ShowTips("有未申请判定的数据,不允许进行缴库单打印!"); // return; //} if (plineCode.Equals("C072")) { strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryTH.cpt&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder; } else { strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYMTest1.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder; } FrmExcel fre = new FrmExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 打印缴库单 /// private void printPipe() { this.ultraGrid7.UpdateData(); this.ultraGrid1.UpdateData(); string jugeNo = ""; string jugeNo2 = ""; string plineCode = ""; UltraGrid ultraGrid = null; if (ultraTabControl1.SelectedTab.Index == 0) { ultraGrid = ultraGrid7; } else if (ultraTabControl1.SelectedTab.Index == 1) { ultraGrid = ultraGrid1; } UltraGridRow uRow = ultraGrid.ActiveRow; if (uRow == null) { MessageUtil.ShowTips("请选择需要打印的炉信息!"); return; } jugeNo = uRow.Cells["JudgeStoveNo"].Value.ToString()+"-01"; jugeNo2 = uRow.Cells["JudgeStoveNo"].Value.ToString(); plineCode = uRow.Cells["PlineCode"].Value.ToString(); string strurl = ""; //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentid = UserInfo.GetDeptid(); string userGroup = this.UserInfo.GetUserGroup(); string userOrder = this.UserInfo.GetUserOrder(); DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryApplyCodeNull", new object[] { jugeNo.Substring(0,6), departMentid, plineCode }, this.ob); //if (int.Parse(ds.Rows[0][0].ToString()) > 0) //{ // MessageUtil.ShowTips("有未申请判定的数据,不允许进行缴库单打印!"); // return; //} //string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYM.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo; strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYMTest.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder; FrmExcel fre = new FrmExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 打印缴库单 /// private void printPipe1() { this.ultraGrid7.UpdateData(); string jugeNo = ""; string plineCode = ""; UltraGrid ultraGrid = null; if (ultraTabControl1.SelectedTab.Index == 0) { ultraGrid = ultraGrid7; } else if (ultraTabControl1.SelectedTab.Index == 1) { ultraGrid = ultraGrid1; } UltraGridRow uRow = ultraGrid.ActiveRow; if (uRow == null) { MessageUtil.ShowTips("请选择需要打印的炉信息!"); return; } jugeNo = uRow.Cells["JudgeStoveNo"].Value.ToString(); plineCode = uRow.Cells["PlineCode"].Value.ToString(); //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentid = UserInfo.GetDeptid(); string userGroup = this.UserInfo.GetUserGroup(); string userOrder = this.UserInfo.GetUserOrder(); DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryApplyCodeNull", new object[] { jugeNo, departMentid, plineCode }, this.ob); //if (int.Parse(ds.Rows[0][0].ToString()) > 0) //{ // MessageUtil.ShowTips("有未申请判定的数据,不允许进行缴库单打印!"); // return; //} string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYMTestAgain.cpt&format=pdf&JUDGE_STOVE_NO=" + jugeNo + "&GROUP=" + userGroup + "&SHIFT=" + userOrder; FrmExcel fre = new FrmExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 回填过磅重量 /// private void insertProssWt() { this.ultraGrid6.UpdateData(); UltraGridRow uRow = this.ultraGrid6.ActiveRow; //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); string departMentid = UserInfo.GetDeptid(); if (uRow == null) { MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!"); return; } DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlanPrt", new object[] { uRow.Cells["JudgeStoveNo"].Text + "-01" }, ob); if(!uRow.Cells["PlineCode"].Text.ToString().Equals("C072")) { if (ds.Rows[0][0].ToString() == "0" || ds.Rows[0][0].ToString() == "") { 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["LotNo"].Value.ToString()); list.Add(uRow.Cells["BelongCode"].Value.ToString()); list.Add(this.UserInfo.GetUserName()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "insertProssWt"; ccp.ServerParams = new object[] { list, departMentid }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("回报成功!")) { QueryMat(); MatZcMEntity2bindingSource.Clear(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销申请判定 /// private void cancelDoDecision() { this.ultraGrid7.UpdateData(); IQueryable checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!"); return; } ArrayList parm = new ArrayList(); foreach (UltraGridRow uRow in checkMagRows) { MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject; string matTity = JSONFormat.Format(matZcTity); parm.Add(matTity); } if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "cancelDoDecision"; ccp.ServerParams = new object[] { parm,this.UserInfo.GetUserName() }; 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.ultraGrid7.UpdateData(); int m = 0; int n = 0; int z = 0; string target = "";//去向 //string departMentid = UserInfo.GetDeptid(); //NativeMethodNew na = new NativeMethodNew(this.ob); //string plinCode = na.GetPCode(this.UserInfo.GetDepartment()); UltraGridRow row = this.ultraGrid6.ActiveRow; int JugdeApplyNum1 = int.Parse(row.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; if (row == null) return; IQueryable checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { MessageUtil.ShowTips("请选择需要申请判定的主信息!"); return; } if (this.CustomInfo.Equals("ZG")) { //成品没检验合格的不能送判 if (row.Cells["Target"].Text == "A" && row.Cells["PlineCode"].Text != "C072") { //DataTable bj = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBjCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), row.Cells["PlineCode"].Text }, ob); //if (bj.Rows.Count > 0) //{ // if (int.Parse(bj.Rows[0][0].ToString3()) < int.Parse(row.Cells["ActCount"].Text.ToString3())) // { // MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!"); // return; // } //} if (row.Cells["IsOk"].Text.ToString().Equals("不可送判")) { MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!"); return; } } if (row.Cells["Target"].Text == "B" && row.Cells["PlineCode"].Text != "C072") { //DataTable bj = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBjCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), row.Cells["PlineCode"].Text }, ob); //if (bj.Rows.Count > 0) //{ // if (int.Parse(bj.Rows[0][0].ToString3()) < int.Parse(row.Cells["ActCount"].Text.ToString3())) // { // MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!"); // return; // } //} if (row.Cells["IsOk"].Text.ToString().Equals("不可送判")) { MessageUtil.ShowTips("存在未检验合格的支数,不允许申请判定!"); return; } } if (row.Cells["Target"].Text == "C" && row.Cells["PlineCode"].Text != "C072") { //DataTable dc = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOfflineCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob); //if (dc.Rows.Count > 0) //{ // MessageUtil.ShowTips("该炉有存在待处理品,不允许申请判定!"); // return; //} DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgContratNo", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob); DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgJugdeCount", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), dd.Rows[0][0].ToString() }, ob); if (ds.Rows.Count > 0) { if (!ds.Rows[0][0].Equals("0") ) { MessageUtil.ShowTips("炉为C字头,该合同已申请判定过,不允许申请判定!"); // return; } } MilPlan milPlan3 = new MilPlan(); milPlan3.JudgeStoveNo = row.Cells["JudgeStoveNo"].Text.Trim(); milPlan3.LotNo = row.Cells["LotNo"].Text.Trim(); milPlan3.PlineCode = row.Cells["PlineCode"].Text.Trim(); milPlan3.ProPlanId = row.Cells["ProOrderId"].Text.Trim(); milPlan3.GxPlanNo = row.Cells["GxPlanNo"].Text.Trim(); int num = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.updateProcess", new object[] { milPlan3 }, this.ob); DataTable dtc = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilProcess", new object[] { row.Cells["JudgeStoveNo"].Text.Trim(), row.Cells["ProOrderId"].Text.Trim(), row.Cells["GxPlanNo"].Text.Trim() }, ob); if (dtc.Rows.Count > 0) { if (!dtc.Rows[0][0].Equals("0")) { MessageUtil.ShowTips("炉为C字头,有待处理的数据,不允许申请判定!"); // return; } } } DataTable ddPrtFlag = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgPrtFlag", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob); DataTable ddPonderGrossWT = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZgPonderGrossWT", new object[] { row.Cells["JudgeStoveNo"].Text.Trim() }, ob); if (ddPrtFlag.Rows.Count > 0) { if (ddPrtFlag.Rows[0][0].Equals("1") && ddPonderGrossWT.Rows[0][0].Equals("0")) { MessageUtil.ShowTips("该炉需要过磅,没过磅不允许申请判定!"); return; } } } ArrayList parm = new ArrayList(); switch (this.CustomInfo) { case "ZG": if (!doQueryNode(this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString())) { MessageUtil.ShowTips("该炉在交库点未结炉,不允许申请判定!"); return; } //DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Text + "-01", "", "" }, ob); //target = dd.Rows[0]["TARGET"].ToString(); foreach (UltraGridRow uRow in checkMagRows) { if (uRow.Cells["QcmStaus"].Text.Trim() == "判废" || uRow.Cells["QcmStaus"].Text.Trim() == "待处理") { m = m + 1; } if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "") { n = n + 1; } //DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryResult", new object[] { uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["BatchNo"].Text, uRow.Cells["BatchGroudNo"].Text, target }, ob); //if (int.Parse(ds.Rows[0][0].ToString()) > 0) //{ // z = z + 1; //} if (int.Parse(uRow.Cells["PonderGrossCount"].Text.ToString3())>0) { if (uRow.Cells["ActCount"].Text.Trim() != uRow.Cells["PonderGrossCount"].Text.Trim()) { MessageUtil.ShowTips("还有未过磅的管子,不允许申请判定!"); return; } } MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject; matZcEntity.Target = this.ultraGrid6.ActiveRow.Cells["Target"].Value.ToString(); if (row.Cells["MchDimensionsResult"].Text.Trim() == "") { matZcEntity.MchDimensionsResult = "合格"; } else { matZcEntity.MchDimensionsResult = row.Cells["MchDimensionsResult"].Text.Trim(); } if (row.Cells["MchVisualResult"].Text.Trim() == "") { matZcEntity.MchVisualResult = "合格"; } else { matZcEntity.MchVisualResult = row.Cells["MchVisualResult"].Text.Trim(); } string matZcTity = JSONFormat.Format(matZcEntity); parm.Add(matZcTity); JugdeApplyNum2 += int.Parse(uRow.Cells["ActCount"].Value.ToString()); string LengthType = uRow.Cells["LengthType"].Value.ToString();//长度类型(0-正尺,1-长尺,2-短尺) string InMold = uRow.Cells["InMold"].Value.ToString();//入库区分(801701-非计划入,801703-按计划入) double ActLen1 = double.Parse(uRow.Cells["ActLen1"].Value.ToString3());//累计送判米 double ActWeight1 = double.Parse(uRow.Cells["ActWeight1"].Value.ToString3());//累计送判吨 double ActWeightL = double.Parse(uRow.Cells["ActWeightL"].Value.ToString3());//累计送判吨(长尺) double ActWeightS = double.Parse(uRow.Cells["ActWeightS"].Value.ToString3());//累计送判吨(短尺) double ActLen2 = double.Parse(uRow.Cells["ActLen2"].Value.ToString3());//累计送判米(按计划入) double ActWeight2 = double.Parse(uRow.Cells["ActWeight2"].Value.ToString3());//累计送判吨(按计划入) double PaydownWtMax = double.Parse(uRow.Cells["PaydownWtMax"].Value.ToString3());//缴库量上限 double Orderweight = double.Parse(uRow.Cells["Orderweight"].Value.ToString3());//估算量 double OrderWtMaxShort = double.Parse(uRow.Cells["OrderWtMaxShort"].Value.ToString3());//短尺缴库量上限 double OrderWtMaxLong = double.Parse(uRow.Cells["OrderWtMaxLong"].Value.ToString3());//长尺缴库量上限 double Kspz = double.Parse(uRow.Cells["Kspz"].Value.ToString3());//预计可送判支 double Cfz = double.Parse(row.Cells["Cfz"].Value.ToString3());//拆分支 if (row.Cells["Target"].Text == "A" && row.Cells["PlineCode"].Text != "C072") { //正尺 if (LengthType.Equals("正尺") && InMold.Equals("801703")) { if (row.Cells["OrderUnit"].Value.ToString().Equals("吨")) { ActWeightTep += double.Parse(uRow.Cells["ActWeight"].Value.ToString()); if (PaydownWtMax < ActWeight2 + ActWeightTep && checkMagRows.Count() > 1 ) { MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判"); return; } } else { ActLenTep += double.Parse(uRow.Cells["ActLen"].Value.ToString()); if (PaydownWtMax < ActLen2 + ActLenTep && checkMagRows.Count() > 1) { MessageBox.Show("选中的正尺总量超出缴库量上限,请分开送判"); return; } } } //长尺 if (LengthType.Equals("长尺") && InMold.Equals("801703")) { if (row.Cells["OrderUnit"].Value.ToString().Equals("吨")) { ActWeightTep1 += double.Parse(uRow.Cells["ActWeight"].Value.ToString()); if (OrderWtMaxLong < ActWeightL + ActWeightTep1 && checkMagRows.Count() > 1) { MessageBox.Show("选中的长尺总量超出长尺缴库量上限,请分开送判"); return; } } else { ActLenTep1 += double.Parse(uRow.Cells["ActLen"].Value.ToString()); if (OrderWtMaxLong < ActWeightL + ActLenTep1 && checkMagRows.Count() > 1) { MessageBox.Show("选中的长尺总量超出长尺缴库量上限,请分开送判"); return; } } } //短尺 if (LengthType.Equals("短尺") && InMold.Equals("801703")) { if (row.Cells["OrderUnit"].Value.ToString().Equals("吨")) { ActWeightTep2 += double.Parse(uRow.Cells["ActWeight"].Value.ToString()); if (OrderWtMaxShort < ActWeightS + ActWeightTep2 && checkMagRows.Count() > 1) { MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判"); return; } } else { ActLenTep2 += double.Parse(uRow.Cells["ActLen"].Value.ToString()); if (OrderWtMaxShort < ActWeightS + ActLenTep2 && checkMagRows.Count() > 1) { MessageBox.Show("选中的短尺总量超出短尺缴库量上限,请分开送判"); return; } } } //按计划入 if (InMold.Equals("801703")) { if (row.Cells["OrderUnit"].Value.ToString().Equals("吨")) { ActWeightTep3 += double.Parse(uRow.Cells["ActWeight"].Value.ToString()); if (PaydownWtMax < ActWeight2 + ActWeightTep3 && checkMagRows.Count() > 1) { MessageBox.Show("选中的总量超出缴库量上限,请分开送判"); return; } } else { ActLenTep3 += double.Parse(uRow.Cells["ActLen"].Value.ToString()); if (PaydownWtMax < ActWeight2 + ActLenTep3 && checkMagRows.Count() > 1) { MessageBox.Show("选中的总量超出缴库量上限,请分开送判"); return; } } } //非计划入 if (InMold.Equals("801701")) { if (Cfz > int.Parse(row.Cells["ActCount"].Value.ToString())) { MessageBox.Show("输入的拆分支数不能大于实际送判支数"); return; } } } } if (z > 0) { //if (MessageUtil.ShowYesNoAndQuestion("炉批组下探伤种类没有的信息,是否继续进行申请判定?") == DialogResult.No) return; MessageUtil.ShowTips("炉批组下探伤种类没有的信息,不能进行申请判定!"); return; } if (m > 0) { MessageUtil.ShowTips("废品/待处理的炉批组信息,不允许申请判定!"); return; } break; case "WG": foreach (UltraGridRow uRow in checkMagRows) { if (uRow.Cells["Target"].Text.Trim().Equals("A")) { if (uRow.Cells["ActCount"].Text.Trim() != uRow.Cells["PonderGrossCount"].Text.Trim()) { MessageUtil.ShowTips("还有未过磅的管子,不允许申请判定!"); return; } } if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "") { n = n + 1; } MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject; string matZcTity = JSONFormat.Format(matZcEntity); parm.Add(matZcTity); JugdeApplyNum2 += int.Parse(uRow.Cells["ActCount"].Value.ToString()); } break; } if (n > 0) { MessageUtil.ShowTips("正在进行判定的炉批组信息,不允许重复申请判定!"); return; } if (JugdeApplyNum1 < JugdeApplyNum2) { MessageUtil.ShowTips("上下两部分的送判支数不一致,请把查询范围放大!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "doDecision"; ccp.ServerParams = new object[] { parm, this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["ProductFlag"].Value.ToString(), UserInfo.GetUserName(), this.txtMemo.Text.Trim(), this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString(), this.CustomInfo }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("申请判定成功!")) { string zpMLh = ""; string zpColl = ""; string jugdeApplyCode = ""; DataTable dtZp = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZpJudgeStoveNo", new object[] { this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(),this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString() }, ob); if (dtZp.Rows.Count > 0) { if (!dtZp.Rows[0][0].Equals("0") ) { DataTable dtZp2 = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryZpMLh", new object[] { this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["PlineCode"].Value.ToString() }, ob); if (dtZp2.Rows.Count > 0) { zpMLh = dtZp2.Rows[0]["ZP_M_LH"].ToString(); zpColl = dtZp2.Rows[0]["ZP_COLL"].ToString(); jugdeApplyCode = dtZp2.Rows[0]["JUGDE_APPLY_CODE"].ToString(); } foreach (UltraGridRow Crow in checkMagRows) { OpeBase obPss = new OpeBase { MainUrl = CoreCommon.coreCommon.UrlList["pssserver"].Url }; ccp.ServerName = "com.steering.pss.judge.Bll.BllCreateGroupStoveInfo"; ccp.MethodName = "Create"; ccp.ServerParams = new object[] { "D", Crow.Cells["LotNo"].Value.ToString(),Crow.Cells["JudgeStoveNo"].Value.ToString(), Crow.Cells["BatchNo"].Value.ToString(),jugdeApplyCode }; 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 QueryZgJugdeApply() { string plinCode = ""; string jugeNo = ""; string startTim = ""; string endTim = ""; string departMentid = UserInfo.GetDeptid(); NativeMethodNew na = new NativeMethodNew(this.ob); plinCode = na.GetPCode(this.UserInfo.GetDepartment()); if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "") { jugeNo = this.txtHeatNo2.Text.Trim(); } if (chkTim2.Checked) { if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString())) { MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!"); return; } else { startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); } } List listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.QueryZgJugdeApply", new object[] { jugeNo, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); qcmZgJugdeApplyEntityBindingSource.DataSource = listSource; WriteTextToGrid(); } /// /// 查询炉信息 /// private void QueryMat() { //查询前清空炉批组信息 this.MatZcMEntity2bindingSource.Clear(); string plinCode = ""; string jugeNo = ""; string startTim = ""; string endTim = ""; ArrayList list = new ArrayList(); List listSource = null; //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob); switch (this.CustomInfo) { case "WG": if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "") { jugeNo = this.txtHeatNo2.Text.Trim(); } if (chkTim2.Checked) { if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString())) { MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!"); return; } else { startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); } } list.Add(jugeNo); listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.doQueryMatWG", new object[] { list, startTim, endTim, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); MatZcMEntity1bindingSource.DataSource = listSource; break; case "ZG": string departMentid = UserInfo.GetDeptid(); NativeMethodNew na = new NativeMethodNew(this.ob); plinCode = na.GetPCode(this.UserInfo.GetDepartment()); if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "") { jugeNo = this.txtHeatNo2.Text.Trim(); } if (chkTim2.Checked) { if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString())) { MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!"); return; } else { startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss"); } } list.Add(jugeNo); list.Add(plinCode); listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.doQueryMat", new object[] { list, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString(), plineCodes }, this.ob); MatZcMEntity1bindingSource.DataSource = listSource; foreach (UltraGridRow uRow in this.ultraGrid6.Rows)//StdName { if (uRow.Cells["Target"].Text == "A" && uRow.Cells["PlineCode"].Text != "C072") { 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; } } if (uRow.Cells["Target"].Text == "B" && uRow.Cells["PlineCode"].Text != "C072"&& uRow.Cells["StdName"].Text.ToUpper().Contains("JY") &&(! uRow.Cells["PlineName"].Text.Contains("168"))) { 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; } } } break; } WriteTextToGrid(); } /// /// 查询是否该炉已交库结炉 /// /// /// /// private Boolean doQueryNode(string jugeNo,string plineCode) { bool node = true; string nodeStaus = ""; DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryNode", new object[] { jugeNo, plineCode }, ob); if (int.Parse(ds.Rows[0][0].ToString())>0) { node = false; } return node; } /// /// 查询炉批组信息 /// /// /// private void chkTim2_CheckedChanged(object sender, EventArgs e) { this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked; } private void chkHeatNo2_CheckedChanged(object sender, EventArgs e) { this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked; } private void ultraGrid6_ClickCellButton(object sender, CellEventArgs e) { if (e.Cell.Column.Key == "ChemResultCode") { updateChemResult(this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString()); } } /// /// 修改成分结果 /// /// private void updateChemResult(string jugeNo) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "updateChemResult"; ccp.ServerParams = new object[] { jugeNo }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { QueryMat(); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } private void updatePhyResult(string jugeNo,string bathNo) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "updatePhyResult"; ccp.ServerParams = new object[] { jugeNo, bathNo }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("修改成功!")) { QueryMat(); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } private void doSaveOrdLnDlyPk() { IQueryable checkMags = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMags.Count() == 0) { MessageUtil.ShowTips("请选择需要修改的数据!"); return; } ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in checkMags) { MatZcMEntity matBcEntity1 = (MatZcMEntity)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.signature.FrmInOnlineStore"; 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 ultraGrid6_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid6.ActiveRow; this.MatZcMEntity2bindingSource.Clear(); List listSource = null; switch (this.CustomInfo) { case "ZG": listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.doQueryMatData", new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); MatZcMEntity2bindingSource.DataSource = listSource; break; case "WG": listSource = EntityHelper.GetData( "com.steering.mes.signature.FrmInOnlineStore.doQueryMatDataWG", new object[] { uRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob); MatZcMEntity2bindingSource.DataSource = listSource; break; } DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryJugeMemo", new object[] { uRow.Cells["JudgeStoveNo"].Text }, ob); if (listSource.Count > 0) { this.getDeliveryNo(listSource[0].OrdLnPk.ToString()); } this.txtMemo.Text = ""; if (ds.Rows.Count > 0) { this.txtMemo.Text = ds.Rows[0]["MEMO"].ToString(); } foreach (UltraGridRow ugr in this.ultraGrid7.Rows) { ugr.Cells["CHK"].Value = true; } WriteTextToGrid2(); } private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraGridRow row = ultraGrid6.ActiveRow; if (e.Button.Key.ToLower().Equals("select")) { if (ultraGrid6.ActiveCell.Column.Key == "DetectResultPath") { //探伤报告 string filePath = row.GetValue("DetectResultPath"); dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath); down.DeleteButton.Visible = false; down.ShowDialog(); } else if (ultraGrid6.ActiveCell.Column.Key == "FaceResultPath") { //表检报告 string filePath = row.GetValue("FaceResultPath") ; dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath); down.DeleteButton.Visible = false; down.ShowDialog(); } } } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { if (toolMenu == null) return; if (ultraTabControl1.SelectedTab.Index == 0) { chkTim2.Text = "入库日期"; } else if (ultraTabControl1.SelectedTab.Index == 1) { chkTim2.Text = "送判日期"; } } private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e) { this.ultraGrid1.UpdateData(); if (e.Cell.Column.Key == "JugdeApplyCode") { string jugdeApplyCode = ultraGrid1.ActiveRow.Cells["JugdeApplyCode"].Value.ToString(); string judgeStoveNo = ultraGrid1.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(); string ordenNo = ultraGrid1.ActiveRow.Cells["ProOrderNo"].Value.ToString(); FrmQcmAddAsk orderZg = new FrmQcmAddAsk(jugdeApplyCode, judgeStoveNo, ordenNo,this.ob); orderZg.ShowDialog(); } } /// /// 获取测量点重量 /// private void updateProssWt() { this.ultraGrid7.UpdateData(); IQueryable checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!"); return; } ArrayList parm = new ArrayList(); foreach (UltraGridRow uRow in checkMagRows) { MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject; string matTity = JSONFormat.Format(matZcTity); parm.Add(matTity); } //if (MessageUtil.ShowYesNoAndQuestion("是否确认获取测量点重量?") == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore"; ccp.MethodName = "updateProssWt"; ccp.ServerParams = new object[] { parm, this.UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("获取测量点重量成功!")) { QueryMat(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } } }