diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index bd1fb462..79fe64ea 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -320,8 +320,9 @@ namespace Tnb.ProductionMgr result = await _db.Queryable().LeftJoin((a, b) => a.mo_id == b.id) .LeftJoin((a, b, c) => a.material_id == c.id) .LeftJoin((a, b, c, d) => a.workline_id == d.Id) + .LeftJoin((a,b,c,d,e)=>a.process_id==e.id) .Where((a, b, c, d) => b.id == moId || b.parent_id == moId) - .Select((a, b, c, d) => new PrdMoTaskOutput + .Select((a, b, c, d,e) => new PrdMoTaskOutput { mo_task_code = a.mo_task_code, mo_task_status = a.mo_task_status, @@ -329,10 +330,12 @@ namespace Tnb.ProductionMgr workline_name = d.FullName, material_code = c.code, material_name = c.name, + process_code = e.process_code, + process_name = e.process_name, mo_task_qty = SqlFunc.Subqueryable().Where(a => a.mo_id == moId).Count(), estimated_start_date = a.estimated_start_date.Value.ToString("yyyy-MM-dd HH"), estimated_end_date = a.estimated_end_date.Value.ToString("yyyy-MM-dd HH"), - plan_qty = b.scheduled_qty, + plan_qty = a.scheduled_qty, complete_qty = a.complete_qty, }) .Mapper(it => diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index 488d0645..a285f4b6 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -94,8 +94,8 @@ namespace Tnb.ProductionMgr node.workline_id = $"{workLine.Item1}/{workLine.Item2}"; } } - node.plan_start_date = item.estimated_start_date.HasValue ? item.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; - node.plan_end_date = item.estimated_end_date.HasValue ? item.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; + node.plan_start_date = item.plan_start_date.HasValue ? item.plan_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; + node.plan_end_date = item.plan_end_date.HasValue ? item.plan_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; await GetChild(item.id, trees, dic); trees.Add(node); }