This commit is contained in:
parent
ef0c9b41d7
commit
3a1cef0ae6
|
|
@ -4161,22 +4161,22 @@ namespace BLL
|
|||
/// <returns></returns>
|
||||
public static List<Model.SecurityRiskOutput> GetSecurityRiskOutputs()
|
||||
{
|
||||
var query = (from x in Funs.DB.Base_Project
|
||||
join y in Funs.DB.Hazard_HazardSelectedItem on x.ProjectId equals y.ProjectId into yGroup
|
||||
var query = (from x in Funs.DB.Hazard_HazardList
|
||||
join y in Funs.DB.Hazard_HazardSelectedItem on x.HazardListId equals y.HazardListId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
join z in Funs.DB.Base_RiskLevel on y.HazardLevel equals z.RiskLevelId into zGroup
|
||||
join z in Funs.DB.Base_Project on x.ProjectId equals z.ProjectId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
group new { y, z } by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
group new { y, z } by new { z.ProjectId, z.ProjectName, z.ProjectCode } into gg
|
||||
select new SecurityRiskOutput
|
||||
{
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
LowRiskNum = gg.Sum(g => (g.z.RiskLevel == 1 || g.y.HazardLevel == "1") ? 1 : 0),
|
||||
GeneralRiskNum = gg.Sum(g => (g.z.RiskLevel == 2 || g.y.HazardLevel == "2") ? 1 : 0),
|
||||
MediumRiskNum = gg.Sum(g => (g.z.RiskLevel == 3 || g.y.HazardLevel == "3") ? 1 : 0),
|
||||
HighRiskNum = gg.Sum(g => g.z.RiskLevel == 4 ? 1 : 0),
|
||||
LowRiskNum = gg.Sum(g => (g.y.HazardLevel == "1") ? 1 : 0),
|
||||
GeneralRiskNum = gg.Sum(g => (g.y.HazardLevel == "2") ? 1 : 0),
|
||||
MediumRiskNum = gg.Sum(g => (g.y.HazardLevel == "3") ? 1 : 0),
|
||||
HighRiskNum = gg.Sum(g => (g.y.HazardLevel == "4") ? 1 : 0),
|
||||
}).ToList();
|
||||
return query;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace FineUIPro.Web.DataShow
|
|||
BLL.ProjectService.InitCNCECShowProjectDropDownList(this.drpProject, true);
|
||||
LargerHazard = (from x in Funs.DB.Solution_LargerHazard
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
where y.ProjectState == Const.ProjectState_1 && y.IsCNCECShow == true
|
||||
select x).ToList();
|
||||
// 绑定表格t
|
||||
BindGrid();
|
||||
|
|
|
|||
Loading…
Reference in New Issue