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);