From 06f65a2037073ffee3775509fcb4433b7cf93769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Mon, 26 Jan 2026 15:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=83=85=E5=86=B5=E5=AD=90?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BIStatiscialAnalysisController.cs | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIStatiscialAnalysisController.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIStatiscialAnalysisController.cs index a29c02d..0727fa5 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIStatiscialAnalysisController.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIStatiscialAnalysisController.cs @@ -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(); + 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); } }