bug处理

This commit is contained in:
2024-06-24 13:01:42 +08:00
parent c0be9943f8
commit 7d6602ad12
6 changed files with 79 additions and 27 deletions

View File

@@ -37,6 +37,7 @@ using Aop.Api.Domain;
using Senparc.Weixin.Work.AdvancedAPIs.OaDataOpen;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Asn1.X509;
using Tnb.ProductionMgr.Entities;
namespace Tnb.WarehouseMgr
{
@@ -548,12 +549,48 @@ namespace Tnb.WarehouseMgr
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();
//WmsCarryH wmsCarryH = _db.Queryable<WmsCarryH>().Where(r => r.work_station == organizeEntity.EnCode).First();
//if (wmsCarryH == null)
//{
// Logger.LogWarning($"【CallRackToProductionLine】不存在工位为{organizeEntity.EnCode}的料架号!");
// throw new AppFriendlyException($"不存在工位为{organizeEntity.EnCode}的料架号!", 500);
//}
WmsCarryH wmsCarryH = _db.Queryable<WmsCarryH>().Where(r => r.carry_code == input.carry_code).First();
if (wmsCarryH == null)
{
Logger.LogWarning($"【CallRackToProductionLine】不存在工位为{organizeEntity.EnCode}的料架");
throw new AppFriendlyException($"不存在编码为{organizeEntity.EnCode}的料架", 500);
Logger.LogWarning($"【CallRackToProductionLine】不存在料架号为{input.carry_code}的料架!");
throw new AppFriendlyException($"【CallRackToProductionLine】不存在料架号为{input.carry_code}的料架!", 500);
}
// 获取产线
OrganizeEntity organizeEntityCX = _db.Queryable<OrganizeEntity>().Where(r => r.Id == organizeEntity.ParentId).First();
if (organizeEntityCX == null)
{
Logger.LogWarning($"【CallRackToProductionLine】基础资料错误工位{organizeEntity.EnCode}的上级产线不存在,请检查!");
throw new AppFriendlyException($"【CallRackToProductionLine】基础资料错误工位{organizeEntity.EnCode}的上级产线不存在,请检查!", 500);
}
if (organizeEntityCX.Category != "workline")
{
Logger.LogWarning($"【CallRackToProductionLine】基础资料错误工位{organizeEntity.EnCode}的上级{organizeEntityCX.EnCode}不属于产线类型,请检查!");
throw new AppFriendlyException($"【CallRackToProductionLine】基础资料错误工位{organizeEntity.EnCode}的上级{organizeEntityCX.EnCode}不属于产线类型,请检查!", 500);
}
// 获取任务单
List<PrdMoTask> organizeEntityCXs = _db.Queryable<PrdMoTask>().Where(r => r.workline_code == organizeEntityCX.EnCode).ToList();
if (organizeEntityCXs.Count > 1)
{
Logger.LogWarning($"【CallRackToProductionLine】工位{organizeEntity.EnCode}的上级{organizeEntityCX.EnCode}对应的进行中的任务单不唯一,请检查!");
throw new AppFriendlyException($"【CallRackToProductionLine】工位{organizeEntity.EnCode}的上级{organizeEntityCX.EnCode}对应的进行中的任务单不唯一,请检查!", 500);
}
if (organizeEntityCXs.Count == 0)
{
Logger.LogWarning($"【CallRackToProductionLine】未找到工位{organizeEntity.EnCode}的上级{organizeEntityCX.EnCode}对应的进行中的任务单,请检查!");
throw new AppFriendlyException($"【CallRackToProductionLine】未找到工位{organizeEntity.EnCode}的上级{organizeEntityCX.EnCode}对应的进行中的任务单,请检查!", 500);
}
PrdMoTask prdMoTask = organizeEntityCXs.First();
//if (string.IsNullOrEmpty(wmsCarryH.work_station))
//{
// Logger.LogWarning($"【CallRackToProductionLine】此料架目标工位为空{input.carry_code}");
@@ -588,6 +625,8 @@ namespace Tnb.WarehouseMgr
commonCreatePretaskInput.carry_code = wmsCarryH.carry_code;
commonCreatePretaskInput.task_type = "";
commonCreatePretaskInput.biz_type = "FloorCallMaterial";
commonCreatePretaskInput.require_id = prdMoTask.id;
commonCreatePretaskInput.require_code = prdMoTask.mo_task_code;
var res = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput);
if (res.code != JNPF.Common.Enums.HttpStatusCode.OK)