diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Common/NewTransType.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Common/NewTransType.cs index b75eb24..4741c7c 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.Common/NewTransType.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Common/NewTransType.cs @@ -31,7 +31,7 @@ namespace ICSSoft.Common "生产发料-补料申请单","副产品入库-生产订单","条码打印","锐腾两步调入","锐腾委外发料-委外订单备料表", "无源头调拨","副产品入库-无源头","副产品入库-委外订单","红字其他入库","采购入库-入库单","委外入库-入库单","销售发货-出库单", "生产发料-生产订单备料表-自动出库","杂发-自动","产成品入库-产成品入库单-mes","销售发货-红字出库单","销售发货-红字出库单原条码","采购退货-采购订单","委外退货-委外采购订单", - "物料调拨-自动","销售发货单-快递单","成品预入库-DRCoffee","采购入库-采购订单-DRCoffee","条码拆分记录查询","条码查询-未入库","条码记录","赋码上架","生产交接","采购到货-开立到货单","采购拒收-退回" + "物料调拨-自动","销售发货单-快递单","成品预入库-DRCoffee","采购入库-采购订单-DRCoffee","条码拆分记录查询","条码查询-未入库","条码记录","赋码上架","生产交接","采购到货-开立到货单","采购拒收-退回","出货检验" }; diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs index 1416b18..6fe953b 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs @@ -344,5 +344,9 @@ namespace ICSSoft.Common [Description("生产交接")] [DBValue("88")] MOIssueHandOver, + + [Description("出货检验")] + [DBValue("89")] + DisPatchInspect, } } diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs index 02e41b0..ff22a92 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs @@ -22,6 +22,53 @@ namespace ICSSoft.DataProject private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #region 销售出库 + /// + /// 出货检验 + /// + /// + /// + /// + /// + /// + public static void SalesShipmentInspectDoc(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd, Dictionary language, string TransID, string CourierCode) + { + try + { + string sql = @"DECLARE @Status VARCHAR(10) + SELECT @Status=a.Status FROM ICSSDN a + WHERE a.SDNCode='{0}' AND a.Sequence='{3}' and a.id='{4}' AND a.WorkPoint='{1}' AND a.Type='1' + + IF (@Status IS NULL) + BEGIN + RAISERROR('" + language.GetNameByCode("WMSAPIInfo139") + @"',16,1); + RETURN + END + ELSE IF (@Status!='2') + BEGIN + RAISERROR('" + language.GetNameByCode("WMSAPIInfo140") + @"',16,1); + RETURN + END + UPDATE a SET a.EATTRIBUTE5='已检验' + FROM ICSSDN a + WHERE a.SDNCode='{0}' AND a.Sequence='{3}' and a.id='{4}' AND a.WorkPoint='{1}' AND a.Type='1' + + "; + + sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence, TransID, CourierCode); + + if (!DBHelper.ExecuteNonQuery(sql, cmd)) + { + throw new Exception(language.GetNameByCode("WMSAPIInfo141"));//"销售领料单更新失败!"); + } + } + catch (Exception) + { + throw; + } + } + + + /// /// 销售出库 /// diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 163312b..4b75b03 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -800,7 +800,41 @@ a.ExtensionID } #endregion #region 销售出库(合并发料) - else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription()) + else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription()|| TransType == TransTypeEnum.DisPatchInspect.GetDescription()) + { + sqlCheckSign = @"select * from ICSConfiguration where code = 'OutWithLocationCode007' and enable = '1'"; + flag = DBHelper.SQlReturnData(sqlCheckSign, cmd); + isMerge = true; + columnsMerge = @"mer.MergeID+'~'+a.SDNCode AS TransCode, + a.SDNDetailID AS DetailID, + a.SOCode, + a.Type, + a.Sequence AS TransSequence, + ISNULL(a.SDNQuantity,0) AS IssueQuantity,"; + + tableNameMerge = @"ICSSDN a + INNER JOIN ICSMOPickMerge mer ON a.id=mer.SourceID AND a.WorkPoint=mer.WorkPoint"; + + columns = @"a.SDNCode AS TransCode, + a.SDNDetailID AS DetailID, + a.SOCode, + a.Type, + a.Sequence AS TransSequence, + ISNULL(a.SDNQuantity,0) AS IssueQuantity,"; + + tableName = @"ICSSDN a "; + + where = @" a.SDNCode='{0}' AND a.WorkPoint='{1}' AND a.Type='1' AND a.Status<>'3' + AND a.Quantity-ISNULL(a.SDNQuantity,0)>0 and a.EATTRIBUTE5='已检验'"; + + singleWhere = @" a.SDNCode='{0}' AND a.WorkPoint='{1}'"; + + completeWhere = @" a.SDNCode='{0}' AND a.WorkPoint='{1}' AND a.Quantity>ISNULL(a.SDNQuantity,0)"; + } + #endregion + + #region 销售出库(合并发料) + else if ( TransType == TransTypeEnum.DisPatchInspect.GetDescription()) { sqlCheckSign = @"select * from ICSConfiguration where code = 'OutWithLocationCode007' and enable = '1'"; flag = DBHelper.SQlReturnData(sqlCheckSign, cmd); @@ -8588,7 +8622,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode, || TransType == TransTypeEnum.BrrowDoc.GetDescription() || TransType == TransTypeEnum.StepTransferDocIn.GetDescription() || TransType == TransTypeEnum.TwoStepTransferDocOut.GetDescription() || TransType == TransTypeEnum.MOReplenishment.GetDescription() || TransType == TransTypeEnum.OtherInRedDoc.GetDescription() || TransType == TransTypeEnum.MOIssueAutoDoc.GetDescription() - || TransType == TransTypeEnum.SalesShipmentOutDoc.GetDescription()) + || TransType == TransTypeEnum.SalesShipmentOutDoc.GetDescription() || TransType == TransTypeEnum.DisPatchInspect.GetDescription()) { if (JsonData.IsPick != "1") { @@ -8600,7 +8634,10 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode, for (int i = 0; i < ZLtable.Rows.Count; i++) { - + if (TransType == TransTypeEnum.DisPatchInspect.GetDescription()) + { + JsonData.TransType = "销售发货-销售发货单"; + } string zlName = ZLtable.Rows[i]["Name"].ToString(); string zlTransCode = ZLtable.Rows[i]["BusinessCode"].ToString(); string Enable = ZLtable.Rows[i]["Enable"].ToString(); @@ -11528,6 +11565,23 @@ BEGIN item.User, item.WorkPoint, "3", TransTypeEnum.SalesShipmentDoc.GetDescription(), cmd, language, itemInfo.LogID, item.TransID, MergeID); } + } + #endregion + #region 销售出库 + else if (TransType == TransTypeEnum.DisPatchInspect.GetDescription()) + { + BusinessCode = TransTypeEnum.DisPatchInspect.GetDescription(); + //更新源头单据数量 + ICSSalesService.SalesShipmentInspectDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language, item.TransID, item.CourierCode); + + //foreach (var itemInfo in item.detail) + //{ + // workPoint = item.WorkPoint; + // //出库 + // printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, + // item.User, item.WorkPoint, "3", TransTypeEnum.SalesShipmentDoc.GetDescription(), cmd, language, itemInfo.LogID, item.TransID, MergeID); + //} + } #endregion #region 销售出库-出库单