This commit is contained in:
2026-03-23 14:33:54 +08:00
parent 1454442fd8
commit 58f23e59d1
68 changed files with 5316 additions and 432 deletions
+140 -20
View File
@@ -43,6 +43,15 @@ namespace BLL
NewWaterConsumption = newtable.NewWaterConsumption,
HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
LargerClosedNum = newtable.LargerClosedNum,
LargerNotClosedNum = newtable.LargerNotClosedNum,
AwaitApprovalNum = newtable.AwaitApprovalNum,
PendingApprovalNum = newtable.PendingApprovalNum,
CompletedApprovalNum = newtable.CompletedApprovalNum,
SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum,
SuperPendingApprovalNum = newtable.SuperPendingApprovalNum,
SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum,
BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
BranchFullTimeNum = newtable.BranchFullTimeNum,
ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
@@ -182,6 +191,17 @@ namespace BLL
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
item.FinishedNum = dataHsse.FinishedNum;
item.ArgumentNum = dataHsse.ArgumentNum;
item.LargerClosedNum = dataHsse.LargerClosedNum;
item.LargerNotClosedNum = dataHsse.LargerNotClosedNum;
item.LargerRate = "";
item.AwaitApprovalNum = dataHsse.AwaitApprovalNum;
item.PendingApprovalNum = dataHsse.PendingApprovalNum;
item.CompletedApprovalNum = dataHsse.CompletedApprovalNum;
item.SuperAwaitApprovalNum = dataHsse.SuperAwaitApprovalNum;
item.SuperPendingApprovalNum = dataHsse.SuperPendingApprovalNum;
item.SuperCompletedApprovalNum = dataHsse.SuperCompletedApprovalNum;
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
@@ -492,6 +512,15 @@ namespace BLL
CertificateANum = projectData.Sum(x => x.CertificateANum),
CertificateBNum = projectData.Sum(x => x.CertificateBNum),
CertificateCNum = projectData.Sum(x => x.CertificateCNum),
LargerClosedNum = projectData.Sum(x => x.LargerClosedNum),
LargerNotClosedNum = projectData.Sum(x => x.LargerNotClosedNum),
AwaitApprovalNum = projectData.Sum(x => x.AwaitApprovalNum),
PendingApprovalNum = projectData.Sum(x => x.PendingApprovalNum),
CompletedApprovalNum = projectData.Sum(x => x.CompletedApprovalNum),
SuperAwaitApprovalNum = projectData.Sum(x => x.SuperAwaitApprovalNum),
SuperPendingApprovalNum = projectData.Sum(x => x.SuperPendingApprovalNum),
SuperCompletedApprovalNum = projectData.Sum(x => x.SuperCompletedApprovalNum),
SafetyCommitteeMeetingNum = GetSafetyCommitteeMeeting().Count,
EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(),
ProjectSafetyLeadingGroupMeetingNum = projectData.Sum(x => x.ProjectSafetyLeadingGroupMeetingNum),
@@ -668,7 +697,7 @@ namespace BLL
var newWaterConsumptionTask = ChemicalReportItemService.GetLatstTimeNewWaterConsumption();
var securityRiskOutputListTask = HSSEData_HSSEService.GetSecurityRiskOutputsAsync();
var largeEngineeringOutputsTask = HSSEData_HSSEService.GetLargeEngineeringOutputsAsync();
var largerHiddenRectificationOutputsTask = HSSEData_HSSEService.GetLargerHiddenRectificationOutputsAsync();
var safetyInjectionEngineerTask = HSSEData_HSSEService.GetSafetyInjectionEngineerAsync();
var certificateATask = HSSEData_HSSEService.GetCertificateAAsync();
var certificateBTask = HSSEData_HSSEService.GetCertificateBAsync();
@@ -742,6 +771,7 @@ namespace BLL
certificateATask,
certificateBTask,
certificateCTask,
largerHiddenRectificationOutputsTask,
qualityPersonNumTask,
beUnderConstructionTask,
shutdownTask,
@@ -810,6 +840,7 @@ namespace BLL
var certificateAList = await certificateATask;
var certificateBList = await certificateBTask;
var certificateCList = await certificateCTask;
var largerHiddenRectificationOutputsList = await largerHiddenRectificationOutputsTask;
var qualityPersonList = await qualityPersonNumTask;
var beUnderConstructionList = await beUnderConstructionTask;
var shutdownList = await shutdownTask;
@@ -890,6 +921,16 @@ namespace BLL
TotalWorkingHour = totalWorkingHour,
LostWorkingHour = lostWorkingHour,
SafeWorkingHour = safeWorkingHour,
LargerClosedNum = largerHiddenRectificationOutputsList.Sum(x => x.RecNum),
LargerNotClosedNum = largerHiddenRectificationOutputsList.Sum(x => x.NoRecNum),
AwaitApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.AwaitApprovalNum),
PendingApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.PendingApprovalNum),
CompletedApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.CompletedApprovalNum),
SuperAwaitApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperAwaitApprovalNum),
SuperPendingApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperPendingApprovalNum),
SuperCompletedApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedApprovalNum),
SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum),
SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum),
SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum),
@@ -978,6 +1019,12 @@ namespace BLL
g => g.Key,
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
);
var largerHiddenRectificationOutputsDict = largerHiddenRectificationOutputsList
.GroupBy(x => x.ProjectId)
.ToDictionary(
g => g.Key,
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
);
var majorHiddenRectificationOutputsDict = majorHiddenRectificationOutputsList
.GroupBy(x => x.ProjectId)
.ToDictionary(
@@ -1015,12 +1062,19 @@ namespace BLL
SuperOperativesNum = g.Sum(x => x.SuperOperativesNum),
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
SuperFinishedNum = g.Sum(x => x.SuperFinishedNum),
AwaitApprovalNum = g.Sum(x => x.AwaitApprovalNum),
PendingApprovalNum = g.Sum(x => x.PendingApprovalNum),
CompletedApprovalNum = g.Sum(x => x.CompletedApprovalNum),
SuperAwaitApprovalNum = g.Sum(x => x.SuperAwaitApprovalNum),
SuperPendingApprovalNum = g.Sum(x => x.SuperPendingApprovalNum),
SuperCompletedApprovalNum = g.Sum(x => x.SuperCompletedApprovalNum),
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
}
);
foreach (var projectid in BeUnderConstructionList)
{
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
largerHiddenRectificationOutputsDict.TryGetValue(projectid, out var largerHiddenRectificationOutputs);
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs);
@@ -1042,6 +1096,14 @@ namespace BLL
SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
HseTechnicalNum = hseTechnicalList.Count(x => x.ProjectId == projectid),
EnvironmentalTrainNum = 0,
LargerClosedNum = largerHiddenRectificationOutputs?.ClosedNum ?? 0,
LargerNotClosedNum = largerHiddenRectificationOutputs?.NotClosedNum ?? 0,
AwaitApprovalNum = largeEngineeringOutputs?.AwaitApprovalNum ?? 0,
PendingApprovalNum = largeEngineeringOutputs?.PendingApprovalNum ?? 0,
CompletedApprovalNum = largeEngineeringOutputs?.CompletedApprovalNum ?? 0,
SuperAwaitApprovalNum = largeEngineeringOutputs?.SuperAwaitApprovalNum ?? 0,
SuperPendingApprovalNum = largeEngineeringOutputs?.SuperPendingApprovalNum ?? 0,
SuperCompletedApprovalNum = largeEngineeringOutputs?.SuperCompletedApprovalNum ?? 0,
TotalEnergyConsumption = 0,
IncomeComprehensiveEnergyConsumption = 0,
NewWaterConsumption = 0,
@@ -1277,6 +1339,14 @@ namespace BLL
table.SafeWorkingHour = newtable.SafeWorkingHour;
table.SafeTrainNum = newtable.SafeTrainNum;
table.SpecialTrainNum = newtable.SpecialTrainNum;
table.LargerClosedNum = newtable.LargerClosedNum;
table.LargerNotClosedNum = newtable.LargerNotClosedNum;
table.AwaitApprovalNum = newtable.AwaitApprovalNum;
table.PendingApprovalNum = newtable.PendingApprovalNum;
table.CompletedApprovalNum = newtable.CompletedApprovalNum;
table.SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum;
table.SuperPendingApprovalNum = newtable.SuperPendingApprovalNum;
table.SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum;
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
table.HseTechnicalNum = newtable.HseTechnicalNum;
table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum;
@@ -3937,24 +4007,24 @@ namespace BLL
{
List<LicenseOutput> result = new List<LicenseOutput>();
var result1 = (from x in Funs.DB.View_License_LicenseManager
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsHighRisk == true &&
x.CompileDate > Const.DtmarkTime
select new Model.LicenseOutput
{
Id = x.LicenseManagerId,
ProjectId = x.ProjectId,
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
UnitId = x.UnitId,
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
LicenseTypeName = x.LicenseTypeName,
UnitTypeName = "",
IsHighRisk = x.IsHighRisk,
WorkAreaName = "",
CompileDate = x.CompileDate,
StartDate = x.StartDate,
EndDate = x.EndDate,
WorkStatesStr = ""
}).ToList();
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsHighRisk == true &&
x.CompileDate > Const.DtmarkTime
select new Model.LicenseOutput
{
Id = x.LicenseManagerId,
ProjectId = x.ProjectId,
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
UnitId = x.UnitId,
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
LicenseTypeName = x.LicenseTypeName,
UnitTypeName = "",
IsHighRisk = x.IsHighRisk,
WorkAreaName = "",
CompileDate = x.CompileDate,
StartDate = x.StartDate,
EndDate = x.EndDate,
WorkStatesStr = ""
}).ToList();
var result2 = (from x in Funs.DB.License_FireWork
where BeUnderConstructionList.Contains(x.ProjectId)
select new Model.LicenseOutput
@@ -4162,7 +4232,7 @@ namespace BLL
var query = (from x in Funs.DB.Base_Project
join y in Funs.DB.HSSE_Hazard_HazardRegister on x.ProjectId equals y.ProjectId into yGroup
from y in yGroup.DefaultIfEmpty()
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && (y.HazardValue == "0.3" || y.HazardValue == "1" || y.HazardValue == null) && y.CheckTime > Const.DtmarkTime
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && (y.HazardValue == "0.3" || y.HazardValue == null) && y.CheckTime > Const.DtmarkTime
group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
select new HiddenRectificationOutput
{
@@ -4188,6 +4258,42 @@ namespace BLL
return await Task.Run(GetGeneralHiddenRectificationOutputs);
}
/// <summary>
/// 获取较大隐患数据
/// </summary>
/// <returns></returns>
public static List<Model.HiddenRectificationOutput> GetLargerHiddenRectificationOutputs()
{
var query = (from x in Funs.DB.Base_Project
join y in Funs.DB.HSSE_Hazard_HazardRegister on x.ProjectId equals y.ProjectId into yGroup
from y in yGroup.DefaultIfEmpty()
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.HazardValue == "1" && y.CheckTime > Const.DtmarkTime
group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
select new HiddenRectificationOutput
{
ProjectId = gg.Key.ProjectId,
ProjectName = gg.Key.ProjectName,
ProjectCode = gg.Key.ProjectCode,
ProNum = gg.Count(y => y.States != "4" && y.States != "-1"),
RecNum = gg.Count(y => y.States == "3"),
NoRecNum = gg.Count(y => y.States != "3" && y.States != "4" && y.States != "-1"),
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
Math.Round(Convert.ToDecimal(gg.Count(y => y.States == "3") /
gg.Count(y => y.States != "4" && y.States != "-1") * 100), 2, MidpointRounding.AwayFromZero).ToString()
}).ToList();
foreach (var item in query)
{
item.RecRate = Math.Round(Convert.ToDecimal(item.RecRate), 2).ToString(); // 转换为字符串并格式化为两位小数
}
return query;
}
public static async Task<List<Model.HiddenRectificationOutput>> GetLargerHiddenRectificationOutputsAsync()
{
return await Task.Run(GetLargerHiddenRectificationOutputs);
}
/// <summary>
/// 获取重大隐患数据
/// </summary>
@@ -4285,6 +4391,12 @@ namespace BLL
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
OperativesNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.OperativesNum) ?? 0,
SuperOperativesNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.OperativesNum) ?? 0,
AwaitApprovalNum = gg.Count(x => x.ApprovalState == "0" && x.IsSuperLargerHazard == false),
PendingApprovalNum = gg.Count(x => x.ApprovalState == "1" && x.IsSuperLargerHazard == false),
CompletedApprovalNum = gg.Count(x => x.ApprovalState == "2" && x.IsSuperLargerHazard == false),
SuperAwaitApprovalNum = gg.Count(x => x.ApprovalState == "0" && x.IsSuperLargerHazard == true),
SuperPendingApprovalNum = gg.Count(x => x.ApprovalState == "1" && x.IsSuperLargerHazard == true),
SuperCompletedApprovalNum = gg.Count(x => x.ApprovalState == "2" && x.IsSuperLargerHazard == true),
}).ToList();
return query;
@@ -4531,6 +4643,14 @@ namespace BLL
x.SpecialTrainNum,
x.SpecialOperationTrainNum,
x.HseTechnicalNum,
x.LargerClosedNum,
x.LargerNotClosedNum,
x.AwaitApprovalNum,
x.PendingApprovalNum,
x.CompletedApprovalNum,
x.SuperAwaitApprovalNum,
x.SuperPendingApprovalNum,
x.SuperCompletedApprovalNum,
x.EnvironmentalTrainNum,
x.TotalEnergyConsumption,
x.IncomeComprehensiveEnergyConsumption,