From 5a694f72888ef2ad1ef41c2e3bf78ef08f2cfa59 Mon Sep 17 00:00:00 2001 From: chenlin Date: Fri, 23 Jan 2026 14:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=AE=8C=E6=88=90=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOAN.Model/MES/report/MonthProuctModel.cs | 2 +- DOAN.Service/MES/report/ReportService.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DOAN.Model/MES/report/MonthProuctModel.cs b/DOAN.Model/MES/report/MonthProuctModel.cs index eacb50a..343dd18 100644 --- a/DOAN.Model/MES/report/MonthProuctModel.cs +++ b/DOAN.Model/MES/report/MonthProuctModel.cs @@ -108,7 +108,7 @@ namespace DOAN.Model.MES.report public int CompletionNum { get; set; } public double CompletionRate { get; set; } public string Status { get; set; } - public List List { get; set; } + public List List { get; set; } = new List(); public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } diff --git a/DOAN.Service/MES/report/ReportService.cs b/DOAN.Service/MES/report/ReportService.cs index c048cfc..b7f8725 100644 --- a/DOAN.Service/MES/report/ReportService.cs +++ b/DOAN.Service/MES/report/ReportService.cs @@ -198,7 +198,7 @@ namespace DOAN.Service.MES.report { WorkOrder = t.Workorder, GroupName = t.GroupName, - WorkTimePeriod = $"{t.StartTime}-{t.EndTime}", + WorkTimePeriod = $"{t.StartTime?.ToString("HH:mm")}-{t.EndTime?.ToString("HH:mm")}", DeliveryNum = t.DeliveryNum ?? 0, Status = GetStatusName(t.Status??0), StartTime=t.StartTime, @@ -212,12 +212,12 @@ namespace DOAN.Service.MES.report for (int i = 0; i < hours; i++) { var productionCompletionModel = productionCompletionList.Where(t => t.TimePeriod.Hour == (8 + i)).FirstOrDefault(); - var mod = new PlanModel + t.List.Add(new PlanModel { StartTime = $"{8 + i}:00", PlanNum = t.DeliveryNum / 8, - CompletionNum = productionCompletionModel.Count, - }; + CompletionNum = productionCompletionModel?.Count ?? 0, + }); } t.CompletionNum = productionCompletionList.Sum(t => t.Count); t.CompletionRate = Math.Round(t.CompletionNum*100.0 / t.DeliveryNum,2);