集团大屏数据
This commit is contained in:
@@ -9,7 +9,7 @@ using System.Web.UI.WebControls;
|
||||
using Aspose.Words.Lists;
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace BLL
|
||||
{
|
||||
public static SGGLDB Db = Funs.DB;
|
||||
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Where(x=> (x.ProjectAttribute == "GONGCHENG" || x.ProjectAttribute == null)).Select(x => x.ProjectId).ToList();
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Where(x => (x.ProjectAttribute == "GONGCHENG" || x.ProjectAttribute == null)).Select(x => x.ProjectId).ToList();
|
||||
|
||||
public static void AddHSSEData_HSSE(HSSEData_HSSE newtable)
|
||||
{
|
||||
@@ -40,6 +40,7 @@ namespace BLL
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
HseTechnicalNum = newtable.HseTechnicalNum,
|
||||
EnvironmentalTrainNum = newtable.EnvironmentalTrainNum,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
@@ -75,10 +76,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
||||
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
||||
CompanyDrillNum = newtable.CompanyDrillNum,
|
||||
CompanyDrillPersonNum = newtable.CompanyDrillPersonNum,
|
||||
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
||||
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
||||
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
||||
ProjectDrillNum = newtable.ProjectDrillNum,
|
||||
ProjectDrillPersonNum = newtable.ProjectDrillPersonNum,
|
||||
CostExtract = newtable.CostExtract,
|
||||
CostUse = newtable.CostUse,
|
||||
UseEquipmentNum = newtable.UseEquipmentNum,
|
||||
@@ -97,10 +100,12 @@ namespace BLL
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
ConstructionNum = newtable.ConstructionNum,
|
||||
FinishedNum = newtable.FinishedNum,
|
||||
ArgumentNum = newtable.ArgumentNum,
|
||||
SuperCompletedNum = newtable.SuperCompletedNum,
|
||||
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
||||
SuperConstructionNum = newtable.SuperConstructionNum,
|
||||
SuperFinishedNum = newtable.SuperFinishedNum,
|
||||
SuperArgumentNum = newtable.SuperArgumentNum,
|
||||
State = newtable.State,
|
||||
CreateDate = newtable.CreateDate,
|
||||
CreateMan = newtable.CreateMan
|
||||
@@ -148,6 +153,7 @@ namespace BLL
|
||||
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
||||
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
||||
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
||||
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
||||
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
||||
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
||||
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
||||
@@ -158,6 +164,7 @@ namespace BLL
|
||||
item.CostUse = dataHsse.CostUse;
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -183,6 +190,7 @@ namespace BLL
|
||||
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
||||
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
||||
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
||||
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
||||
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
||||
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
||||
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
||||
@@ -203,6 +211,7 @@ namespace BLL
|
||||
item.ShutdownNum = dataHsse.ShutdownNum;
|
||||
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
||||
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
||||
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
||||
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
||||
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
||||
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
||||
@@ -210,6 +219,7 @@ namespace BLL
|
||||
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
||||
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
||||
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
||||
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
||||
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
||||
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
||||
item.TrainPersonNum = dataHsse.TrainPersonNum;
|
||||
@@ -253,6 +263,7 @@ namespace BLL
|
||||
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
||||
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
||||
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
||||
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
||||
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
||||
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
||||
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
||||
@@ -263,6 +274,7 @@ namespace BLL
|
||||
item.CostUse = dataHsse.CostUse;
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -288,6 +300,7 @@ namespace BLL
|
||||
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
||||
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
||||
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
||||
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
||||
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
||||
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
||||
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
||||
@@ -308,12 +321,14 @@ namespace BLL
|
||||
item.ShutdownNum = dataHsse.ShutdownNum;
|
||||
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
||||
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
||||
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
||||
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
||||
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
||||
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
||||
item.SuperCompletedNum = dataHsse.SuperCompletedNum;
|
||||
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
||||
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
||||
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
||||
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
||||
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
||||
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
||||
@@ -341,13 +356,13 @@ namespace BLL
|
||||
}
|
||||
|
||||
public static async Task<HSSEData> GetTodayHSSEData_HSSE()
|
||||
{
|
||||
var modelTask= StatisticalDataAsync();
|
||||
var model=await modelTask;
|
||||
{
|
||||
var modelTask = StatisticalDataAsync();
|
||||
var model = await modelTask;
|
||||
HSSEData data = model;
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static HSSEData_HSSE GetTodayData()
|
||||
{
|
||||
var q = (from x in Funs.DB.HSSEData_HSSE
|
||||
@@ -602,7 +617,7 @@ namespace BLL
|
||||
|
||||
var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<HSSEData> StatisticalDataAsync()
|
||||
{
|
||||
@@ -633,6 +648,7 @@ namespace BLL
|
||||
var safeTrainTask = HSSEData_HSSEService.GetSafeTrainAsync();
|
||||
var specialTrainTask = HSSEData_HSSEService.GetSpecialTrainAsync();
|
||||
var specialOperationTrainTask = HSSEData_HSSEService.GetSpecialOperationTrainAsync();
|
||||
var hseTechnicalNumTask = HSSEData_HSSEService.GetHseTechnicalNumAsync();
|
||||
var headOfficeInspectorGeneralTask = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralAsync();
|
||||
var headOfficeFullTimeTask = HSSEData_HSSEService.GetHeadOfficeFullTimeAsync();
|
||||
var branchInspectorGeneralTask = HSSEData_HSSEService.GetBranchInspectorGeneralAsync();
|
||||
@@ -690,7 +706,7 @@ namespace BLL
|
||||
safeWorkingHourTask,
|
||||
safeTrainTask,
|
||||
specialTrainTask,
|
||||
specialOperationTrainTask,
|
||||
specialOperationTrainTask, hseTechnicalNumTask,
|
||||
headOfficeInspectorGeneralTask,
|
||||
headOfficeFullTimeTask,
|
||||
branchInspectorGeneralTask,
|
||||
@@ -751,6 +767,7 @@ namespace BLL
|
||||
var safeTrainList = await safeTrainTask;
|
||||
var specialTrainList = await specialTrainTask;
|
||||
var specialOperationTrainList = await specialOperationTrainTask;
|
||||
var hseTechnicalNum = await hseTechnicalNumTask;
|
||||
var headOfficeInspectorGeneralList = await headOfficeInspectorGeneralTask;
|
||||
var headOfficeFullTimeList = await headOfficeFullTimeTask;
|
||||
var branchInspectorGeneralList = await branchInspectorGeneralTask;
|
||||
@@ -812,6 +829,7 @@ namespace BLL
|
||||
SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalNum,
|
||||
EnvironmentalTrainNum = 0,
|
||||
TotalEnergyConsumption = totalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption,
|
||||
@@ -843,10 +861,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = companySpecialPlanList.Count(),
|
||||
CompanyOnSiteDisposalPlan = companyOnSiteDisposalPlanList.Count(),
|
||||
CompanyDrillNum = companyDrillList.Count(),
|
||||
CompanyDrillPersonNum = companyDrillList.Sum(x => x.JointPersonNum),
|
||||
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(),
|
||||
ProjectSpecialPlanNum = projectSpecialPlanList.Count(),
|
||||
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(),
|
||||
ProjectDrillNum = projectDrillList.Count(),
|
||||
ProjectDrillPersonNum = projectDrillList.Sum(x => x.JointPersonNum),
|
||||
CostExtract = Convert.ToInt32(costExtract.Sum(x => x.SUMCost)),
|
||||
CostUse = Convert.ToInt32(costUseList.Sum(x => x.SUMCost)),
|
||||
UseEquipmentNum = useEquipmentList.Count(),
|
||||
@@ -865,16 +885,67 @@ namespace BLL
|
||||
TrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.ConstructionNum),
|
||||
FinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.FinishedNum),
|
||||
ArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.ArgumentNum),
|
||||
SuperCompletedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum)
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum),
|
||||
SuperFinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperFinishedNum),
|
||||
SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum)
|
||||
};
|
||||
|
||||
#region 添加项目统计数据
|
||||
|
||||
Project_HSSEData_HSSEService.DeleteProject_HSSEData_HSSEByDate(DateTime.Now.Date);
|
||||
|
||||
var generalHiddenRectificationOutputsDict = generalHiddenRectificationOutputsList
|
||||
.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(
|
||||
g => g.Key,
|
||||
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
|
||||
);
|
||||
var securityRiskOutputList = securityRiskOutputListTask.Result;
|
||||
var securityRiskOutputDict = securityRiskOutputList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new
|
||||
{
|
||||
LowRiskNum = g.Sum(x => x.LowRiskNum),
|
||||
GeneralRiskNum = g.Sum(x => x.GeneralRiskNum),
|
||||
MediumRiskNum = g.Sum(x => x.MediumRiskNum),
|
||||
HighRiskNum = g.Sum(x => x.HighRiskNum)
|
||||
}
|
||||
);
|
||||
var largeEngineeringOutputList = largeEngineeringOutputsTask.Result;
|
||||
var largeEngineeringOutputsDict = largeEngineeringOutputList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new
|
||||
{
|
||||
CompletedNum = g.Sum(x => x.CompletedNum),
|
||||
TrainPersonNum = g.Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = g.Sum(x => x.ConstructionNum),
|
||||
FinishedNum = g.Sum(x => x.FinishedNum),
|
||||
ArgumentNum = g.Sum(x => x.ArgumentNum),
|
||||
SuperCompletedNum = g.Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = g.Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
|
||||
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
|
||||
}
|
||||
);
|
||||
foreach (var projectid in BeUnderConstructionList)
|
||||
{
|
||||
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
|
||||
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
|
||||
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
|
||||
largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs);
|
||||
var projectHsseData = new Project_HSSEData_HSSE
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
@@ -891,12 +962,13 @@ namespace BLL
|
||||
SafeTrainNum = safeTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalNum,
|
||||
EnvironmentalTrainNum = 0,
|
||||
TotalEnergyConsumption = 0,
|
||||
IncomeComprehensiveEnergyConsumption = 0,
|
||||
NewWaterConsumption = 0,
|
||||
HeadOfficeInspectorGeneralNum = 0,
|
||||
HeadOfficeFullTimeNum =0,
|
||||
HeadOfficeFullTimeNum = 0,
|
||||
BranchInspectorGeneralNum = 0,
|
||||
BranchFullTimeNum = 0,
|
||||
SafetyInjectionEngineer = safetyInjectionEngineerList.Count(x => x.ProjectId == projectid),
|
||||
@@ -923,33 +995,37 @@ namespace BLL
|
||||
SpecialSeriousAccidentNum = specialSeriousAccidentList.Count(x => x.ProjectId == projectid),
|
||||
CompanyComprehensivePlanNum = 0,
|
||||
CompanySpecialPlanNum = 0,
|
||||
CompanyOnSiteDisposalPlan =0,
|
||||
CompanyOnSiteDisposalPlan = 0,
|
||||
CompanyDrillNum = 0,
|
||||
CompanyDrillPersonNum = 0,
|
||||
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectSpecialPlanNum = projectSpecialPlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectDrillNum = projectDrillList.Count(x => x.ProjectId == projectid),
|
||||
ProjectDrillPersonNum = projectDrillList.Where(x => x.ProjectId == projectid).Sum(x => x.JointPersonNum),
|
||||
CostExtract = Convert.ToInt32(costExtract.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)),
|
||||
CostUse = Convert.ToInt32(costUseList.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)),
|
||||
UseEquipmentNum = useEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
SpecialEquipmentNum = specialEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
LicensesNum = licensesList.Count(x => x.ProjectId == projectid),
|
||||
LicensesCloseNum = licensesCloseList.Count(x => x.ProjectId == projectid),
|
||||
GeneralClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum),
|
||||
GeneralNotClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum),
|
||||
MajorClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum),
|
||||
MajorNotClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum),
|
||||
LowRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.LowRiskNum),
|
||||
GeneralRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.GeneralRiskNum),
|
||||
MediumRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.MediumRiskNum),
|
||||
HighRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.HighRiskNum),
|
||||
CompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.CompletedNum),
|
||||
TrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.ConstructionNum),
|
||||
FinishedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.FinishedNum),
|
||||
SuperCompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperConstructionNum)
|
||||
GeneralClosedNum = generalHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
GeneralNotClosedNum = generalHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
MajorClosedNum = majorHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
MajorNotClosedNum = majorHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
LowRiskNum = securityRiskOutputs?.LowRiskNum ?? 0,
|
||||
GeneralRiskNum = securityRiskOutputs?.GeneralRiskNum ?? 0,
|
||||
MediumRiskNum = securityRiskOutputs?.MediumRiskNum ?? 0,
|
||||
HighRiskNum = securityRiskOutputs?.HighRiskNum ?? 0,
|
||||
CompletedNum = largeEngineeringOutputs?.CompletedNum ?? 0,
|
||||
TrainPersonNum = largeEngineeringOutputs?.TrainPersonNum ?? 0,
|
||||
ConstructionNum = largeEngineeringOutputs?.ConstructionNum ?? 0,
|
||||
FinishedNum = largeEngineeringOutputs?.FinishedNum ?? 0,
|
||||
ArgumentNum = largeEngineeringOutputs?.ArgumentNum ?? 0,
|
||||
SuperCompletedNum = largeEngineeringOutputs?.SuperCompletedNum ?? 0,
|
||||
SuperTrainPersonNum = largeEngineeringOutputs?.SuperTrainPersonNum ?? 0,
|
||||
SuperConstructionNum = largeEngineeringOutputs?.SuperConstructionNum ?? 0,
|
||||
SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 0
|
||||
};
|
||||
Project_HSSEData_HSSEService.AddProject_HSSEData_HSSE(projectHsseData);
|
||||
}
|
||||
@@ -1109,6 +1185,7 @@ namespace BLL
|
||||
table.SafeTrainNum = newtable.SafeTrainNum;
|
||||
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
||||
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
||||
table.HseTechnicalNum = newtable.HseTechnicalNum;
|
||||
table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum;
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
@@ -1144,10 +1221,12 @@ namespace BLL
|
||||
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
|
||||
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
|
||||
table.CompanyDrillNum = newtable.CompanyDrillNum;
|
||||
table.CompanyDrillPersonNum = newtable.CompanyDrillPersonNum;
|
||||
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
|
||||
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
|
||||
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
|
||||
table.ProjectDrillNum = newtable.ProjectDrillNum;
|
||||
table.ProjectDrillPersonNum = newtable.ProjectDrillPersonNum;
|
||||
table.CostExtract = newtable.CostExtract;
|
||||
table.CostUse = newtable.CostUse;
|
||||
table.UseEquipmentNum = newtable.UseEquipmentNum;
|
||||
@@ -1166,10 +1245,12 @@ namespace BLL
|
||||
table.TrainPersonNum = newtable.TrainPersonNum;
|
||||
table.ConstructionNum = newtable.ConstructionNum;
|
||||
table.FinishedNum = newtable.FinishedNum;
|
||||
table.ArgumentNum = newtable.ArgumentNum;
|
||||
table.SuperCompletedNum = newtable.SuperCompletedNum;
|
||||
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
|
||||
table.SuperConstructionNum = newtable.SuperConstructionNum;
|
||||
table.SuperFinishedNum = newtable.SuperFinishedNum;
|
||||
table.SuperArgumentNum = newtable.SuperArgumentNum;
|
||||
table.State = newtable.State;
|
||||
table.CreateMan = newtable.CreateMan;
|
||||
table.CreateDate = newtable.CreateDate;
|
||||
@@ -1217,10 +1298,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetHeadOfficeInspectorGeneralAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetHeadOfficeInspectorGeneral);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取企业总部专职人数
|
||||
@@ -1258,7 +1339,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetHeadOfficeFullTimeAsync()
|
||||
{
|
||||
return await Task.Run(GetHeadOfficeFullTime);
|
||||
return await Task.Run(GetHeadOfficeFullTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1297,7 +1378,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetBranchFullTimeAsync()
|
||||
{
|
||||
|
||||
|
||||
return await Task.Run(GetBranchFullTime);
|
||||
}
|
||||
|
||||
@@ -1336,7 +1417,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetBranchInspectorGeneralAsync()
|
||||
{
|
||||
|
||||
|
||||
return await Task.Run(GetBranchInspectorGeneral);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -1376,7 +1457,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectInspectorGeneralAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetProjectInspectorGeneral);
|
||||
}
|
||||
|
||||
@@ -1434,7 +1515,7 @@ namespace BLL
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
join post in Funs.DB.Base_WorkPost on x.WorkPostId equals post.WorkPostId into postGroup
|
||||
from post in postGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
select new Model.OfSafetySupervisorsOutput
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
@@ -1460,7 +1541,7 @@ namespace BLL
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectSafetyMonitorAsync()
|
||||
{
|
||||
return await Task.Run(GetProjectSafetyMonitor);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1525,7 +1606,7 @@ namespace BLL
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetSafetyInjectionEngineerAsync()
|
||||
{
|
||||
return await Task.Run(GetSafetyInjectionEngineer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1585,7 +1666,7 @@ namespace BLL
|
||||
/// 获取A证人员(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateAAsync()
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateAAsync()
|
||||
{
|
||||
return await Task.Run(GetCertificateA);
|
||||
}
|
||||
@@ -1650,7 +1731,7 @@ namespace BLL
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateBAsync()
|
||||
{
|
||||
return await Task.Run(GetCertificateB);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1711,7 +1792,7 @@ namespace BLL
|
||||
/// 获取C证人员(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateCAsync()
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateCAsync()
|
||||
{
|
||||
return await Task.Run(GetCertificateC);
|
||||
}
|
||||
@@ -1722,29 +1803,29 @@ namespace BLL
|
||||
/// 获取企业安委会会数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<MeetingOutput> GetSafetyCommitteeMeeting()
|
||||
public static List<MeetingOutput> GetSafetyCommitteeMeeting()
|
||||
{
|
||||
var result =
|
||||
(from x in Funs.DB.Meeting_CompanySafetyMeeting
|
||||
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
where x.CompileDate > Const.DtmarkTime
|
||||
select new MeetingOutput()
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = u.UnitName,
|
||||
Id = x.CompanySafetyMeetingId,
|
||||
MeetingName = x.CompanySafetyMeetingName,
|
||||
MeetingDate = x.CompanySafetyMeetingDate,
|
||||
MeetingHours = x.MeetingHours,
|
||||
HostMan = x.MeetingHostMan,
|
||||
AttentPerson = x.AttentPerson,
|
||||
AttentPersonNum = x.AttentPersonNum,
|
||||
});
|
||||
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
where x.CompileDate > Const.DtmarkTime
|
||||
select new MeetingOutput()
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = u.UnitName,
|
||||
Id = x.CompanySafetyMeetingId,
|
||||
MeetingName = x.CompanySafetyMeetingName,
|
||||
MeetingDate = x.CompanySafetyMeetingDate,
|
||||
MeetingHours = x.MeetingHours,
|
||||
HostMan = x.MeetingHostMan,
|
||||
AttentPerson = x.AttentPerson,
|
||||
AttentPersonNum = x.AttentPersonNum,
|
||||
});
|
||||
return result.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -1775,7 +1856,7 @@ namespace BLL
|
||||
public static List<MeetingOutput> GetEnterpriseTopicsMeeting()
|
||||
{
|
||||
var result =
|
||||
(from x in Funs.DB.Meeting_CompanySpecialMeeting
|
||||
(from x in Funs.DB.Meeting_CompanySpecialMeeting
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
where x.CompileDate > Const.DtmarkTime
|
||||
@@ -1798,7 +1879,7 @@ namespace BLL
|
||||
/// 获取企业专题会议(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<MeetingOutput>> GetEnterpriseTopicsMeetingAsync()
|
||||
public static async Task<List<MeetingOutput>> GetEnterpriseTopicsMeetingAsync()
|
||||
{
|
||||
return await Task.Run(GetEnterpriseTopicsMeeting);
|
||||
}
|
||||
@@ -1904,7 +1985,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<MeetingOutput>> GetProjectSafetyLeadingGroupMeetingAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetProjectSafetyLeadingGroupMeeting);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -2133,7 +2214,7 @@ namespace BLL
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join u in Funs.DB.Base_Unit on x.ResponsibleUnit equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
join user in Funs.DB.Sys_User on x.CheckManId equals user.UserId into userGroup
|
||||
join user in Funs.DB.Sys_User on x.CheckManId equals user.UserId into userGroup
|
||||
from user in userGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId) && x.CheckTime > Const.DtmarkTime
|
||||
select new Model.CheckOutput()
|
||||
@@ -2566,7 +2647,7 @@ namespace BLL
|
||||
from projectType in projectTypeJoin.DefaultIfEmpty()
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState2, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false)
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false)
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
@@ -2703,7 +2784,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> GetLostWorkingHourAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetLostWorkingHour);
|
||||
}
|
||||
|
||||
@@ -2855,6 +2936,29 @@ namespace BLL
|
||||
return await Task.Run(GetSpecialOperationTrain);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取安全技术交底数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHseTechnicalNum()
|
||||
{
|
||||
var list = (from x in Funs.DB.License_HSETechnical
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
select x).Distinct().ToList();
|
||||
var result = list.ToList().Count();
|
||||
return result;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取安全技术交底数(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> GetHseTechnicalNumAsync()
|
||||
{
|
||||
return await Task.Run(GetHseTechnicalNum);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -3127,22 +3231,22 @@ namespace BLL
|
||||
public static List<Model.CostSmallDetailOutput> GetCostExtract()
|
||||
{
|
||||
var query = from cost in Funs.DB.CostGoods_CostSmallDetail
|
||||
join p in Funs.DB.Base_Project on cost.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join unit in Funs.DB.Base_Unit on cost.UnitId equals unit.UnitId into unitGroup
|
||||
from unit in unitGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
select new CostSmallDetailOutput
|
||||
{
|
||||
Id = cost.CostSmallDetailId,
|
||||
ProjectId = p.ProjectId,
|
||||
ProjectCode = p.ProjectCode,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = cost.UnitId,
|
||||
UnitName = unit.UnitName,
|
||||
Months = cost.Months,
|
||||
SUMCost = cost.Extract//Math.Round(sumCost, 2)
|
||||
};
|
||||
join p in Funs.DB.Base_Project on cost.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join unit in Funs.DB.Base_Unit on cost.UnitId equals unit.UnitId into unitGroup
|
||||
from unit in unitGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
select new CostSmallDetailOutput
|
||||
{
|
||||
Id = cost.CostSmallDetailId,
|
||||
ProjectId = p.ProjectId,
|
||||
ProjectCode = p.ProjectCode,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = cost.UnitId,
|
||||
UnitName = unit.UnitName,
|
||||
Months = cost.Months,
|
||||
SUMCost = cost.Extract//Math.Round(sumCost, 2)
|
||||
};
|
||||
return query.ToList();
|
||||
}
|
||||
public static async Task<List<Model.CostSmallDetailOutput>> GetCostExtractAsync()
|
||||
@@ -3304,7 +3408,7 @@ namespace BLL
|
||||
return query.ToList();
|
||||
}
|
||||
public static async Task<List<Model.ConstructionEquipmentOutput>> GetSpecialEquipmentAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetSpecialEquipment);
|
||||
}
|
||||
|
||||
@@ -3342,7 +3446,7 @@ namespace BLL
|
||||
}
|
||||
public static async Task<List<LicenseOutput>> GetLicensesAsync()
|
||||
{
|
||||
|
||||
|
||||
return await Task.Run(GetLicenses);
|
||||
}
|
||||
|
||||
@@ -3399,17 +3503,17 @@ namespace BLL
|
||||
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 != "-1"),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
|
||||
Math.Round(Convert.ToDecimal( gg.Count(y => y.States == "3") /
|
||||
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 != "-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(); // 转换为字符串并格式化为两位小数
|
||||
item.RecRate = Math.Round(Convert.ToDecimal(item.RecRate), 2).ToString(); // 转换为字符串并格式化为两位小数
|
||||
}
|
||||
return query;
|
||||
}
|
||||
@@ -3434,12 +3538,12 @@ namespace BLL
|
||||
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 != "-1" ),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1" ) == 0 ? "0" :
|
||||
Math.Round((decimal)gg.Count(y => y.States == "3" ) /
|
||||
gg.Count(y => y.States != "4" && y.States != "-1" ) * 100, 2, MidpointRounding.AwayFromZero).ToString()
|
||||
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 != "-1"),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
|
||||
Math.Round((decimal)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)
|
||||
{
|
||||
@@ -3462,22 +3566,22 @@ namespace BLL
|
||||
public static List<Model.SecurityRiskOutput> GetSecurityRiskOutputs()
|
||||
{
|
||||
var query = (from x in Funs.DB.Base_Project
|
||||
join y in Funs.DB.Hazard_HazardSelectedItem on x.ProjectId equals y.ProjectId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
join z in Funs.DB.Base_RiskLevel on y.HazardLevel equals z.RiskLevelId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && (y.IsStart == true || y.State == "1")
|
||||
group new { y, z } by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new SecurityRiskOutput
|
||||
{
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
LowRiskNum = gg.Sum(g => (g.z.RiskLevel == 1 || g.y.HazardLevel == "1") ? 1 : 0),
|
||||
GeneralRiskNum = gg.Sum(g => (g.z.RiskLevel == 2 || g.y.HazardLevel == "2") ? 1 : 0),
|
||||
MediumRiskNum = gg.Sum(g => (g.z.RiskLevel == 3 || g.y.HazardLevel == "3") ? 1 : 0),
|
||||
HighRiskNum = gg.Sum(g => g.z.RiskLevel == 4 ? 1 : 0),
|
||||
}).ToList();
|
||||
join y in Funs.DB.Hazard_HazardSelectedItem on x.ProjectId equals y.ProjectId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
join z in Funs.DB.Base_RiskLevel on y.HazardLevel equals z.RiskLevelId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && (y.IsStart == true || y.State == "1")
|
||||
group new { y, z } by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new SecurityRiskOutput
|
||||
{
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
LowRiskNum = gg.Sum(g => (g.z.RiskLevel == 1 || g.y.HazardLevel == "1") ? 1 : 0),
|
||||
GeneralRiskNum = gg.Sum(g => (g.z.RiskLevel == 2 || g.y.HazardLevel == "2") ? 1 : 0),
|
||||
MediumRiskNum = gg.Sum(g => (g.z.RiskLevel == 3 || g.y.HazardLevel == "3") ? 1 : 0),
|
||||
HighRiskNum = gg.Sum(g => g.z.RiskLevel == 4 ? 1 : 0),
|
||||
}).ToList();
|
||||
return query;
|
||||
}
|
||||
public static async Task<List<Model.SecurityRiskOutput>> GetSecurityRiskOutputsAsync()
|
||||
@@ -3503,20 +3607,21 @@ namespace BLL
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
CompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == false ),
|
||||
TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false ).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false ),
|
||||
CompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == false),
|
||||
TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false),
|
||||
FinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == false),
|
||||
ArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == false),
|
||||
SuperCompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == true),
|
||||
SuperTrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
SuperConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == true),
|
||||
SuperFinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == true),
|
||||
|
||||
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
|
||||
}).ToList();
|
||||
return query;
|
||||
}
|
||||
public static async Task<List<Model.LargeEngineeringOutput>> GetLargeEngineeringOutputsAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetLargeEngineeringOutputs);
|
||||
}
|
||||
|
||||
@@ -3684,6 +3789,7 @@ namespace BLL
|
||||
x.SafeTrainNum,
|
||||
x.SpecialTrainNum,
|
||||
x.SpecialOperationTrainNum,
|
||||
x.HseTechnicalNum,
|
||||
x.EnvironmentalTrainNum,
|
||||
x.TotalEnergyConsumption,
|
||||
x.IncomeComprehensiveEnergyConsumption,
|
||||
@@ -3719,10 +3825,12 @@ namespace BLL
|
||||
x.CompanySpecialPlanNum,
|
||||
x.CompanyOnSiteDisposalPlan,
|
||||
x.CompanyDrillNum,
|
||||
x.CompanyDrillPersonNum,
|
||||
x.ProjectComprehensivePlanNum,
|
||||
x.ProjectSpecialPlanNum,
|
||||
x.ProjectOnSiteDisposalPlan,
|
||||
x.ProjectDrillNum,
|
||||
x.ProjectDrillPersonNum,
|
||||
x.CostExtract,
|
||||
x.CostUse,
|
||||
x.UseEquipmentNum,
|
||||
@@ -3741,10 +3849,12 @@ namespace BLL
|
||||
x.TrainPersonNum,
|
||||
x.ConstructionNum,
|
||||
x.FinishedNum,
|
||||
x.ArgumentNum,
|
||||
x.SuperCompletedNum,
|
||||
x.SuperTrainPersonNum,
|
||||
x.SuperConstructionNum,
|
||||
x.SuperFinishedNum,
|
||||
x.SuperArgumentNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
|
||||
Reference in New Issue
Block a user