年度安全检查情况综合统计分析
This commit is contained in:
parent
89a3118bce
commit
4aeec69c2d
@ -103,17 +103,17 @@ namespace APT.MS.Domain.Enums
|
|||||||
[Description("全公司")] /*全局*/
|
[Description("全公司")] /*全局*/
|
||||||
All = 0,
|
All = 0,
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 选矿厂
|
///// 选矿厂
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[Description("选矿厂")]
|
//[Description("选矿厂")]
|
||||||
MineChoose = 10,
|
//MineChoose = 10,
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 尾矿库
|
///// 尾矿库
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[Description("尾矿库")]
|
//[Description("尾矿库")]
|
||||||
Minelast = 20,
|
//Minelast = 20,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 露天矿
|
/// 露天矿
|
||||||
@ -121,28 +121,28 @@ namespace APT.MS.Domain.Enums
|
|||||||
[Description("露天矿")]
|
[Description("露天矿")]
|
||||||
Mine = 30,
|
Mine = 30,
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 地下矿
|
///// 地下矿
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[Description("地下矿")]
|
//[Description("地下矿")]
|
||||||
MineUnderground = 40,
|
//MineUnderground = 40,
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 安全库类型(需同步修改FMProductionUnit)
|
/// 安全库类型(需同步修改FMProductionUnit)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum BSMineTypeEditEnum
|
public enum BSMineTypeEditEnum
|
||||||
{
|
{
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 选矿
|
///// 选矿
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[Description("选矿厂")]
|
//[Description("选矿厂")]
|
||||||
MineChoose = 10,
|
//MineChoose = 10,
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 尾矿
|
///// 尾矿
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[Description("尾矿库")]
|
//[Description("尾矿库")]
|
||||||
Minelast = 20,
|
//Minelast = 20,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 矿山
|
/// 矿山
|
||||||
@ -150,11 +150,11 @@ namespace APT.MS.Domain.Enums
|
|||||||
[Description("露天矿")]
|
[Description("露天矿")]
|
||||||
Mine = 30,
|
Mine = 30,
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 地下矿
|
///// 地下矿
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[Description("地下矿")]
|
//[Description("地下矿")]
|
||||||
MineUnderground = 40,
|
//MineUnderground = 40,
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
|
|||||||
@ -137,10 +137,10 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
listMineType.Add(BSMineTypeEditEnum.MineChoose);
|
//listMineType.Add(BSMineTypeEditEnum.MineChoose);
|
||||||
listMineType.Add(BSMineTypeEditEnum.Minelast);
|
//listMineType.Add(BSMineTypeEditEnum.Minelast);
|
||||||
|
//listMineType.Add(BSMineTypeEditEnum.MineUnderground);
|
||||||
listMineType.Add(BSMineTypeEditEnum.Mine);
|
listMineType.Add(BSMineTypeEditEnum.Mine);
|
||||||
listMineType.Add(BSMineTypeEditEnum.MineUnderground);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -121,44 +121,44 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
{
|
{
|
||||||
BIDepartmentSafeYear result = new BIDepartmentSafeYear();
|
BIDepartmentSafeYear result = new BIDepartmentSafeYear();
|
||||||
//BSMineTypeEnum MineType = BSMineTypeEnum.Mine;
|
//BSMineTypeEnum MineType = BSMineTypeEnum.Mine;
|
||||||
List<BSMineTypeEnum> listMineType = new List<BSMineTypeEnum>();
|
//List<BSMineTypeEnum> listMineType = new List<BSMineTypeEnum>();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
//if (!string.IsNullOrEmpty(filter.Keyword))
|
||||||
{
|
//{
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
string types = filter.Keyword.Split("=")[1];
|
// string types = filter.Keyword.Split("=")[1];
|
||||||
if (types.Contains("_"))
|
// if (types.Contains("_"))
|
||||||
{
|
// {
|
||||||
var listTypes = types.Split("_");
|
// var listTypes = types.Split("_");
|
||||||
//listTypes.foreach ((e) => { listMineType.Add((BSMineTypeEnum)int.Parse(e))})
|
// //listTypes.foreach ((e) => { listMineType.Add((BSMineTypeEnum)int.Parse(e))})
|
||||||
foreach (var item in listTypes)
|
// foreach (var item in listTypes)
|
||||||
{
|
// {
|
||||||
listMineType.Add((BSMineTypeEnum)int.Parse(item));
|
// listMineType.Add((BSMineTypeEnum)int.Parse(item));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
listMineType.Add((BSMineTypeEnum)int.Parse(types));
|
// listMineType.Add((BSMineTypeEnum)int.Parse(types));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
catch { }
|
// catch { }
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
listMineType.Add(BSMineTypeEnum.Mine);
|
// listMineType.Add(BSMineTypeEnum.Mine);
|
||||||
}
|
//}
|
||||||
Expression<Func<T_BI_BSSAFECHECKTYPE_YEAR, bool>> expression = e => e.YEAR == DateTime.Now.Year;
|
Expression<Func<T_BI_BSSAFECHECKTYPE_YEAR, bool>> expression = e => e.YEAR == DateTime.Now.Year;
|
||||||
|
|
||||||
//行洛坑 选矿部 = 选矿部 + 尾矿部 看传参
|
//行洛坑 选矿部 = 选矿部 + 尾矿部 看传参
|
||||||
if (listMineType.Count == 1)
|
//if (listMineType.Count == 1)
|
||||||
{
|
//{
|
||||||
expression = expression.And(e => e.MineType == listMineType[0]);
|
// expression = expression.And(e => e.MineType == listMineType[0]);
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
expression = expression.And(e => listMineType.Contains(e.MineType));
|
// expression = expression.And(e => listMineType.Contains(e.MineType));
|
||||||
}
|
//}
|
||||||
|
|
||||||
var listCheckLevel = GetEntities<T_BI_BSSAFECHECKTYPE_YEAR>(expression, null, null);
|
var listCheckLevel = GetEntities<T_BI_BSSAFECHECKTYPE_YEAR>(expression, null, null);
|
||||||
if (listCheckLevel != null && listCheckLevel.Any())
|
if (listCheckLevel != null && listCheckLevel.Any())
|
||||||
@ -207,31 +207,31 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//总结数据
|
//总结数据 listMineType.Contains((BSMineTypeEnum)e.MineType) &&
|
||||||
IEnumerable<T_BI_SUMMARY> listSummery = GetEntities<T_BI_SUMMARY>(e => listMineType.Contains((BSMineTypeEnum)e.MineType) && e.CODE == "BI052_BSSafeCheckYear", null, null).OrderBy(e => e.NUM).ThenBy(e => e.PART);//e.MineType == (BSMineTypeEditEnum)MineType
|
IEnumerable<T_BI_SUMMARY> listSummery = GetEntities<T_BI_SUMMARY>(e => e.CODE == "BI052_BSSafeCheckYear", null, null).OrderBy(e => e.NUM).ThenBy(e => e.PART);//e.MineType == (BSMineTypeEditEnum)MineType
|
||||||
|
|
||||||
//前12月的数据
|
//前12月的数据
|
||||||
IEnumerable<T_BI_BSCHECKTYPE_YEAR> listCheckType = null;
|
IEnumerable<T_BI_BSCHECKTYPE_YEAR> listCheckType = null;
|
||||||
if (listMineType.Count == 1)
|
//if (listMineType.Count == 1)
|
||||||
{
|
//{
|
||||||
if (DateTime.Now.Month == 12)
|
if (DateTime.Now.Month == 12)
|
||||||
listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => e.MineType == listMineType[0] && e.YEAR == DateTime.Now.Year, null, null);
|
listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => e.YEAR == DateTime.Now.Year, null, null);//e.MineType == listMineType[0] &&
|
||||||
else
|
else
|
||||||
listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => e.MineType == listMineType[0] && (e.YEAR == DateTime.Now.Year || (e.YEAR == (DateTime.Now.Year - 1) && (e.MONTH > DateTime.Now.Month))), null, null);
|
listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => (e.YEAR == DateTime.Now.Year || (e.YEAR == (DateTime.Now.Year - 1) && (e.MONTH > DateTime.Now.Month))), null, null);//e.MineType == listMineType[0] &&
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
if (DateTime.Now.Month == 12)
|
// if (DateTime.Now.Month == 12)
|
||||||
listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => listMineType.Contains(e.MineType) && e.YEAR == DateTime.Now.Year, null, null);
|
// listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => listMineType.Contains(e.MineType) && e.YEAR == DateTime.Now.Year, null, null);
|
||||||
else
|
// else
|
||||||
listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => listMineType.Contains(e.MineType) && (e.YEAR == DateTime.Now.Year || (e.YEAR == (DateTime.Now.Year - 1) && (e.MONTH > DateTime.Now.Month))), null, null);
|
// listCheckType = GetEntities<T_BI_BSCHECKTYPE_YEAR>(e => listMineType.Contains(e.MineType) && (e.YEAR == DateTime.Now.Year || (e.YEAR == (DateTime.Now.Year - 1) && (e.MONTH > DateTime.Now.Month))), null, null);
|
||||||
}
|
//}
|
||||||
listCheckType = listCheckType.OrderBy(e => e.YEAR).ThenBy(e => e.MONTH);
|
listCheckType = listCheckType.OrderBy(e => e.YEAR).ThenBy(e => e.MONTH);
|
||||||
|
|
||||||
if (listSummery != null && listSummery.Any())
|
if (listSummery != null && listSummery.Any())
|
||||||
{
|
{
|
||||||
if (listMineType.Count > 1)
|
//if (listMineType.Count > 1)
|
||||||
{
|
//{
|
||||||
//PART 1 3 合并
|
//PART 1 3 合并
|
||||||
var temp = listSummery.ToList();
|
var temp = listSummery.ToList();
|
||||||
for (int i = 1; i < temp.Count; i++)
|
for (int i = 1; i < temp.Count; i++)
|
||||||
@ -275,16 +275,16 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.listSummary = temp;
|
result.listSummary = temp;
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
result.listSummary = listSummery.ToList();
|
// result.listSummary = listSummery.ToList();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
if (listCheckType != null && listCheckType.Any())
|
if (listCheckType != null && listCheckType.Any())
|
||||||
{
|
{
|
||||||
if (listMineType.Count > 0)
|
//if (listMineType.Count > 0)
|
||||||
{
|
//{
|
||||||
var Temp = listCheckType.ToList();
|
var Temp = listCheckType.ToList();
|
||||||
for (int i = 1; i < Temp.Count; i++)
|
for (int i = 1; i < Temp.Count; i++)
|
||||||
{
|
{
|
||||||
@ -312,11 +312,11 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.listCheckTypeYear = Temp;
|
result.listCheckTypeYear = Temp;
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
result.listCheckTypeYear = listCheckType.ToList();
|
// result.listCheckTypeYear = listCheckType.ToList();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
if (result.listCheckTypeYear == null)
|
if (result.listCheckTypeYear == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user