From 78272927c7e72dd4103cf82d50302e7258ff5a4f Mon Sep 17 00:00:00 2001 From: lilili Date: Wed, 31 May 2023 14:29:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=9F=E4=BA=A7=E9=80=80?= =?UTF-8?q?=E6=96=99=E4=B8=8A=E6=9E=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ICSSoft.DataProject/ICSSubmitService.cs | 14 +++++++++++--- .../ICSWareHouseLotInfoService.cs | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index e6d3d71..fb4e5f2 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -2561,6 +2561,7 @@ namespace ICSSoft.DataProject { string TransType = string.Empty; string Identification = Guid.NewGuid().ToString(); + DateTime createDate = DateTime.Now; foreach (var item in JsonData) { TransType = item.TransType; @@ -2594,7 +2595,7 @@ namespace ICSSoft.DataProject BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription(); //入库 ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, - item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode); + item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode,createDate.ToString()); ////更新日志表源头单据信息 //string sql = @"UPDATE ICSWareHouseLotInfoLog SET TransCode='{3}',TransSequence='{4}' @@ -2682,6 +2683,13 @@ namespace ICSSoft.DataProject //更新源头单据数量 ICSManufactureService.MOIssueDocNegative(TransType, itemInfo.LogID, itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language); BusinessCode = TransTypeEnum.MOIssueDocNegative.GetDescription(); + var getDate = $@"SELECT top 1 MTIME FROM ICSWareHouseLotInfo WHERE InvCode='{itemInfo.InvCode}' AND Quantity>0 ORDER BY MTIME "; + var date=DBHelper.ExecuteScalar(getDate, cmd); + if (date!=null||date.ToString()!="") + { + createDate = Convert.ToDateTime(date).AddDays(-1); + } + } #endregion #region 生产入库 @@ -2738,7 +2746,7 @@ namespace ICSSoft.DataProject } //入库 ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, - item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode); + item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode,createDate.ToString()); } //上传ERP @@ -2886,7 +2894,7 @@ namespace ICSSoft.DataProject } //入库 ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, - itemInfo.User, JsonData.DATA.Head[0].WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode); + itemInfo.User, JsonData.DATA.Head[0].WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode,DateTime.Now.ToString()); } //上传ERP if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"])) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index 1495929..11e3297 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -53,7 +53,7 @@ namespace ICSSoft.DataProject /// /// public static void WareHouseLotInfoUp(string Identification, string LocationCode, string LotNo, string Quantity, string User, - string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language, string LogID, string jointLotNo) + string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language, string LogID, string jointLotNo,string createDate) { try { @@ -130,7 +130,7 @@ namespace ICSSoft.DataProject END END INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1) - SELECT NEWID(),a.LotNo ,e.WarehouseCode,d.LocationCode,a.InvCode ,'{3}',SYSDATETIME(),'0',f.F_Account ,f.F_RealName ,SYSDATETIME() ,a.WorkPoint ,'' + SELECT NEWID(),a.LotNo ,e.WarehouseCode,d.LocationCode,a.InvCode ,'{3}','{5}','0',f.F_Account ,f.F_RealName ,'{5}' ,a.WorkPoint ,'' FROM ICSInventoryLot a INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint --INNER JOIN ICSOApplyNegDetail c ON b.TransCode=c.OApplyNegCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint @@ -139,7 +139,7 @@ namespace ICSSoft.DataProject INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' END"; - sql = string.Format(sql, LotNo, WorkPoint, User, Quantity, LocationCode); + sql = string.Format(sql, LotNo, WorkPoint, User, Quantity, LocationCode,createDate); if (!DBHelper.ExecuteNonQuery(sql, cmd)) {