diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index 1fe8b2a..774fa78 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -7441,7 +7441,7 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer else { //呼叫AGV开始搬运任务 - PostionCode = ICSWareHouseLotInfoService.GetAGVTaskPosition(item.ContainerCode, item.User, item.WorkPoint, cmd, language); + PostionCode = ICSWareHouseLotInfoService.GetAGVTaskPosition(item.ContainerCode, item.IsOverLoad, item.User, item.WorkPoint, cmd, language); } } res.Success = true; @@ -8686,7 +8686,7 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer } else { - ICSWareHouseLotInfoService.ActionMaterialBack(GUID,JsonData.OutPosition, JsonData.WorkPoint, cmd, language); + ICSWareHouseLotInfoService.ActionMaterialBack(GUID, JsonData.OutPosition, JsonData.WorkPoint, cmd, language); } res.Ret = 1; res.RetMsg = "success";// "接口调用成功!"; diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs index afe6f85..5a41208 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs @@ -3188,30 +3188,30 @@ namespace ICSSoft.DataProject /// /// /// - public static string GetAGVTaskPosition(string LocationCode, string User, string WorkPoint, SqlCommand cmd, Dictionary language) + public static string GetAGVTaskPosition(string ContainerCode, bool isOverLoad, string User, string WorkPoint, SqlCommand cmd, Dictionary language) { try { - //string sql = @" select TOP 1 B.LotNo from ICSContainer A - // INNER JOIN ICSContainerLot B ON B.ContainerID=A.ID AND B.WorkPoint=A.WorkPoint - // ORDER BY B.MTIME DESC"; - //sql = string.Format(sql, LocationCode, WorkPoint); - //DataTable dt = DBHelper.SQlReturnData(sql, cmd); - //if (dt.Rows.Count == 0) - //{ - // return ""; - //} - //else - //{ - // sql = @"SELECT A.WHCode,C.LocationCode FROM ICSDeliveryNotice A - // INNER JOIN ICSInventoryLotDetail B ON B.TransCode=A.DNCode AND B.TransSequence=A.Sequence AND B.WorkPoint=A.WorkPoint - // INNER JOIN ICSInventoryDetail C ON C.INVCode=A.InvCode AND C.WHCode=A.WHCode AND C.WorkPoint=A.WorkPoint - // WHERE B.LotNo='{0}' AND B.WorkPoint='{1}'"; - // sql = string.Format(sql, dt.Rows[0]["LotNo"].ToString(), WorkPoint); - - // return dt.Rows[0]["Define1"].ToString(); - //} - return "S02"; + string sql = @" select TOP 1 B.LotNo from ICSContainer A + INNER JOIN ICSContainerLot B ON B.ContainerID=A.ID AND B.WorkPoint=A.WorkPoint + Where A.ContainerCode='{0}' AND A.WorkPoint='{1}' + ORDER BY B.MTIME DESC"; + sql = string.Format(sql, ContainerCode, WorkPoint); + DataTable dt = DBHelper.SQlReturnData(sql, cmd); + if (dt.Rows.Count == 0) + { + return ""; + } + else + { + sql = @"SELECT A.WHCode,C.LocationCode FROM ICSDeliveryNotice A + INNER JOIN ICSInventoryLotDetail B ON B.TransCode=A.DNCode AND B.TransSequence=A.Sequence AND B.WorkPoint=A.WorkPoint + INNER JOIN ICSInventoryDetail C ON C.INVCode=A.InvCode AND C.WHCode=A.WHCode AND C.WorkPoint=A.WorkPoint + WHERE B.LotNo='{0}' AND B.WorkPoint='{1}'"; + sql = string.Format(sql, dt.Rows[0]["LotNo"].ToString(), WorkPoint); + dt = DBHelper.SQlReturnData(sql, cmd); + return dt.Rows[0]["Define1"].ToString(); + } } catch (Exception) {