From 5bc7f01c15b31113a8015dfffab374d3b2e20a3e Mon Sep 17 00:00:00 2001 From: FoxV Date: Thu, 18 Aug 2022 14:40:37 +0800 Subject: [PATCH] jiang --- .../ICSControlModeService.cs | 7 +- .../ICSManufactureService.cs | 4 +- .../ICSOutsourcingService.cs | 6 +- .../ICSSoft.DataProject/ICSPurchaseService.cs | 6 +- .../ICSSoft.DataProject/ICSSalesService.cs | 4 +- .../ICSSoft.DataProject.csproj | 4 +- .../ICSSoft.DataProject/ICSSubmitService.cs | 5 +- .../ICSWareHouseLotInfoService.cs | 90 +++++++++++++++++-- .../ICSWareHouseService.cs | 2 +- .../ICSSoft.Entity/LOTStockUpCreateIModel.cs | 7 +- .../Controllers/WMSBarCoreController.cs | 48 ++++++++++ 11 files changed, 154 insertions(+), 29 deletions(-) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSControlModeService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSControlModeService.cs index 60d49ce..2f65081 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSControlModeService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSControlModeService.cs @@ -43,14 +43,13 @@ namespace ICSSoft.DataProject cmd.Connection = conn; try { - string sql = @"SELECT F_ItemCode as itemCode,F_ItemName as itemName,F_EnabledMark as enableMark FROM [dbo].[Sys_SRM_ItemsDetail] WHERE F_ItemCode='ControlMode01' OR F_ItemCode='ControlMode02'"; + string sql = @"SELECT TOP 1 F_ItemCode as itemCode,F_ItemName as itemName,F_EnabledMark as enableMark FROM [dbo].[Sys_SRM_ItemsDetail] WHERE F_ItemId='14361ce1-c5e3-4e85-a253-51aa3cdde3e6'AND F_EnabledMark='1' ORDER BY F_ItemCode"; - //sql = string.Format(sql, cmd); DataTable table = DBHelper.SQlReturnData(sql, cmd); string json = JsonConvert.SerializeObject(table); - ControlMode model = JsonConvert.DeserializeObject(json); + List model = JsonConvert.DeserializeObject>(json); cmd.Transaction.Commit(); - return model; + return model[0]; } catch (Exception ex) { diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs index da4b2e2..3236ecc 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs @@ -554,7 +554,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSMOPick x ON x.MODetailID=y.MODetailID AND x.WorkPoint=y.WorkPoint AND b.TransSequence = y.Sequence + '~' + x.Sequence INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND a.ERPUpload='0' AND ISNULL(a.LogID, '')<>'' - GROUP BY y.DepCode,a.ToWarehouseCode,y.MOCode,a.MUSER,a.InvCode,x.PickID,x.MODetailID,Enable + GROUP BY y.DepCode,a.ToWarehouseCode,y.MOCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,x.PickID,x.MODetailID,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') @@ -787,7 +787,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSMO c ON b.TransCode=c.MOCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.DepCode,a.ToWarehouseCode,c.MOCode,a.MUSER,a.InvCode,c.MODetailID,Enable + GROUP BY c.DepCode,a.ToWarehouseCode,c.MOCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.MODetailID,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs index 34e40f0..dc980c1 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs @@ -871,7 +871,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSOutsourcingOrder c ON b.TransCode=c.OOCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.VenCode,a.ToWarehouseCode,c.OOCode,a.MUSER,a.InvCode,c.OODetailID,isnull((c.UnitPrice),0),c.Currency,Enable + GROUP BY c.VenCode,a.ToWarehouseCode,c.OOCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.OODetailID,isnull((c.UnitPrice),0),c.Currency,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') @@ -1001,7 +1001,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSODeliveryNotice c ON b.TransCode=c.ODNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,a.MUSER,a.InvCode,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable + GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') @@ -1132,7 +1132,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSODeliveryNotice d ON c.OODetailID=d.ODNDetailID AND d.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,d.ODNCode,a.MUSER,a.InvCode,d.ODNDetailID,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable + GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,d.ODNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,d.ODNDetailID,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs index 153c1f6..3b8acc4 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs @@ -177,7 +177,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSPurchaseOrder c ON b.TransCode=c.POCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.VenCode,a.ToWarehouseCode,c.POCode,a.MUSER,a.InvCode,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,Enable + GROUP BY c.VenCode,a.ToWarehouseCode,c.POCode,a.MUSER,a.InvCode,lot.Amount,lot.Quantity,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') @@ -307,7 +307,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSDeliveryNotice c ON b.TransCode=c.DNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,a.MUSER,a.InvCode,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable + GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') @@ -438,7 +438,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSDeliveryNotice d ON c.PODetailID=d.DNDetailID AND d.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,d.DNCode,a.MUSER,a.InvCode,d.DNDetailID,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable + GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,d.DNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,d.DNDetailID,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs index 2f4fe4d..a46683c 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs @@ -225,7 +225,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSSDN c ON b.TransCode=c.SDNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' AND c.Type='2' - GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,a.InvCode,c.SDNDetailID,Enable + GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.SDNDetailID,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') @@ -354,7 +354,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSSDN c ON a.TransCode=c.SDNCode AND a.TransSequence=c.Sequence AND a.WorkPoint=c.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' AND c.Type='2' - GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,a.InvCode,c.SDNDetailID,Enable + GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.SDNDetailID,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSoft.DataProject.csproj b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSoft.DataProject.csproj index 874497c..b64c7c5 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSoft.DataProject.csproj +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSoft.DataProject.csproj @@ -43,9 +43,9 @@ ..\packages\log4net.2.0.13\lib\net45\log4net.dll - + False - ..\ICSSoft.WebAPI\bin\Newtonsoft.Json.dll + ..\ICSSoft.WMS.WebAPI\bin\Newtonsoft.Json.dll diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 0e72ada..7ae3fd6 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -1691,7 +1691,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); + item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode); //更新日志表源头单据信息 string sql = @"UPDATE ICSWareHouseLotInfoLog SET TransCode='{3}',TransSequence='{4}' @@ -1834,9 +1834,8 @@ namespace ICSSoft.DataProject throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!" } //入库 - ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, - item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID); + item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID,itemInfo.InvCode + itemInfo.WarehouseCode); } } diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index ff6f083..df0eedc 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -50,8 +50,9 @@ 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 WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language, string LogID,string jointLotNo) { try { @@ -107,13 +108,6 @@ namespace ICSSoft.DataProject throw new Exception(language.GetNameByCode("WMSAPIInfo165")); } - ControlMode mode = ICSControlModeService.GetControlModes(); - //管控方式启用"料品"时 - if (mode.itemCode.Equals("ControlMode02")) - { - - } - ///添加日志 sql = @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode, FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, @@ -137,6 +131,86 @@ namespace ICSSoft.DataProject { throw new Exception(language.GetNameByCode("WMSAPIInfo166")); } + + ControlMode mode = ICSControlModeService.GetControlModes(); + //管控方式是"料品"时 + if (mode.itemCode.Equals("ControlMode02")) + { + ///将物料编码作为物料条码添加库存(原条码退回,更新库存;新条码直接入库) + if (BusinessCode != TransTypeEnum.SalesReturnBack.GetDescription() + && string.IsNullOrWhiteSpace(LogID)) + { + sql = @"IF EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}') + BEGIN + RAISERROR('" + language.GetNameByCode("WMSAPIInfo164") + @"',16,1); + RETURN + END "; + } + sql += @" IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}') + BEGIN + RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1); + RETURN + END + + IF EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}') + BEGIN + UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)+'{3}' WHERE LotNo='{0}' AND WorkPoint='{1}' + END + ELSE + BEGIN + IF EXISTS(SELECT il.InvCode FROM ICSInventoryLocation il + INNER JOIN ICSInventoryLot a ON a.InvCode=il.InvCode AND a.WorkPoint=il.WorkPoint + WHERE il.Enable='1' AND a.LotNo='{0}' AND a.WorkPoint='{1}') + BEGIN + IF NOT EXISTS(SELECT il.InvCode FROM ICSInventoryLocation il + INNER JOIN ICSInventoryLot a ON a.InvCode=il.InvCode AND a.WorkPoint=il.WorkPoint + WHERE il.Enable='1' AND a.LotNo='{0}' AND a.WorkPoint='{1}' AND il.LocationCode='{4}') + BEGIN + RAISERROR('" + language.GetNameByCode("WMSAPIInfo180") + @"',16,1); + RETURN + 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 ,'' + 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 + INNER JOIN ICSLocation d ON d.LocationCode='{4}' AND a.WorkPoint=d.WorkPoint + INNER JOIN ICSWarehouse e ON d.WHID=e.ID AND d.WorkPoint=e.WorkPoint + 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, jointLotNo, WorkPoint, User, Quantity, LocationCode); + + if (!DBHelper.ExecuteNonQuery(sql, cmd)) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo165")); + } + + ///添加日志 + sql = @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode, + FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, + Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID, + ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName, + MTIME,WorkPoint,EATTRIBUTE1,LogID) + SELECT NEWID(),'{3}',b.TransCode,b.TransSequence,a.LotNo ,a.InvCode , + '','',c.WarehouseCode,c.LocationCode,'{6}', + '','0','{4}','{5}','0','', + '','','',f.F_Account ,f.F_RealName , + SYSDATETIME() ,a.WorkPoint ,'','{7}' + FROM ICSInventoryLot a + INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint + INNER JOIN ICSWareHouseLotInfo c ON a.LotNo=c.LotNo AND a.WorkPoint=c.WorkPoint + 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}' + "; + sql = string.Format(sql, jointLotNo, WorkPoint, User, Identification, TransType, BusinessCode, Quantity, LogID); + + if (!DBHelper.ExecuteNonQuery(sql, cmd)) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo166")); + } + } } catch (Exception) { diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs index 3ef3346..9d78d7b 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs @@ -1015,7 +1015,7 @@ namespace ICSSoft.DataProject INNER JOIN ICSReturn b ON a.TransCode=b.ReturnCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock002' AND a.WorkPoint=con.WorkPoint WHERE a.Identification='{0}' AND ERPUpload='0' - GROUP BY a.ToWarehouseCode,b.ReturnCode,a.MUSER,a.InvCode,b.ReturnDetailID,Enable + GROUP BY a.ToWarehouseCode,b.ReturnCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,b.ReturnDetailID,Enable ,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '') diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/LOTStockUpCreateIModel.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/LOTStockUpCreateIModel.cs index bc65d5f..ad6eac1 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/LOTStockUpCreateIModel.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/LOTStockUpCreateIModel.cs @@ -26,7 +26,7 @@ namespace ICSSoft.Entity /// 类型 /// public string TransType { get; set; } - + public List detail { get; set; } @@ -64,5 +64,10 @@ namespace ICSSoft.Entity /// 数量 /// public string Quantity { get; set; } + + /// + /// 物料编码 + /// + public string InvCode { get; set; } } } diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs index 185306a..2df3d28 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs @@ -376,6 +376,54 @@ namespace ICSSoft.WebAPI.Controllers return result; } + /* + /// + /// 测试获取管控方式 + /// + /// + [HttpPost] + [Route("api/ControlMode/Get")] + public HttpResponseMessage getControlMode() + { + log.Info("获取管控方式" ); + try + { + ControlMode model = new ControlMode(); + //model = JsonConvert.DeserializeObject>(JsonData.ToString()); + //WMSBarCoreService action = new WMSBarCoreService(); + //var resultStr = action.LOTStockCreate(model); + var resultStr = ICSControlModeService.GetControlModes(); + res.Success = true; + res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!"; + if (resultStr != null && resultStr.ToString() != "[]") + { + if (resultStr.itemCode.Equals("ControlMode01")) + { + res.Data = "启用批次"; + } + else + { + res.Data = "启用物料"; + } + //res.Data = resultStr.itemCode + "," + resultStr.itemName + "," + resultStr.enableMark + "," + resultStr.itemCode.Equals("ControlMode01"); + } + } + catch (Exception ex) + { + log.Error("转换失败:" + ex.ToString()); + res.Success = false; + res.Message = ex.Message; + } + finally + { + str = JsonConvert.SerializeObject(res); + result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json"); + } + log.Debug("上架返回值:" + str); + return result; + } + */ + ///// ///// 上架删除 /////