From 53db402c7a115afb251d6e70b6936f735a3930c6 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Fri, 11 Aug 2023 17:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E6=8A=A5=E8=AE=B0=E5=BD=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr.Entities/Entity/PrdReport.cs | 6 ++++++ ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs index 8128efe1..f6875100 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs @@ -113,4 +113,10 @@ public partial class PrdReport : BaseEntity /// 物料单位 /// public string? unit_id { get; set; } + + /// + /// 工序id + /// + public string? process_id { get; set; } + } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 08616bb7..326cb5fa 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1364,6 +1364,7 @@ namespace Tnb.ProductionMgr var row = -1; var report = await db.Queryable().FirstAsync(it => it.mo_task_id == input.mo_task_id); var prdMoTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); + var mbomProcess = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mbom_process_id); if (prdMoTask.mo_task_status == DictConst.MoStatusPauseCode) { @@ -1409,6 +1410,7 @@ namespace Tnb.ProductionMgr report.status = 0; report.material_id = prdMoTask.material_id; report.unit_id = prdMoTask.unit_id; + report.process_id = mbomProcess?.process_id ?? ""; row = await db.Insertable(report).ExecuteCommandAsync(); @@ -1444,7 +1446,6 @@ namespace Tnb.ProductionMgr if (prdMoTask.schedule_type == 2 && !string.IsNullOrEmpty(prdMoTask.mbom_process_id)) { - var mbomProcess = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mbom_process_id); if (mbomProcess.is_last==1 && prdMoTask != null && !string.IsNullOrEmpty(prdMoTask.parent_id)) { var parentMoTask = await db.Queryable().SingleAsync(x => x.id == prdMoTask.parent_id);