From eb6c4151f8492d48b404e55e398cddc40871a2eb Mon Sep 17 00:00:00 2001 From: chenlin Date: Thu, 5 Feb 2026 09:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=BB=E5=81=9C=E6=9C=BA=E6=97=B6=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOAN.Model/MES/report/MonthProuctModel.cs | 9 +++++++++ DOAN.Service/MES/report/ReportService.cs | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/DOAN.Model/MES/report/MonthProuctModel.cs b/DOAN.Model/MES/report/MonthProuctModel.cs index 6e170e6..af50d47 100644 --- a/DOAN.Model/MES/report/MonthProuctModel.cs +++ b/DOAN.Model/MES/report/MonthProuctModel.cs @@ -94,6 +94,15 @@ namespace DOAN.Model.MES.report /// 停机总时长 /// public double TotalDowntimeHours { get; set; } + + /// + /// 计划总时长 + /// + public double TotalPlanHours { get; set; } + /// + /// 停机率 + /// + public double TotalDowntimeRate { get; set; } } public class ProductionCompletionModel diff --git a/DOAN.Service/MES/report/ReportService.cs b/DOAN.Service/MES/report/ReportService.cs index e733a08..04fb897 100644 --- a/DOAN.Service/MES/report/ReportService.cs +++ b/DOAN.Service/MES/report/ReportService.cs @@ -112,6 +112,7 @@ namespace DOAN.Service.MES.report }).ToList(); var totalDowntimeHours = response.Sum(it => it.DowntimeHours); + var totalPlanHours = groupListWorkRoute.Sum(it => it.PlanHours); var groupList = response.GroupBy(it => it.LineCode).Select(it => new { LineCode = it.Key, @@ -128,7 +129,9 @@ namespace DOAN.Service.MES.report PlanHours = l.PlanHours, DowntimeHours = gList.FirstOrDefault()?.DowntimeHours ?? 0, // 如果没有停机时间则为0 DowntimeRate = l.PlanHours == 0 ? 0 : Math.Round((gList.FirstOrDefault()?.DowntimeHours ?? 0) / l.PlanHours, 2), - TotalDowntimeHours = totalDowntimeHours + TotalDowntimeHours = totalDowntimeHours, + TotalPlanHours = totalPlanHours, + TotalDowntimeRate = totalPlanHours == 0 ? 0 : Math.Round(totalDowntimeHours / totalPlanHours, 2) }).ToList(); return result; }