diff --git a/SGGL/BLL/API/APICdPuService.cs b/SGGL/BLL/API/APICdPuService.cs index 460086f1..514a06a2 100644 --- a/SGGL/BLL/API/APICdPuService.cs +++ b/SGGL/BLL/API/APICdPuService.cs @@ -112,19 +112,20 @@ namespace BLL select x).FirstOrDefault(); if (ProjectTotal3 !=null) { - ProjectTotal3Value = int.Parse((ProjectTotal3.GetType().GetProperty("Month" + currentMonth)?.GetValue(ProjectTotal3, null).ToString() ?? "0") ); + ProjectTotal3Value = int.Parse((ProjectTotal3.GetType().GetProperty("Month" + currentMonth)?.GetValue(ProjectTotal3, null)?.ToString() ?? "0") ); projectDataItem.onsiteperson = ProjectTotal3Value.ToString() ?? ""; // 本月现场人数 + } - + var ProjectTotal4 = (from x in Funs.DB.HSSE_MonthReportItem join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId where ("成达公司HSE管理人数" == x.ReportItem) && y.Years == currentYear && y.ProjectId == item.ProjectId select x).FirstOrDefault(); if (ProjectTotal4 != null) { - ProjectTotal4Value = int.Parse((ProjectTotal4.GetType().GetProperty("Month" + currentMonth)?.GetValue(ProjectTotal4, null).ToString() ?? "0")); + ProjectTotal4Value = int.Parse((ProjectTotal4.GetType().GetProperty("Month" + currentMonth)?.GetValue(ProjectTotal4, null)?.ToString() ?? "0")); projectDataItem.maxperson = (ProjectTotal4Value + ProjectTotal3Value).ToString() ?? ""; //现场高峰人数 - + }