bug修复,转库单工位带入二楼任务

This commit is contained in:
2024-06-24 00:07:35 +08:00
parent af388c17dd
commit 97c81f6050
7 changed files with 64 additions and 36 deletions

View File

@@ -542,17 +542,23 @@ namespace Tnb.WarehouseMgr
{
try
{
WmsCarryH wmsCarryH = _db.Queryable<WmsCarryH>().Where(r => r.carry_code == input.carry_code).First();
OrganizeEntity organizeEntity = _db.Queryable<OrganizeEntity>().Where(r => r.Id == input.workstation_id).First();
if (organizeEntity == null)
{
Logger.LogWarning($"【CallRackToProductionLine】不存在工位id为{input.workstation_id}的工位!");
throw new AppFriendlyException($"不存在工位id为{input.workstation_id}的工位!", 500);
}
WmsCarryH wmsCarryH = _db.Queryable<WmsCarryH>().Where(r => r.work_station == organizeEntity.EnCode).First();
if (wmsCarryH == null)
{
Logger.LogWarning($"【CallRackToProductionLine】不存在编码为{input.carry_code}的料架号!");
throw new AppFriendlyException($"不存在编码为{input.carry_code}的料架号!", 500);
}
if (string.IsNullOrEmpty(wmsCarryH.work_station))
{
Logger.LogWarning($"【CallRackToProductionLine】此料架目标工位为空{input.carry_code}");
throw new AppFriendlyException($"此料架目标工位为空!{input.carry_code}", 500);
Logger.LogWarning($"【CallRackToProductionLine】不存在工位为{organizeEntity.EnCode}的料架号!");
throw new AppFriendlyException($"不存在编码为{organizeEntity.EnCode}的料架号!", 500);
}
//if (string.IsNullOrEmpty(wmsCarryH.work_station))
//{
// Logger.LogWarning($"【CallRackToProductionLine】此料架目标工位为空{input.carry_code}");
// throw new AppFriendlyException($"此料架目标工位为空!{input.carry_code}", 500);
//}
//if (string.IsNullOrEmpty(wmsCarryH.location_id))
//{
@@ -562,8 +568,8 @@ namespace Tnb.WarehouseMgr
if (string.IsNullOrEmpty(input.endlocation_id))
{
Logger.LogWarning($"【CallRackToProductionLine】终点库位不能为空{input.carry_code}");
throw new AppFriendlyException($"终点库位不能为空!{input.carry_code}", 500);
Logger.LogWarning($"【CallRackToProductionLine】终点库位不能为空{input.endlocation_id}");
throw new AppFriendlyException($"终点库位不能为空!{input.endlocation_id}", 500);
}
//BasLocation endlocation = _db.Queryable<BasLocation>().Where(r => r.location_code == wmsCarryH.work_station).First();
@@ -571,8 +577,8 @@ namespace Tnb.WarehouseMgr
WmsPretaskH wmsPretaskH = _db.Queryable<WmsPretaskH>().Where(r => r.carry_code == wmsCarryH.carry_code && r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID).First();
if (wmsPretaskH != null)
{
Logger.LogWarning($"【CallRackToProductionLine】此料架{input.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}");
throw new AppFriendlyException($"此料架{input.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}", 500);
Logger.LogWarning($"【CallRackToProductionLine】此料架{wmsCarryH.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}");
throw new AppFriendlyException($"此料架{wmsCarryH.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}", 500);
}
CommonCreatePretaskInput commonCreatePretaskInput = new CommonCreatePretaskInput();