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