From d333b62dfa01b2fe51fb8c6e9b30e803a2d3cfdb Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Mon, 8 Jul 2024 12:02:48 +0800 Subject: [PATCH] bug --- .../Tnb.ProductionMgr/PrdFeedingService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs index 0412945a..4151c0a2 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs @@ -420,11 +420,20 @@ namespace Tnb.ProductionMgr PrdMaterialReceiptD? detail = null; if (carry.carrystd_id == WmsWareHouseConst.CARRY_ZYXCSTD_ID || carry.carrystd_id == WmsWareHouseConst.CARRY_ZYLJSTD_ID) { - detail = await db.Queryable().Where(x => x.carry_id == carry.id && x.is_all_feeding == 0).FirstAsync(); + detail = await db.Queryable() + .LeftJoin((x,y)=>x.material_receipt_id==y.id) + .Where((x,y) => x.carry_id == carry.id && x.is_all_feeding == 0 && y.mo_task_id==moTask.id).FirstAsync(); } else { - detail = await db.Queryable().Where(x => x.member_carry_code == input.carry_code && x.is_all_feeding == 0).FirstAsync(); + detail = await db.Queryable() + .LeftJoin((x,y)=>x.material_receipt_id==y.id) + .Where((x,y) => x.member_carry_code == input.carry_code && x.is_all_feeding == 0 && y.mo_task_id==moTask.id).FirstAsync(); + } + + if (detail == null) + { + throw Oops.Bah($"未找到任务单{moTask.mo_task_code}下载具{carry.carry_code}的签收记录"); } if (prdMaterialReceiptH == null)