From b8180d941fe002b3364c11a66fb8b68bda8d2f81 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 24 Jul 2023 13:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8F=90=E6=8A=A5=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=A4=A7=E4=BA=8E=E7=AD=89=E4=BA=8E=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=95=B0=E6=94=B9=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr/PrdMoTaskService.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 0d2f713d..8b8af35d 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1330,11 +1330,11 @@ namespace Tnb.ProductionMgr } - bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty; - if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty) - { - throw Oops.Bah("已完成数量不能大于任务单数量"); - } + // bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty; + // if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty) + // { + // throw Oops.Bah("已完成数量不能大于任务单数量"); + // } report = input.Adapt(); report.id = SnowflakeIdHelper.NextId(); @@ -1369,7 +1369,7 @@ namespace Tnb.ProductionMgr await db.Updateable() // .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty) .SetColumns(x => x.reported_work_qty == input.reported_qty) - .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) + // .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); } else @@ -1377,7 +1377,7 @@ namespace Tnb.ProductionMgr await db.Updateable() // .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty) .SetColumns(x => x.reported_work_qty == x.reported_work_qty + input.reported_qty) - .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) + // .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); } @@ -1391,13 +1391,13 @@ namespace Tnb.ProductionMgr { await db.Updateable() .SetColumns(x => x.last_process_complete_qty == input.reported_qty) - .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) + // .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) .Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync(); }else if (parentMoTask?.last_process_complete_qty != null) { await db.Updateable() .SetColumns(x => x.last_process_complete_qty == x.last_process_complete_qty + input.reported_qty) - .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) + // .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) .Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync(); } }