From 53a4c145a57b41787bb02b4f1d54d928aaaf8c2e Mon Sep 17 00:00:00 2001 From: lilili Date: Mon, 11 Sep 2023 11:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A3=80=E9=AA=8C=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E5=8D=95=E7=94=9F=E6=88=90=E6=9D=A1=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs index abc4645..23729b3 100644 --- a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs +++ b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs @@ -1518,7 +1518,8 @@ insert into ICSInventoryLot decimal minPackQty = Convert.ToDecimal(queryParam["minPackQty"].ToString()); decimal thisCreateQty = Convert.ToDecimal(queryParam["thisCreateQty"].ToString()); decimal LOTQTY = minPackQty; - string Pre = "DN" + DNCode + Sequence; + var dateString = DateTime.Now.ToString("yyMMdd").Substring(1); + string Pre = "DN" + DNCode + dateString; string sql = string.Empty; string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode; string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName; @@ -1590,7 +1591,7 @@ WHERE SELECT @locationCodeCurrent"; object locationCode = SqlHelper.ExecuteScalar(locstionsql); - string LotNo = GetSerialCode(WorkPoint, "ICSInventoryLot", "LotNO", Pre, 5); + string LotNo = GetSerialCode(WorkPoint, "ICSInventoryLot", "LotNO", Pre, 2); sql += string.Format(@"Insert into ICSInventoryLotDetail(LotNo, TransCode,TransSequence,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1) Values('{0}','{1}','{2}','{3}','{4}',getdate(),'{5}','{6}')", LotNo, DNCode, Sequence, MUSER, MUSERNAME, WorkPoints, locationCode); @@ -1709,6 +1710,7 @@ WHERE return 0; DataTable table = dataset.Tables[0]; StringBuilder sqlString = new StringBuilder(); + var dateString = MTime.ToString("yyMMdd").Substring(1); for (int i = 0; i < table.Rows.Count; i++) { string dnCode = table.Rows[i]["DNCode"].ToString(); @@ -1719,9 +1721,9 @@ WHERE string sequence = table.Rows[i]["Sequence"].ToString(); string extensionID = table.Rows[i]["ExtensionID"].ToString(); string amount = table.Rows[i]["Amount"].ToString(); - string code = "DN" + table.Rows[i]["DNCode"].ToString() + table.Rows[i]["Sequence"].ToString(); + string code = "DN" + table.Rows[i]["DNCode"].ToString() + dateString; //条码 - string LotNo = GetSerialCode(workPoint, "ICSInventoryLot", "LotNO", code, 5); + string LotNo = GetSerialCode(workPoint, "ICSInventoryLot", "LotNO", code, 2); //获取推荐库位 var locstionsql = $@"DECLARE @locationCodeCurrent VARCHAR(50) SET @locationCodeCurrent=(SELECT