diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs index c2d9a9e..373e2a1 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs @@ -628,7 +628,7 @@ namespace ICSSoft.DataProject LEFT JOIN ICSOutsourcingOrder y ON x.OODetailID=y.OODetailID AND x.WorkPoint=y.WorkPoint LEFT JOIN ICSOApply z ON m.ApplyDetailID=z.ApplyDetailID AND m.WorkPoint=z.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint - INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=con.WorkPoint + INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=conv.WorkPoint WHERE a.Identification='{0}' AND a.ERPUpload='0' AND ISNULL(a.LogID, '')='' GROUP BY ISNULL(y.DepCode, ''),a.ToWarehouseCode,ISNULL(z.ApplyCode, y.OOCode),a.MUSER,a.InvCode,m.PickID,m.ApplyDetailID,con.Enable,conv.Enable,lot.Amount,lot.Quantity ,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, ''), @@ -649,7 +649,7 @@ namespace ICSSoft.DataProject LEFT JOIN ICSOutsourcingOrder y ON x.OODetailID=y.OODetailID AND x.WorkPoint=y.WorkPoint LEFT JOIN ICSOApply z ON m.ApplyDetailID=z.ApplyDetailID AND m.WorkPoint=z.WorkPoint INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint - INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=con.WorkPoint + INNER JOIN ICSConfiguration conv ON conv.Code='CompleteVerification' AND a.WorkPoint=conv.WorkPoint WHERE a.Identification='{0}' AND a.ERPUpload='0' AND ISNULL(a.LogID, '')<>'' GROUP BY ISNULL(y.DepCode, ''),a.ToWarehouseCode,ISNULL(z.ApplyCode, y.OOCode),a.MUSER,a.InvCode,m.PickID,m.ApplyDetailID,con.Enable,conv.Enable,lot.Amount,lot.Quantity ,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, ''), diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 0eb44fb..5e6eda7 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -1515,33 +1515,32 @@ namespace ICSSoft.DataProject #region 出库检验是否符合源头单据 string msg = string.Empty; bool isLimit = false; - if (isOut&& TransType != TransTypeEnum.TransferLibrary.GetDescription()) // && TransType != TransTypeEnum.LOTSplit.GetDescription() - { - //string Lot =""; - //if (TransType == TransTypeEnum.TransferLibrary.GetDescription()) - //{ - // foreach (DataRow drLot in table.Rows) - // { - // Lot = drLot["LotNo"].ToString(); - // string sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'"; - // sql = string.Format(sql, Lot, WorkPoint); - // DataTable dt = DBHelper.SQlReturnData(sql, cmd); - // if (dt == null || dt.Rows.Count <= 0) - // { - // throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo171"), LotNo)); - // } - // string whcode = dt.Rows[0]["WarehouseCode"].ToString(); - // IF("+whcode+@" != '{8}') - //BEGIN - - // RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo394"), "{8}",whcode) + @"', 16, 1); - // RETURN - // END - // } - - //} - //else - //{ + if (isOut) // && TransType != TransTypeEnum.LOTSplit.GetDescription() + {//&& TransType != TransTypeEnum.TransferLibrary.GetDescription() + string Lot = ""; + string workP = ""; + if (TransType == TransTypeEnum.TransferLibrary.GetDescription()) + { + foreach (DataRow drLot in table.Rows) + { + Lot = drLot["LotNo"].ToString(); + sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'"; + sql = string.Format(sql, Lot, JsonData.WorkPoint); + DataTable dt = DBHelper.SQlReturnData(sql, cmd); + if (dt == null || dt.Rows.Count <= 0) + { + throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo171"), Lot)); + } + string whcode = dt.Rows[0]["WarehouseCode"].ToString(); + if (!JsonData.WHCode.Equals(whcode)) + { + throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo395"), JsonData.WHCode, whcode)); + } + } + + } + else + { if (string.IsNullOrEmpty(JsonData.TransCode)) { throw new Exception(language.GetNameByCode("WMSAPIInfo001"));//"单据号不能为空!" @@ -1554,7 +1553,7 @@ namespace ICSSoft.DataProject DataView dataView = TransData.DefaultView; foreach (DataRow drLot in table.Rows) { - string Lot = drLot["LotNo"].ToString(); + Lot = drLot["LotNo"].ToString(); //盘点不需要对比以下属性 if (TransType == TransTypeEnum.Check.GetDescription()) continue; @@ -1622,8 +1621,8 @@ namespace ICSSoft.DataProject isLimit = true; } } - //} - + } + } #endregion //return table; diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index 041036c..cfd8fcb 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -887,19 +887,25 @@ namespace ICSSoft.DataProject try { - // IF("+whcode+@" != '{8}') - // BEGIN - - // RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo394"), "{8}",whcode) + @"', 16, 1); - // RETURN - //END + string sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'"; + sql = string.Format(sql, LotNo,WorkPoint); + DataTable dt = DBHelper.SQlReturnData(sql, cmd); + if (dt == null || dt.Rows.Count <= 0) + { + throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo171"), LotNo)); + } + string whcode = dt.Rows[0]["WarehouseCode"].ToString(); ///添加日志 - string sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}') + 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('" + whcode + @"' != '{8}') + BEGIN + RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo394"), "{8}", whcode) + @"', 16, 1); + RETURN + END INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode, FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity, diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/BarCodeModel.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/BarCodeModel.cs index 1eb32b7..96f1bd1 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/BarCodeModel.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/BarCodeModel.cs @@ -21,5 +21,6 @@ namespace ICSSoft.Entity /// 用于排除本次已扫描的条码(多个用'',分割,如:'001','002') /// public string ScanLotCode { get; set; } + public string WHCode { get; set; } } }