This commit is contained in:
geh
2026-03-23 15:22:29 +08:00
parent 94584d242b
commit c38590add8
173 changed files with 19679 additions and 4413 deletions
@@ -119,7 +119,17 @@ namespace BLL
SuperArgumentNum = newtable.SuperArgumentNum,
State = newtable.State,
CreateDate = newtable.CreateDate,
CreateMan = newtable.CreateMan
CreateMan = newtable.CreateMan,
LargerClosedNum = newtable.LargerClosedNum,
LargerNotClosedNum = newtable.LargerNotClosedNum,
AwaitApprovalNum = newtable.AwaitApprovalNum,
PendingApprovalNum = newtable.PendingApprovalNum,
CompletedApprovalNum = newtable.CompletedApprovalNum,
SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum,
SuperPendingApprovalNum = newtable.SuperPendingApprovalNum,
SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum,
};
db.HSSEData_HSSE.InsertOnSubmit(table);
db.SubmitChanges();
@@ -247,6 +257,17 @@ namespace BLL
item.OperativesNum = dataHsse.OperativesNum;
item.UnitId = dataHsse.UnitId;
item.UseEquipmentNum = dataHsse.UseEquipmentNum;
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;
var hSseDataHiddens =
HSSEData_HiddenDangerDetailService.GetHSSEData_HiddenDangerDetailByDate(dataHsse.ReportDate);
if (hSseDataHiddens != null)
@@ -551,7 +572,16 @@ namespace BLL
SuperConstructionNum = projectData.Sum(x => x.SuperConstructionNum),
SuperFinishedNum = projectData.Sum(x => x.SuperFinishedNum),
CreateMan = Const.sysglyId,
CreateDate = DateTime.Now
CreateDate = DateTime.Now,
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),
};
return result;
}
@@ -639,6 +669,7 @@ namespace BLL
var licensesCloseTask = HSSEData_HSSEService.GetLicensesCloseAsync();
var generalHiddenRectificationOutputsTask = HSSEData_HSSEService.GetGeneralHiddenRectificationOutputsAsync();
var majorHiddenRectificationOutputsTask = HSSEData_HSSEService.GetMajorHiddenRectificationOutputsAsync();
var largerHiddenRectificationOutputsTask = HSSEData_HSSEService.GetLargerHiddenRectificationOutputsAsync();
// 等待所有异步方法执行完成
await Task.WhenAll(
@@ -703,7 +734,8 @@ namespace BLL
licensesTask,
licensesCloseTask,
generalHiddenRectificationOutputsTask,
majorHiddenRectificationOutputsTask
majorHiddenRectificationOutputsTask,
largerHiddenRectificationOutputsTask
);
@@ -774,6 +806,7 @@ namespace BLL
var licensesCloseList = await licensesCloseTask;
var generalHiddenRectificationOutputsList = await generalHiddenRectificationOutputsTask;
var majorHiddenRectificationOutputsList = await majorHiddenRectificationOutputsTask;
var largerHiddenRectificationOutputsList = await largerHiddenRectificationOutputsTask;
// 构造结果对象
var table = new HSSEData_HSSE
@@ -870,7 +903,17 @@ namespace BLL
SuperOperativesNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperOperativesNum),
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum),
SuperFinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperFinishedNum),
SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum)
SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum),
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),
};
#region
@@ -883,6 +926,13 @@ 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(
@@ -920,11 +970,20 @@ namespace BLL
SuperOperativesNum = g.Sum(x => x.SuperOperativesNum),
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
SuperFinishedNum = g.Sum(x => x.SuperFinishedNum),
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum),
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),
}
);
foreach (var projectid in BeUnderConstructionList)
{
largerHiddenRectificationOutputsDict.TryGetValue(projectid, out var largerHiddenRectificationOutputs);
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
@@ -1021,7 +1080,17 @@ namespace BLL
SuperOperativesNum = largeEngineeringOutputs?.SuperOperativesNum ?? 0,
SuperConstructionNum = largeEngineeringOutputs?.SuperConstructionNum ?? 0,
SuperFinishedNum=largeEngineeringOutputs?.SuperFinishedNum ?? 0,
SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 0
SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 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,
};
Project_HSSEData_HSSEService.AddProject_HSSEData_HSSE(projectHsseData);
}
@@ -1148,6 +1217,16 @@ namespace BLL
table.State = newtable.State;
table.CreateMan = newtable.CreateMan;
table.CreateDate = newtable.CreateDate;
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;
db.SubmitChanges();
}
}
@@ -4086,6 +4165,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;
}
@@ -4337,7 +4422,17 @@ namespace BLL
x.SuperArgumentNum,
x.State,
x.CreateDate,
x.CreateMan
x.CreateMan,
x.LargerClosedNum,
x.LargerNotClosedNum,
x.AwaitApprovalNum,
x.PendingApprovalNum,
x.CompletedApprovalNum,
x.SuperAwaitApprovalNum,
x.SuperPendingApprovalNum,
x.SuperCompletedApprovalNum,
};
}
@@ -203,7 +203,17 @@ namespace BLL
SuperOperativesNum = newtable.SuperOperativesNum,
SuperConstructionNum = newtable.SuperConstructionNum,
SuperFinishedNum = newtable.SuperFinishedNum,
SuperArgumentNum = newtable.SuperArgumentNum
SuperArgumentNum = newtable.SuperArgumentNum,
LargerClosedNum = newtable.LargerClosedNum,
LargerNotClosedNum = newtable.LargerNotClosedNum,
AwaitApprovalNum = newtable.AwaitApprovalNum,
PendingApprovalNum = newtable.PendingApprovalNum,
CompletedApprovalNum = newtable.CompletedApprovalNum,
SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum,
SuperPendingApprovalNum = newtable.SuperPendingApprovalNum,
SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum,
};
db.Project_HSSEData_HSSE.InsertOnSubmit(table);
db.SubmitChanges();
@@ -341,6 +351,18 @@ namespace BLL
table.SuperOperativesNum = newtable.SuperOperativesNum;
table.SuperConstructionNum = newtable.SuperConstructionNum;
table.SuperFinishedNum = newtable.SuperFinishedNum;
table.LargerClosedNum = newtable.LargerClosedNum;
table.LargerNotClosedNum = newtable.LargerNotClosedNum;
table.ArgumentNum = newtable.ArgumentNum;
table.SuperArgumentNum = newtable.SuperArgumentNum;
table.AwaitApprovalNum = newtable.AwaitApprovalNum;
table.PendingApprovalNum = newtable.PendingApprovalNum;
table.CompletedApprovalNum = newtable.CompletedApprovalNum;
table.SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum;
table.SuperPendingApprovalNum = newtable.SuperPendingApprovalNum;
table.SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum;
db.SubmitChanges();
}
}
@@ -551,6 +573,9 @@ namespace BLL
table.GeneralNotClosedNum = GetGeneralNotClosedNum(projectid);
table.MajorClosedNum = GetMajorClosedNum(projectid);
table.MajorNotClosedNum = GetMajorNotClosedNum(projectid);
table.LargerClosedNum = GetLargerClosedNum(projectid);
table.LargerNotClosedNum = GetLargerNotClosedNum(projectid);
}
if (hSseDateType == HSSEDateType.SecurityRisk || hSseDateType == HSSEDateType.All)
@@ -615,6 +640,15 @@ namespace BLL
table.SuperOperativesNum = GetSuperOperativesNum(projectid);
table.SuperConstructionNum = GetSuperConstructionNum(projectid);
table.SuperFinishedNum = GetSuperFinishedNum(projectid);
table.ArgumentNum = GetArgumentNum(projectid);
table.SuperArgumentNum = GetSuperArgumentNum(projectid);
table.AwaitApprovalNum = GetAwaitApprovalNum(projectid);
table.PendingApprovalNum = GetPendingApprovalNum(projectid);
table.CompletedApprovalNum = GetCompletedApprovalNum(projectid);
table.SuperAwaitApprovalNum = GetSuperAwaitApprovalNum(projectid);
table.SuperPendingApprovalNum = GetSuperPendingApprovalNum(projectid);
table.SuperCompletedApprovalNum = GetSuperCompletedApprovalNum(projectid);
}
if (IsReportByToday(projectid))
@@ -1401,6 +1435,33 @@ namespace BLL
select x).Count();
return result;
}
/// <summary>
/// 获取较大隐患整改闭环项
/// </summary>
/// <returns></returns>
public static int GetLargerClosedNum(string projectid)
{
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.Risk_Level == "较大" && x.States == "3" &&
x.CheckTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取较大隐患未整改完成项
/// </summary>
/// <returns></returns>
public static int GetLargerNotClosedNum(string projectid)
{
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.Risk_Level == "较大" && x.States != "3" && x.States != "-1" &&
x.CheckTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取重大隐患整改闭环项
@@ -1541,6 +1602,105 @@ namespace BLL
select x).Count();
return result;
}
/// <summary>
/// 获取危大工程论证个数
/// </summary>
/// <returns></returns>
public static int GetArgumentNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.IsArgument == true && x.IsSuperLargerHazard == false &&
x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取超危大工程论证个数
/// </summary>
/// <returns></returns>
public static int GetSuperArgumentNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.IsArgument == true && x.IsSuperLargerHazard == true &&
x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取危大工程待审核个数
/// </summary>
/// <returns></returns>
public static int GetAwaitApprovalNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.ApprovalState == "0" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取超危大工程待审核个数
/// </summary>
/// <returns></returns>
public static int GetSuperAwaitApprovalNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.ApprovalState == "0" && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取危大工程审核中个数
/// </summary>
/// <returns></returns>
public static int GetPendingApprovalNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.ApprovalState == "1" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取超危大工程审核中个数
/// </summary>
/// <returns></returns>
public static int GetSuperPendingApprovalNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.ApprovalState == "1" && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取危大工程已完成个数
/// </summary>
/// <returns></returns>
public static int GetCompletedApprovalNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.ApprovalState == "2" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取超危大工程已完成个数
/// </summary>
/// <returns></returns>
public static int GetSuperCompletedApprovalNum(string projectid)
{
var result = (from x in Funs.DB.Solution_LargerHazard
where x.ProjectId == projectid && x.ApprovalState == "2" && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
/// 获取超危大工程审批完成数
@@ -1725,7 +1885,19 @@ namespace BLL
x.SuperTrainPersonNum,
x.SuperOperativesNum,
x.SuperConstructionNum,
x.SuperFinishedNum
x.SuperFinishedNum,
x.LargerClosedNum,
x.LargerNotClosedNum,
x.ArgumentNum,
x.SuperArgumentNum,
x.AwaitApprovalNum,
x.PendingApprovalNum,
x.CompletedApprovalNum,
x.SuperAwaitApprovalNum,
x.SuperPendingApprovalNum,
x.SuperCompletedApprovalNum,
};
}