diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index 263d3f3..f1645ef 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -684,22 +684,22 @@ namespace ICSSoft.DataProject locationsql = @"select B.LocationCode from ICSDeliveryNotice A INNER JOIN ICSInventoryDetail B ON B.INVCode=A.InvCode AND B.WHCode=A.WHCode AND B.WorkPoint=A.WorkPoint - WHERE A.DNCode='{0}' AND A.WorkPoint='{1}'"; + WHERE A.DNCode='{0}' AND A.WorkPoint='{1}' and a.invcode='{2}'"; } else if (BusinessCode == "18") { locationsql = @"select B.LocationCode from ICSManufactureReceive A INNER JOIN ICSInventoryDetail B ON B.INVCode=A.InvCode AND B.WHCode=A.WHCode AND B.WorkPoint=A.WorkPoint - WHERE A.RCVCode='{0}' AND A.WorkPoint='{1}'"; + WHERE A.RCVCode='{0}' AND A.WorkPoint='{1}' and a.invcode='{2}'"; } else if (BusinessCode == "16") { locationsql = @"select B.LocationCode from ICSMOApplyNeg A INNER JOIN ICSMOApplyNegDetail C ON C.ApplyNegCode=A.ApplyNegCode AND C.WorkPoint=A.WorkPoint INNER JOIN ICSInventoryDetail B ON B.INVCode=C.InvCode AND B.WHCode=C.WHCode AND B.WorkPoint=C.WorkPoint - WHERE A.ApplyNegCode='{0}' AND A.WorkPoint='{1}'"; + WHERE A.ApplyNegCode='{0}' AND A.WorkPoint='{1}' and c.invcode='{2}'"; } - locationsql = string.Format(locationsql, TransCode, WorkPoint); + locationsql = string.Format(locationsql, TransCode, WorkPoint, INVCode); DataTable locationdt = DBHelper.SQlReturnData(locationsql, cmd); if (locationdt.Rows.Count == 0) {