1安全生产看板打开报错问题处理

This commit is contained in:
夏菊 2025-04-23 10:23:42 +08:00
parent a4b291fecb
commit b982382a48
1 changed files with 97 additions and 82 deletions

View File

@ -102,7 +102,8 @@ namespace FineUIPro.Web.common
div_zasrs.InnerHtml = tb.Rows.Count.ToString(); div_zasrs.InnerHtml = tb.Rows.Count.ToString();
} }
else { else
{
//项目总监 //项目总监
div_xmrs.InnerHtml = (from x in db.SitePerson_Person div_xmrs.InnerHtml = (from x in db.SitePerson_Person
where x.WorkPostId == Const.WorkPost_HSSEDirector && x.IsUsed == true where x.WorkPostId == Const.WorkPost_HSSEDirector && x.IsUsed == true
@ -184,7 +185,8 @@ namespace FineUIPro.Web.common
//int wHours = Funs.DB.SitePerson_PersonInOutNumber.Max(x => x.WorkHours) ?? 0; //int wHours = Funs.DB.SitePerson_PersonInOutNumber.Max(x => x.WorkHours) ?? 0;
this.div_safeworktime.InnerHtml = Count3().ToString().Split('.')[0]; this.div_safeworktime.InnerHtml = Count3().ToString().Split('.')[0];
} }
else { else
{
var list = db.Base_Project.Where(x => pids.Contains(x.ProjectId)); var list = db.Base_Project.Where(x => pids.Contains(x.ProjectId));
//在建项目 //在建项目
div_zjxm.InnerHtml = list.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).Count().ToString(); div_zjxm.InnerHtml = list.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).Count().ToString();
@ -242,7 +244,8 @@ namespace FineUIPro.Web.common
cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0); cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0);
} }
} }
else { else
{
var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber
where pids.Contains(x.ProjectId) where pids.Contains(x.ProjectId)
select x; select x;
@ -300,7 +303,8 @@ namespace FineUIPro.Web.common
{ {
list = db.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList(); list = db.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList();
} }
else { else
{
list = db.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); list = db.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
} }
var hazardRegisters = from x in db.HSSE_Hazard_HazardRegister select x; var hazardRegisters = from x in db.HSSE_Hazard_HazardRegister select x;
@ -366,17 +370,20 @@ namespace FineUIPro.Web.common
div_xmalh.InnerHtml = ((from x in Funs.DB.Meeting_WeekMeeting where x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count() div_xmalh.InnerHtml = ((from x in Funs.DB.Meeting_WeekMeeting where x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count()
+ (from x in Funs.DB.Meeting_MonthMeeting where x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count()).ToString(); + (from x in Funs.DB.Meeting_MonthMeeting where x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count()).ToString();
} }
else { else
{
//项目安全领导小组 //项目安全领导小组
div_xmaqldxz.InnerHtml = Funs.DB.Meeting_SafetyLeaderGroupMeeting.Where(x => x.CompileDate > Const.DtmarkTime div_xmaqldxz.InnerHtml = Funs.DB.Meeting_SafetyLeaderGroupMeeting.Where(x => x.CompileDate > Const.DtmarkTime
&& pids.Contains(x.ProjectId)).Count().ToString(); && pids.Contains(x.ProjectId)).Count().ToString();
//项目安全例会 //项目安全例会
DateTime date = DateTime.Now; DateTime date = DateTime.Now;
div_xmalh.InnerHtml = ((from x in Funs.DB.Meeting_WeekMeeting where x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day div_xmalh.InnerHtml = ((from x in Funs.DB.Meeting_WeekMeeting
where x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day
&& pids.Contains(x.ProjectId) && pids.Contains(x.ProjectId)
select x).Count() select x).Count()
+ (from x in Funs.DB.Meeting_MonthMeeting where x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day + (from x in Funs.DB.Meeting_MonthMeeting
where x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day
&& pids.Contains(x.ProjectId) && pids.Contains(x.ProjectId)
select x).Count()).ToString(); select x).Count()).ToString();
@ -652,7 +659,8 @@ namespace FineUIPro.Web.common
{ {
return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum(); return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum();
} }
else { else
{
return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum(pids); return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum(pids);
} }
@ -697,7 +705,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
return result; return result;
} }
else { else
{
var result = (from x in Funs.DB.Check_ProjectLeaderCheck var result = (from x in Funs.DB.Check_ProjectLeaderCheck
where x.CompileDate > Const.DtmarkTime where x.CompileDate > Const.DtmarkTime
&& pids.Contains(x.ProjectId) && pids.Contains(x.ProjectId)
@ -720,7 +729,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
return result; return result;
} }
else { else
{
var result = (from x in Funs.DB.Check_CheckSpecial var result = (from x in Funs.DB.Check_CheckSpecial
where x.CheckTime > Const.DtmarkTime where x.CheckTime > Const.DtmarkTime
&& pids.Contains(x.ProjectId) && pids.Contains(x.ProjectId)
@ -743,7 +753,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
return result; return result;
} }
else { else
{
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.CheckTime > Const.DtmarkTime where x.CheckTime > Const.DtmarkTime
&& pids.Contains(x.ProjectId) && pids.Contains(x.ProjectId)
@ -768,7 +779,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
return result; return result;
} }
else { else
{
var result = (from x in Funs.DB.Accident_AccidentPersonRecord var result = (from x in Funs.DB.Accident_AccidentPersonRecord
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId)
@ -792,7 +804,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
return result; return result;
} }
else { else
{
var result = (from x in Funs.DB.Accident_AccidentPersonRecord var result = (from x in Funs.DB.Accident_AccidentPersonRecord
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) where x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId)
@ -874,7 +887,8 @@ namespace FineUIPro.Web.common
/// <returns></returns> /// <returns></returns>
public int GetSpecialSeriousAccidentNum() public int GetSpecialSeriousAccidentNum()
{ {
if (pids == null) { if (pids == null)
{
var result = (from x in Funs.DB.Accident_AccidentReport var result = (from x in Funs.DB.Accident_AccidentReport
where x.AccidentDegree == "4" where x.AccidentDegree == "4"
select x).Count(); select x).Count();
@ -1188,7 +1202,8 @@ namespace FineUIPro.Web.common
select x).Count(); select x).Count();
return result; return result;
} }
else { else
{
var result = (from x in Funs.DB.Hazard_HazardSelectedItem var result = (from x in Funs.DB.Hazard_HazardSelectedItem
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
where y.RiskLevel == 4 && (x.IsStart == true || x.State == "1") where y.RiskLevel == 4 && (x.IsStart == true || x.State == "1")
@ -1328,7 +1343,7 @@ namespace FineUIPro.Web.common
{ {
var result = var result =
(from x in Funs.DB.Solution_LargerHazard (from x in Funs.DB.Solution_LargerHazard
where x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime where x.IsSuperLargerHazard == true && x.TrainPersonNum != null && x.RecordTime > Const.DtmarkTime
select x.TrainPersonNum).ToList().Sum(x => x.Value); select x.TrainPersonNum).ToList().Sum(x => x.Value);
return result; return result;
} }
@ -1336,7 +1351,7 @@ namespace FineUIPro.Web.common
{ {
var result = var result =
(from x in Funs.DB.Solution_LargerHazard (from x in Funs.DB.Solution_LargerHazard
where x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) where x.IsSuperLargerHazard == true && x.TrainPersonNum != null && x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId)
select x.TrainPersonNum).ToList().Sum(x => x.Value); select x.TrainPersonNum).ToList().Sum(x => x.Value);
return result; return result;
} }