This commit is contained in:
2024-07-08 12:02:48 +08:00
parent c2aaa1e353
commit d333b62dfa

View File

@@ -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<PrdMaterialReceiptD>().Where(x => x.carry_id == carry.id && x.is_all_feeding == 0).FirstAsync();
detail = await db.Queryable<PrdMaterialReceiptD>()
.LeftJoin<PrdMaterialReceiptH>((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<PrdMaterialReceiptD>().Where(x => x.member_carry_code == input.carry_code && x.is_all_feeding == 0).FirstAsync();
detail = await db.Queryable<PrdMaterialReceiptD>()
.LeftJoin<PrdMaterialReceiptH>((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)