From f298b2e16d2b602f726f002f0ab73f16e4623f78 Mon Sep 17 00:00:00 2001 From: chenlin Date: Fri, 30 Jan 2026 14:21:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E6=9C=BA=E7=8E=87=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MES/report/ReportController.cs | 8 ++++---- DOAN.Admin.WebApi/appsettings.Development.json | 2 +- .../MES/product/ProPlanAchievementrateVersion2Service.cs | 2 +- DOAN.Service/MES/report/ReportService.cs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/MES/report/ReportController.cs b/DOAN.Admin.WebApi/Controllers/MES/report/ReportController.cs index 8faf263..d2eeb97 100644 --- a/DOAN.Admin.WebApi/Controllers/MES/report/ReportController.cs +++ b/DOAN.Admin.WebApi/Controllers/MES/report/ReportController.cs @@ -107,7 +107,7 @@ namespace DOAN.WebApi.Controllers public IActionResult ProductionReport() { DateTime dt = new DateTime(2026, 1, 27); - //dt = DateTime.Now; + dt = DateTime.Now; var response = _ReportService.ProductionReport(dt); return SUCCESS(response); @@ -121,7 +121,7 @@ namespace DOAN.WebApi.Controllers public IActionResult ProductionReportRate() { DateTime dt = new DateTime(2026, 1, 27); - //dt = DateTime.Now; + dt = DateTime.Now; var response = _ReportService.ProductionReportRate2(dt); return SUCCESS(response); } @@ -134,7 +134,7 @@ namespace DOAN.WebApi.Controllers public IActionResult ProductionReportWeekRate() { DateTime dt = new DateTime(2026, 1, 27); - //dt = DateTime.Now; + dt = DateTime.Now; var response = _ReportService.ProductionReportRate(dt,1); return SUCCESS(response); } @@ -147,7 +147,7 @@ namespace DOAN.WebApi.Controllers public IActionResult ProductionReportMonthRate() { DateTime dt = new DateTime(2026, 1, 27); - //dt = DateTime.Now; + dt = DateTime.Now; var response = _ReportService.ProductionReportRate(dt, 2); return SUCCESS(response); } diff --git a/DOAN.Admin.WebApi/appsettings.Development.json b/DOAN.Admin.WebApi/appsettings.Development.json index c8d585e..babd955 100644 --- a/DOAN.Admin.WebApi/appsettings.Development.json +++ b/DOAN.Admin.WebApi/appsettings.Development.json @@ -9,7 +9,7 @@ "dbConfigs": [ { // "Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=GXAssembly;Port=3308", - "Conn": "Data Source=47.101.40.214;User ID=root;Password=Rizo123456@;Initial Catalog=gxassembly2;Port=3306;AllowLoadLocalInfile=true", + "Conn": "Data Source=47.101.40.214;User ID=root;Password=Rizo123456@;Initial Catalog=gxassembly_pro;Port=3306;AllowLoadLocalInfile=true", //"Conn": "Data Source=192.168.1.48;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306;AllowLoadLocalInfile=true", // "Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306", //"Conn": "Data Source=192.168.50.163;User ID=root;Password=123456;Initial Catalog=GXAssembly;Port=3306", diff --git a/DOAN.Service/MES/product/ProPlanAchievementrateVersion2Service.cs b/DOAN.Service/MES/product/ProPlanAchievementrateVersion2Service.cs index 724245c..af2bc26 100644 --- a/DOAN.Service/MES/product/ProPlanAchievementrateVersion2Service.cs +++ b/DOAN.Service/MES/product/ProPlanAchievementrateVersion2Service.cs @@ -609,7 +609,7 @@ namespace DOAN.Service.MES.product { t.SummaryActualNum = t.DayProuctModels.Sum(it => it.SummaryActualNum ?? 0); t.SummaryPlanNum = t.DayProuctModels.Sum(it => it.SummaryPlanNum ?? 0); - t.SummaryPlanAchievementRate = Math.Round(t.SummaryActualNum * 100.0M / t.SummaryPlanNum ?? 1, 2); + t.SummaryPlanAchievementRate = Math.Round(t.SummaryActualNum ?? 0 * 100.0M / (t.SummaryPlanNum ?? 1), 2); }); diff --git a/DOAN.Service/MES/report/ReportService.cs b/DOAN.Service/MES/report/ReportService.cs index 0285de2..6c6fa94 100644 --- a/DOAN.Service/MES/report/ReportService.cs +++ b/DOAN.Service/MES/report/ReportService.cs @@ -109,15 +109,15 @@ namespace DOAN.Service.MES.report it.LineCode, it.StartTime, it.EndTime, - DowntimeHours = (it.EndTime.Value - it.StartTime.Value).TotalHours, + DowntimeHours = SqlFunc.Round((it.EndTime.Value - it.StartTime.Value).TotalMinutes/60.0,2), }).ToList(); - var totalDowntimeHours = response.Sum(it => it.DowntimeHours); - var totalPlanHours = groupListWorkRoute.Sum(it => it.PlanHours); + var totalDowntimeHours =Math.Round(response.Sum(it => it.DowntimeHours),2); + var totalPlanHours =Math.Round(groupListWorkRoute.Sum(it => it.PlanHours),2); var groupList = response.GroupBy(it => it.LineCode).Select(it => new { LineCode = it.Key, - DowntimeHours = it.ToList().Sum(t=>t.DowntimeHours) + DowntimeHours =Math.Round( it.ToList().Sum(t=>t.DowntimeHours),2) }).ToList(); var result = groupListWorkRoute.GroupJoin(groupList,