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