新增:安全技术数据
This commit is contained in:
@@ -2968,10 +2968,10 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一般事故数
|
||||
/// 按事故等级获取在施项目事故列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetGeneralAccident()
|
||||
/// <param name="accidentDegree">事故等级(1一般 2较大 3重大 4特别重大)</param>
|
||||
private static List<Model.AccidentOutput> GetAccidentByDegree(string accidentDegree)
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
@@ -2980,7 +2980,7 @@ namespace BLL
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "1"
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == accidentDegree
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
@@ -2995,10 +2995,15 @@ namespace BLL
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
/// <summary>
|
||||
/// 获取一般事故数
|
||||
/// </summary>
|
||||
public static List<Model.AccidentOutput> GetGeneralAccident()
|
||||
{
|
||||
return GetAccidentByDegree("1");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetGeneralAccidentAsync()
|
||||
@@ -3009,33 +3014,9 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 获取较大事故数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetMajorAccident()
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
from AccidentType in AccidentTypeGroup.DefaultIfEmpty()
|
||||
join Project in Funs.DB.Base_Project on Record.ProjectId equals Project.ProjectId into ProjectGroup
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "2"
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
ProjectId = Record.ProjectId,
|
||||
ProjectCode = Project.ProjectCode,
|
||||
ProjectName = Project.ProjectName,
|
||||
AccidentTypeName = AccidentType.ConstText,
|
||||
AccidentDate = Record.AccidentDate,
|
||||
UnitId = Unit.UnitId,
|
||||
UnitName = Unit.UnitName,
|
||||
PeopleNum = Record.PeopleNum,
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return result;
|
||||
return GetAccidentByDegree("2");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetMajorAccidentAsync()
|
||||
@@ -3046,69 +3027,22 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 获取重大事故数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetSeriousAccident()
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
from AccidentType in AccidentTypeGroup.DefaultIfEmpty()
|
||||
join Project in Funs.DB.Base_Project on Record.ProjectId equals Project.ProjectId into ProjectGroup
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "3"
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
ProjectId = Record.ProjectId,
|
||||
ProjectCode = Project.ProjectCode,
|
||||
ProjectName = Project.ProjectName,
|
||||
AccidentTypeName = AccidentType.ConstText,
|
||||
AccidentDate = Record.AccidentDate,
|
||||
UnitId = Unit.UnitId,
|
||||
UnitName = Unit.UnitName,
|
||||
PeopleNum = Record.PeopleNum,
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return result;
|
||||
return GetAccidentByDegree("3");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetSeriousAccidentAsync()
|
||||
{
|
||||
return await Task.Run(GetSeriousAccident);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取特别重大事故数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetSpecialSeriousAccident()
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
from AccidentType in AccidentTypeGroup.DefaultIfEmpty()
|
||||
join Project in Funs.DB.Base_Project on Record.ProjectId equals Project.ProjectId into ProjectGroup
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "4"
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
ProjectId = Record.ProjectId,
|
||||
ProjectCode = Project.ProjectCode,
|
||||
ProjectName = Project.ProjectName,
|
||||
AccidentTypeName = AccidentType.ConstText,
|
||||
AccidentDate = Record.AccidentDate,
|
||||
UnitId = Unit.UnitId,
|
||||
UnitName = Unit.UnitName,
|
||||
PeopleNum = Record.PeopleNum,
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return result;
|
||||
return GetAccidentByDegree("4");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetSpecialSeriousAccidentAsync()
|
||||
|
||||
Reference in New Issue
Block a user