From 501f5c1ca648257e44383a3e78a66a11fae70228 Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Thu, 12 Sep 2024 08:59:11 +0800 Subject: [PATCH] bug --- .../Tnb.ProductionMgr/PrdMaterialReceiptService.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index 35026424..cedcd0e0 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -347,6 +347,7 @@ namespace Tnb.ProductionMgr WmsCarryH carry = await db.Queryable().Where(x=>x.carry_code==input.carry_code).FirstAsync(); + prdMaterialReceiptH = new PrdMaterialReceiptH() { code = code, @@ -368,11 +369,21 @@ namespace Tnb.ProductionMgr { foreach (var item in input.details) { + PrdMaterialReceiptD existD = await db.Queryable() + .LeftJoin((x, y) => x.material_receipt_id == y.id) + .Where((x, y) => x.carry_id == carry.id && y.mo_task_id == moTask.id && x.is_all_feeding == 0) + .Select((x,y)=>x) + .FirstAsync(); + if (existD != null) + { + throw new Exception($"{moTask.mo_task_code}任务单存在未投完的签收物料,物料签收子表id{existD.id}"); + } + if (!inputMaterials.Contains(item.material_id) && !input.sure) { throw new Exception("存在不属于生产bom的投入物料,确认签收吗"); } - + list.Add(new PrdMaterialReceiptD { material_receipt_id = prdMaterialReceiptH.id,