增加四色图接口
This commit is contained in:
parent
1d25c12911
commit
9b4e8b6892
@ -74,6 +74,66 @@ namespace APT.HM.WebApi.Controllers.Api
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class levelCountData
|
||||||
|
{
|
||||||
|
public List<riskLevelCountModel> RISKLEVELCOUNTS { get; set; }
|
||||||
|
}
|
||||||
|
public class riskLevelCountModel
|
||||||
|
{
|
||||||
|
public string NAME { get; set; }
|
||||||
|
public int LEVEL { get; set; }
|
||||||
|
public int LEVEL1 { get; set; }
|
||||||
|
public int LEVEL2 { get; set; }
|
||||||
|
public int LEVEL3 { get; set; }
|
||||||
|
public int LEVEL4 { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 风险库统计
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageFilter">返回系统用户数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, Route("getRiskLevelCountData")]
|
||||||
|
public JsonActionResult<levelCountData> getRiskLevelCountData([FromBody] KeywordFilter filter)
|
||||||
|
{
|
||||||
|
return SafeExecute<levelCountData>(() =>
|
||||||
|
{
|
||||||
|
var riskFilter = new BaseFilter(filter.GetOrgId());
|
||||||
|
riskFilter.SelectField = new string[] { "AREA_ID", "Nav_Area.NAME", "EVALUATE_LEVEL" };
|
||||||
|
IEnumerable<T_HM_EVALUATE_RISK> allrisk = null;
|
||||||
|
allrisk = GetEntities<T_HM_EVALUATE_RISK>(t => t.STATUS == (int)HMOperationStepEnum.有效, riskFilter);
|
||||||
|
var distinctArea = GetEntities<T_HM_RISK_AREA>(t => t.IS_DELETED == false, new BaseFilter(filter.GetOrgId()));
|
||||||
|
levelCountData riskData = new levelCountData();
|
||||||
|
List<riskLevelCountModel> item1s = new List<riskLevelCountModel>();
|
||||||
|
foreach (var itemArea in distinctArea)
|
||||||
|
{
|
||||||
|
riskLevelCountModel item = new riskLevelCountModel();
|
||||||
|
item.NAME = itemArea.NAME;
|
||||||
|
item.LEVEL1 = allrisk.Count(t => t.AREA_ID == itemArea.ID && t.EVALUATE_LEVEL == EvaluateLevelEnum.一级);
|
||||||
|
item.LEVEL2 = allrisk.Count(t => t.AREA_ID == itemArea.ID && t.EVALUATE_LEVEL == EvaluateLevelEnum.二级);
|
||||||
|
item.LEVEL3 = allrisk.Count(t => t.AREA_ID == itemArea.ID && t.EVALUATE_LEVEL == EvaluateLevelEnum.三级);
|
||||||
|
item.LEVEL4 = allrisk.Count(t => t.AREA_ID == itemArea.ID && t.EVALUATE_LEVEL == EvaluateLevelEnum.四级);
|
||||||
|
if (item.LEVEL1 > 0)
|
||||||
|
{
|
||||||
|
item.LEVEL = 1;
|
||||||
|
}
|
||||||
|
else if (item.LEVEL1 == 0 && item.LEVEL2 > 0)
|
||||||
|
{
|
||||||
|
item.LEVEL = 2;
|
||||||
|
}
|
||||||
|
else if (item.LEVEL1 == 0 && item.LEVEL2 == 0 && item.LEVEL3 > 0)
|
||||||
|
{
|
||||||
|
item.LEVEL = 3;
|
||||||
|
}
|
||||||
|
else if (item.LEVEL1 == 0 && item.LEVEL2 == 0 && item.LEVEL3 == 0)
|
||||||
|
{
|
||||||
|
item.LEVEL = 4;
|
||||||
|
}
|
||||||
|
item1s.Add(item);
|
||||||
|
}
|
||||||
|
riskData.RISKLEVELCOUNTS = item1s;
|
||||||
|
return riskData;
|
||||||
|
});
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取导入数据
|
/// 获取导入数据
|
||||||
/// 参考 [Route("api/PF/Import")]
|
/// 参考 [Route("api/PF/Import")]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user