20240124上报集团安全风险接口方法修改

This commit is contained in:
杨红卫 2024-01-24 16:17:59 +08:00
parent 629c33a322
commit 698d687ebf
2 changed files with 27 additions and 22 deletions

View File

@ -1303,7 +1303,8 @@ namespace BLL
{ {
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 x.ProjectId == projectid && y.RiskLevel == 2 && (x.IsStart == true || x.State == "1") join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
where z.ProjectId == projectid && y.RiskLevel == 2 && z.CompileDate.Value.Year >= 2023
select x).Count(); select x).Count();
return result; return result;
} }
@ -1316,7 +1317,8 @@ namespace BLL
{ {
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 x.ProjectId == projectid && y.RiskLevel == 1 && (x.IsStart == true || x.State == "1") join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
where z.ProjectId == projectid && y.RiskLevel == 1 && z.CompileDate.Value.Year >= 2023
select x).Count(); select x).Count();
return result; return result;
} }
@ -1329,7 +1331,8 @@ namespace BLL
{ {
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 x.ProjectId == projectid && y.RiskLevel == 3 && (x.IsStart == true || x.State == "1") join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
where z.ProjectId == projectid && y.RiskLevel == 3 && z.CompileDate.Value.Year >= 2023
select x).Count(); select x).Count();
return result; return result;
} }
@ -1342,7 +1345,8 @@ namespace BLL
{ {
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 x.ProjectId == projectid && y.RiskLevel == 4 && (x.IsStart == true || x.State == "1") join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
where z.ProjectId == projectid && y.RiskLevel == 4 && z.CompileDate.Value.Year >= 2023
select x).Count(); select x).Count();
return result; return result;
} }

View File

@ -219,17 +219,7 @@ namespace FineUIPro.Web.DataShow
} }
return cout4; return cout4;
} }
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Hazard_HazardList> getDataLists = from x in Funs.DB.Hazard_HazardList
select x;
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Hazard_HazardSelectedItem> getDataItemLists = from x in Funs.DB.Hazard_HazardSelectedItem
where (x.IsStart == true || x.State == "1")
select x;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -242,8 +232,19 @@ namespace FineUIPro.Web.DataShow
var getlevel = Funs.DB.Base_RiskLevel.FirstOrDefault(x => x.RiskLevel == level); var getlevel = Funs.DB.Base_RiskLevel.FirstOrDefault(x => x.RiskLevel == level);
if (getlevel != null) if (getlevel != null)
{ {
string levels = getlevel.RiskLevel.ToString(); count = (from x in Funs.DB.Hazard_HazardSelectedItem
count = getDataItemLists.Where(x => x.ProjectId == projectId && (x.HazardLevel == getlevel.RiskLevelId || x.HazardLevel == levels)).Count(); join y in Funs.DB.Hazard_HazardList on x.HazardListId equals y.HazardListId
where y.ProjectId == projectId && (x.HazardLevel == getlevel.RiskLevelId || x.HazardLevel == level.ToString()) && y.States == Const.State_2
&& y.CompileDate.Value.Year >= 2023
select x).Count();
}
else
{
count = (from x in Funs.DB.Hazard_HazardSelectedItem
join y in Funs.DB.Hazard_HazardList on x.HazardListId equals y.HazardListId
where y.ProjectId == projectId && x.HazardLevel == level.ToString() && y.States == Const.State_2
&& y.CompileDate.Value.Year >= 2023
select x).Count();
} }
return count; return count;
} }