From c9f8e00d2406a742e0ae1e52eebe90d51346d02a Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Tue, 2 Jan 2024 16:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Project_HSSEData_HSSEService.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs index c2b0827a..94179931 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs @@ -629,10 +629,11 @@ namespace BLL /// public static int GetTotalWorkingHour(string projectid) { - var result = (from x in Funs.DB.SitePerson_DayReportDetail - join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId - where y.ProjectId == projectid && y.CompileDate > Const.DtmarkTime - select x.PersonWorkTime ?? 0).ToList().Sum(); + var result = (from x in Funs.DB.SeDin_MonthReport2 + join y in Funs.DB.SeDin_MonthReport on x.MonthReportId equals y.MonthReportId + where y.ProjectId == projectid + orderby y.ReporMonth descending + select x.ProjectWorkTime ?? 0).FirstOrDefault(); var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]); return q; @@ -664,10 +665,11 @@ namespace BLL /// public static int GetSafeWorkingHour(string projectid) { - var result1 = (from x in Funs.DB.SitePerson_DayReportDetail - join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId - where y.ProjectId == projectid && y.CompileDate > Const.DtmarkTime - select x.PersonWorkTime ?? 0).ToList().Sum(); + var result1 = (from x in Funs.DB.SeDin_MonthReport2 + join y in Funs.DB.SeDin_MonthReport on x.MonthReportId equals y.MonthReportId + where y.ProjectId == projectid + orderby y.ReporMonth descending + select x.ProjectWorkTime ?? 0).FirstOrDefault(); var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime