diff --git a/PDAForm/PDAForm/Bill/AsnBill/F_AsnBill.cs b/PDAForm/PDAForm/Bill/AsnBill/F_AsnBill.cs index a649931..abad5dc 100644 --- a/PDAForm/PDAForm/Bill/AsnBill/F_AsnBill.cs +++ b/PDAForm/PDAForm/Bill/AsnBill/F_AsnBill.cs @@ -20,24 +20,26 @@ namespace PDAForm.Bill.AsnBill /// public void BillNew(DataGrid dg) { - string Cmd = "BILL_NEW_" + billType; + string Cmd = "BILL_GET_" + billType; string Pars = BillNo + ";" + UserInfo.UserName; MyCommand cmd = new MyCommand(Cmd, Pars); dsBill = F_Message.ServiceMessage(cmd.GetCommand()); - + dg.DataSource = dsBill.Tables[0]; DataGridTableStyle style = new DataGridTableStyle(); style.MappingName = dsBill.Tables[0].TableName; + dg.TableStyles.Clear(); dg.TableStyles.Add(style); - dg.TableStyles[0].GridColumnStyles["PackageNo"].HeaderText = "装箱单号"; - dg.TableStyles[0].GridColumnStyles["PackageNo"].Width = 150; - dg.TableStyles[0].GridColumnStyles["IsCheck"].HeaderText = "是否扫描"; - dg.TableStyles[0].GridColumnStyles["AsnNumber"].Width = 0; - dg.TableStyles[0].GridColumnStyles["IsShipingVerification"].Width = 0; - - + dg.TableStyles[0].GridColumnStyles["PartNumber"].HeaderText = "零件号"; + dg.TableStyles[0].GridColumnStyles["PartNumber"].Width = 150; + dg.TableStyles[0].GridColumnStyles["Qty"].HeaderText = "计划数量"; + dg.TableStyles[0].GridColumnStyles["Qty"].Width = 100; + dg.TableStyles[0].GridColumnStyles["CheckQty"].HeaderText = "校验数量"; + dg.TableStyles[0].GridColumnStyles["CheckQty"].Width = 100; + dg.TableStyles[0].GridColumnStyles["IsPackingVerification"].HeaderText = "校验通过"; + dg.TableStyles[0].GridColumnStyles["IsPackingVerification"].Width = 50; } /// @@ -53,7 +55,27 @@ namespace PDAForm.Bill.AsnBill } + /// + /// 提交单据 + /// + public void BillSubmit(DataTable scanInfo) + { + string Cmd = "BILL_SUBMIT_WITHSCAN"; + string Pars = UserInfo.UserName; + MyCommand cmd = new MyCommand(Cmd, Pars); + F_Message.ServiceMessage(cmd.GetCommand(), dsBill); + } + + public DataTable GetShipingVerification() + { + string Cmd = "BILL_GET_VERIHIS"; + string Pars = BillNo + ";" + UserInfo.UserName; + + MyCommand cmd = new MyCommand(Cmd, Pars); + var dsBillVeriHis = F_Message.ServiceMessage(cmd.GetCommand()); + return dsBillVeriHis.Tables[0]; + } } } diff --git a/PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.cs b/PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.cs index d4322c6..66d5a83 100644 --- a/PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.cs +++ b/PDAForm/PDAForm/Bill/AsnBill/frmAsnBill.cs @@ -93,8 +93,8 @@ namespace PDAForm.Bill.AsnBill throw new Exception("托盘号 " + BarCode + " 已扫描"); } //本次扫描的数据中是否重复扫描该托盘号 - drs = dtNowScan.Select("[PackageNo]='" + BarCode + "'"); - if (drs.Length > 0) + var drNow = dtNowScan.Select("[PackageNo]='" + BarCode + "'"); + if (drNow.Length > 0) { throw new Exception("托盘号 " + BarCode + " 已扫描"); } @@ -114,12 +114,25 @@ namespace PDAForm.Bill.AsnBill } } rowAsn[0]["CheckQty"] = int.Parse(strQty) + int.Parse(rowAsn[0]["CheckQty"].ToString()); + if (int.Parse(rowAsn[0]["CheckQty"].ToString()) == int.Parse(rowAsn[0]["Qty"].ToString())) + { + rowAsn[0]["IsPackingVerification"] = 1; + } //填加校验明细 var scanInfo = dtNowScan.NewRow(); scanInfo["AsnNumber"] = m_base.BillNo; - scanInfo["PackageNo"] = boxID; + scanInfo["PackageNo"] = BarCode; scanInfo["UserName"] = UserInfo.UserName; dtNowScan.Rows.Add(scanInfo); + if (m_base.dsBill.Tables.Count == 1) + { + dtNowScan.TableName = "ScanInfo"; + m_base.dsBill.Tables.Add(dtNowScan); + } + else + { + m_base.dsBill.Tables[1].Rows.Add(scanInfo.ItemArray); + } Total(); this.txtBarCode.Focus(); this.txtBarCode.SelectAll(); diff --git a/PDAForm/PDAForm/PDAForm.csproj b/PDAForm/PDAForm/PDAForm.csproj index 9f267cc..0c17e10 100644 --- a/PDAForm/PDAForm/PDAForm.csproj +++ b/PDAForm/PDAForm/PDAForm.csproj @@ -811,7 +811,7 @@ - Always + PreserveNewest diff --git a/PDAForm/PDAForm/PDAForm.xml b/PDAForm/PDAForm/PDAForm.xml index 3c3e84d..3e5a163 100644 --- a/PDAForm/PDAForm/PDAForm.xml +++ b/PDAForm/PDAForm/PDAForm.xml @@ -2,11 +2,11 @@ test - 刘洪辉 + 闻荫 WebService - http://127.0.0.1:8084/Service.asmx + http://127.0.0.1:8009/Service.asmx 当前用户 diff --git a/PDAForm/PDAForm/frmMain.Designer.cs b/PDAForm/PDAForm/frmMain.Designer.cs index 938848a..5cddd58 100644 --- a/PDAForm/PDAForm/frmMain.Designer.cs +++ b/PDAForm/PDAForm/frmMain.Designer.cs @@ -52,6 +52,7 @@ this.btnOnLine = new System.Windows.Forms.Button(); this.btnSort = new System.Windows.Forms.Button(); this.tabPage4 = new System.Windows.Forms.TabPage(); + this.button2 = new System.Windows.Forms.Button(); this.btnNBCCH = new System.Windows.Forms.Button(); this.btnVDA = new System.Windows.Forms.Button(); this.btnShipBill = new System.Windows.Forms.Button(); @@ -62,7 +63,6 @@ this.btnQuality = new System.Windows.Forms.Button(); this.btnBarCodeCheck = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); - this.button2 = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -313,6 +313,17 @@ this.tabPage4.Size = new System.Drawing.Size(230, 187); this.tabPage4.Text = "功能三"; // + // button2 + // + this.button2.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular); + this.button2.Location = new System.Drawing.Point(128, 104); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(100, 50); + this.button2.TabIndex = 43; + this.button2.Text = "VDA标签照核"; + this.button2.Visible = false; + this.button2.Click += new System.EventHandler(this.button2_Click); + // // btnNBCCH // this.btnNBCCH.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular); @@ -321,20 +332,22 @@ this.btnNBCCH.Size = new System.Drawing.Size(100, 50); this.btnNBCCH.TabIndex = 43; this.btnNBCCH.Text = "内部参考号查询"; + this.btnNBCCH.Visible = false; this.btnNBCCH.Click += new System.EventHandler(this.btnNBCCH_Click); // // btnVDA // - this.btnVDA.Location = new System.Drawing.Point(16, 24); + this.btnVDA.Location = new System.Drawing.Point(127, 25); this.btnVDA.Name = "btnVDA"; this.btnVDA.Size = new System.Drawing.Size(100, 50); this.btnVDA.TabIndex = 43; this.btnVDA.Text = "装箱校验"; + this.btnVDA.Visible = false; this.btnVDA.Click += new System.EventHandler(this.btnVDA_Click); // // btnShipBill // - this.btnShipBill.Location = new System.Drawing.Point(127, 24); + this.btnShipBill.Location = new System.Drawing.Point(16, 25); this.btnShipBill.Name = "btnShipBill"; this.btnShipBill.Size = new System.Drawing.Size(100, 50); this.btnShipBill.TabIndex = 42; @@ -411,16 +424,6 @@ this.tabPage2.Size = new System.Drawing.Size(230, 187); this.tabPage2.Text = "设置"; // - // button2 - // - this.button2.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular); - this.button2.Location = new System.Drawing.Point(128, 104); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(100, 50); - this.button2.TabIndex = 43; - this.button2.Text = "VDA标签照核"; - this.button2.Click += new System.EventHandler(this.button2_Click); - // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); diff --git a/Stone.WinForm/Stone.DataService/PDAService/Web.Config b/Stone.WinForm/Stone.DataService/PDAService/Web.Config index a8217dd..93f70d3 100644 --- a/Stone.WinForm/Stone.DataService/PDAService/Web.Config +++ b/Stone.WinForm/Stone.DataService/PDAService/Web.Config @@ -9,7 +9,7 @@ --> - + diff --git a/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_BillAsn.cs b/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_BillAsn.cs index b05131c..47a2e3a 100644 --- a/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_BillAsn.cs +++ b/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/Bill/F_BillAsn.cs @@ -65,33 +65,37 @@ namespace Stone.DataService.Biz.Bill if (dtVDA.Rows.Count == 0) throw new Exception($"{AsnNumber} 在系统中不存在"); - DataRow[] drs = dtVDA.Select($"[IsPackingVerification]=False"); - if(drs.Length > 0) - { - string msg = ""; - foreach(DataRow dr in drs) - { - msg += dr["PackageNo"].ToString() + ","; - } - if(msg != "") - { - throw new Exception($"未做装箱校验:{msg}"); - } - } - - if (dtVDA.Select($"[IsShipingVerification]=False").Length == 0) - throw new Exception($"{AsnNumber} 已经完成发货校验"); + // DataRow[] drs = dtVDA.Select($"[IsPackingVerification]=False"); + // if(drs.Length > 0) + // { + // string msg = ""; + // foreach(DataRow dr in drs) + // { + // msg += dr["PackageNo"].ToString() + ","; + // } + // if(msg != "") + // { + // throw new Exception($"未做装箱校验:{msg}"); + // } + // } + // + // if (dtVDA.Select($"[IsShipingVerification]=False").Length == 0) + // throw new Exception($"{AsnNumber} 已经完成发货校验"); foreach (DataRow drData in dsData.Tables[0].Rows) { t_JIS_VDA.Edit( - $"[IsShipingVerification]=1", - $"[PackageNo]='{drData["PackageNo"]}'"); + $"[IsPackingVerification]='{drData["IsPackingVerification"]}',[CheckQty] = {drData["CheckQty"]}", + $"[PartNumber]='{drData["PartNumber"]}' and [AsnNumber] = '{drData["AsnNumber"]}'"); + } + //装箱记录 + foreach (DataRow drScan in dsData.Tables[1].Rows) + { DataRow drNew = t_ShipingVerification.Table.NewRow(); - drNew["AsnNumber"] = drData["AsnNumber"].ToString(); - drNew["PackageNo"] = drData["PackageNo"].ToString(); + drNew["AsnNumber"] = drScan["AsnNumber"].ToString(); + drNew["PackageNo"] = drScan["PackageNo"].ToString(); drNew["UserName"] = UserName; t_ShipingVerification.Add(drNew); } @@ -119,7 +123,7 @@ namespace Stone.DataService.Biz.Bill Entity_t_ShipingVerification t_ShipingVerification = new Entity_t_ShipingVerification(); DataSet dsData = t_ShipingVerification.GetData( - $"AsnNumber,PackageNo", + $"AsnNumber,PackageNo,UserName", $"[AsnNumber]='{AsnNumber}'", $"[PackageNo] desc"); return dsData; @@ -132,7 +136,7 @@ namespace Stone.DataService.Biz.Bill Entity_t_JIS_VDA t_JIS_VDA = new Entity_t_JIS_VDA(); DataSet dsData = t_JIS_VDA.GetData( - $"PartNumber,Qty,CheckQty", + $"AsnNumber,PartNumber,Qty,CheckQty,IsPackingVerification", $"[AsnNumber]='{AsnNumber}'", $"[PackageNo] desc"); return dsData; diff --git a/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs b/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs index a3b9914..d970ac5 100644 --- a/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs +++ b/Stone.WinForm/Stone.DataService/Stone.DataService.Biz/CommandFactory.cs @@ -84,7 +84,16 @@ namespace Stone.DataService.Biz f_BillAsn = new F_BillAsn(); f_BillAsn.BillSubmit(cmd, dsData); return null; - + case "BILL_SUBMIT_WITHSCAN": + f_BillAsn = new F_BillAsn(); + f_BillAsn.BillSubmit(cmd, dsData); + return null; + case "BILL_GET_VERIHIS": + f_BillAsn = new F_BillAsn(); + return f_BillAsn.GetVefiHis(cmd); + case "BILL_GET_ASNBILL": + f_BillAsn = new F_BillAsn(); + return f_BillAsn.GetASN(cmd); #endregion #region STDУ diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmASNScan.Designer.cs b/Stone.WinForm/Stone.WinModule/Standard/frmASNScan.Designer.cs index 712df4c..a588e60 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmASNScan.Designer.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmASNScan.Designer.cs @@ -48,7 +48,6 @@ this.txtAsnNumber.Location = new System.Drawing.Point(26, 63); this.txtAsnNumber.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7); this.txtAsnNumber.Name = "txtAsnNumber"; - this.txtAsnNumber.PasswordChar = '*'; this.txtAsnNumber.Size = new System.Drawing.Size(350, 34); this.txtAsnNumber.TabIndex = 1; this.txtAsnNumber.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPassword_KeyDown); diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs index 0904525..0fcfc3c 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs @@ -908,26 +908,30 @@ namespace Stone.WinModule.Standard Entity_t_JIS_VDA t_Input = new Entity_t_JIS_VDA(db); DataRow drInput = null; //第四行开始读日期,第五行是到货时间,第六行车型不要,第七行读零件和数量 - int readRow = 4; + int readDPDateRow = 4; + //第7行是ASN + int readASNRowIndex = 7; //导入的列数 var coloumnCount = dsData.Tables[0].Columns.Count; //零件号所在的行 从0开始 - var partRowIndex = 7; + var partRowIndex = 8; //零件号所在的列数 从0 开始 var partIndex = 2; //校验零件号是否有订单信息 - var strCheckPO = CheckPartPO(dsData.Tables[0], partRowIndex, partIndex); + var dtPartPo = new DataTable(); + var strCheckPO = CheckPartPO(dsData.Tables[0], partRowIndex, partIndex,out dtPartPo); if (strCheckPO != "OK") { throw new Exception("导入数据失败!\r\n" + "原因为:\r\n" + strCheckPO); } - //删掉以导入的ASN todo ASN模板未确认 - // DelDPASNHis(dsData.Tables[0]); + //删掉以导入的ASN + DelDPASNHis(dsData.Tables[0]); + //获取零件订单基础数据 for (int i = 0; i < dsData.Tables[0].Rows.Count; i++) { - if (i == readRow-1) + if (i == readDPDateRow-1) { var drDate = dsData.Tables[0].Rows[i]; for (int n = 0; n < coloumnCount; n++) @@ -944,6 +948,8 @@ namespace Stone.WinModule.Standard //校验是否是日期,如果是日期,循环读入天的需求 if (DateTime.TryParse(date, out DateTime dt)) { + var asnNum = dsData.Tables[0].Rows[readASNRowIndex-1][n].ToString(); + //todo 校验ASN的规则 规则待定 var DPTime = dsData.Tables[0].Rows[i + 1][n].ToString(); //得到了发货日期 和 发货时间 //开始循坏要货明细 @@ -960,13 +966,12 @@ namespace Stone.WinModule.Standard drInput["fileType"] = "SY88"; drInput["LabelDate"] = dt.ToString("yyyy-MM-dd") + " " + DPTime + ":00"; drInput["Date"] = dt; - //todo AsnNumber 当前模板没有ASN号 - drInput["AsnNumber"] = ""; + drInput["AsnNumber"] = asnNum; drInput["PartNumber"] = dr[partIndex]; drInput["Qty"] = planQty; //todo 从基础数据表获取PO - drInput["orderNumber"] = ""; - //todo 增加表结构 + var partPO = dtPartPo.Select("Code = '" + dr[partIndex] + "'"); + drInput["orderNumber"] = partPO[0]["PONumber"].ToString(); drInput["CheckQty"] = 0; //是否完成装箱校验 drInput["IsPackingVerification"] = 0; @@ -1037,11 +1042,12 @@ namespace Stone.WinModule.Standard return Result; } - private string CheckPartPO(DataTable dtImport,int startRowIndex,int columnIndex) + private string CheckPartPO(DataTable dtImport,int startRowIndex,int columnIndex,out DataTable dtPartPo) { string strRtn = ""; Entity_t_PartPO partPO = new Entity_t_PartPO(); DataTable dtData = partPO.GetData($"1 = 1").Tables[0]; + dtPartPo = dtData; if (dtData.Rows.Count == 0) { return "系统中没有定义零件号对应的订单信息!"; @@ -1080,7 +1086,6 @@ namespace Stone.WinModule.Standard var sql = ""; var AsnNums = ""; //ASN 行位置 - //todo asn模板未确定 var asnRowIndex = 6; var asnRow = dtImport.Rows[asnRowIndex]; //ASN 列开始位置