修改
This commit is contained in:
parent
db73ff246c
commit
c60228600c
@ -17,5 +17,7 @@ namespace APT.BaseData.Domain.Entities.FM
|
||||
|
||||
[Description("颜色")]
|
||||
public string COLOR { get; set; }
|
||||
[Description("排序")]
|
||||
public int NUM { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,10 +75,6 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
throw new Exception("辨识区域不能为空");
|
||||
}
|
||||
});
|
||||
if (files == null || files.Count <= 0)
|
||||
{
|
||||
throw new Exception("附件未上传,无法发送");
|
||||
}
|
||||
if (entity.DEPUTY_GROUP_LEADER_ID == null || entity.GROUP_LEADER_ID == null)
|
||||
{
|
||||
throw new Exception("组长或副组长未填写");
|
||||
|
||||
@ -533,49 +533,46 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
||||
var riskLevelProportions = new List<T_FM_RISK_LEVEL_PROPORTION>();
|
||||
var riskTypeProportions = new List<T_FM_RISK_TYPE_PROPORTION>();
|
||||
baseFilter.SelectField = new string[] { "EVALUATE_LEVEL", "Nav_Type.NAME", "MineType" };
|
||||
var evaluateRisks = GetEntities<T_HM_EVALUATE_RISK>(t => t.TYPE_ID != null && t.EVALUATE_LEVEL != 0 && t.MineType != 0, baseFilter).Select(i => new { i.EVALUATE_LEVEL, i.Nav_Type.NAME, i.MineType }).OrderBy(i => i.EVALUATE_LEVEL).ToList();
|
||||
var distinctLevelTypes = evaluateRisks.GroupBy(m => new { m.EVALUATE_LEVEL, m.MineType }).Select(group => new { group.Key.EVALUATE_LEVEL, group.Key.MineType, count = group.Count() }).ToList();
|
||||
baseFilter.SelectField = new string[] { "EVALUATE_LEVEL", "Nav_Type.NAME" };
|
||||
var evaluateRisks = GetEntities<T_HM_EVALUATE_RISK>(t => t.TYPE_ID != null && t.EVALUATE_LEVEL != 0, baseFilter).Select(i => new { i.EVALUATE_LEVEL, i.Nav_Type.NAME }).OrderBy(i => i.EVALUATE_LEVEL).ToList();
|
||||
var distinctLevelTypes = evaluateRisks.GroupBy(m => new { m.EVALUATE_LEVEL }).Select(group => new { group.Key.EVALUATE_LEVEL, count = group.Count() }).ToList();
|
||||
var levels = new int[] { 10, 20, 30, 40 };
|
||||
var mineTypes = new int[] { 10, 20, 30 };
|
||||
|
||||
|
||||
foreach (var level in levels)
|
||||
{
|
||||
foreach (var mineType in mineTypes)
|
||||
var item = distinctLevelTypes.FirstOrDefault(t => (int)t.EVALUATE_LEVEL == level);
|
||||
T_FM_RISK_LEVEL_PROPORTION riskLevelProportion = new T_FM_RISK_LEVEL_PROPORTION();
|
||||
if (item != null)
|
||||
{
|
||||
var item = distinctLevelTypes.FirstOrDefault(t => (int)t.MineType.Value == mineType && (int)t.EVALUATE_LEVEL == level);
|
||||
T_FM_RISK_LEVEL_PROPORTION riskLevelProportion = new T_FM_RISK_LEVEL_PROPORTION();
|
||||
riskLevelProportion.COLOR = mineType.ToString();
|
||||
if (item != null)
|
||||
{
|
||||
riskLevelProportion.COUNT = item.count;
|
||||
}
|
||||
else
|
||||
{
|
||||
riskLevelProportion.COUNT = 0;
|
||||
}
|
||||
var label = "";
|
||||
if (level == 10)
|
||||
{
|
||||
label = "一级";
|
||||
}
|
||||
else if (level == 20)
|
||||
{
|
||||
label = "二级";
|
||||
}
|
||||
else if (level == 30)
|
||||
{
|
||||
label = "三级";
|
||||
}
|
||||
else if (level == 40)
|
||||
{
|
||||
label = "四级";
|
||||
}
|
||||
riskLevelProportion.RISK_LEVEL = label;
|
||||
riskLevelProportion.ORG_ID = filter.GetOrgId();
|
||||
riskLevelProportions.Add(riskLevelProportion);
|
||||
riskLevelProportion.COUNT = item.count;
|
||||
}
|
||||
else
|
||||
{
|
||||
riskLevelProportion.COUNT = 0;
|
||||
}
|
||||
var label = "";
|
||||
if (level == 10)
|
||||
{
|
||||
label = "重大风险";
|
||||
riskLevelProportion.NUM = 1;
|
||||
}
|
||||
else if (level == 20)
|
||||
{
|
||||
label = "较大风险";
|
||||
riskLevelProportion.NUM = 2;
|
||||
}
|
||||
else if (level == 30)
|
||||
{
|
||||
label = "一般风险";
|
||||
riskLevelProportion.NUM = 3;
|
||||
}
|
||||
else if (level == 40)
|
||||
{
|
||||
label = "低风险";
|
||||
riskLevelProportion.NUM = 4;
|
||||
}
|
||||
riskLevelProportion.RISK_LEVEL = label;
|
||||
riskLevelProportion.ORG_ID = filter.GetOrgId();
|
||||
riskLevelProportions.Add(riskLevelProportion);
|
||||
}
|
||||
var distinctTypes = evaluateRisks.GroupBy(m => m.NAME).Select(group => new { group.Key, count = group.Count() }).ToList();
|
||||
foreach (var item in distinctTypes)
|
||||
@ -771,8 +768,8 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
{
|
||||
DeleteEntityNoCommit<T_FM_HIDDEN_DANGER_RECTIFICATION>(t => true);//删除表数据
|
||||
|
||||
//添加信息
|
||||
if (listResult.Any() && listResult.Count > 0)
|
||||
//添加信息
|
||||
if (listResult.Any() && listResult.Count > 0)
|
||||
BantchAddEntityNoCommit(listResult);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user