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,