From 5dd833e2b7d298abc7fd995e82da3f3db0c5838a Mon Sep 17 00:00:00 2001 From: lixh Date: Fri, 27 May 2022 09:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=8F=91=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ICSSoft.Common/TransTypeEnum.cs | 22 +- .../ICSSoft.DataProject/ICSSubmitService.cs | 240 ++++++++++++++---- .../ICSWareHouseLotInfoService.cs | 20 +- 3 files changed, 211 insertions(+), 71 deletions(-) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs index 4500b80..3e517fe 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs @@ -30,15 +30,15 @@ namespace ICSSoft.Common [Description("委外发料-委外订单备料表")] [DBValue("5")] - OutsourcingIssueDoc, + OutsourcingIssueDoc, //(合并发料) [Description("委外发料-委外领料申请单")] [DBValue("6")] - OOApply, + OOApply, //(合并发料) [Description("委外发料-委外材料出库单")] [DBValue("7")] - OOIssue, + OOIssue, //(合并发料) [Description("委外退料-委外退料单")] [DBValue("8")] @@ -74,15 +74,15 @@ namespace ICSSoft.Common [Description("生产发料-生产订单备料表")] [DBValue("13")] - MOIssueDoc, + MOIssueDoc, //(合并发料) [Description("生产发料-领料申请单")] [DBValue("14")] - MOApply, + MOApply, //(合并发料) [Description("生产发料-材料出库单")] [DBValue("15")] - MOIssue, + MOIssue, //(合并发料) [Description("生产退料-生产退料单")] [DBValue("16")] @@ -106,7 +106,7 @@ namespace ICSSoft.Common [Description("销售发货-销售发货单")] [DBValue("19")] - SalesShipmentDoc, + SalesShipmentDoc, //(合并发料) [Description("销售退货-销售退货单")] [DBValue("20")] @@ -114,11 +114,11 @@ namespace ICSSoft.Common [Description("一步调拨")] [DBValue("21")] - OneStepTransferDocIn, + OneStepTransferDocIn, //(合并发料) [Description("两步调出")] [DBValue("22")] - TwoStepTransferDocOut, + TwoStepTransferDocOut, //(合并发料) [Description("两步调入")] [DBValue("23")] @@ -130,7 +130,7 @@ namespace ICSSoft.Common [Description("杂发")] [DBValue("24")] - OtherOutDoc, + OtherOutDoc, //(合并发料) [Description("杂收")] [DBValue("25")] @@ -138,7 +138,7 @@ namespace ICSSoft.Common [Description("借用")] [DBValue("26")] - BrrowDoc, + BrrowDoc, //(合并发料) [Description("归还")] [DBValue("27")] diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 22bfb8e..88b47de 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -57,13 +57,13 @@ namespace ICSSoft.DataProject string TransType = JsonData.TransType; #region SLQ - string sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2}) + string sqlCheck = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2}) BEGIN RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); RETURN END - - SELECT a.ID, + "; + string sql = @"SELECT a.ID, {0} a.InvCode, inv.InvName, @@ -103,6 +103,9 @@ namespace ICSSoft.DataProject string columns = string.Empty; //查询源头单据表的特殊列名 string tableName = string.Empty; //查询源头单据表名 string where = string.Empty; //查询源头单据的过滤条件 + bool isMerge = false; //合并发料 + string columnsMerge = string.Empty; //合并发料查询源头单据表的特殊列名 + string tableNameMerge = string.Empty; //合并发料查询源头单据表名 #region 出库 #region 采购退货 if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription()) @@ -123,9 +126,20 @@ namespace ICSSoft.DataProject where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='2' "; } #endregion - #region 委外发料 + #region 委外发料(合并发料) else if (TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+b.OOCode AS TransCode, + a.PickID AS DetailID, + a.SupplyType AS Type, + b.Sequence+'-'+a.Sequence AS TransSequence, + a.IssueQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSOOPick a + INNER JOIN ICSOutsourcingOrder b ON a.OODetailID=b.OODetailID AND a.WorkPoint=b.WorkPoint + INNER JOIN ICSMOPickMerge mer ON a.PickID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"b.OOCode AS TransCode, a.PickID AS DetailID, a.SupplyType AS Type, @@ -157,9 +171,20 @@ namespace ICSSoft.DataProject where = @" a.ODNCode='{0}' AND a.WorkPoint='{1}' AND a.ODNType='2' "; } #endregion - #region 生产发料 + #region 生产发料(合并发料) else if (TransType == TransTypeEnum.MOIssueDoc.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+b.MOCode AS TransCode, + a.PickID AS DetailID, + a.SupplyType AS Type, + b.Sequence+'-'+a.Sequence AS TransSequence, + a.IssueQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSMOPick a + INNER JOIN ICSMO b ON a.MODetailID=b.MODetailID AND a.WorkPoint=b.WorkPoint + INNER JOIN ICSMOPickMerge mer ON a.PickID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"b.MOCode AS TransCode, a.PickID AS DetailID, a.SupplyType AS Type, @@ -172,9 +197,19 @@ namespace ICSSoft.DataProject where = @" b.MOCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 销售出库 + #region 销售出库(合并发料) else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.SDNCode AS TransCode, + a.SDNDetailID AS DetailID, + a.Type, + a.Sequence AS TransSequence, + a.SDNQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSSDN a + INNER JOIN ICSMOPickMerge mer ON a.SDNDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.SDNCode AS TransCode, a.SDNDetailID AS DetailID, a.Type, @@ -190,13 +225,7 @@ namespace ICSSoft.DataProject else if (TransType == TransTypeEnum.Check.GetDescription()) { #region SLQ - sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2}) - BEGIN - RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); - RETURN - END - - SELECT a.ID, + sql = @"SELECT a.ID, {0} a.InvCode, inv.InvName, @@ -226,18 +255,22 @@ namespace ICSSoft.DataProject where = @" a.CheckCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 一步调拨 + #region 一步调拨(合并发料) else if (TransType == TransTypeEnum.OneStepTransferDocIn.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.TransferNO AS TransCode, + a.TransferDetailID AS DetailID, + '' AS Type, + a.Sequence AS TransSequence, + a.TransferQuantity AS IssueQuantity, + a.ToWarehouseCode,"; - #region SLQ - sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2}) - BEGIN - RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); - RETURN - END + tableNameMerge = @"ICSTransfer a + INNER JOIN ICSMOPickMerge mer ON a.TransferDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; - SELECT a.ID, + #region SLQ + sql = @"SELECT a.ID, {0} a.InvCode, inv.InvName, @@ -285,9 +318,20 @@ namespace ICSSoft.DataProject where = @" a.TransferNO='{0}' AND a.WorkPoint='{1}' AND a.Status='1' "; } #endregion - #region 两步调出 + #region 两步调出(合并发料) else if (TransType == TransTypeEnum.TwoStepTransferDocOut.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.OutCode AS TransCode, + a.OutDetailID AS DetailID, + '' AS Type, + a.Sequence AS TransSequence, + a.OutQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSOtherOut a + INNER JOIN ICSTransfer tra ON a.TransferDetailID=tra.TransferDetailID AND a.WorkPoint=tra.WorkPoint + INNER JOIN ICSMOPickMerge mer ON a.OutDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.OutCode AS TransCode, a.OutDetailID AS DetailID, '' AS Type, @@ -300,9 +344,19 @@ namespace ICSSoft.DataProject where = @" a.OutCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 其他出库 + #region 其他出库(合并发料) else if (TransType == TransTypeEnum.OtherOutDoc.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.OutCode AS TransCode, + a.OutDetailID AS DetailID, + '' AS Type, + a.Sequence AS TransSequence, + a.OutQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSOtherOut a + INNER JOIN ICSMOPickMerge mer ON a.OutDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.OutCode AS TransCode, a.OutDetailID AS DetailID, '' AS Type, @@ -314,9 +368,19 @@ namespace ICSSoft.DataProject where = @" a.OutCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 领料申请单发料 + #region 领料申请单发料(合并发料) else if (TransType == TransTypeEnum.MOApply.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.ApplyCode AS TransCode, + a.ApplyDetailID AS DetailID, + a.Type, + a.Sequence AS TransSequence, + a.IssueQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSMOApply a + INNER JOIN ICSMOPickMerge mer ON a.ApplyDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.ApplyCode AS TransCode, a.ApplyDetailID AS DetailID, a.Type, @@ -328,9 +392,19 @@ namespace ICSSoft.DataProject where = @" a.ApplyCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 委外领料申请单发料 + #region 委外领料申请单发料(合并发料) else if (TransType == TransTypeEnum.OOApply.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.ApplyCode AS TransCode, + a.ApplyDetailID AS DetailID, + a.Type, + a.Sequence AS TransSequence, + a.IssueQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSOApply a + INNER JOIN ICSMOPickMerge mer ON a.ApplyDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.ApplyCode AS TransCode, a.ApplyDetailID AS DetailID, a.Type, @@ -342,9 +416,19 @@ namespace ICSSoft.DataProject where = @" a.ApplyCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 开立材料出库 + #region 开立材料出库(合并发料) else if (TransType == TransTypeEnum.MOIssue.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.IssueCode AS TransCode, + a.IssueDetailID AS DetailID, + a.Type, + a.Sequence AS TransSequence, + a.IssueQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSMOIssue a + INNER JOIN ICSMOPickMerge mer ON a.IssueDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.IssueCode AS TransCode, a.IssueDetailID AS DetailID, a.Type, @@ -356,9 +440,19 @@ namespace ICSSoft.DataProject where = @" a.IssueCode='{0}' AND a.WorkPoint='{1}' "; } #endregion - #region 开立委外材料出库 + #region 开立委外材料出库(合并发料) else if (TransType == TransTypeEnum.OOIssue.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.IssueCode AS TransCode, + a.IssueDetailID AS DetailID, + a.Type, + a.Sequence AS TransSequence, + a.IssueQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSOIssue a + INNER JOIN ICSMOPickMerge mer ON a.IssueDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.IssueCode AS TransCode, a.IssueDetailID AS DetailID, a.Type, @@ -398,9 +492,19 @@ namespace ICSSoft.DataProject where = @" a.RCVCode='{0}' AND a.WorkPoint='{1}' AND a.Type='2' "; } #endregion - #region 借用 + #region 借用(合并发料) else if (TransType == TransTypeEnum.BrrowDoc.GetDescription()) { + isMerge = true; + columnsMerge = @"mer.MergeID+'-'+a.BrrowCode AS TransCode, + a.BrrowDetailID AS DetailID, + '' AS Type, + a.Sequence AS TransSequence, + a.BrrowQuantity AS IssueQuantity,"; + + tableNameMerge = @"ICSBrrow a + INNER JOIN ICSMOPickMerge mer ON a.BrrowDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + columns = @"a.BrrowCode AS TransCode, a.BrrowDetailID AS DetailID, '' AS Type, @@ -571,16 +675,10 @@ namespace ICSSoft.DataProject #endregion if (string.IsNullOrWhiteSpace(columns) || string.IsNullOrWhiteSpace(tableName) || string.IsNullOrWhiteSpace(where)) throw new Exception(language.GetNameByCode("WMSAPIInfo003")); - if (isDeliveryNotice) + if (isDeliveryNotice)//送货、到货、含委外 { #region SLQ - sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2}) - BEGIN - RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); - RETURN - END - - SELECT a.ID, + sql = sqlCheck + @"SELECT a.ID, {0} a.InvCode, inv.InvName, @@ -609,7 +707,26 @@ namespace ICSSoft.DataProject INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint WHERE {2} "; #endregion - + } + else if(isMerge)//合并发料 + { + #region SLQ + string sqlMerge = @"IF EXISTS(SELECT ID FROM ICSMOPickMerge WHERE MergeID='{3}' AND WorkPoint='{4}' ) + BEGIN + "+ sql; + string whereMerge = string.Format("mer.MergeID='{0}' AND mer.WorkPoint='{1}'", JsonData.TransCode, JsonData.WorkPoint); + sqlMerge = string.Format(sqlMerge, columnsMerge, tableNameMerge, whereMerge, JsonData.TransCode, JsonData.WorkPoint); + sql = sqlMerge + @" + END + ELSE + BEGIN + " + sqlCheck + sql + @" + END"; + #endregion + } + else + { + sql = sqlCheck + sql; } where = string.Format(where, JsonData.TransCode, JsonData.WorkPoint); sql = string.Format(sql, columns, tableName, where, JsonData.TransCode); @@ -722,6 +839,7 @@ namespace ICSSoft.DataProject || TransType == TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription()//开立委外红字入库单 || TransType == TransTypeEnum.BrrowDoc.GetDescription() //借用 || TransType == TransTypeEnum.TransferLibrary.GetDescription() //移库 + //|| TransType == TransTypeEnum.DisassemblyDoc.GetDescription() //拆卸单(散件生成条码入库) ) { isOut = true; @@ -1314,6 +1432,10 @@ namespace ICSSoft.DataProject BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription(); } #endregion + else + { + 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); @@ -1436,6 +1558,13 @@ namespace ICSSoft.DataProject { throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!" } + string[] trans = item.TransCode.Split('-'); + string MergeID = ""; + if (trans.Length == 2) + { + MergeID = trans[0]; + item.TransCode = trans[1]; + } #region 采购退货 if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription()) { @@ -1460,7 +1589,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.OutsourcingIssueDoc.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.OutsourcingIssueDoc.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1488,7 +1617,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.MOIssueDoc.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.MOIssueDoc.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1502,7 +1631,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.SalesShipmentDoc.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.SalesShipmentDoc.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1516,7 +1645,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "6", TransTypeEnum.TwoStepTransferDocOut.GetDescription(), cmd, language); + item.User, item.WorkPoint, "6", TransTypeEnum.TwoStepTransferDocOut.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1530,7 +1659,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.OtherOutDoc.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.OtherOutDoc.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1544,7 +1673,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.MOApply.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.MOApply.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1558,7 +1687,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.OOApply.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.OOApply.GetDescription(), cmd, language,MergeID); } } #endregion @@ -1572,7 +1701,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.MOIssue.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.MOIssue.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1586,7 +1715,7 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.OOIssue.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.OOIssue.GetDescription(), cmd, language, MergeID); } } #endregion @@ -1628,10 +1757,14 @@ namespace ICSSoft.DataProject { //出库 ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, - item.User, item.WorkPoint, "3", TransTypeEnum.BrrowDoc.GetDescription(), cmd, language); + item.User, item.WorkPoint, "3", TransTypeEnum.BrrowDoc.GetDescription(), cmd, language, MergeID); } } #endregion + else + { + throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!" + } } //上传ERP if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"])) @@ -3431,6 +3564,13 @@ namespace ICSSoft.DataProject throw new Exception(language.GetNameByCode("WMSAPIInfo027"));//"调拨单号不能为空!"); } + string[] trans = item.TransCode.Split('-'); + string MergeID = ""; + if (trans.Length == 2) + { + MergeID = trans[0]; + item.TransCode = trans[1]; + } //验证信息 sql = @"DECLARE @Status VARCHAR(10) SELECT @Status=Status FROM ICSTransfer WHERE TransferNO='{0}' and WorkPoint='{1}' AND Type = '1' @@ -3477,7 +3617,7 @@ namespace ICSSoft.DataProject //更新条码信息 ICSWareHouseLotInfoService.WareHouseLotInfoTransfer(Identification, item.TransCode, item.TransSequence, itemInfo.WarehouseCode, itemInfo.LocationCode, - itemInfo.LotNo, itemInfo.CurrentQuantity, item.User, item.WorkPoint, "6", "21", cmd, language); + itemInfo.LotNo, itemInfo.CurrentQuantity, item.User, item.WorkPoint, "6", TransTypeEnum.OneStepTransferDocIn.GetDescription(), cmd, language, MergeID); } } ICSWareHouseService.OneStepTransferDocInERP(TransTypeEnum.OneStepTransferDocIn.GetDescription(), Identification, cmd, language); @@ -4051,8 +4191,8 @@ namespace ICSSoft.DataProject } sql = @"SELECT a.ContainerCode, a.ContainerName,b.LotNo FROM ICSContainer a INNER JOIN ICSContainerLot b ON a.ID=b.ContainerID - WHERE a.ContainerCODE+a.WorkPoint='{0}'"; - sql = string.Format(sql, codes); + WHERE a.ContainerCODE+a.WorkPoint IN({0})"; + sql = string.Format(sql, codes.Substring(0,codes.Length - 1)); DataTable table = DBHelper.SQlReturnData(sql, cmd); cmd.Transaction.Commit(); return table; diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index 1e06e27..6c2ff69 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -91,12 +91,12 @@ namespace ICSSoft.DataProject FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID, ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName, - MTIME,WorkPoint,EATTRIBUTE1) + 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}' + 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 @@ -130,7 +130,7 @@ namespace ICSSoft.DataProject /// /// public static void WareHouseLotInfoDown(string Identification, string TransCode, string TransSequence, string LotNo, string Quantity, string User, - string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language) + string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language,string MergeID="") { try { @@ -159,18 +159,18 @@ namespace ICSSoft.DataProject FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID, ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName, - MTIME,WorkPoint,EATTRIBUTE1) + MTIME,WorkPoint,EATTRIBUTE1,MergeID) SELECT NEWID(),'{3}','{4}','{5}',a.LotNo ,a.InvCode , c.WarehouseCode,c.LocationCode,'','','{6}', '','0','{7}','{8}','0','', '','','',f.F_Account ,f.F_RealName , - SYSDATETIME() ,a.WorkPoint ,'' + SYSDATETIME() ,a.WorkPoint ,'','{9}' FROM ICSInventoryLot a 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, LotNo, WorkPoint, User, Identification, TransCode, TransSequence, Quantity, TransType, BusinessCode); + sql = string.Format(sql, LotNo, WorkPoint, User, Identification, TransCode, TransSequence, Quantity, TransType, BusinessCode, MergeID); if (!DBHelper.ExecuteNonQuery(sql, cmd)) { @@ -274,7 +274,7 @@ namespace ICSSoft.DataProject /// /// public static void WareHouseLotInfoTransfer(string Identification, string TransCode, string TransSequence, string WarehouseCode, string LocationCode, - string LotNo, string Quantity, string User, string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language) + string LotNo, string Quantity, string User, string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary language, string MergeID) { try { @@ -289,18 +289,18 @@ namespace ICSSoft.DataProject FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID, ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName, - MTIME,WorkPoint,EATTRIBUTE1) + MTIME,WorkPoint,EATTRIBUTE1,MergeID) SELECT NEWID(),'{3}','{4}','{5}',a.LotNo ,a.InvCode , c.WarehouseCode,c.LocationCode,'{9}','{10}','{6}', '','0','{7}','{8}','0','', '','','',f.F_Account ,f.F_RealName , - SYSDATETIME() ,a.WorkPoint ,'' + SYSDATETIME() ,a.WorkPoint ,'','{11}' FROM ICSInventoryLot a 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, LotNo, WorkPoint, User, Identification, TransCode, TransSequence, Quantity, TransType, BusinessCode, WarehouseCode, LocationCode); + sql = string.Format(sql, LotNo, WorkPoint, User, Identification, TransCode, TransSequence, Quantity, TransType, BusinessCode, WarehouseCode, LocationCode, MergeID); if (!DBHelper.ExecuteNonQuery(sql, cmd)) {