From 0b8495cbf5127e62d473f813b8505cdead2026af Mon Sep 17 00:00:00 2001 From: JinH Date: Tue, 24 May 2022 19:34:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=B4=AF=E8=AE=A1=E5=8F=91=E8=B4=A7=E6=95=B0?= =?UTF-8?q?=E9=87=8F=20=E5=A2=9E=E5=8A=A0=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=8F=91=E8=B4=A7=E6=95=B0=E9=87=8F=E3=80=81=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E5=8F=91=E8=B4=A7=E6=97=B6=E9=97=B4=E3=80=81=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E5=8F=91=E8=B4=A7=E7=9A=84ASN=E5=8F=B7=202.ASN?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=B6=EF=BC=8C=E5=BD=B1=E5=93=8D=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E5=8F=91=E8=B4=A7=E6=95=B0=E9=87=8F=203.ASN=E6=92=A4?= =?UTF-8?q?=E9=94=80=E6=97=B6=EF=BC=8C=E5=BD=B1=E5=93=8D=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E6=95=B0=E9=87=8F=204.=E5=8F=B7=E7=A0=81?= =?UTF-8?q?=E9=A2=84=E5=88=86=E9=85=8D=E8=8F=9C=E5=8D=95=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8F=AA=E6=9F=A5=E8=AF=A2=E6=9C=AA=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=85=8D=E5=8A=9F=E8=83=BD=205.=E7=94=9F=E6=88=90Pre-?= =?UTF-8?q?DN=E6=97=B6=EF=BC=8C=E6=A0=A1=E9=AA=8C=E5=8E=9FASN=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=97=B6=E7=9A=84=E6=A0=A1=E9=AA=8C=E9=A1=B9=206.ASN?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=B6=EF=BC=8C=E5=8F=AA=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E6=96=B0LAB=E8=BF=9B=E6=9D=A5?= =?UTF-8?q?=E3=80=82=E5=8D=B3=EF=BC=8C=E6=A0=A1=E9=AA=8C=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=92=8C=E9=9C=80=E6=B1=82=E6=95=B0=E9=87=8F?= =?UTF-8?q?=207.LAB=E8=A7=A3=E6=9E=90=E7=9A=84=E9=A2=84=E8=AD=A6=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E5=88=86=E4=BA=BA=E6=9D=A5=E5=8F=91=EF=BC=9B=208.?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=A3=E6=9E=90=E6=8A=A5=E9=94=99=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=8F=9C=E5=8D=95=20=E5=8F=AA=E8=83=BD=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=87=AA=E5=B7=B1=E8=B4=9F=E8=B4=A3=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF=EF=BC=9B=E9=A2=84=E8=AD=A6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=AD=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Stone.Common.Dlls/Stone.Entity.dll | Bin 23040 -> 23040 bytes Stone.WinForm/Stone.Entity/Entity_t_ErrLog.cs | 27 +++ .../Stone.Entity/Stone.Entity.csproj | 1 + .../Stone.WinBiz/BasicData/F_ErrLog.cs | 62 ++++++ .../Stone.WinBiz/BasicData/F_ErrTypeLevel.cs | 10 +- .../Stone.WinBiz/BasicData/F_PartOutQty.cs | 10 +- .../JISAdmin/F_EDI_JIS5000Sequence.cs | 181 ++++++++++++++---- .../Stone.WinBiz/Stone.WinBiz.csproj | 1 + Stone.WinForm/Stone.WinForm/frmMain.cs | 9 + .../BasicData/frmErrLog.Designer.cs | 81 ++++++++ .../Stone.WinModule/BasicData/frmErrLog.cs | 81 ++++++++ .../Stone.WinModule/BasicData/frmErrLog.resx | 180 +++++++++++++++++ .../frmErrTypeLevelDetail.Designer.cs | 83 ++++---- .../BasicData/frmErrTypeLevelDetail.cs | 5 +- .../BasicData/frmPartOutQtyDetail.Designer.cs | 38 ++-- .../Standard/frmJISVDA.Designer.cs | 17 ++ .../Stone.WinModule/Standard/frmJISVDA.cs | 40 ++-- .../Stone.WinModule/Standard/frmJISVDA.resx | 2 +- .../Stone.WinModule/Standard/frmJISVDAASN.cs | 86 ++++++++- .../Stone.WinModule/Stone.WinModule.csproj | 9 + 20 files changed, 805 insertions(+), 118 deletions(-) create mode 100644 Stone.WinForm/Stone.Entity/Entity_t_ErrLog.cs create mode 100644 Stone.WinForm/Stone.WinBiz/BasicData/F_ErrLog.cs create mode 100644 Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.Designer.cs create mode 100644 Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.cs create mode 100644 Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.resx diff --git a/Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll b/Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll index 8e06d41badc1da853614556ab4345971c64ca8a8..b4e8c479d14a83d32b6e78455b21af06f5442a9a 100644 GIT binary patch delta 5564 zcmc(jiFZ`h9ml_SCb_dfLLd?XB#@9jBq0k)NJ0o%STYdFLVy4Pf(s%FA>>s#E)Q(c zAO(#Vm8ujdV5JIzBie`yE=Q!o0j=~@>jo5T)D{JMT&w-P-(zmxIsO4o&V1*6?)Urd zI(hHDS@X15^R&3P%iXVHL-&Sw@oD#-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>tp5#pQ7*Fxd_kXSuU;iwciNun=Le(Kt$X#h2rW>-T4y!!LS=eMe zg;~&sESiNwp5$!&&UlLN_CM$)o2TcS|I)tc>(O7xoxUFFhAgVbOi!`_Eyh!5z(zwB zHQ;_vvJrcYr}**Wh#}jeMx66RoA9YI6`BxT)_c?}YC@Kfdzj{+#CQsGFxQYpb8w?4 zITt@Mp5o`3-G(fi=Hg{fbRNzalOKz5!H`As5Hqo_PR$rD%h6>Si06#O_-&?eUUwI`J z*HNguqxhn~dwp3~|LzgB2UKiaPjSJT3;(Xzb?M6o<5Fjz=zf3pc3%a*v|Pf4c4*qQb8k?${3U(enP?fZ1)}il4<{ugV&N8-9UE1DU*OXP&v2J`h@>qCv_ vbOj9>)Nh?LjQbhuv=h6MLNrt#YpTK%u;nxA$_@M%K-Ey1 diff --git a/Stone.WinForm/Stone.Entity/Entity_t_ErrLog.cs b/Stone.WinForm/Stone.Entity/Entity_t_ErrLog.cs new file mode 100644 index 0000000..a75ba9f --- /dev/null +++ b/Stone.WinForm/Stone.Entity/Entity_t_ErrLog.cs @@ -0,0 +1,27 @@ +using Gm_WMS.DataAccess.DataService; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Stone.Entity +{ + public class Entity_t_ErrLog : EntityBase + + { + public static string TableNameNew = "t_Error_Log"; + + public Entity_t_ErrLog() + { + base.TableName = TableNameNew; + base.Init(); + } + + public Entity_t_ErrLog(LocalDBService myDB) + { + base.db = myDB; + base.TableName = TableNameNew; + base.Init(); + } + } +} diff --git a/Stone.WinForm/Stone.Entity/Stone.Entity.csproj b/Stone.WinForm/Stone.Entity/Stone.Entity.csproj index 8f1c03a..47bb976 100644 --- a/Stone.WinForm/Stone.Entity/Stone.Entity.csproj +++ b/Stone.WinForm/Stone.Entity/Stone.Entity.csproj @@ -62,6 +62,7 @@ + diff --git a/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrLog.cs b/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrLog.cs new file mode 100644 index 0000000..470d555 --- /dev/null +++ b/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrLog.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Data; +using Stone.Entity; +using Gm_WMS.DataAccess.DataService; +using Stone.Common; + +namespace Stone.WinBiz.BasicData +{ + public class F_ErrLog : F_Base + { + public F_ErrLog() + { + this.type = "ErrLog"; + this.name = "系统设置_预警错误处理"; + this.entity = new Entity_t_ErrLog(); + } + + public override void GetView(DataGridView dgv) + { + base.GetView(dgv); + + dgv.Columns["ID"].HeaderText = "ID"; + dgv.Columns["OperCode"].HeaderText = "操作者"; + dgv.Columns["Msg"].HeaderText = "预警信息"; + dgv.Columns["CreateTime"].HeaderText = "创建时间"; + dgv.Columns["IsClose"].HeaderText = "是否处理"; + } + + public override void Checking(DataRow drData, bool isNew) + { + base.Checking(drData, isNew); + } + + + public override void InputData(DataSet dsData, LocalDBService db) + { + Entity_t_ErrLog t_Input = new Entity_t_ErrLog(db); + DataRow drInput = null; + + foreach (DataRow drData in dsData.Tables[0].Rows) + { + + drInput = t_Input.Table.NewRow(); + drInput["ID"] = drData["ID"].ToString().Trim(); + drInput["OperCode"] = drData["操作者"].ToString().Trim(); + drInput["Msg"] = drData["预警信息"].ToString().Trim(); + drInput["CreateTime"] = drData["创建时间"].ToString().Trim(); + drInput["IsClose"] = drData["是否处理"].ToString().Trim(); + + if (drInput["OperCode"].ToString().Trim() == "") + throw new Exception("代码不能为空!"); + + t_Input.Add(drInput); + + } + } + } +} diff --git a/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs b/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs index 639a882..548c56d 100644 --- a/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs +++ b/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs @@ -27,7 +27,7 @@ namespace Stone.WinBiz.BasicData dgv.Columns["ErrTypeDesc"].HeaderText = "预警类型"; dgv.Columns["ErrLevel"].HeaderText = "级别"; dgv.Columns["ToPerson"].HeaderText = "邮件通知人"; - + dgv.Columns["OperCode"].HeaderText = "处理人"; } public override void Checking(DataRow drData, bool isNew) @@ -49,6 +49,7 @@ namespace Stone.WinBiz.BasicData drInput["ErrTypeDesc"] = drData["类型描述"].ToString().Trim(); drInput["ErrLevel"] = drData["级别"].ToString().Trim(); drInput["ToPerson"] = drData["邮件通知人"].ToString().Trim(); + drInput["OperCode"] = drData["处理人"].ToString().Trim(); if (drInput["Code"].ToString().Trim() == "") throw new Exception("代码不能为空!"); @@ -56,6 +57,13 @@ namespace Stone.WinBiz.BasicData if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0) throw new Exception("类型编码 " + drInput["Code"].ToString() + " 已经存在!"); + + var strsql = ""; + strsql = "select count(1) from t_Sys_User where Name = '" + drInput["OperCode"].ToString() + "'"; + var ds = db.Exec_DataSet(strsql); + if(ds.Tables[0].Rows.Count == 0) + throw new Exception("处理人 " + drInput["OperCode"].ToString() + " 不是有效的系统账号!"); + t_Input.Add(drInput); } diff --git a/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs b/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs index 8bb9e8e..4e6685e 100644 --- a/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs +++ b/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs @@ -25,8 +25,9 @@ namespace Stone.WinBiz.BasicData dgv.Columns["Code"].HeaderText = "存货代码"; dgv.Columns["PartOutQty"].HeaderText = "累计发货数量"; - - + dgv.Columns["LastOutQty"].HeaderText = "最后发货数量"; + dgv.Columns["LastOutTime"].HeaderText = "最后发货时间"; + dgv.Columns["AsnNum"].HeaderText = "ASN号"; } public override void Checking(DataRow drData, bool isNew) @@ -54,8 +55,9 @@ namespace Stone.WinBiz.BasicData drInput = t_Input.Table.NewRow(); drInput["Code"] = drData["存货代码"].ToString().Trim(); drInput["PartOutQty"] = drData["累计发货数量"].ToString().Trim(); - - + drInput["LastOutQty"] = drData["最后发货数量"].ToString().Trim(); + drInput["LastOutTime"] = drData["最后发货时间"].ToString().Trim(); + drInput["AsnNum"] = drData["ASN号"].ToString().Trim(); if (drInput["Code"].ToString().Trim() == "") throw new Exception("存货代码不能为空!"); diff --git a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs index 8b3f06b..a3b908a 100644 --- a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs +++ b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs @@ -147,6 +147,12 @@ namespace Stone.WinBiz.JISAdmin var title = ""; title = "LAB解析异常:错误级别-" + errLvevl + "-" + errTypeDesc; F_Mail.Send(file.Name + "解析失败", title, mailTo); + + //插入报警信息 + var operCode = dsErrMail.Tables[0].Rows[0]["OperCode"].ToString(); + strsql = "Insert into t_Error_Log(OperCode,Msg) values ('" + operCode + "','" + file.Name + + "解析失败')"; + db.Exec_NonQuery(strsql); } // F_Mail.Send(file.Name + " 处理失败,原因为:" + ex.Message); @@ -240,8 +246,6 @@ namespace Stone.WinBiz.JISAdmin //版本号在需求日期之后,目前是在需求日期处进行的数据插入 var lstPartRelease = new List(); var partRelese = new PartRelease(); - //定义预警级别 - var errType = 0; foreach (var line_text in sp_text) { @@ -283,6 +287,16 @@ namespace Stone.WinBiz.JISAdmin } } var strPartMsg = ""; + //卸货点新增 + var alertMsg1 = ""; + //卸货点与代码不匹配 + var alertMsg2 = ""; + //卸货点失效 + var alertMsg3 = ""; + //零件新增 + var alertMsg4 = ""; + //零件失效 + var alertMsg5 = ""; foreach (string line_text in sp_text) { @@ -330,19 +344,13 @@ namespace Stone.WinBiz.JISAdmin if (strState == "0" || string.IsNullOrEmpty(strState)) { strPartMsg += "零件号 " + partNumber + " 已失效!" + Environment.NewLine; - if (errType == 0 || errType > 6) - { - errType = 6; - } + alertMsg5 += "零件号 " + partNumber + " 已失效!" + Environment.NewLine; } } else { strPartMsg += "零件号 " + partNumber + " 未定义!" + Environment.NewLine; - if (errType == 0 || errType > 5) - { - errType = 5; - } + alertMsg4 += "零件号 " + partNumber + " 未定义!" + Environment.NewLine; } } @@ -364,19 +372,13 @@ namespace Stone.WinBiz.JISAdmin if (strState == "0" || string.IsNullOrEmpty(strState)) { strPartMsg += "卸货点 " + location + " 已失效!" + Environment.NewLine; - if (errType == 0 || errType > 4) - { - errType = 4; - } + alertMsg3 += "卸货点 " + location + " 已失效!" + Environment.NewLine; } } else { strPartMsg += "卸货点 " + location + " 未在系统中定义!" + Environment.NewLine; - if (errType == 0 || errType > 2) - { - errType = 2; - } + alertMsg1 += "卸货点 " + location + " 未在系统中定义!" + Environment.NewLine; } //校验卸货点、卸货点代码是否匹配 @@ -389,10 +391,7 @@ namespace Stone.WinBiz.JISAdmin if (dsLoc.Tables[0].Rows.Count == 0) { strPartMsg += "卸货点 " + location + " 对应的代码 " + LocationCode + " 未在系统中定义!" + Environment.NewLine; - if (errType == 0 || errType > 3) - { - errType = 3; - } + alertMsg2 += "卸货点 " + location + " 对应的代码 " + LocationCode + " 未在系统中定义!" + Environment.NewLine; } } @@ -474,24 +473,130 @@ namespace Stone.WinBiz.JISAdmin if (strPartMsg != "") { - strPartMsg = filename + " " + strPartMsg; - var strErrTypeCode = errType.ToString("00"); - var strsql = "select top 1 * from t_ErrTypeLevel" + - " where Code = '" + strErrTypeCode + "'" + - " order by id desc"; - var dsErrMail = db.Exec_DataSet(strsql); - if (dsErrMail.Tables[0].Rows.Count > 0) + var strsql = ""; + var dsErrMail = new DataSet(); + if (alertMsg1 != "") + { + alertMsg1 = filename + " " + alertMsg1; + strsql = "select top 1 * from t_ErrTypeLevel" + + " where Code = '02'" + + " order by id desc"; + dsErrMail = db.Exec_DataSet(strsql); + if (dsErrMail.Tables[0].Rows.Count > 0) + { + //获取收件人 + var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); + var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); + //设置邮件标题 + var title = ""; + title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(title, alertMsg1, mailTo); + + //插入报警信息 + var operCode = dsErrMail.Tables[0].Rows[0]["OperCode"].ToString(); + strsql = "Insert into t_Error_Log(OperCode,Msg) values ('" + operCode + "','" + alertMsg1 + "')"; + db.Exec_NonQuery(strsql); + } + + } + if (alertMsg2 != "") + { + alertMsg2 = filename + " " + alertMsg2; + strsql = "select top 1 * from t_ErrTypeLevel" + + " where Code = '03'" + + " order by id desc"; + dsErrMail = db.Exec_DataSet(strsql); + if (dsErrMail.Tables[0].Rows.Count > 0) + { + //获取收件人 + var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); + var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); + //设置邮件标题 + var title = ""; + title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(title, alertMsg2, mailTo); + + //插入报警信息 + var operCode = dsErrMail.Tables[0].Rows[0]["OperCode"].ToString(); + strsql = "Insert into t_Error_Log(OperCode,Msg) values ('" + operCode + "','" + alertMsg2 + "')"; + db.Exec_NonQuery(strsql); + } + } + if (alertMsg3 != "") + { + alertMsg3 = filename + " " + alertMsg3; + strsql = "select top 1 * from t_ErrTypeLevel" + + " where Code = '04'" + + " order by id desc"; + dsErrMail = db.Exec_DataSet(strsql); + if (dsErrMail.Tables[0].Rows.Count > 0) + { + //获取收件人 + var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); + var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); + //设置邮件标题 + var title = ""; + title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(title, alertMsg3, mailTo); + + //插入报警信息 + var operCode = dsErrMail.Tables[0].Rows[0]["OperCode"].ToString(); + strsql = "Insert into t_Error_Log(OperCode,Msg) values ('" + operCode + "','" + alertMsg3 + "')"; + db.Exec_NonQuery(strsql); + } + } + if (alertMsg4 != "") { - //获取收件人 - var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); - var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); - var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); - //设置邮件标题 - var title = ""; - title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; - F_Mail.Send(title, strPartMsg, mailTo); + alertMsg4 = filename + " " + alertMsg4; + strsql = "select top 1 * from t_ErrTypeLevel" + + " where Code = '05'" + + " order by id desc"; + dsErrMail = db.Exec_DataSet(strsql); + if (dsErrMail.Tables[0].Rows.Count > 0) + { + //获取收件人 + var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); + var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); + //设置邮件标题 + var title = ""; + title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(title, alertMsg4, mailTo); + + //插入报警信息 + var operCode = dsErrMail.Tables[0].Rows[0]["OperCode"].ToString(); + strsql = "Insert into t_Error_Log(OperCode,Msg) values ('" + operCode + "','" + alertMsg4 + "')"; + db.Exec_NonQuery(strsql); + } } - + if (alertMsg5 != "") + { + alertMsg5 = filename + " " + alertMsg5; + strsql = "select top 1 * from t_ErrTypeLevel" + + " where Code = '06'" + + " order by id desc"; + dsErrMail = db.Exec_DataSet(strsql); + if (dsErrMail.Tables[0].Rows.Count > 0) + { + //获取收件人 + var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); + var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); + //设置邮件标题 + var title = ""; + title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(title, alertMsg5, mailTo); + + //插入报警信息 + var operCode = dsErrMail.Tables[0].Rows[0]["OperCode"].ToString(); + strsql = "Insert into t_Error_Log(OperCode,Msg) values ('" + operCode + "','" + alertMsg5 + "')"; + db.Exec_NonQuery(strsql); + } + } + strPartMsg = filename + " " + strPartMsg; } Msg = strPartMsg; } diff --git a/Stone.WinForm/Stone.WinBiz/Stone.WinBiz.csproj b/Stone.WinForm/Stone.WinBiz/Stone.WinBiz.csproj index bda6f04..a9bb781 100644 --- a/Stone.WinForm/Stone.WinBiz/Stone.WinBiz.csproj +++ b/Stone.WinForm/Stone.WinBiz/Stone.WinBiz.csproj @@ -80,6 +80,7 @@ + diff --git a/Stone.WinForm/Stone.WinForm/frmMain.cs b/Stone.WinForm/Stone.WinForm/frmMain.cs index 3bb088c..bf58a93 100644 --- a/Stone.WinForm/Stone.WinForm/frmMain.cs +++ b/Stone.WinForm/Stone.WinForm/frmMain.cs @@ -117,6 +117,15 @@ namespace Stone.WinForm ShowWindow(frm); } + if (e.Node.Text == "预警错误处理") + { + Stone.WinModule.BasicData.frmErrLog frm = new Stone.WinModule.BasicData.frmErrLog(); + frm.m_Base = new WinBiz.BasicData.F_ErrLog(); + frm.init(); + + ShowWindow(frm); + } + #endregion #region 基础资料管理 diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.Designer.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.Designer.cs new file mode 100644 index 0000000..6cc7121 --- /dev/null +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.Designer.cs @@ -0,0 +1,81 @@ +namespace Stone.WinModule.BasicData +{ + partial class frmErrLog + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmErrLog)); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.cbIsNeed = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + this.imageList1.Images.SetKeyName(0, "(10,09).png"); + this.imageList1.Images.SetKeyName(1, "(09,36).png"); + this.imageList1.Images.SetKeyName(2, "(12,27).png"); + this.imageList1.Images.SetKeyName(3, "(25,41).png"); + this.imageList1.Images.SetKeyName(4, "redo.png"); + // + // cbIsNeed + // + this.cbIsNeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cbIsNeed.AutoSize = true; + this.cbIsNeed.Checked = true; + this.cbIsNeed.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbIsNeed.Location = new System.Drawing.Point(599, 12); + this.cbIsNeed.Name = "cbIsNeed"; + this.cbIsNeed.Size = new System.Drawing.Size(60, 16); + this.cbIsNeed.TabIndex = 19; + this.cbIsNeed.Text = "待处理"; + this.cbIsNeed.UseVisualStyleBackColor = true; + // + // frmErrLog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.ClientSize = new System.Drawing.Size(881, 562); + this.Controls.Add(this.cbIsNeed); + this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Name = "frmErrLog"; + this.Load += new System.EventHandler(this.frmErrLog_Load); + this.Controls.SetChildIndex(this.txtCode, 0); + this.Controls.SetChildIndex(this.btnSerach, 0); + this.Controls.SetChildIndex(this.cbIsNeed, 0); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.CheckBox cbIsNeed; + } +} diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.cs new file mode 100644 index 0000000..c45df00 --- /dev/null +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using Gm_WMS.DataAccess.DataService; +using Stone.Common; + +namespace Stone.WinModule.BasicData +{ + public partial class frmErrLog : Stone.WinModule.BasicData.frmBaseMain + { + public frmErrLog() + { + InitializeComponent(); + + this.tlbAdd.Visible = false; + this.tlbAddCopy.Visible = false; + this.tlbEdit.Visible = false; + this.tlbDelete.Visible = false; + this.tlbInput.Visible = false; + } + + public override void Search(string code) + { + if (code == "") + { + strWhere = "1=1"; + } + else + { + strWhere = "(OperCode like '%" + code + "%'"; + strWhere += " or [Msg] like '%" + code + "%')"; + } + + if (cbIsNeed.Checked) + { + strWhere += " and IsClose = 0"; + } + } + + private void frmErrLog_Load(object sender, EventArgs e) + { + ToolStripButton btnHandle = new ToolStripButton("处理"); + btnHandle.Image = this.imageList1.Images[3]; + btnHandle.TextImageRelation = TextImageRelation.ImageAboveText; + btnHandle.Click += btnHandle_Click; + this.toolStrip1.Items.Insert(4, btnHandle); + } + + private void btnHandle_Click(object sender, EventArgs e) + { + string LogID = "0"; + try + { + if (this.dgrdView.SelectedRows.Count == 0) + throw new Exception("请选择一行记录"); + + string OperCode = this.dgrdView.SelectedRows[0].Cells["OperCode"].Value.ToString(); + //校验当前人员是否运行操作该记录 + if(OperCode != User.UserInfo.UserName) + { + throw new Exception($"只能处理自己权限下的错误提示!"); + } + var strID = this.dgrdView.SelectedRows[0].Cells["ID"].Value.ToString(); + + var strsql = "Update t_Error_Log set IsClose = 1 where ID = " + strID; + var db = new LocalDBService(); + db.Exec_NonQuery(strsql); + MyMessageBox.ShowInfoMessage($"处理成功"); + this.tlbRefresh.PerformClick(); + } + catch (Exception ex) + { + MyMessageBox.ShowErrorMessage(ex.Message); + } + } + } +} diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.resx b/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.resx new file mode 100644 index 0000000..67cb869 --- /dev/null +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrLog.resx @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 227, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM + CwAAAk1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AAbQD1QKtAfABAAH/AYsBtAEJBgAB8wHVAQkB3AG0 + AYsB9AgAAfAB8wX/ARkBBwGuAfACAAEHA8MBoAFYARoBWAGgBsMBZgEAAf8B1gEJARkB3AG0Aq0BtQG0 + AYsB1QEJBwAB8wHVAQkBiwH0CQAB/wEHAf8B9AK8AgcB8QHrAa4CAAEJA8MBeQEaAfYBGgF5A8MB9wNm + AgAB1gH/AQAB3QHcAdUDrQG0AgkIAAHzAbQB9AsAAfMB8AX/AfMBBwGuAf8BAAQJAaABWAEaAVgBoAPD + AbUBvAFmAfEGAAEJAdwFCQH/FwAB8wgHBgABWAGgAXkBoAFYA8MBtQFmAfEIAAHzAgkB3QHzAf8pAAUJ + AQcBuwHxIgABQgFNAT4HAAE+AwABKAMAAUADAAEgAwABAQEAAQEGAAEBFgAD/wEAAv8GAAL/BgAC/wYA + Av8GAAH/AcAGAAGPAcAGAAGDAYAGAAGABwABgAcAAcAHAAHgAQ8GAAL/BgAC/wYAAv8GAAL/BgAC/wYA + Av8BAAE/BP8BgAEDAQABPwT/AQABAQIAAf8BHwL/AQABAQIAAf8BDwL/AQABAQIAAf8BDwH4AT8BAAEB + AgAB/wHHAfgBPwEAAQECAAH9AccB+AE/AQABAQIAAcABwwH4AT8BAAEBAgABwAHjAeABDwGAAQECAAHA + AeMB4AEPAcABAQIAAcABQwHwAR8B4AEDAgABgAEDAfgBPwHgAQMCAAHIAQMB/AF/AfABAQIAAfwBAwL/ + AfgBAwHwAQEB/gEHBP8B/AEDBP8L + + + \ No newline at end of file diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs index 39bd4d0..81da2cc 100644 --- a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs @@ -37,103 +37,116 @@ this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.label4 = new System.Windows.Forms.Label(); this.txtemail = new System.Windows.Forms.TextBox(); + this.tbHandler = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // btnAddNewLine // - this.btnAddNewLine.Location = new System.Drawing.Point(62, 286); - this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(6); + this.btnAddNewLine.Location = new System.Drawing.Point(41, 191); + this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); // // btnClose // - this.btnClose.Location = new System.Drawing.Point(381, 286); - this.btnClose.Margin = new System.Windows.Forms.Padding(6); + this.btnClose.Location = new System.Drawing.Point(254, 191); + this.btnClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); // // btnOK // - this.btnOK.Location = new System.Drawing.Point(250, 286); - this.btnOK.Margin = new System.Windows.Forms.Padding(6); + this.btnOK.Location = new System.Drawing.Point(167, 191); + this.btnOK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); // // txtLevel // - this.txtLevel.Location = new System.Drawing.Point(170, 150); - this.txtLevel.Margin = new System.Windows.Forms.Padding(4); + this.txtLevel.Location = new System.Drawing.Point(113, 100); this.txtLevel.MaxLength = 200; this.txtLevel.Name = "txtLevel"; - this.txtLevel.Size = new System.Drawing.Size(331, 28); + this.txtLevel.Size = new System.Drawing.Size(222, 21); this.txtLevel.TabIndex = 2; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(34, 154); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Location = new System.Drawing.Point(47, 103); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(62, 18); + this.label3.Size = new System.Drawing.Size(41, 12); this.label3.TabIndex = 111; this.label3.Text = "级别:"; // // txtName // - this.txtName.Location = new System.Drawing.Point(170, 106); - this.txtName.Margin = new System.Windows.Forms.Padding(4); + this.txtName.Location = new System.Drawing.Point(113, 71); this.txtName.MaxLength = 100; this.txtName.Name = "txtName"; - this.txtName.Size = new System.Drawing.Size(331, 28); + this.txtName.Size = new System.Drawing.Size(222, 21); this.txtName.TabIndex = 1; // // txtCode // - this.txtCode.Location = new System.Drawing.Point(170, 60); - this.txtCode.Margin = new System.Windows.Forms.Padding(4); + this.txtCode.Location = new System.Drawing.Point(113, 40); this.txtCode.MaxLength = 10; this.txtCode.Name = "txtCode"; - this.txtCode.Size = new System.Drawing.Size(331, 28); + this.txtCode.Size = new System.Drawing.Size(222, 21); this.txtCode.TabIndex = 0; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(34, 111); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Location = new System.Drawing.Point(23, 74); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(98, 18); + this.label2.Size = new System.Drawing.Size(65, 12); this.label2.TabIndex = 109; this.label2.Text = "预警类型:"; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(34, 66); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Location = new System.Drawing.Point(23, 44); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(98, 18); + this.label1.Size = new System.Drawing.Size(65, 12); this.label1.TabIndex = 108; this.label1.Text = "类型编码:"; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(34, 201); - this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Location = new System.Drawing.Point(12, 134); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(116, 18); + this.label4.Size = new System.Drawing.Size(77, 12); this.label4.TabIndex = 111; this.label4.Text = "邮件通知人:"; // // txtemail // - this.txtemail.Location = new System.Drawing.Point(170, 197); - this.txtemail.Margin = new System.Windows.Forms.Padding(4); + this.txtemail.Location = new System.Drawing.Point(113, 131); this.txtemail.MaxLength = 200; this.txtemail.Name = "txtemail"; - this.txtemail.Size = new System.Drawing.Size(331, 28); + this.txtemail.Size = new System.Drawing.Size(222, 21); this.txtemail.TabIndex = 2; // + // tbHandler + // + this.tbHandler.Location = new System.Drawing.Point(113, 160); + this.tbHandler.MaxLength = 200; + this.tbHandler.Name = "tbHandler"; + this.tbHandler.Size = new System.Drawing.Size(222, 21); + this.tbHandler.TabIndex = 112; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(35, 163); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(53, 12); + this.label5.TabIndex = 113; + this.label5.Text = "处理人:"; + // // frmErrTypeLevelDetail // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); - this.ClientSize = new System.Drawing.Size(572, 416); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.ClientSize = new System.Drawing.Size(381, 277); + this.Controls.Add(this.tbHandler); + this.Controls.Add(this.label5); this.Controls.Add(this.txtemail); this.Controls.Add(this.txtLevel); this.Controls.Add(this.label4); @@ -142,7 +155,7 @@ this.Controls.Add(this.txtCode); this.Controls.Add(this.label2); this.Controls.Add(this.label1); - this.Margin = new System.Windows.Forms.Padding(6); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "frmErrTypeLevelDetail"; this.Load += new System.EventHandler(this.frmColorDetail_Load); this.Controls.SetChildIndex(this.btnOK, 0); @@ -156,6 +169,8 @@ this.Controls.SetChildIndex(this.label4, 0); this.Controls.SetChildIndex(this.txtLevel, 0); this.Controls.SetChildIndex(this.txtemail, 0); + this.Controls.SetChildIndex(this.label5, 0); + this.Controls.SetChildIndex(this.tbHandler, 0); this.ResumeLayout(false); this.PerformLayout(); @@ -172,5 +187,7 @@ private System.Windows.Forms.ColorDialog colorDialog1; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox txtemail; + private System.Windows.Forms.TextBox tbHandler; + private System.Windows.Forms.Label label5; } } diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs index 438caec..0608252 100644 --- a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs @@ -27,12 +27,13 @@ namespace Stone.WinModule.BasicData if (!MyValidator.IsEmpty(this.txtName, "")) return false; if (!MyValidator.IsEmpty(this.txtLevel, "")) return false; if (!MyValidator.IsEmpty(this.txtemail, "")) return false; + if (!MyValidator.IsEmpty(this.tbHandler, "")) return false; base.GetData(); drData["Code"] = MyStrings.GetString(this.txtCode.Text.Trim()); drData["ErrTypeDesc"] = MyStrings.GetString(this.txtName.Text.Trim()); drData["Errlevel"] = MyStrings.GetString(this.txtLevel.Text.Trim()); drData["ToPerson"] = MyStrings.GetString(this.txtemail.Text.Trim()); - + drData["OperCode"] = MyStrings.GetString(this.tbHandler.Text.Trim()); return true; } @@ -49,6 +50,7 @@ namespace Stone.WinModule.BasicData this.txtName.Text = drData["ErrTypeDesc"].ToString(); this.txtLevel.Text = drData["ErrLevel"].ToString(); this.txtemail.Text = drData["ToPerson"].ToString(); + this.tbHandler.Text = drData["OperCode"].ToString(); } return false; @@ -61,6 +63,7 @@ namespace Stone.WinModule.BasicData this.txtName.Text = ""; this.txtLevel.Text = ""; this.txtemail.Text = ""; + this.tbHandler.Text = ""; this.txtCode.Focus(); } diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs index b89c973..f30121c 100644 --- a/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs @@ -37,66 +37,62 @@ // // btnAddNewLine // - this.btnAddNewLine.Location = new System.Drawing.Point(60, 190); - this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(6); + this.btnAddNewLine.Location = new System.Drawing.Point(41, 116); + this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); // // btnClose // - this.btnClose.Location = new System.Drawing.Point(379, 190); - this.btnClose.Margin = new System.Windows.Forms.Padding(6); + this.btnClose.Location = new System.Drawing.Point(254, 116); + this.btnClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); // // btnOK // - this.btnOK.Location = new System.Drawing.Point(248, 190); - this.btnOK.Margin = new System.Windows.Forms.Padding(6); + this.btnOK.Location = new System.Drawing.Point(166, 116); + this.btnOK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); // // txtOutQty // - this.txtOutQty.Location = new System.Drawing.Point(170, 106); - this.txtOutQty.Margin = new System.Windows.Forms.Padding(4); + this.txtOutQty.Location = new System.Drawing.Point(113, 71); this.txtOutQty.MaxLength = 100; this.txtOutQty.Name = "txtOutQty"; - this.txtOutQty.Size = new System.Drawing.Size(331, 28); + this.txtOutQty.Size = new System.Drawing.Size(222, 21); this.txtOutQty.TabIndex = 1; // // txtCode // - this.txtCode.Location = new System.Drawing.Point(170, 60); - this.txtCode.Margin = new System.Windows.Forms.Padding(4); + this.txtCode.Location = new System.Drawing.Point(113, 40); this.txtCode.MaxLength = 10; this.txtCode.Name = "txtCode"; - this.txtCode.Size = new System.Drawing.Size(331, 28); + this.txtCode.Size = new System.Drawing.Size(222, 21); this.txtCode.TabIndex = 0; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(34, 111); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Location = new System.Drawing.Point(23, 74); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(134, 18); + this.label2.Size = new System.Drawing.Size(89, 12); this.label2.TabIndex = 109; this.label2.Text = "累计发货数量:"; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(34, 66); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Location = new System.Drawing.Point(23, 44); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(80, 18); + this.label1.Size = new System.Drawing.Size(53, 12); this.label1.TabIndex = 108; this.label1.Text = "物料号:"; // // frmPartOutQtyDetail // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); - this.ClientSize = new System.Drawing.Size(572, 288); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.ClientSize = new System.Drawing.Size(381, 170); this.Controls.Add(this.txtOutQty); this.Controls.Add(this.txtCode); this.Controls.Add(this.label2); this.Controls.Add(this.label1); - this.Margin = new System.Windows.Forms.Padding(6); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "frmPartOutQtyDetail"; this.Load += new System.EventHandler(this.frmColorDetail_Load); this.Controls.SetChildIndex(this.btnOK, 0); diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.Designer.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.Designer.cs index 22fbb02..1fdcd0f 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.Designer.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.Designer.cs @@ -36,6 +36,7 @@ this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.chkAuto = new System.Windows.Forms.CheckBox(); this.timer2 = new System.Windows.Forms.Timer(this.components); + this.cbIsDiff = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // btnSerach @@ -92,10 +93,24 @@ // this.timer2.Tick += new System.EventHandler(this.timer2_Tick); // + // cbIsDiff + // + this.cbIsDiff.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cbIsDiff.AutoSize = true; + this.cbIsDiff.Checked = true; + this.cbIsDiff.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbIsDiff.Location = new System.Drawing.Point(569, 10); + this.cbIsDiff.Name = "cbIsDiff"; + this.cbIsDiff.Size = new System.Drawing.Size(84, 16); + this.cbIsDiff.TabIndex = 22; + this.cbIsDiff.Text = "未完全分配"; + this.cbIsDiff.UseVisualStyleBackColor = true; + // // frmJISVDA // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.ClientSize = new System.Drawing.Size(1156, 562); + this.Controls.Add(this.cbIsDiff); this.Controls.Add(this.chkAuto); this.Controls.Add(this.dateTimePicker2); this.Controls.Add(this.dateTimePicker1); @@ -107,6 +122,7 @@ this.Controls.SetChildIndex(this.dateTimePicker1, 0); this.Controls.SetChildIndex(this.dateTimePicker2, 0); this.Controls.SetChildIndex(this.chkAuto, 0); + this.Controls.SetChildIndex(this.cbIsDiff, 0); this.ResumeLayout(false); this.PerformLayout(); @@ -120,5 +136,6 @@ private System.Windows.Forms.ImageList imageList1; private System.Windows.Forms.CheckBox chkAuto; private System.Windows.Forms.Timer timer2; + private System.Windows.Forms.CheckBox cbIsDiff; } } diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs index 9aa7f43..b49ec89 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs @@ -56,6 +56,10 @@ namespace Stone.WinModule.Standard strWhere += " [filename] like '%" + code + "%' "; } + if (cbIsDiff.Checked) + { + strWhere += " and quantity > quantity_print "; + } strWhere = "[IsStandard]=1 and [startDate]>='" + d1 + "' and [startDate]<='" + d2 + "' and (" + strWhere + ")"; } @@ -323,10 +327,10 @@ namespace Stone.WinModule.Standard string Date = MyDateTime.GetServerDateTime().ToString("yyyy-MM-dd"); string AsnNumbers = ""; - var strsql = ""; - var dtPartOutQty = new DataTable(); - strsql = "select * from t_PartOutQty"; - dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; + // var strsql = ""; + // var dtPartOutQty = new DataTable(); + // strsql = "select * from t_PartOutQty"; + // dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; foreach (DataRow drData in dtData.Rows) { @@ -393,13 +397,13 @@ namespace Stone.WinModule.Standard t_JIS_VDA.Add(drVDA); //增加已发货数量 - var code = drData["PartNumber"].ToString(); - var outQty = decimal.Parse(drData["PackNumer"].ToString()); - strsql = CreatePartOutSql(code, outQty, dtPartOutQty,out dtPartOutQty); - if (!string.IsNullOrEmpty(strsql)) - { - db.Exec_NonQuery(strsql); - } + // var code = drData["PartNumber"].ToString(); + // var outQty = decimal.Parse(drData["PackNumer"].ToString()); + // strsql = CreatePartOutSql(code, outQty, dtPartOutQty,out dtPartOutQty); + // if (!string.IsNullOrEmpty(strsql)) + // { + // db.Exec_NonQuery(strsql); + // } PackageNos += drVDA["PackageNo"].ToString() + ","; } @@ -421,13 +425,13 @@ namespace Stone.WinModule.Standard t_JIS_VDA.Add(drVDA); //增加已发货数量 - var code = drData["PartNumber"].ToString(); - var outQty = Odd; - strsql = CreatePartOutSql(code, outQty, dtPartOutQty, out dtPartOutQty); - if (!string.IsNullOrEmpty(strsql)) - { - db.Exec_NonQuery(strsql); - } + // var code = drData["PartNumber"].ToString(); + // var outQty = Odd; + // strsql = CreatePartOutSql(code, outQty, dtPartOutQty, out dtPartOutQty); + // if (!string.IsNullOrEmpty(strsql)) + // { + // db.Exec_NonQuery(strsql); + // } PackageNos += drVDA["PackageNo"].ToString() + ","; } diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.resx b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.resx index 5793ce9..7487b59 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.resx +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.resx @@ -128,7 +128,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA8 - CQAAAk1TRnQBSQFMAgEBAgEAASABAAEgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAATgBAAE4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs index bb8cd92..de1ecfc 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs @@ -209,6 +209,12 @@ namespace Stone.WinModule.Standard if (dsData.Tables[0].Select("[IsPrintASN]=False").Length > 0) throw new Exception(AsnNumber + " 未打印"); + if (dsData.Tables[0].Select("[IsPackingVerification]=False").Length > 0) + throw new Exception(AsnNumber + " 未完成装箱校验"); + + if (dsData.Tables[0].Select("[IsShipingVerification]=False").Length > 0) + throw new Exception(AsnNumber + " 未完成装车校验"); + DateTime UploadTime = t_JIS_VDA.GetDateTime(); for (int i = 0; i < dsData.Tables[0].Rows.Count; i++) @@ -223,6 +229,25 @@ namespace Stone.WinModule.Standard string filename = F_JIS5000_Print.WriteASN_VDA(db, dsData, AsnNumber); + #region 计算累计发货数量 + var strsql = ""; + var dtPartOutQty = new DataTable(); + strsql = "select * from t_PartOutQty"; + dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; + foreach (DataRow drData in dsData.Tables[0].Rows) + { + var code = drData["PartNumber"].ToString(); + var outQty = decimal.Parse(drData["Qty"].ToString()); + var asnNum = drData["AsnNumber"].ToString(); + strsql = CreatePartOutSql(code, outQty, dtPartOutQty, asnNum,out dtPartOutQty); + if (!string.IsNullOrEmpty(strsql)) + { + db.Exec_NonQuery(strsql); + } + } + + #endregion + db.Commit(); try { @@ -277,7 +302,7 @@ namespace Stone.WinModule.Standard } else if (Convert.ToInt32(dtLab.Rows[0]["quantity"]) != Qty) { - msg += $"{PartNumber} {Date} 发货数量 {dtLab.Rows[0]["quantity"]} 和LAB需求数量 {Qty} 不一样\r\n"; + msg += $"{PartNumber} {Date} 发货数量 {Qty} 和LAB需求数量 {dtLab.Rows[0]["quantity"]} 不一样\r\n"; } } @@ -362,6 +387,16 @@ namespace Stone.WinModule.Standard CancelASN(AsnNumber); + //计算累计发货数量 + var strSql = "UPDATE t_PartOutQty " + + " set PartOutQty -= LastOutQty," + + " LastOutQty = 0," + + " LastOutTime = null," + + " AsnNum = ''" + + " where AsnNum = '" + AsnNumber + "'"; + var db = new LocalDBService(); + db.Exec_NonQuery(strSql); + F_JIS_Log.WriteLogsEnd(LogID, true, ""); MyMessageBox.ShowInfoMessage($"{AsnNumber} 撤销成功"); @@ -414,6 +449,8 @@ namespace Stone.WinModule.Standard string AsnNumber = this.dgrdView.SelectedRows[0].Cells["AsnNumber"].Value.ToString(); + if (!CheckASN(AsnNumber)) return; + Entity_v_JIS_VDA v_JIS_VDA = new Entity_v_JIS_VDA(); DataTable dtData = v_JIS_VDA.GetData("", $"[AsnNumber]='{AsnNumber}'", "[PackageNo] asc").Tables[0]; if (dtData.Rows.Count == 0) throw new Exception("打印的数据不存在"); @@ -751,5 +788,52 @@ namespace Stone.WinModule.Standard this.dateTimePicker2.Enabled = true; } } + + private static string CreatePartOutSql(string PartCode, decimal outQty, DataTable dt, string asnNum,out DataTable dtPartOutQty) + { + dtPartOutQty = dt; + string strsql = ""; + if (dtPartOutQty.Select(" Code = '" + PartCode + "'").Length > 0) + { + //继续校验该ASN是否维护累计发货数量信息 + if (dtPartOutQty.Select(" AsnNum = '" + asnNum + "'").Length > 0) + { + strsql = "Update t_PartOutQty" + + " set PartOutQty += " + outQty + "," + + " LastOutQty += " + outQty + + " where Code = '" + PartCode + "'" + + " and AsnNum = '" + asnNum + "'"; + } + else + { + strsql = "Update t_PartOutQty" + + " set PartOutQty += " + outQty + "," + + " LastOutQty = " + outQty + "," + + " LastOutTime = getdate()," + + " AsnNum = '" + asnNum + "'" + + " where Code = '" + PartCode + "'"; + var db = new LocalDBService(); + db.Exec_NonQuery(strsql); + //DT重新赋值 + strsql = "select * from t_PartOutQty"; + dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; + strsql = ""; + } + + } + else + { + //该零件未维护累计发货数量信息 + strsql = "Insert into t_PartOutQty(Code,PartOutQty,LastOutQty,LastOutTime,AsnNum) values ('" + PartCode + "'," + outQty + "," + outQty + ",getdate(),'"+ asnNum + "')"; + var db = new LocalDBService(); + db.Exec_NonQuery(strsql); + //DT重新赋值 + strsql = "select * from t_PartOutQty"; + dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; + strsql = ""; + } + + return strsql; + } } } diff --git a/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj b/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj index b37a053..b092a0e 100644 --- a/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj +++ b/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj @@ -154,6 +154,12 @@ frmCallOff.cs + + Form + + + frmErrLog.cs + Form @@ -664,6 +670,9 @@ frmColor.cs + + frmErrLog.cs + frmPartOutQtyDetail.cs