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