生产相关列表倒叙,生产工单列表重写

This commit is contained in:
2023-07-28 16:26:27 +08:00
parent 703eda463e
commit c18b937dc1
10 changed files with 163 additions and 59 deletions

View File

@@ -81,6 +81,7 @@ namespace Tnb.ProductionMgr
// .WhereIF(end, a => a.estimated_end_date != null && endTimes[0] <= a.estimated_end_date && endTimes[1] >= a.estimated_end_date)
.WhereIF(!string.IsNullOrEmpty(input.workline), a => list.Where(p => p.EnCode.Contains(input.workline) || p.FullName.Contains(input.workline)).Select(p => p.Id).ToList().Contains(a.workline_id!))
.Where(a => string.IsNullOrEmpty(a.parent_id) && a.schedule_type == 2 && a.mo_task_status != "ToBeScheduled")
.OrderByDescending(a=>a.create_time)
.Select((a, b, c) => new PrdMoTask
{
id = a.id,
@@ -187,7 +188,7 @@ namespace Tnb.ProductionMgr
process_name = b.process_name,
plan_start_date = a.estimated_start_date,
plan_end_date = a.estimated_end_date,
plan_qty = c.scheduled_qty,
plan_qty = a.scheduled_qty,
//complete_qty = SqlFunc.Subqueryable<PrdReport>().Where(it => it.mo_task_code == a.mo_task_code).Sum(it => it.reported_work_qty),
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
mo_task_status = a.mo_task_status,