diff --git a/Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll b/Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll index 8e06d41..b4e8c47 100644 Binary files a/Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll and b/Stone.WinForm/Stone.Common.Dlls/Stone.Entity.dll differ 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 + CwAAAk1TRnQBSQFMAgEBBQEAAWgBAAFoAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQAB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f8BAAQJAaABWAEaAVgBoAPD + 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