运行情况子表
This commit is contained in:
parent
82ce41eac6
commit
06f65a2037
@ -11230,18 +11230,37 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
||||
{
|
||||
foreach (var item in taskGroup)
|
||||
{
|
||||
var details = listAddNew.Where(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME).ToList();
|
||||
TaskViewInfo info = new TaskViewInfo();
|
||||
info.COMPANY_NAME = item.Key.COMPANY_NAME;
|
||||
info.MOULD_NAME = item.Key.MOULD_NAME;
|
||||
info.FORM_NAME = item.Key.FORM_NAME;
|
||||
info.TOTAL_QTY = listAddNew.Count(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME);
|
||||
info.NORMAL_FINISH = listAddNew.Count(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME && t.NOTICE_STATUS == "1");
|
||||
info.OVER_FINISH = listAddNew.Count(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME && t.NOTICE_STATUS == "2");
|
||||
info.DOING = listAddNew.Count(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME && t.NOTICE_STATUS == "0" && t.TASK_ENDDT >=DateTime.Now);
|
||||
info.UNFINISH = listAddNew.Count(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME && t.NOTICE_STATUS == "0");
|
||||
info.OVER_UNFINISH = listAddNew.Count(t => t.COMPANY_NAME == item.Key.COMPANY_NAME && t.MOULD_NAME == item.Key.MOULD_NAME && t.FORM_NAME == item.Key.FORM_NAME && t.NOTICE_STATUS == "0" && t.TASK_ENDDT < DateTime.Now);
|
||||
info.TOTAL_QTY = details.Count();
|
||||
info.NORMAL_FINISH = details.Count(t => t.NOTICE_STATUS == "1");
|
||||
info.OVER_FINISH = details.Count(t => t.NOTICE_STATUS == "2");
|
||||
info.DOING = details.Count(t => t.NOTICE_STATUS == "0" && t.TASK_ENDDT >= DateTime.Now);
|
||||
info.UNFINISH = details.Count(t => t.NOTICE_STATUS == "0");
|
||||
info.OVER_UNFINISH = details.Count(t => t.NOTICE_STATUS == "0" && t.TASK_ENDDT < DateTime.Now);
|
||||
info.FINISH_RATE = info.TOTAL_QTY == 0 ? "0" : ((info.NORMAL_FINISH + info.OVER_FINISH) / info.TOTAL_QTY * 100).ToString();
|
||||
info.NORMAL_RATE = info.TOTAL_QTY == 0 ? "0" : (info.NORMAL_FINISH / info.TOTAL_QTY * 100).ToString();
|
||||
if (details != null && details.Any())
|
||||
{
|
||||
info.details = new List<TaskViewInfoDetail>();
|
||||
foreach (var de in details)
|
||||
{
|
||||
TaskViewInfoDetail dd = new TaskViewInfoDetail();
|
||||
dd.COMPANY_NAME = de.COMPANY_NAME;
|
||||
dd.MOULD_NAME = de.MOULD_NAME;
|
||||
dd.FORM_NAME = de.FORM_NAME;
|
||||
dd.NOTICE_TITLE = de.NOTICE_TITLE;
|
||||
dd.NOTICE_STATUS = de.NOTICE_STATUS;
|
||||
dd.TASK_DT = de.TASK_DT;
|
||||
dd.TASK_STARTDT = de.TASK_STARTDT;
|
||||
dd.TASK_ENDDT = de.TASK_ENDDT;
|
||||
dd.USER_NAME = de.USER_NAME;
|
||||
info.details.Add(dd);
|
||||
}
|
||||
}
|
||||
result.Data.Add(info);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user