20240124上报集团安全风险接口方法修改
This commit is contained in:
@@ -219,17 +219,7 @@ namespace FineUIPro.Web.DataShow
|
||||
}
|
||||
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>
|
||||
@@ -238,12 +228,23 @@ namespace FineUIPro.Web.DataShow
|
||||
/// <returns></returns>
|
||||
private int getcount(string projectId, int level)
|
||||
{
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
var getlevel = Funs.DB.Base_RiskLevel.FirstOrDefault(x => x.RiskLevel == level);
|
||||
if (getlevel != null)
|
||||
{
|
||||
string levels = getlevel.RiskLevel.ToString();
|
||||
count = getDataItemLists.Where(x => x.ProjectId == projectId && (x.HazardLevel == getlevel.RiskLevelId || x.HazardLevel == levels)).Count();
|
||||
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 == 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user