2023-08-10 11:40:02 +08:00
|
|
|
|
using System;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
using System.Runtime.InteropServices.ComTypes;
|
|
|
|
|
using System.Runtime.Remoting.Contexts;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
using Aspose.Words.Lists;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
using FineUIPro;
|
|
|
|
|
using Model;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
using Newtonsoft.Json;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
{
|
|
|
|
|
public static class HSSEData_HSSEService
|
|
|
|
|
{
|
2025-06-23 21:31:12 +08:00
|
|
|
|
//public static SGGLDB Db = Funs.DB;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
|
2025-06-19 16:55:10 +08:00
|
|
|
|
//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 = BaseDataService.BeUnderConstructionList;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static void AddHSSEData_HSSE(HSSEData_HSSE newtable)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
using (var db = new SGGLDB(Funs.ConnString))
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var table = new HSSEData_HSSE
|
|
|
|
|
{
|
|
|
|
|
Id = newtable.Id,
|
|
|
|
|
UnitId = newtable.UnitId,
|
|
|
|
|
CollCropCode = newtable.CollCropCode,
|
|
|
|
|
UnitName = newtable.UnitName,
|
|
|
|
|
ReportDate = newtable.ReportDate,
|
|
|
|
|
BeUnderConstructionNum = newtable.BeUnderConstructionNum,
|
|
|
|
|
ShutdownNum = newtable.ShutdownNum,
|
|
|
|
|
JoinConstructionPersonNum = newtable.JoinConstructionPersonNum,
|
|
|
|
|
MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum,
|
|
|
|
|
TotalWorkingHour = newtable.TotalWorkingHour,
|
|
|
|
|
LostWorkingHour = newtable.LostWorkingHour,
|
|
|
|
|
SafeWorkingHour = newtable.SafeWorkingHour,
|
|
|
|
|
SafeTrainNum = newtable.SafeTrainNum,
|
|
|
|
|
SpecialTrainNum = newtable.SpecialTrainNum,
|
|
|
|
|
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
HseTechnicalNum = newtable.HseTechnicalNum,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
EnvironmentalTrainNum = newtable.EnvironmentalTrainNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
|
|
|
|
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
|
|
|
|
NewWaterConsumption = newtable.NewWaterConsumption,
|
|
|
|
|
HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
|
|
|
|
|
HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
|
|
|
|
|
BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
|
|
|
|
|
BranchFullTimeNum = newtable.BranchFullTimeNum,
|
|
|
|
|
ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
|
|
|
|
|
ProjectFullTimeNum = newtable.ProjectFullTimeNum,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
ProjectSubFullTimeNum = newtable.ProjectSubFullTimeNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
|
|
|
|
|
SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
|
|
|
|
|
CertificateANum = newtable.CertificateANum,
|
|
|
|
|
CertificateBNum = newtable.CertificateBNum,
|
|
|
|
|
CertificateCNum = newtable.CertificateCNum,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
QualityPersonNum = newtable.QualityPersonNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
|
|
|
|
|
EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
|
|
|
|
|
ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
|
|
|
|
|
ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
|
|
|
|
|
CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
|
|
|
|
|
CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
|
|
|
|
|
CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchLeadShiftCheckNum = newtable.BranchLeadShiftCheckNum,
|
|
|
|
|
BranchComprehensiveCheckNum = newtable.BranchComprehensiveCheckNum,
|
|
|
|
|
BranchSpecialCheckNum = newtable.BranchSpecialCheckNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum,
|
|
|
|
|
ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum,
|
|
|
|
|
ProjectMajorCheckNum = newtable.ProjectMajorCheckNum,
|
|
|
|
|
NearMissNum = newtable.NearMissNum,
|
|
|
|
|
RecordableEventNum = newtable.RecordableEventNum,
|
|
|
|
|
GeneralAccidentNum = newtable.GeneralAccidentNum,
|
|
|
|
|
MajorAccidentNum = newtable.MajorAccidentNum,
|
|
|
|
|
SeriousAccidentNum = newtable.SeriousAccidentNum,
|
|
|
|
|
SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum,
|
|
|
|
|
CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum,
|
|
|
|
|
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
|
|
|
|
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchComprehensivePlanNum = newtable.BranchComprehensivePlanNum,
|
|
|
|
|
BranchSpecialPlanNum = newtable.BranchSpecialPlanNum,
|
|
|
|
|
BranchOnSiteDisposalPlan = newtable.BranchOnSiteDisposalPlan,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
CompanyDrillNum = newtable.CompanyDrillNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
CompanyDrillPersonNum = newtable.CompanyDrillPersonNum,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchDrillNum = newtable.BranchDrillNum,
|
|
|
|
|
BranchDrillPersonNum = newtable.BranchDrillPersonNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
|
|
|
|
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
|
|
|
|
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
|
|
|
|
ProjectDrillNum = newtable.ProjectDrillNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ProjectDrillPersonNum = newtable.ProjectDrillPersonNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
CostExtract = newtable.CostExtract,
|
|
|
|
|
CostUse = newtable.CostUse,
|
|
|
|
|
UseEquipmentNum = newtable.UseEquipmentNum,
|
|
|
|
|
SpecialEquipmentNum = newtable.SpecialEquipmentNum,
|
|
|
|
|
LicensesNum = newtable.LicensesNum,
|
|
|
|
|
LicensesCloseNum = newtable.LicensesCloseNum,
|
|
|
|
|
GeneralClosedNum = newtable.GeneralClosedNum,
|
|
|
|
|
GeneralNotClosedNum = newtable.GeneralNotClosedNum,
|
|
|
|
|
MajorClosedNum = newtable.MajorClosedNum,
|
|
|
|
|
MajorNotClosedNum = newtable.MajorNotClosedNum,
|
|
|
|
|
GeneralRiskNum = newtable.GeneralRiskNum,
|
|
|
|
|
LowRiskNum = newtable.LowRiskNum,
|
|
|
|
|
MediumRiskNum = newtable.MediumRiskNum,
|
|
|
|
|
HighRiskNum = newtable.HighRiskNum,
|
|
|
|
|
CompletedNum = newtable.CompletedNum,
|
|
|
|
|
TrainPersonNum = newtable.TrainPersonNum,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
OperativesNum = newtable.OperativesNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ConstructionNum = newtable.ConstructionNum,
|
|
|
|
|
FinishedNum = newtable.FinishedNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ArgumentNum = newtable.ArgumentNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
SuperCompletedNum = newtable.SuperCompletedNum,
|
|
|
|
|
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
|
|
|
|
SuperConstructionNum = newtable.SuperConstructionNum,
|
|
|
|
|
SuperFinishedNum = newtable.SuperFinishedNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperArgumentNum = newtable.SuperArgumentNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
State = newtable.State,
|
|
|
|
|
CreateDate = newtable.CreateDate,
|
|
|
|
|
CreateMan = newtable.CreateMan
|
|
|
|
|
};
|
|
|
|
|
db.HSSEData_HSSE.InsertOnSubmit(table);
|
|
|
|
|
db.SubmitChanges();
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static void DeleteHSSEData_HSSEById(string id)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
using (var db = new SGGLDB(Funs.ConnString))
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == id);
|
|
|
|
|
if (table != null)
|
|
|
|
|
{
|
|
|
|
|
db.HSSEData_HSSE.DeleteOnSubmit(table);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static HSSEData_HSSE GetHSSEData_HSSEById(string id)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
using (var db = new SGGLDB(Funs.ConnString))
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
return db.HSSEData_HSSE.FirstOrDefault(x => x.Id == id);
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static HSSEData GetItemById(string id)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var item = new HsseDataItem();
|
|
|
|
|
var data = new HSSEData();
|
|
|
|
|
var dataHsse = GetHSSEData_HSSEById(id);
|
|
|
|
|
if (dataHsse != null)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.BranchLeadShiftCheckNum = dataHsse.BranchLeadShiftCheckNum;
|
|
|
|
|
item.BranchComprehensiveCheckNum = dataHsse.BranchComprehensiveCheckNum;
|
|
|
|
|
item.BranchSpecialCheckNum = dataHsse.BranchSpecialCheckNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.BeUnderConstructionNum = dataHsse.BeUnderConstructionNum;
|
|
|
|
|
item.BranchFullTimeNum = dataHsse.BranchFullTimeNum;
|
|
|
|
|
item.BranchInspectorGeneralNum = dataHsse.BranchInspectorGeneralNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.BranchComprehensivePlanNum = dataHsse.BranchComprehensivePlanNum;
|
|
|
|
|
item.BranchSpecialPlanNum = dataHsse.BranchSpecialPlanNum;
|
|
|
|
|
item.BranchOnSiteDisposalPlan = dataHsse.BranchOnSiteDisposalPlan;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.CertificateANum = dataHsse.CertificateANum;
|
|
|
|
|
item.CertificateBNum = dataHsse.CertificateBNum;
|
|
|
|
|
item.CertificateCNum = dataHsse.CertificateCNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.QualityPersonNum = dataHsse.QualityPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.CollCropCode = dataHsse.CollCropCode;
|
|
|
|
|
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
|
|
|
|
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
|
|
|
|
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.BranchDrillNum = dataHsse.BranchDrillNum;
|
|
|
|
|
item.BranchDrillPersonNum = dataHsse.BranchDrillPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
|
|
|
|
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
|
|
|
|
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
|
|
|
|
item.CompanySpecialPlanNum = dataHsse.CompanySpecialPlanNum;
|
|
|
|
|
item.CompletedNum = dataHsse.CompletedNum;
|
|
|
|
|
item.ConstructionNum = dataHsse.ConstructionNum;
|
|
|
|
|
item.CostExtract = dataHsse.CostExtract;
|
|
|
|
|
item.CostUse = dataHsse.CostUse;
|
|
|
|
|
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
|
|
|
|
item.FinishedNum = dataHsse.FinishedNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.ArgumentNum = dataHsse.ArgumentNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
|
|
|
|
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
|
|
|
|
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
item.GeneralRate = "";
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.GeneralRiskNum = dataHsse.GeneralRiskNum;
|
|
|
|
|
item.HeadOfficeFullTimeNum = dataHsse.HeadOfficeFullTimeNum;
|
|
|
|
|
item.HeadOfficeInspectorGeneralNum = dataHsse.HeadOfficeInspectorGeneralNum;
|
|
|
|
|
item.HighRiskNum = dataHsse.HighRiskNum;
|
|
|
|
|
item.Id = dataHsse.Id;
|
|
|
|
|
item.IncomeComprehensiveEnergyConsumption = dataHsse.IncomeComprehensiveEnergyConsumption;
|
|
|
|
|
item.JoinConstructionPersonNum = dataHsse.JoinConstructionPersonNum;
|
|
|
|
|
item.LicensesCloseNum = dataHsse.LicensesCloseNum;
|
|
|
|
|
item.LicensesNum = dataHsse.LicensesNum;
|
|
|
|
|
item.LostWorkingHour = dataHsse.LostWorkingHour;
|
|
|
|
|
item.LowRiskNum = dataHsse.LowRiskNum;
|
|
|
|
|
item.MajorAccidentNum = dataHsse.MajorAccidentNum;
|
|
|
|
|
item.MajorClosedNum = dataHsse.MajorClosedNum;
|
|
|
|
|
item.MajorNotClosedNum = dataHsse.MajorNotClosedNum;
|
|
|
|
|
item.MajorProjectsUnderConstructionNum = dataHsse.MajorProjectsUnderConstructionNum;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
item.MajorRate = "";
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.MediumRiskNum = dataHsse.MediumRiskNum;
|
|
|
|
|
item.NearMissNum = dataHsse.NearMissNum;
|
|
|
|
|
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
|
|
|
|
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
|
|
|
|
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
|
|
|
|
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
|
|
|
|
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
|
|
|
|
item.ProjectMajorCheckNum = dataHsse.ProjectMajorCheckNum;
|
|
|
|
|
item.ProjectOnSiteDisposalPlan = dataHsse.ProjectOnSiteDisposalPlan;
|
|
|
|
|
item.ProjectSafetyLeadingGroupMeetingNum = dataHsse.ProjectSafetyLeadingGroupMeetingNum;
|
|
|
|
|
item.ProjectSafetyMeetingNum = dataHsse.ProjectSafetyMeetingNum;
|
|
|
|
|
item.ProjectSafetyMonitorNum = dataHsse.ProjectSafetyMonitorNum;
|
|
|
|
|
item.ProjectSpecialCheckNum = dataHsse.ProjectSpecialCheckNum;
|
|
|
|
|
item.ProjectSpecialPlanNum = dataHsse.ProjectSpecialPlanNum;
|
|
|
|
|
item.RecordableEventNum = dataHsse.RecordableEventNum;
|
|
|
|
|
item.ReportDate = dataHsse.ReportDate.Value.ToShortDateString();
|
|
|
|
|
item.SafeTrainNum = dataHsse.SafeTrainNum;
|
|
|
|
|
item.SafetyCommitteeMeetingNum = dataHsse.SafetyCommitteeMeetingNum;
|
|
|
|
|
item.SafetyInjectionEngineer = dataHsse.SafetyInjectionEngineer;
|
|
|
|
|
item.SafeWorkingHour = dataHsse.SafeWorkingHour;
|
|
|
|
|
item.SeriousAccidentNum = dataHsse.SeriousAccidentNum;
|
|
|
|
|
item.ShutdownNum = dataHsse.ShutdownNum;
|
|
|
|
|
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
|
|
|
|
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
|
|
|
|
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
|
|
|
|
item.SuperCompletedNum = dataHsse.SuperCompletedNum;
|
|
|
|
|
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
|
|
|
|
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
|
|
|
|
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.SuperOperativesNum = dataHsse.SuperOperativesNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
|
|
|
|
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
|
|
|
|
item.TrainPersonNum = dataHsse.TrainPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.OperativesNum = dataHsse.OperativesNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.UnitId = dataHsse.UnitId;
|
|
|
|
|
item.UseEquipmentNum = dataHsse.UseEquipmentNum;
|
|
|
|
|
var hSseDataHiddens =
|
|
|
|
|
HSSEData_HiddenDangerDetailService.GetHSSEData_HiddenDangerDetailByDate(dataHsse.ReportDate);
|
|
|
|
|
if (hSseDataHiddens != null)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var list = hSseDataHiddens.Select(detail => new HSSEDataHiddenDangerDetailItem
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
Id = detail.Id,
|
|
|
|
|
NeedRectifyNum = detail.NeedRectifyNum,
|
|
|
|
|
TotalNum = detail.TotalNum,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
TypeName = detail.TypeName
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
item.HiddenDangerDetailItems = list;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
|
|
|
|
var hsseDataItems = new List<HsseDataItem> { item };
|
2022-12-26 14:34:56 +08:00
|
|
|
|
data.HSSEDataItems = hsseDataItems;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
|
|
|
|
public static HSSEData GetItemByHSSEData_HSSE(HSSEData_HSSE dataHsse,
|
|
|
|
|
List<HSSEDataHiddenDangerDetailItem> hSseDataHiddens)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var item = new HsseDataItem();
|
|
|
|
|
var data = new HSSEData();
|
|
|
|
|
if (dataHsse != null)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.BranchLeadShiftCheckNum = dataHsse.BranchLeadShiftCheckNum;
|
|
|
|
|
item.BranchComprehensiveCheckNum = dataHsse.BranchComprehensiveCheckNum;
|
|
|
|
|
item.BranchSpecialCheckNum = dataHsse.BranchSpecialCheckNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.BeUnderConstructionNum = dataHsse.BeUnderConstructionNum;
|
|
|
|
|
item.BranchFullTimeNum = dataHsse.BranchFullTimeNum;
|
|
|
|
|
item.BranchInspectorGeneralNum = dataHsse.BranchInspectorGeneralNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.BranchComprehensivePlanNum = dataHsse.BranchComprehensivePlanNum;
|
|
|
|
|
item.BranchSpecialPlanNum = dataHsse.BranchSpecialPlanNum;
|
|
|
|
|
item.BranchOnSiteDisposalPlan = dataHsse.BranchOnSiteDisposalPlan;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.CertificateANum = dataHsse.CertificateANum;
|
|
|
|
|
item.CertificateBNum = dataHsse.CertificateBNum;
|
|
|
|
|
item.CertificateCNum = dataHsse.CertificateCNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.QualityPersonNum = dataHsse.QualityPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.CollCropCode = dataHsse.CollCropCode;
|
|
|
|
|
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
|
|
|
|
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
|
|
|
|
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.BranchDrillNum = dataHsse.BranchDrillNum;
|
|
|
|
|
item.BranchDrillPersonNum = dataHsse.BranchDrillPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
|
|
|
|
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
|
|
|
|
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
|
|
|
|
item.CompanySpecialPlanNum = dataHsse.CompanySpecialPlanNum;
|
|
|
|
|
item.CompletedNum = dataHsse.CompletedNum;
|
|
|
|
|
item.ConstructionNum = dataHsse.ConstructionNum;
|
|
|
|
|
item.CostExtract = dataHsse.CostExtract;
|
|
|
|
|
item.CostUse = dataHsse.CostUse;
|
|
|
|
|
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
|
|
|
|
item.FinishedNum = dataHsse.FinishedNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.ArgumentNum = dataHsse.ArgumentNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
|
|
|
|
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
|
|
|
|
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
item.GeneralRate = "";
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.GeneralRiskNum = dataHsse.GeneralRiskNum;
|
|
|
|
|
item.HeadOfficeFullTimeNum = dataHsse.HeadOfficeFullTimeNum;
|
|
|
|
|
item.HeadOfficeInspectorGeneralNum = dataHsse.HeadOfficeInspectorGeneralNum;
|
|
|
|
|
item.HighRiskNum = dataHsse.HighRiskNum;
|
|
|
|
|
item.Id = dataHsse.Id;
|
|
|
|
|
item.IncomeComprehensiveEnergyConsumption = dataHsse.IncomeComprehensiveEnergyConsumption;
|
|
|
|
|
item.JoinConstructionPersonNum = dataHsse.JoinConstructionPersonNum;
|
|
|
|
|
item.LicensesCloseNum = dataHsse.LicensesCloseNum;
|
|
|
|
|
item.LicensesNum = dataHsse.LicensesNum;
|
|
|
|
|
item.LostWorkingHour = dataHsse.LostWorkingHour;
|
|
|
|
|
item.LowRiskNum = dataHsse.LowRiskNum;
|
|
|
|
|
item.MajorAccidentNum = dataHsse.MajorAccidentNum;
|
|
|
|
|
item.MajorClosedNum = dataHsse.MajorClosedNum;
|
|
|
|
|
item.MajorNotClosedNum = dataHsse.MajorNotClosedNum;
|
|
|
|
|
item.MajorProjectsUnderConstructionNum = dataHsse.MajorProjectsUnderConstructionNum;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
item.MajorRate = "";
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.MediumRiskNum = dataHsse.MediumRiskNum;
|
|
|
|
|
item.NearMissNum = dataHsse.NearMissNum;
|
|
|
|
|
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
|
|
|
|
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
|
|
|
|
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.ProjectSubFullTimeNum = dataHsse.ProjectSubFullTimeNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
|
|
|
|
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
|
|
|
|
item.ProjectMajorCheckNum = dataHsse.ProjectMajorCheckNum;
|
|
|
|
|
item.ProjectOnSiteDisposalPlan = dataHsse.ProjectOnSiteDisposalPlan;
|
|
|
|
|
item.ProjectSafetyLeadingGroupMeetingNum = dataHsse.ProjectSafetyLeadingGroupMeetingNum;
|
|
|
|
|
item.ProjectSafetyMeetingNum = dataHsse.ProjectSafetyMeetingNum;
|
|
|
|
|
item.ProjectSafetyMonitorNum = dataHsse.ProjectSafetyMonitorNum;
|
|
|
|
|
item.ProjectSpecialCheckNum = dataHsse.ProjectSpecialCheckNum;
|
|
|
|
|
item.ProjectSpecialPlanNum = dataHsse.ProjectSpecialPlanNum;
|
|
|
|
|
item.RecordableEventNum = dataHsse.RecordableEventNum;
|
|
|
|
|
item.ReportDate = dataHsse.ReportDate.Value.ToShortDateString();
|
|
|
|
|
item.SafeTrainNum = dataHsse.SafeTrainNum;
|
|
|
|
|
item.SafetyCommitteeMeetingNum = dataHsse.SafetyCommitteeMeetingNum;
|
|
|
|
|
item.SafetyInjectionEngineer = dataHsse.SafetyInjectionEngineer;
|
|
|
|
|
item.SafeWorkingHour = dataHsse.SafeWorkingHour;
|
|
|
|
|
item.SeriousAccidentNum = dataHsse.SeriousAccidentNum;
|
|
|
|
|
item.ShutdownNum = dataHsse.ShutdownNum;
|
|
|
|
|
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
|
|
|
|
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
|
|
|
|
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
|
|
|
|
item.SuperCompletedNum = dataHsse.SuperCompletedNum;
|
|
|
|
|
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
|
|
|
|
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.SuperOperativesNum = dataHsse.SuperOperativesNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
|
|
|
|
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
|
|
|
|
item.TrainPersonNum = dataHsse.TrainPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
item.OperativesNum = dataHsse.OperativesNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
item.UnitId = dataHsse.UnitId;
|
|
|
|
|
item.UseEquipmentNum = dataHsse.UseEquipmentNum;
|
|
|
|
|
if (hSseDataHiddens != null)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var list = hSseDataHiddens.Select(detail =>
|
|
|
|
|
new HSSEDataHiddenDangerDetailItem
|
|
|
|
|
{
|
|
|
|
|
Id = detail.Id,
|
|
|
|
|
NeedRectifyNum = detail.NeedRectifyNum,
|
|
|
|
|
TotalNum = detail.TotalNum,
|
|
|
|
|
TypeName = detail.TypeName
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
item.HiddenDangerDetailItems = list;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
|
|
|
|
var hsseDataItems = new List<HsseDataItem> { item };
|
2022-12-26 14:34:56 +08:00
|
|
|
|
data.HSSEDataItems = hsseDataItems;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static async Task<HSSEData> GetTodayHSSEData_HSSE()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
|
|
|
|
var modelTask = StatisticalDataAsync();
|
|
|
|
|
var model = await modelTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
HSSEData data = model;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
return data;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static HSSEData_HSSE GetTodayData()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
|
|
|
|
var q = (from x in Funs.DB.HSSEData_HSSE
|
2024-12-24 19:04:32 +08:00
|
|
|
|
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
|
|
|
|
select x).FirstOrDefault();
|
2022-12-26 14:34:56 +08:00
|
|
|
|
return q;
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
public static void UpdateTodyData_State()
|
|
|
|
|
{
|
|
|
|
|
var q = GetTodayData();
|
2023-08-10 11:40:02 +08:00
|
|
|
|
if (q != null)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
|
|
|
|
q.State = Const.CNCEC_State_1;
|
|
|
|
|
UpdateHSSEData_HSSE(q);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
public static bool IsReportByDate(DateTime dateTime)
|
|
|
|
|
{
|
|
|
|
|
var result = false;
|
|
|
|
|
var q = (from x in Funs.DB.HSSEData_HSSE
|
2024-12-24 19:04:32 +08:00
|
|
|
|
where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
|
|
|
|
|
select x).ToList();
|
2023-08-10 11:40:02 +08:00
|
|
|
|
if (q.Count > 0) result = true;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// 判断当天是否已上报
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool IsReportByToday()
|
|
|
|
|
{
|
|
|
|
|
var result = false;
|
|
|
|
|
var q = (from x in Funs.DB.HSSEData_HSSE
|
2024-12-24 19:04:32 +08:00
|
|
|
|
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
|
|
|
|
select x).ToList();
|
2023-08-10 11:40:02 +08:00
|
|
|
|
if (q.Count > 0) result = true;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static ReturnData PushCncec(string id)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var baseurl = "/api/HSSEData/SaveHSSEData";
|
|
|
|
|
var item = GetItemById(id);
|
|
|
|
|
var str = JsonConvert.SerializeObject(item);
|
|
|
|
|
var responeData = ServerService.PushCNCEC(str, baseurl);
|
2022-12-26 14:34:56 +08:00
|
|
|
|
return responeData;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static Model.HSSEData_HSSE GetSubUnitHsseDataByDate(string Unitid, DateTime? reportdate)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = new Model.HSSEData_HSSE();
|
|
|
|
|
if (reportdate == null)
|
|
|
|
|
{
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2022-12-26 14:34:56 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var projectlist = BLL.ProjectService.GetProjectWorkList(Unitid);
|
|
|
|
|
var baseUnit = UnitService.GetUnitByUnitId(Unitid);
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var projectData = (from x in Funs.DB.Project_HSSEData_HSSE
|
2024-12-24 19:04:32 +08:00
|
|
|
|
where x.ReportDate == reportdate && projectlist.Select(e => e.ProjectId).Contains(x.ProjectId)
|
|
|
|
|
select x).ToList();
|
|
|
|
|
result = new HSSEData_HSSE
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
UnitId = Unitid,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
CollCropCode = baseUnit.CollCropCode,
|
|
|
|
|
UnitName = baseUnit.UnitName,
|
2022-12-26 14:34:56 +08:00
|
|
|
|
ReportDate = DateTime.Now.Date,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
BeUnderConstructionNum = projectData.Sum(x => x.BeUnderConstructionNum),
|
|
|
|
|
ShutdownNum = projectData.Sum(x => x.ShutdownNum),
|
|
|
|
|
JoinConstructionPersonNum = projectData.Sum(x => x.JoinConstructionPersonNum),
|
|
|
|
|
MajorProjectsUnderConstructionNum = projectData.Sum(x => x.MajorProjectsUnderConstructionNum),
|
|
|
|
|
TotalWorkingHour = projectData.Sum(x => x.TotalWorkingHour),
|
|
|
|
|
LostWorkingHour = projectData.Sum(x => x.LostWorkingHour),
|
|
|
|
|
SafeWorkingHour = projectData.Sum(x => x.SafeWorkingHour),
|
|
|
|
|
SafeTrainNum = projectData.Sum(x => x.SafeTrainNum),
|
|
|
|
|
SpecialTrainNum = projectData.Sum(x => x.SpecialTrainNum),
|
|
|
|
|
SpecialOperationTrainNum = projectData.Sum(x => x.SpecialOperationTrainNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
TotalEnergyConsumption = 0,
|
|
|
|
|
IncomeComprehensiveEnergyConsumption = 0,
|
|
|
|
|
NewWaterConsumption = 0,
|
|
|
|
|
HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneral().Count,
|
|
|
|
|
HeadOfficeFullTimeNum = GetHeadOfficeFullTime().Count,
|
|
|
|
|
BranchInspectorGeneralNum = GetBranchInspectorGeneral().Count,
|
|
|
|
|
BranchFullTimeNum = GetBranchFullTime().Count,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectInspectorGeneralNum = projectData.Sum(x => x.ProjectInspectorGeneralNum),
|
|
|
|
|
ProjectFullTimeNum = projectData.Sum(x => x.ProjectFullTimeNum),
|
|
|
|
|
ProjectSafetyMonitorNum = projectData.Sum(x => x.ProjectSafetyMonitorNum),
|
|
|
|
|
SafetyInjectionEngineer = projectData.Sum(x => x.SafetyInjectionEngineer),
|
|
|
|
|
CertificateANum = projectData.Sum(x => x.CertificateANum),
|
|
|
|
|
CertificateBNum = projectData.Sum(x => x.CertificateBNum),
|
|
|
|
|
CertificateCNum = projectData.Sum(x => x.CertificateCNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
SafetyCommitteeMeetingNum = GetSafetyCommitteeMeeting().Count,
|
2022-12-26 14:34:56 +08:00
|
|
|
|
EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(),
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectSafetyLeadingGroupMeetingNum = projectData.Sum(x => x.ProjectSafetyLeadingGroupMeetingNum),
|
|
|
|
|
ProjectSafetyMeetingNum = projectData.Sum(x => x.ProjectSafetyMeetingNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheck().Count,
|
|
|
|
|
CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheck().Count,
|
|
|
|
|
CompanySpecialCheckNum = GetCompanySpecialCheck().Count,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectLeadShiftCheckNum = projectData.Sum(x => x.ProjectLeadShiftCheckNum),
|
|
|
|
|
ProjectSpecialCheckNum = projectData.Sum(x => x.ProjectSpecialCheckNum),
|
|
|
|
|
ProjectMajorCheckNum = projectData.Sum(x => x.ProjectMajorCheckNum),
|
|
|
|
|
NearMissNum = projectData.Sum(x => x.NearMissNum),
|
|
|
|
|
RecordableEventNum = projectData.Sum(x => x.RecordableEventNum),
|
|
|
|
|
GeneralAccidentNum = projectData.Sum(x => x.GeneralAccidentNum),
|
|
|
|
|
MajorAccidentNum = projectData.Sum(x => x.MajorAccidentNum),
|
|
|
|
|
SeriousAccidentNum = projectData.Sum(x => x.SeriousAccidentNum),
|
|
|
|
|
SpecialSeriousAccidentNum = projectData.Sum(x => x.SpecialSeriousAccidentNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
// CompanyComprehensivePlanNum = GetCompanyComprehensivePlan(),
|
|
|
|
|
// CompanySpecialPlanNum = GetCompanySpecialPlan(),
|
|
|
|
|
// CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(),
|
|
|
|
|
// CompanyDrillNum = GetCompanyDrill(),
|
2023-08-10 11:40:02 +08:00
|
|
|
|
ProjectComprehensivePlanNum = projectData.Sum(x => x.ProjectComprehensivePlanNum),
|
|
|
|
|
ProjectSpecialPlanNum = projectData.Sum(x => x.ProjectSpecialPlanNum),
|
|
|
|
|
ProjectOnSiteDisposalPlan = projectData.Sum(x => x.ProjectOnSiteDisposalPlan),
|
|
|
|
|
ProjectDrillNum = projectData.Sum(x => x.ProjectDrillNum),
|
|
|
|
|
CostExtract = projectData.Sum(x => x.CostExtract),
|
|
|
|
|
CostUse = projectData.Sum(x => x.CostUse),
|
|
|
|
|
UseEquipmentNum = projectData.Sum(x => x.UseEquipmentNum),
|
|
|
|
|
SpecialEquipmentNum = projectData.Sum(x => x.SpecialEquipmentNum),
|
|
|
|
|
LicensesNum = projectData.Sum(x => x.LicensesNum),
|
|
|
|
|
LicensesCloseNum = projectData.Sum(x => x.LicensesCloseNum),
|
|
|
|
|
GeneralClosedNum = projectData.Sum(x => x.GeneralClosedNum),
|
|
|
|
|
GeneralNotClosedNum = projectData.Sum(x => x.GeneralNotClosedNum),
|
|
|
|
|
MajorClosedNum = projectData.Sum(x => x.MajorClosedNum),
|
|
|
|
|
MajorNotClosedNum = projectData.Sum(x => x.MajorNotClosedNum),
|
|
|
|
|
GeneralRiskNum = projectData.Sum(x => x.GeneralRiskNum),
|
|
|
|
|
LowRiskNum = projectData.Sum(x => x.LowRiskNum),
|
|
|
|
|
MediumRiskNum = projectData.Sum(x => x.MediumRiskNum),
|
|
|
|
|
HighRiskNum = projectData.Sum(x => x.HighRiskNum),
|
|
|
|
|
CompletedNum = projectData.Sum(x => x.CompletedNum),
|
|
|
|
|
TrainPersonNum = projectData.Sum(x => x.TrainPersonNum),
|
|
|
|
|
ConstructionNum = projectData.Sum(x => x.ConstructionNum),
|
|
|
|
|
FinishedNum = projectData.Sum(x => x.FinishedNum),
|
|
|
|
|
SuperCompletedNum = projectData.Sum(x => x.SuperCompletedNum),
|
|
|
|
|
SuperTrainPersonNum = projectData.Sum(x => x.SuperTrainPersonNum),
|
|
|
|
|
SuperConstructionNum = projectData.Sum(x => x.SuperConstructionNum),
|
|
|
|
|
SuperFinishedNum = projectData.Sum(x => x.SuperFinishedNum),
|
2022-12-26 14:34:56 +08:00
|
|
|
|
CreateMan = Const.sysglyId,
|
2023-08-10 11:40:02 +08:00
|
|
|
|
CreateDate = DateTime.Now
|
2022-12-26 14:34:56 +08:00
|
|
|
|
};
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-19 16:55:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 统计数据(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static async Task<HSSEData> StatisticalDataAsync()
|
|
|
|
|
{
|
|
|
|
|
var thisUnitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null) thisUnitId = thisUnit.UnitId;
|
|
|
|
|
var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
|
|
|
|
|
Project_HSSEData_HiddenDangerDetailService.StatisticalAllProjectData();
|
|
|
|
|
|
|
|
|
|
// 并行执行异步方法
|
|
|
|
|
var totalEnergyConsumptionTask = ChemicalReportItemService.GetLatstTimeTotalEnergyConsumption();
|
|
|
|
|
var incomeComprehensiveEnergyConsumptionTask = ChemicalReportItemService.GetLatstTimeIncomeComprehensiveEnergyConsumption();
|
|
|
|
|
var newWaterConsumptionTask = ChemicalReportItemService.GetLatstTimeNewWaterConsumption();
|
|
|
|
|
var securityRiskOutputListTask = HSSEData_HSSEService.GetSecurityRiskOutputsAsync();
|
|
|
|
|
var largeEngineeringOutputsTask = HSSEData_HSSEService.GetLargeEngineeringOutputsAsync();
|
|
|
|
|
|
|
|
|
|
var safetyInjectionEngineerTask = HSSEData_HSSEService.GetSafetyInjectionEngineerAsync();
|
|
|
|
|
var certificateATask = HSSEData_HSSEService.GetCertificateAAsync();
|
|
|
|
|
var certificateBTask = HSSEData_HSSEService.GetCertificateBAsync();
|
|
|
|
|
var certificateCTask = HSSEData_HSSEService.GetCertificateCAsync();
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var qualityPersonNumTask = HSSEData_HSSEService.GetQualityPersonNumAsync();
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var beUnderConstructionTask = HSSEData_HSSEService.GetBeUnderConstructionAsync();
|
|
|
|
|
var shutdownTask = HSSEData_HSSEService.GetShutdownAsync();
|
|
|
|
|
var joinConstructionPersonTask = HSSEData_HSSEService.GetJoinConstructionPersonAsync();
|
|
|
|
|
var majorProjectsUnderConstructionTask = HSSEData_HSSEService.GetMajorProjectsUnderConstructionAsync();
|
|
|
|
|
var totalWorkingHourTask = HSSEData_HSSEService.GetTotalWorkingHourAsync();
|
|
|
|
|
var lostWorkingHourTask = HSSEData_HSSEService.GetLostWorkingHourAsync();
|
|
|
|
|
var safeWorkingHourTask = HSSEData_HSSEService.GetSafeWorkingHourAsync();
|
|
|
|
|
var safeTrainTask = HSSEData_HSSEService.GetSafeTrainAsync();
|
2025-07-01 14:07:38 +08:00
|
|
|
|
var safeTrainBoShengTask = HSSEData_HSSEService.GetBoShengSafeTrainAsync();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var specialTrainTask = HSSEData_HSSEService.GetSpecialTrainAsync();
|
|
|
|
|
var specialOperationTrainTask = HSSEData_HSSEService.GetSpecialOperationTrainAsync();
|
2025-06-12 10:39:28 +08:00
|
|
|
|
var hseTechnicalTask = HSSEData_HSSEService.GetHseTechnicalAsync();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var headOfficeInspectorGeneralTask = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralAsync();
|
|
|
|
|
var headOfficeFullTimeTask = HSSEData_HSSEService.GetHeadOfficeFullTimeAsync();
|
|
|
|
|
var branchInspectorGeneralTask = HSSEData_HSSEService.GetBranchInspectorGeneralAsync();
|
|
|
|
|
var branchFullTimeTask = HSSEData_HSSEService.GetBranchFullTimeAsync();
|
|
|
|
|
var projectInspectorGeneralTask = HSSEData_HSSEService.GetProjectInspectorGeneralAsync();
|
|
|
|
|
var projectFullTimeTask = HSSEData_HSSEService.GetProjectFullTimeAsync();
|
|
|
|
|
var projectSafetyMonitorTask = HSSEData_HSSEService.GetProjectSafetyMonitorAsync();
|
|
|
|
|
var safetyCommitteeMeetingTask = HSSEData_HSSEService.GetSafetyCommitteeMeetingAsync();
|
|
|
|
|
var enterpriseTopicsMeetingTask = HSSEData_HSSEService.GetEnterpriseTopicsMeetingAsync();
|
|
|
|
|
var projectSafetyLeadingGroupMeetingTask = HSSEData_HSSEService.GetProjectSafetyLeadingGroupMeetingAsync();
|
|
|
|
|
var projectSafetyMeetingTask = HSSEData_HSSEService.GetProjectSafetyMeetingAsync();
|
|
|
|
|
var companyLeadShiftCheckTask = HSSEData_HSSEService.GetCompanyLeadShiftCheckAsync();
|
|
|
|
|
var companyComprehensiveCheckTask = HSSEData_HSSEService.GetCompanyComprehensiveCheckAsync();
|
|
|
|
|
var companySpecialCheckTask = HSSEData_HSSEService.GetCompanySpecialCheckAsync();
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var branchLeadShiftCheckTask = HSSEData_HSSEService.GetBranchLeadShiftCheckAsync();
|
|
|
|
|
var branchComprehensiveCheckTask = HSSEData_HSSEService.GetBranchComprehensiveCheckAsync();
|
|
|
|
|
var branchSpecialCheckTask = HSSEData_HSSEService.GetBranchSpecialCheckAsync();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var projectLeadShiftCheckTask = HSSEData_HSSEService.GetProjectLeadShiftCheckAsync();
|
|
|
|
|
var projectSpecialCheckTask = HSSEData_HSSEService.GetProjectSpecialCheckAsync();
|
|
|
|
|
var projectMajorCheckTask = HSSEData_HSSEService.GetProjectMajorCheckAsync();
|
|
|
|
|
var nearMissTask = HSSEData_HSSEService.GetNearMissAsync();
|
|
|
|
|
var recordableEventTask = HSSEData_HSSEService.GetRecordableEventAsync();
|
|
|
|
|
var generalAccidentTask = HSSEData_HSSEService.GetGeneralAccidentAsync();
|
|
|
|
|
var majorAccidentTask = HSSEData_HSSEService.GetMajorAccidentAsync();
|
|
|
|
|
var seriousAccidentTask = HSSEData_HSSEService.GetSeriousAccidentAsync();
|
|
|
|
|
var specialSeriousAccidentTask = HSSEData_HSSEService.GetSpecialSeriousAccidentAsync();
|
|
|
|
|
var companyComprehensivePlanTask = HSSEData_HSSEService.GetCompanyComprehensivePlanAsync();
|
|
|
|
|
var companySpecialPlanTask = HSSEData_HSSEService.GetCompanySpecialPlanAsync();
|
|
|
|
|
var companyOnSiteDisposalPlanTask = HSSEData_HSSEService.GetCompanyOnSiteDisposalPlanAsync();
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var branchComprehensivePlanTask = HSSEData_HSSEService.GetBranchComprehensivePlanAsync();
|
|
|
|
|
var branchSpecialPlanTask = HSSEData_HSSEService.GetBranchSpecialPlanAsync();
|
|
|
|
|
var branchOnSiteDisposalPlanTask = HSSEData_HSSEService.GetBranchOnSiteDisposalPlanAsync();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var companyDrillTask = HSSEData_HSSEService.GetCompanyDrillAsync();
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var branchDrillTask = HSSEData_HSSEService.GetBranchDrillAsync();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var projectComprehensivePlanTask = HSSEData_HSSEService.GetProjectComprehensivePlanAsync();
|
|
|
|
|
var projectSpecialPlanTask = HSSEData_HSSEService.GetProjectSpecialPlanAsync();
|
|
|
|
|
var projectOnSiteDisposalPlanTask = HSSEData_HSSEService.GetProjectOnSiteDisposalPlanAsync();
|
|
|
|
|
var projectDrillTask = HSSEData_HSSEService.GetProjectDrillAsync();
|
|
|
|
|
var costExtractTask = HSSEData_HSSEService.GetCostExtractAsync();
|
|
|
|
|
var costUseTask = HSSEData_HSSEService.GetCostUseAsync();
|
|
|
|
|
var useEquipmentTask = HSSEData_HSSEService.GetUseEquipmentAsync();
|
|
|
|
|
var specialEquipmentTask = HSSEData_HSSEService.GetSpecialEquipmentAsync();
|
|
|
|
|
var licensesTask = HSSEData_HSSEService.GetLicensesAsync();
|
|
|
|
|
var licensesCloseTask = HSSEData_HSSEService.GetLicensesCloseAsync();
|
|
|
|
|
var generalHiddenRectificationOutputsTask = HSSEData_HSSEService.GetGeneralHiddenRectificationOutputsAsync();
|
|
|
|
|
var majorHiddenRectificationOutputsTask = HSSEData_HSSEService.GetMajorHiddenRectificationOutputsAsync();
|
|
|
|
|
|
|
|
|
|
// 等待所有异步方法执行完成
|
|
|
|
|
await Task.WhenAll(
|
|
|
|
|
securityRiskOutputListTask,
|
|
|
|
|
largeEngineeringOutputsTask,
|
|
|
|
|
safetyInjectionEngineerTask,
|
|
|
|
|
certificateATask,
|
|
|
|
|
certificateBTask,
|
|
|
|
|
certificateCTask,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
qualityPersonNumTask,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
beUnderConstructionTask,
|
|
|
|
|
shutdownTask,
|
|
|
|
|
joinConstructionPersonTask,
|
|
|
|
|
majorProjectsUnderConstructionTask,
|
|
|
|
|
totalWorkingHourTask,
|
|
|
|
|
lostWorkingHourTask,
|
|
|
|
|
safeWorkingHourTask,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
safeTrainTask,
|
2025-07-01 14:07:38 +08:00
|
|
|
|
safeTrainBoShengTask,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
specialTrainTask,
|
2025-06-12 10:39:28 +08:00
|
|
|
|
specialOperationTrainTask, hseTechnicalTask,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
headOfficeInspectorGeneralTask,
|
|
|
|
|
headOfficeFullTimeTask,
|
|
|
|
|
branchInspectorGeneralTask,
|
|
|
|
|
branchFullTimeTask,
|
|
|
|
|
projectInspectorGeneralTask,
|
|
|
|
|
projectFullTimeTask,
|
|
|
|
|
projectSafetyMonitorTask,
|
|
|
|
|
safetyCommitteeMeetingTask,
|
|
|
|
|
enterpriseTopicsMeetingTask,
|
|
|
|
|
projectSafetyLeadingGroupMeetingTask,
|
|
|
|
|
projectSafetyMeetingTask,
|
|
|
|
|
companyLeadShiftCheckTask,
|
|
|
|
|
companyComprehensiveCheckTask,
|
|
|
|
|
companySpecialCheckTask,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
branchLeadShiftCheckTask,
|
|
|
|
|
branchComprehensiveCheckTask,
|
|
|
|
|
branchSpecialCheckTask,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
projectLeadShiftCheckTask,
|
|
|
|
|
projectSpecialCheckTask,
|
|
|
|
|
projectMajorCheckTask,
|
|
|
|
|
nearMissTask,
|
|
|
|
|
recordableEventTask,
|
|
|
|
|
generalAccidentTask,
|
|
|
|
|
majorAccidentTask,
|
|
|
|
|
seriousAccidentTask,
|
|
|
|
|
specialSeriousAccidentTask,
|
|
|
|
|
companyComprehensivePlanTask,
|
|
|
|
|
companySpecialPlanTask,
|
|
|
|
|
companyOnSiteDisposalPlanTask,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
branchComprehensivePlanTask,
|
|
|
|
|
branchSpecialPlanTask,
|
|
|
|
|
branchOnSiteDisposalPlanTask,
|
|
|
|
|
companyDrillTask, branchDrillTask,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
projectComprehensivePlanTask,
|
|
|
|
|
projectSpecialPlanTask,
|
|
|
|
|
projectOnSiteDisposalPlanTask,
|
|
|
|
|
projectDrillTask,
|
|
|
|
|
costExtractTask,
|
|
|
|
|
costUseTask,
|
|
|
|
|
useEquipmentTask,
|
|
|
|
|
specialEquipmentTask,
|
|
|
|
|
licensesTask,
|
|
|
|
|
licensesCloseTask,
|
|
|
|
|
generalHiddenRectificationOutputsTask,
|
|
|
|
|
majorHiddenRectificationOutputsTask
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 统一获取异步方法的返回值
|
|
|
|
|
var totalEnergyConsumption = totalEnergyConsumptionTask;
|
|
|
|
|
var incomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumptionTask;
|
|
|
|
|
var newWaterConsumption = newWaterConsumptionTask;
|
|
|
|
|
var safetyInjectionEngineerList = await safetyInjectionEngineerTask;
|
|
|
|
|
var certificateAList = await certificateATask;
|
|
|
|
|
var certificateBList = await certificateBTask;
|
|
|
|
|
var certificateCList = await certificateCTask;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var qualityPersonList = await qualityPersonNumTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var beUnderConstructionList = await beUnderConstructionTask;
|
|
|
|
|
var shutdownList = await shutdownTask;
|
|
|
|
|
var joinConstructionPersonList = await joinConstructionPersonTask;
|
|
|
|
|
var majorProjectsUnderConstructionList = await majorProjectsUnderConstructionTask;
|
|
|
|
|
var totalWorkingHour = await totalWorkingHourTask;
|
|
|
|
|
var lostWorkingHour = await lostWorkingHourTask;
|
|
|
|
|
var safeWorkingHour = await safeWorkingHourTask;
|
|
|
|
|
var safeTrainList = await safeTrainTask;
|
2025-07-01 14:07:38 +08:00
|
|
|
|
var safeTrainBoShengList = await safeTrainBoShengTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var specialTrainList = await specialTrainTask;
|
|
|
|
|
var specialOperationTrainList = await specialOperationTrainTask;
|
2025-06-12 10:39:28 +08:00
|
|
|
|
var hseTechnicalList = await hseTechnicalTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var headOfficeInspectorGeneralList = await headOfficeInspectorGeneralTask;
|
|
|
|
|
var headOfficeFullTimeList = await headOfficeFullTimeTask;
|
|
|
|
|
var branchInspectorGeneralList = await branchInspectorGeneralTask;
|
|
|
|
|
var branchFullTimeList = await branchFullTimeTask;
|
|
|
|
|
var projectInspectorGeneralList = await projectInspectorGeneralTask;
|
|
|
|
|
var projectFullTimeList = await projectFullTimeTask;
|
|
|
|
|
var projectSafetyMonitorList = await projectSafetyMonitorTask;
|
|
|
|
|
var safetyCommitteeMeetingList = await safetyCommitteeMeetingTask;
|
|
|
|
|
var enterpriseTopicsMeetingList = await enterpriseTopicsMeetingTask;
|
|
|
|
|
var projectSafetyLeadingGroupMeetingList = await projectSafetyLeadingGroupMeetingTask;
|
|
|
|
|
var projectSafetyMeetingList = await projectSafetyMeetingTask;
|
|
|
|
|
var companyLeadShiftCheckList = await companyLeadShiftCheckTask;
|
|
|
|
|
var companyComprehensiveCheckList = await companyComprehensiveCheckTask;
|
|
|
|
|
var companySpecialCheckList = await companySpecialCheckTask;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var branchLeadShiftCheckList = await branchLeadShiftCheckTask;
|
|
|
|
|
var branchComprehensiveCheckList = await branchComprehensiveCheckTask;
|
|
|
|
|
var branchSpecialCheckList = await branchSpecialCheckTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var projectLeadShiftCheckList = await projectLeadShiftCheckTask;
|
|
|
|
|
var projectSpecialCheckList = await projectSpecialCheckTask;
|
|
|
|
|
var projectMajorCheckList = await projectMajorCheckTask;
|
|
|
|
|
var nearMissList = await nearMissTask;
|
|
|
|
|
var recordableEventList = await recordableEventTask;
|
|
|
|
|
var generalAccidentList = await generalAccidentTask;
|
|
|
|
|
var majorAccidentList = await majorAccidentTask;
|
|
|
|
|
var seriousAccidentList = await seriousAccidentTask;
|
|
|
|
|
var specialSeriousAccidentList = await specialSeriousAccidentTask;
|
|
|
|
|
var companyComprehensivePlanList = await companyComprehensivePlanTask;
|
|
|
|
|
var companySpecialPlanList = await companySpecialPlanTask;
|
|
|
|
|
var companyOnSiteDisposalPlanList = await companyOnSiteDisposalPlanTask;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var branchComprehensivePlanList = await branchComprehensivePlanTask;
|
|
|
|
|
var branchSpecialPlanList = await branchSpecialPlanTask;
|
|
|
|
|
var branchOnSiteDisposalPlanList = await branchOnSiteDisposalPlanTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var companyDrillList = await companyDrillTask;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var branchDrillList = await branchDrillTask;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var projectComprehensivePlanList = await projectComprehensivePlanTask;
|
|
|
|
|
var projectSpecialPlanList = await projectSpecialPlanTask;
|
|
|
|
|
var projectOnSiteDisposalPlanList = await projectOnSiteDisposalPlanTask;
|
|
|
|
|
var projectDrillList = await projectDrillTask;
|
|
|
|
|
var costExtract = await costExtractTask;
|
|
|
|
|
var costUseList = await costUseTask;
|
|
|
|
|
var useEquipmentList = await useEquipmentTask;
|
|
|
|
|
var specialEquipmentList = await specialEquipmentTask;
|
|
|
|
|
var licensesList = await licensesTask;
|
|
|
|
|
var licensesCloseList = await licensesCloseTask;
|
|
|
|
|
var generalHiddenRectificationOutputsList = await generalHiddenRectificationOutputsTask;
|
|
|
|
|
var majorHiddenRectificationOutputsList = await majorHiddenRectificationOutputsTask;
|
|
|
|
|
|
|
|
|
|
// 构造结果对象
|
|
|
|
|
var table = new HSSEData_HSSE
|
|
|
|
|
{
|
|
|
|
|
UnitId = thisUnitId,
|
|
|
|
|
CollCropCode = baseUnit.CollCropCode,
|
|
|
|
|
UnitName = baseUnit.UnitName,
|
|
|
|
|
ReportDate = DateTime.Now.Date,
|
|
|
|
|
BeUnderConstructionNum = beUnderConstructionList.Count(),
|
|
|
|
|
ShutdownNum = shutdownList.Count(),
|
|
|
|
|
SafetyInjectionEngineer = safetyInjectionEngineerList.Count(),
|
|
|
|
|
CertificateANum = certificateAList.Count(),
|
|
|
|
|
CertificateBNum = certificateBList.Count(),
|
|
|
|
|
CertificateCNum = certificateCList.Count(),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
QualityPersonNum = qualityPersonList.Count(),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
JoinConstructionPersonNum = joinConstructionPersonList.Count(),
|
|
|
|
|
MajorProjectsUnderConstructionNum = majorProjectsUnderConstructionList.Count(),
|
|
|
|
|
TotalWorkingHour = totalWorkingHour,
|
|
|
|
|
LostWorkingHour = lostWorkingHour,
|
|
|
|
|
SafeWorkingHour = safeWorkingHour,
|
2025-07-01 14:07:38 +08:00
|
|
|
|
SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum) + safeTrainBoShengList.Sum(x => x.TrainPersonNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum),
|
|
|
|
|
SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum),
|
2025-06-12 10:39:28 +08:00
|
|
|
|
HseTechnicalNum = hseTechnicalList.Count(),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
EnvironmentalTrainNum = 0,
|
|
|
|
|
TotalEnergyConsumption = totalEnergyConsumption,
|
|
|
|
|
IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption,
|
|
|
|
|
NewWaterConsumption = newWaterConsumption,
|
|
|
|
|
HeadOfficeInspectorGeneralNum = headOfficeInspectorGeneralList.Count,
|
|
|
|
|
HeadOfficeFullTimeNum = headOfficeFullTimeList.Count,
|
|
|
|
|
BranchInspectorGeneralNum = branchInspectorGeneralList.Count,
|
|
|
|
|
BranchFullTimeNum = branchFullTimeList.Count,
|
|
|
|
|
ProjectInspectorGeneralNum = projectInspectorGeneralList.Count,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
ProjectFullTimeNum = projectFullTimeList.Count(x => x.IsOffice == true),
|
|
|
|
|
ProjectSubFullTimeNum = projectFullTimeList.Count(x => x.IsOffice == false),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ProjectSafetyMonitorNum = projectSafetyMonitorList.Count,
|
|
|
|
|
SafetyCommitteeMeetingNum = safetyCommitteeMeetingList.Count(),
|
|
|
|
|
EnterpriseTopicsMeetingNum = enterpriseTopicsMeetingList.Count(),
|
|
|
|
|
ProjectSafetyLeadingGroupMeetingNum = projectSafetyLeadingGroupMeetingList.Count(),
|
|
|
|
|
ProjectSafetyMeetingNum = projectSafetyMeetingList.Count(),
|
|
|
|
|
CompanyLeadShiftCheckNum = companyLeadShiftCheckList.Count(),
|
|
|
|
|
CompanyComprehensiveCheckNum = companyComprehensiveCheckList.Count(),
|
|
|
|
|
CompanySpecialCheckNum = companySpecialCheckList.Count(),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchLeadShiftCheckNum = branchLeadShiftCheckList.Count(),
|
|
|
|
|
BranchComprehensiveCheckNum = branchComprehensiveCheckList.Count(),
|
|
|
|
|
BranchSpecialCheckNum = branchSpecialCheckList.Count(),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ProjectLeadShiftCheckNum = projectLeadShiftCheckList.Count(),
|
|
|
|
|
ProjectSpecialCheckNum = projectSpecialCheckList.Count(),
|
|
|
|
|
ProjectMajorCheckNum = projectMajorCheckList.Count(),
|
|
|
|
|
NearMissNum = nearMissList.Count(),
|
|
|
|
|
RecordableEventNum = recordableEventList.Count(),
|
|
|
|
|
GeneralAccidentNum = generalAccidentList.Count(),
|
|
|
|
|
MajorAccidentNum = majorAccidentList.Count(),
|
|
|
|
|
SeriousAccidentNum = seriousAccidentList.Count(),
|
|
|
|
|
SpecialSeriousAccidentNum = specialSeriousAccidentList.Count(),
|
|
|
|
|
CompanyComprehensivePlanNum = companyComprehensivePlanList.Count(),
|
|
|
|
|
CompanySpecialPlanNum = companySpecialPlanList.Count(),
|
|
|
|
|
CompanyOnSiteDisposalPlan = companyOnSiteDisposalPlanList.Count(),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchComprehensivePlanNum = branchComprehensivePlanList.Count(),
|
|
|
|
|
BranchSpecialPlanNum = branchSpecialPlanList.Count(),
|
|
|
|
|
BranchOnSiteDisposalPlan = branchOnSiteDisposalPlanList.Count(),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
CompanyDrillNum = companyDrillList.Count(),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
CompanyDrillPersonNum = companyDrillList.Sum(x => x.JointPersonNum),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchDrillNum = branchDrillList.Count(),
|
|
|
|
|
BranchDrillPersonNum = branchDrillList.Sum(x => x.JointPersonNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(),
|
|
|
|
|
ProjectSpecialPlanNum = projectSpecialPlanList.Count(),
|
|
|
|
|
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(),
|
|
|
|
|
ProjectDrillNum = projectDrillList.Count(),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ProjectDrillPersonNum = projectDrillList.Sum(x => x.JointPersonNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
CostExtract = Convert.ToInt32(costExtract.Sum(x => x.SUMCost)),
|
|
|
|
|
CostUse = Convert.ToInt32(costUseList.Sum(x => x.SUMCost)),
|
|
|
|
|
UseEquipmentNum = useEquipmentList.Count(),
|
|
|
|
|
SpecialEquipmentNum = specialEquipmentList.Count(),
|
|
|
|
|
LicensesNum = licensesList.Count(),
|
|
|
|
|
LicensesCloseNum = licensesCloseList.Count(),
|
|
|
|
|
GeneralClosedNum = generalHiddenRectificationOutputsList.Sum(x => x.RecNum),
|
|
|
|
|
GeneralNotClosedNum = generalHiddenRectificationOutputsList.Sum(x => x.NoRecNum),
|
|
|
|
|
MajorClosedNum = majorHiddenRectificationOutputsList.Sum(x => x.RecNum),
|
|
|
|
|
MajorNotClosedNum = majorHiddenRectificationOutputsList.Sum(x => x.NoRecNum),
|
|
|
|
|
LowRiskNum = securityRiskOutputListTask.Result.Sum(x => x.LowRiskNum),
|
|
|
|
|
GeneralRiskNum = securityRiskOutputListTask.Result.Sum(x => x.GeneralRiskNum),
|
|
|
|
|
MediumRiskNum = securityRiskOutputListTask.Result.Sum(x => x.MediumRiskNum),
|
|
|
|
|
HighRiskNum = securityRiskOutputListTask.Result.Sum(x => x.HighRiskNum),
|
|
|
|
|
CompletedNum = largeEngineeringOutputsTask.Result.Sum(x => x.CompletedNum),
|
|
|
|
|
TrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.TrainPersonNum),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
OperativesNum = largeEngineeringOutputsTask.Result.Sum(x => x.OperativesNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.ConstructionNum),
|
|
|
|
|
FinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.FinishedNum),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.ArgumentNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
SuperCompletedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedNum),
|
|
|
|
|
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperTrainPersonNum),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
SuperOperativesNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperOperativesNum),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum),
|
|
|
|
|
SuperFinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperFinishedNum),
|
|
|
|
|
SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum)
|
2024-12-24 19:04:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#region 添加项目统计数据
|
|
|
|
|
|
|
|
|
|
Project_HSSEData_HSSEService.DeleteProject_HSSEData_HSSEByDate(DateTime.Now.Date);
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
|
|
|
|
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),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
OperativesNum = g.Sum(x => x.OperativesNum),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
SuperOperativesNum = g.Sum(x => x.SuperOperativesNum),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
SuperFinishedNum = g.Sum(x => x.SuperFinishedNum),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
|
|
|
|
|
}
|
|
|
|
|
);
|
2024-12-24 19:04:32 +08:00
|
|
|
|
foreach (var projectid in BeUnderConstructionList)
|
|
|
|
|
{
|
2025-06-04 23:40:57 +08:00
|
|
|
|
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
|
|
|
|
|
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
|
|
|
|
|
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
|
|
|
|
|
largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs);
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var projectHsseData = new Project_HSSEData_HSSE
|
|
|
|
|
{
|
|
|
|
|
Id = SQLHelper.GetNewID(),
|
|
|
|
|
ProjectId = projectid,
|
|
|
|
|
UnitId = thisUnitId,
|
|
|
|
|
CollCropCode = baseUnit.CollCropCode,
|
|
|
|
|
UnitName = baseUnit.UnitName,
|
|
|
|
|
ReportDate = DateTime.Now.Date,
|
|
|
|
|
JoinConstructionPersonNum = joinConstructionPersonList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
MajorProjectsUnderConstructionNum = majorProjectsUnderConstructionList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
TotalWorkingHour = 0,//工时数据取自集团报表,项目无法提取
|
|
|
|
|
LostWorkingHour = 0,
|
|
|
|
|
SafeWorkingHour = 0,
|
2025-07-01 14:07:38 +08:00
|
|
|
|
SafeTrainNum = safeTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum) + safeTrainBoShengList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
SpecialTrainNum = specialTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
|
|
|
|
SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
2025-06-12 10:39:28 +08:00
|
|
|
|
HseTechnicalNum = hseTechnicalList.Count(x => x.ProjectId == projectid),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
EnvironmentalTrainNum = 0,
|
|
|
|
|
TotalEnergyConsumption = 0,
|
|
|
|
|
IncomeComprehensiveEnergyConsumption = 0,
|
|
|
|
|
NewWaterConsumption = 0,
|
|
|
|
|
HeadOfficeInspectorGeneralNum = 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
HeadOfficeFullTimeNum = 0,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
BranchInspectorGeneralNum = 0,
|
|
|
|
|
BranchFullTimeNum = 0,
|
|
|
|
|
SafetyInjectionEngineer = safetyInjectionEngineerList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
EnterpriseTopicsMeetingNum = safetyInjectionEngineerList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CertificateANum = certificateAList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CertificateBNum = certificateBList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CertificateCNum = certificateCList.Count(x => x.ProjectId == projectid),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
QualityPersonNum = qualityPersonList.Count(x => x.ProjectId == projectid),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ProjectInspectorGeneralNum = projectInspectorGeneralList.Count(x => x.ProjectId == projectid),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
ProjectFullTimeNum = projectFullTimeList.Count(x => x.ProjectId == projectid && x.IsOffice == true),
|
|
|
|
|
ProjectSubFullTimeNum = projectFullTimeList.Count(x => x.ProjectId == projectid && x.IsOffice == false),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ProjectSafetyMonitorNum = projectSafetyMonitorList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
ProjectSafetyLeadingGroupMeetingNum = projectSafetyLeadingGroupMeetingList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
ProjectSafetyMeetingNum = projectSafetyMeetingList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CompanyLeadShiftCheckNum = companyLeadShiftCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CompanyComprehensiveCheckNum = companyComprehensiveCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CompanySpecialCheckNum = companySpecialCheckList.Count(x => x.ProjectId == projectid),
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchLeadShiftCheckNum = branchLeadShiftCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
BranchComprehensiveCheckNum = branchComprehensiveCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
BranchSpecialCheckNum = branchSpecialCheckList.Count(x => x.ProjectId == projectid),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
ProjectLeadShiftCheckNum = projectLeadShiftCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
ProjectSpecialCheckNum = projectSpecialCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
ProjectMajorCheckNum = projectMajorCheckList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
NearMissNum = nearMissList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
RecordableEventNum = recordableEventList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
GeneralAccidentNum = generalAccidentList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
MajorAccidentNum = majorAccidentList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
SeriousAccidentNum = seriousAccidentList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
SpecialSeriousAccidentNum = specialSeriousAccidentList.Count(x => x.ProjectId == projectid),
|
|
|
|
|
CompanyComprehensivePlanNum = 0,
|
|
|
|
|
CompanySpecialPlanNum = 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
CompanyOnSiteDisposalPlan = 0,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchComprehensivePlanNum = 0,
|
|
|
|
|
BranchSpecialPlanNum = 0,
|
|
|
|
|
BranchOnSiteDisposalPlan = 0,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
CompanyDrillNum = 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
CompanyDrillPersonNum = 0,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
BranchDrillNum = 0,
|
|
|
|
|
BranchDrillPersonNum = 0,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
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),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ProjectDrillPersonNum = projectDrillList.Where(x => x.ProjectId == projectid).Sum(x => x.JointPersonNum),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
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),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
OperativesNum = largeEngineeringOutputs?.OperativesNum ?? 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ConstructionNum = largeEngineeringOutputs?.ConstructionNum ?? 0,
|
|
|
|
|
FinishedNum = largeEngineeringOutputs?.FinishedNum ?? 0,
|
|
|
|
|
ArgumentNum = largeEngineeringOutputs?.ArgumentNum ?? 0,
|
|
|
|
|
SuperCompletedNum = largeEngineeringOutputs?.SuperCompletedNum ?? 0,
|
|
|
|
|
SuperTrainPersonNum = largeEngineeringOutputs?.SuperTrainPersonNum ?? 0,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
SuperOperativesNum = largeEngineeringOutputs?.SuperOperativesNum ?? 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperConstructionNum = largeEngineeringOutputs?.SuperConstructionNum ?? 0,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
SuperFinishedNum = largeEngineeringOutputs?.SuperFinishedNum ?? 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 0
|
2024-12-24 19:04:32 +08:00
|
|
|
|
};
|
|
|
|
|
Project_HSSEData_HSSEService.AddProject_HSSEData_HSSE(projectHsseData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
if (IsReportByToday())
|
|
|
|
|
{
|
|
|
|
|
table.Id = GetTodayData().Id;
|
|
|
|
|
table.State = Const.CNCEC_State_1;
|
|
|
|
|
UpdateHSSEData_HSSE(table);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
table.Id = SQLHelper.GetNewID();
|
|
|
|
|
table.State = Const.CNCEC_State_0;
|
|
|
|
|
AddHSSEData_HSSE(table);
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
|
|
|
|
var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
|
2022-12-26 14:34:56 +08:00
|
|
|
|
return data;
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
public static void UpdateHSSEData_HSSE(HSSEData_HSSE newtable)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
using (var db = new SGGLDB(Funs.ConnString))
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var table = db.HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
|
|
|
|
|
if (table != null)
|
|
|
|
|
{
|
|
|
|
|
table.Id = newtable.Id;
|
|
|
|
|
table.UnitId = newtable.UnitId;
|
|
|
|
|
table.CollCropCode = newtable.CollCropCode;
|
|
|
|
|
table.UnitName = newtable.UnitName;
|
|
|
|
|
table.ReportDate = newtable.ReportDate;
|
|
|
|
|
table.BeUnderConstructionNum = newtable.BeUnderConstructionNum;
|
|
|
|
|
table.ShutdownNum = newtable.ShutdownNum;
|
|
|
|
|
table.JoinConstructionPersonNum = newtable.JoinConstructionPersonNum;
|
|
|
|
|
table.MajorProjectsUnderConstructionNum = newtable.MajorProjectsUnderConstructionNum;
|
|
|
|
|
table.TotalWorkingHour = newtable.TotalWorkingHour;
|
|
|
|
|
table.LostWorkingHour = newtable.LostWorkingHour;
|
|
|
|
|
table.SafeWorkingHour = newtable.SafeWorkingHour;
|
|
|
|
|
table.SafeTrainNum = newtable.SafeTrainNum;
|
|
|
|
|
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
|
|
|
|
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
table.HseTechnicalNum = newtable.HseTechnicalNum;
|
2024-12-24 19:04:32 +08:00
|
|
|
|
table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
|
|
|
|
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
|
|
|
|
table.NewWaterConsumption = newtable.NewWaterConsumption;
|
|
|
|
|
table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
|
|
|
|
|
table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
|
|
|
|
|
table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
|
|
|
|
|
table.BranchFullTimeNum = newtable.BranchFullTimeNum;
|
|
|
|
|
table.ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum;
|
|
|
|
|
table.ProjectFullTimeNum = newtable.ProjectFullTimeNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.ProjectSubFullTimeNum = newtable.ProjectSubFullTimeNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
|
|
|
|
|
table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
|
|
|
|
|
table.CertificateANum = newtable.CertificateANum;
|
|
|
|
|
table.CertificateBNum = newtable.CertificateBNum;
|
|
|
|
|
table.CertificateCNum = newtable.CertificateCNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.QualityPersonNum = newtable.QualityPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum;
|
|
|
|
|
table.EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum;
|
|
|
|
|
table.ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum;
|
|
|
|
|
table.ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum;
|
|
|
|
|
table.CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum;
|
|
|
|
|
table.CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum;
|
|
|
|
|
table.CompanySpecialCheckNum = newtable.CompanySpecialCheckNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.BranchLeadShiftCheckNum = newtable.BranchLeadShiftCheckNum;
|
|
|
|
|
table.BranchComprehensiveCheckNum = newtable.BranchComprehensiveCheckNum;
|
|
|
|
|
table.BranchSpecialCheckNum = newtable.BranchSpecialCheckNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.ProjectLeadShiftCheckNum = newtable.ProjectLeadShiftCheckNum;
|
|
|
|
|
table.ProjectSpecialCheckNum = newtable.ProjectSpecialCheckNum;
|
|
|
|
|
table.ProjectMajorCheckNum = newtable.ProjectMajorCheckNum;
|
|
|
|
|
table.NearMissNum = newtable.NearMissNum;
|
|
|
|
|
table.RecordableEventNum = newtable.RecordableEventNum;
|
|
|
|
|
table.GeneralAccidentNum = newtable.GeneralAccidentNum;
|
|
|
|
|
table.MajorAccidentNum = newtable.MajorAccidentNum;
|
|
|
|
|
table.SeriousAccidentNum = newtable.SeriousAccidentNum;
|
|
|
|
|
table.SpecialSeriousAccidentNum = newtable.SpecialSeriousAccidentNum;
|
|
|
|
|
table.CompanyComprehensivePlanNum = newtable.CompanyComprehensivePlanNum;
|
|
|
|
|
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
|
|
|
|
|
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.BranchComprehensivePlanNum = newtable.BranchComprehensivePlanNum;
|
|
|
|
|
table.BranchSpecialPlanNum = newtable.BranchSpecialPlanNum;
|
|
|
|
|
table.BranchOnSiteDisposalPlan = newtable.BranchOnSiteDisposalPlan;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.CompanyDrillNum = newtable.CompanyDrillNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
table.CompanyDrillPersonNum = newtable.CompanyDrillPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.BranchDrillNum = newtable.BranchDrillNum;
|
|
|
|
|
table.BranchDrillPersonNum = newtable.BranchDrillPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
|
|
|
|
|
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
|
|
|
|
|
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
|
|
|
|
|
table.ProjectDrillNum = newtable.ProjectDrillNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
table.ProjectDrillPersonNum = newtable.ProjectDrillPersonNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.CostExtract = newtable.CostExtract;
|
|
|
|
|
table.CostUse = newtable.CostUse;
|
|
|
|
|
table.UseEquipmentNum = newtable.UseEquipmentNum;
|
|
|
|
|
table.SpecialEquipmentNum = newtable.SpecialEquipmentNum;
|
|
|
|
|
table.LicensesNum = newtable.LicensesNum;
|
|
|
|
|
table.LicensesCloseNum = newtable.LicensesCloseNum;
|
|
|
|
|
table.GeneralClosedNum = newtable.GeneralClosedNum;
|
|
|
|
|
table.GeneralNotClosedNum = newtable.GeneralNotClosedNum;
|
|
|
|
|
table.MajorClosedNum = newtable.MajorClosedNum;
|
|
|
|
|
table.MajorNotClosedNum = newtable.MajorNotClosedNum;
|
|
|
|
|
table.GeneralRiskNum = newtable.GeneralRiskNum;
|
|
|
|
|
table.LowRiskNum = newtable.LowRiskNum;
|
|
|
|
|
table.MediumRiskNum = newtable.MediumRiskNum;
|
|
|
|
|
table.HighRiskNum = newtable.HighRiskNum;
|
|
|
|
|
table.CompletedNum = newtable.CompletedNum;
|
|
|
|
|
table.TrainPersonNum = newtable.TrainPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.OperativesNum = newtable.OperativesNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.ConstructionNum = newtable.ConstructionNum;
|
|
|
|
|
table.FinishedNum = newtable.FinishedNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
table.ArgumentNum = newtable.ArgumentNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.SuperCompletedNum = newtable.SuperCompletedNum;
|
|
|
|
|
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
|
2025-06-19 16:55:10 +08:00
|
|
|
|
table.SuperOperativesNum = newtable.SuperOperativesNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.SuperConstructionNum = newtable.SuperConstructionNum;
|
|
|
|
|
table.SuperFinishedNum = newtable.SuperFinishedNum;
|
2025-06-04 23:40:57 +08:00
|
|
|
|
table.SuperArgumentNum = newtable.SuperArgumentNum;
|
2023-08-10 11:40:02 +08:00
|
|
|
|
table.State = newtable.State;
|
|
|
|
|
table.CreateMan = newtable.CreateMan;
|
|
|
|
|
table.CreateDate = newtable.CreateDate;
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 安监人员数据
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// 获取企业总部总监人数
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetHeadOfficeInspectorGeneral()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var unitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null) unitId = thisUnit.UnitId;
|
|
|
|
|
var result = (from x in Funs.DB.Person_CompanyBranchPerson
|
2024-12-24 19:04:32 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId == unitId && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = "",
|
|
|
|
|
ProjectName = "",
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-05-09 19:56:06 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业总部总监人数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetHeadOfficeInspectorGeneralAsync()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetHeadOfficeInspectorGeneral);
|
|
|
|
|
}
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// 获取企业总部专职人数
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetHeadOfficeFullTime()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var unitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null) unitId = thisUnit.UnitId;
|
|
|
|
|
var result = (from x in Funs.DB.Person_CompanyBranchPerson
|
2024-12-24 19:04:32 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where x.IsOnJob == true && y.IsHsse == true && x.UnitId == unitId && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectName = "",
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-05-09 19:56:06 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业总部专职人数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetHeadOfficeFullTimeAsync()
|
|
|
|
|
{
|
2025-06-04 23:40:57 +08:00
|
|
|
|
return await Task.Run(GetHeadOfficeFullTime);
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取分支机构专职人数
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetBranchFullTime()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var unitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null) unitId = thisUnit.UnitId;
|
|
|
|
|
var result = (from x in Funs.DB.Person_CompanyBranchPerson
|
2024-12-24 19:04:32 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where x.IsOnJob == true && y.IsHsse == true && x.UnitId != unitId && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectName = "",
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-05-09 19:56:06 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构专职人数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetBranchFullTimeAsync()
|
|
|
|
|
{
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetBranchFullTime);
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取分支机构总监人数
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetBranchInspectorGeneral()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2023-08-10 11:40:02 +08:00
|
|
|
|
var unitId = string.Empty;
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
if (thisUnit != null) unitId = thisUnit.UnitId;
|
|
|
|
|
var result = (from x in Funs.DB.Person_CompanyBranchPerson
|
2024-12-24 19:04:32 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId != unitId && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectName = "",
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-05-09 19:56:06 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取分支机构总监人数(异步)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetBranchInspectorGeneralAsync()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetBranchInspectorGeneral);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目总监人数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetProjectInspectorGeneral()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) &&
|
|
|
|
|
x.WorkPostId == Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-07-24 16:42:54 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目总监人数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectInspectorGeneralAsync()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetProjectInspectorGeneral);
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取项目专职人数
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetProjectFullTime()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2025-06-19 16:55:10 +08:00
|
|
|
|
string ThisUnitId = CommonService.GetThisUnitId();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
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()
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId into yGroup
|
|
|
|
|
from y in yGroup.DefaultIfEmpty()
|
|
|
|
|
join z in Funs.DB.Base_Post on x.WorkPostId equals z.PostId into zGroup
|
|
|
|
|
from z in zGroup.DefaultIfEmpty()
|
2024-12-24 19:04:32 +08:00
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && y.IsHsse == true && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
ProjectFromUnitId = p.UnitId,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
WorkPostName = y.WorkPostName == null ? "" : y.WorkPostName,
|
|
|
|
|
Phone = x.Telephone,
|
|
|
|
|
// IsOffice=(u.UnitId== ThisUnitId?true:false)
|
|
|
|
|
IsOffice = u.UnitId == null ? false : (u.UnitId == ThisUnitId || u.IsBranch == true ? true : false)
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-07-24 16:42:54 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取项目专职人数(异步)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectFullTimeAsync()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetProjectFullTime);
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取项目安全监护人数
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// </summary>
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetProjectSafetyMonitor()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
where x.IsSafetyMonitoring == true && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
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()
|
|
|
|
|
join post in Funs.DB.Base_WorkPost on x.WorkPostId equals post.WorkPostId into postGroup
|
|
|
|
|
from post in postGroup.DefaultIfEmpty()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId)
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = post.WorkPostName,
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取项目安全监护人数(异步)
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectSafetyMonitorAsync()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetProjectSafetyMonitor);
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取在岗执业注安师
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetSafetyInjectionEngineer()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && z.IsRegisterHSSE == true && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
var query2 = (from x in Funs.DB.Sys_User
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.UserId equals y.UserId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where z.IsRegisterHSSE == true && x.IdentityCard != null && x.IsPost == true
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.UserName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
result.AddRange(query2);
|
|
|
|
|
result = result
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-07-24 16:42:54 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在岗执业注安师(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetSafetyInjectionEngineerAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSafetyInjectionEngineer);
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取A证人员
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetCertificateA()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = new List<Model.OfSafetySupervisorsOutput>();
|
|
|
|
|
var query1 = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && z.CertificateType == "A" && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
var query2 = (from x in Funs.DB.Sys_User
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.UserId equals y.UserId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where z.CertificateType == "A" && x.IdentityCard != null && x.IsPost == true
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.UserName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
query1.AddRange(query2);
|
|
|
|
|
result = query1
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-07-24 16:42:54 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取A证人员(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2025-06-04 23:40:57 +08:00
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateAAsync()
|
2024-12-24 19:04:32 +08:00
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCertificateA);
|
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取B证人员
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetCertificateB()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = new List<Model.OfSafetySupervisorsOutput>();
|
|
|
|
|
var query1 = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && z.CertificateType == "B" && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
var query2 = (from x in Funs.DB.Sys_User
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.UserId equals y.UserId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where z.CertificateType == "B" && x.IdentityCard != null && x.IsPost == true
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.UserName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
query1.AddRange(query2);
|
|
|
|
|
result = query1
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-07-24 16:42:54 +08:00
|
|
|
|
return result;
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取B证人员(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateBAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCertificateB);
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取C证人员
|
2022-12-26 14:34:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetCertificateC()
|
2022-12-26 14:34:56 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = new List<Model.OfSafetySupervisorsOutput>();
|
|
|
|
|
var query1 = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && z.CertificateType == "C" && x.IsUsed == true && x.IdentityCard != null
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.PersonName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
var query2 = (from x in Funs.DB.Sys_User
|
|
|
|
|
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()
|
|
|
|
|
join y in Funs.DB.QualityAudit_PersonQuality on x.UserId equals y.UserId
|
|
|
|
|
join z in Funs.DB.Base_Certificate on y.CertificateId equals z.CertificateId
|
|
|
|
|
where z.CertificateType == "C" && x.IdentityCard != null && x.IsPost == true
|
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = x.UserName,
|
|
|
|
|
Sex = x.Sex == null ? "" : (x.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
WorkPostName = PostService.GetPostNameById(x.WorkPostId),
|
|
|
|
|
Phone = x.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
query1.AddRange(query2);
|
|
|
|
|
result = query1
|
|
|
|
|
.GroupBy(x => x.IdentityCard)
|
|
|
|
|
.Select(g => g.FirstOrDefault())
|
|
|
|
|
.ToList();
|
2023-07-24 16:42:54 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// <summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// 获取C证人员(异步)
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// </summary>
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <returns></returns>
|
2025-06-04 23:40:57 +08:00
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateCAsync()
|
2023-07-24 16:42:54 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetCertificateC);
|
2023-07-24 16:42:54 +08:00
|
|
|
|
}
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在岗特种作业人员数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.OfSafetySupervisorsOutput> GetQualityPersonNum()
|
|
|
|
|
{
|
2025-06-26 18:59:24 +08:00
|
|
|
|
var result = (from p in Funs.DB.SitePerson_Person
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join bp in Funs.DB.Base_Project on p.ProjectId equals bp.ProjectId into bpGroup
|
|
|
|
|
from bp in bpGroup.DefaultIfEmpty()
|
|
|
|
|
join u in Funs.DB.Base_Unit on p.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
2025-06-26 18:59:24 +08:00
|
|
|
|
join q in Funs.DB.QualityAudit_PersonQuality on p.PersonId equals q.PersonId into qGroup
|
|
|
|
|
from q in qGroup.DefaultIfEmpty()
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join m in Funs.DB.Base_WorkPost on p.WorkPostId equals m.WorkPostId into mGroup
|
|
|
|
|
from m in mGroup.DefaultIfEmpty()
|
2025-06-26 18:59:24 +08:00
|
|
|
|
join su in Funs.DB.Sys_User on q.CompileMan equals su.UserId into suGroup
|
|
|
|
|
from su in suGroup.DefaultIfEmpty()
|
|
|
|
|
join bc in Funs.DB.Base_Certificate on q.CertificateId equals bc.CertificateId into bcGroup
|
|
|
|
|
from bc in bcGroup.DefaultIfEmpty()
|
|
|
|
|
join su1 in Funs.DB.Sys_User on q.AuditorId equals su1.UserId into su1Group
|
|
|
|
|
from su1 in su1Group.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2 && p.IsUsed == true
|
2025-06-19 16:55:10 +08:00
|
|
|
|
select new Model.OfSafetySupervisorsOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = p.ProjectId,
|
|
|
|
|
ProjectName = bp.ProjectName,
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Name = p.PersonName,
|
|
|
|
|
Sex = p.Sex == null ? "" : (p.Sex == "1" ? "男" : "女"),
|
|
|
|
|
IdentityCard = p.IdentityCard,
|
|
|
|
|
WorkPostName = m.WorkPostName == null ? "" : m.WorkPostName,
|
|
|
|
|
Phone = p.Telephone
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2025-06-26 18:59:24 +08:00
|
|
|
|
|
2025-06-19 16:55:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在岗特种作业人员数量(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetQualityPersonNumAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetQualityPersonNum);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
#endregion
|
2023-07-24 16:42:54 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
#region 安全会议数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业安委会会数据
|
2023-08-10 11:40:02 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2025-06-04 23:40:57 +08:00
|
|
|
|
public static List<MeetingOutput> GetSafetyCommitteeMeeting()
|
2023-08-10 11:40:02 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result =
|
|
|
|
|
(from x in Funs.DB.Meeting_CompanySafetyMeeting
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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,
|
|
|
|
|
});
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业安委会会数据(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<MeetingOutput>> GetSafetyCommitteeMeetingAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSafetyCommitteeMeeting);
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
2023-08-10 11:40:02 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业专题会议数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetEnterpriseTopicsMeetingNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Meeting_CompanySpecialMeeting
|
|
|
|
|
where x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业专题会议
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<MeetingOutput> GetEnterpriseTopicsMeeting()
|
|
|
|
|
{
|
|
|
|
|
var result =
|
2025-06-04 23:40:57 +08:00
|
|
|
|
(from x in Funs.DB.Meeting_CompanySpecialMeeting
|
2024-12-24 19:04:32 +08:00
|
|
|
|
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()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.CompanySpecialMeetingId,
|
|
|
|
|
MeetingName = x.CompanySpecialMeetingName,
|
|
|
|
|
MeetingDate = x.CompanySpecialMeetingDate,
|
|
|
|
|
MeetingHours = x.MeetingHours,
|
|
|
|
|
HostMan = x.MeetingHostMan,
|
|
|
|
|
AttentPerson = x.AttentPerson,
|
|
|
|
|
AttentPersonNum = x.AttentPersonNum,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业专题会议(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2025-06-04 23:40:57 +08:00
|
|
|
|
public static async Task<List<MeetingOutput>> GetEnterpriseTopicsMeetingAsync()
|
2024-12-24 19:04:32 +08:00
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetEnterpriseTopicsMeeting);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目班前会
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<MeetingOutput> GetProjectClassMeeting()
|
|
|
|
|
{
|
|
|
|
|
var result =
|
|
|
|
|
(
|
|
|
|
|
from x in Funs.DB.Meeting_ClassMeeting
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where x.CompileDate > Const.DtmarkTime && BeUnderConstructionList.Contains(p.ProjectId)
|
|
|
|
|
select new MeetingOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
Id = x.ClassMeetingId,
|
|
|
|
|
MeetingName = x.ClassMeetingName,
|
|
|
|
|
MeetingDate = x.ClassMeetingDate,
|
|
|
|
|
MeetingHours = x.MeetingHours,
|
|
|
|
|
HostMan = x.MeetingHostMan,
|
|
|
|
|
AttentPerson = x.AttentPerson,
|
|
|
|
|
AttentPersonNum = x.AttentPersonNum,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目班前会议(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<MeetingOutput>> GetProjectClassMeetingAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectClassMeeting);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目专题会议
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<MeetingOutput> GetProjectSpecialMeeting()
|
|
|
|
|
{
|
|
|
|
|
var result =
|
|
|
|
|
(
|
|
|
|
|
from x in Funs.DB.Meeting_SpecialMeeting
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where x.CompileDate > Const.DtmarkTime && BeUnderConstructionList.Contains(p.ProjectId)
|
|
|
|
|
select new MeetingOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
Id = x.SpecialMeetingId,
|
|
|
|
|
MeetingName = x.SpecialMeetingName,
|
|
|
|
|
MeetingDate = x.SpecialMeetingDate,
|
|
|
|
|
MeetingHours = x.MeetingHours,
|
|
|
|
|
HostMan = x.MeetingHostMan,
|
|
|
|
|
AttentPerson = x.AttentPerson,
|
|
|
|
|
AttentPersonNum = x.AttentPersonNum,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目专题会议(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<MeetingOutput>> GetProjectSpecialMeetingAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectSpecialMeeting);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目安全领导小组会议
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<MeetingOutput> GetProjectSafetyLeadingGroupMeeting()
|
|
|
|
|
{
|
|
|
|
|
var result =
|
|
|
|
|
(
|
|
|
|
|
from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where x.CompileDate > Const.DtmarkTime && BeUnderConstructionList.Contains(p.ProjectId)
|
|
|
|
|
select new MeetingOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
Id = x.SafetyLeaderGroupMeetingId,
|
|
|
|
|
MeetingName = x.SafetyLeaderGroupMeetingName,
|
|
|
|
|
MeetingDate = x.SafetyLeaderGroupMeetingDate,
|
|
|
|
|
MeetingHours = x.MeetingHours,
|
|
|
|
|
HostMan = x.MeetingHostMan,
|
|
|
|
|
AttentPerson = x.AttentPerson,
|
|
|
|
|
AttentPersonNum = x.AttentPersonNum,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目安全领导小组会议(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<MeetingOutput>> GetProjectSafetyLeadingGroupMeetingAsync()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetProjectSafetyLeadingGroupMeeting);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目安全例会数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<MeetingOutput> GetProjectSafetyMeeting()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Meeting_WeekMeeting
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new MeetingOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
Id = x.WeekMeetingId,
|
|
|
|
|
MeetingName = x.WeekMeetingName,
|
|
|
|
|
MeetingDate = x.WeekMeetingDate,
|
|
|
|
|
MeetingHours = x.MeetingHours,
|
|
|
|
|
HostMan = x.MeetingHostMan,
|
|
|
|
|
AttentPerson = x.AttentPerson,
|
|
|
|
|
AttentPersonNum = x.AttentPersonNum,
|
|
|
|
|
}).Union
|
|
|
|
|
(from x in Funs.DB.Meeting_MonthMeeting
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new MeetingOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
Id = x.MonthMeetingId,
|
|
|
|
|
MeetingName = x.MonthMeetingName,
|
|
|
|
|
MeetingDate = x.MonthMeetingDate,
|
|
|
|
|
MeetingHours = x.MeetingHours,
|
|
|
|
|
HostMan = x.MeetingHostMan,
|
|
|
|
|
AttentPerson = x.AttentPerson,
|
|
|
|
|
AttentPersonNum = x.AttentPersonNum,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目安全例会数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<MeetingOutput>> GetProjectSafetyMeetingAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectSafetyMeeting);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 安全监督检查数据
|
|
|
|
|
|
2025-06-19 16:55:10 +08:00
|
|
|
|
#region 企业级-本单位
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业负责人带班检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetCompanyLeadShiftCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
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()
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join cu in Funs.DB.Base_Unit on x.CheckUnitId equals cu.UnitId into cuGroup
|
|
|
|
|
from cu in cuGroup.DefaultIfEmpty()
|
|
|
|
|
where cu.UnitId == CommonService.GetThisUnitId() && x.CheckMainType == "0" && x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业负责人带班检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetCompanyLeadShiftCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanyLeadShiftCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业综合检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetCompanyComprehensiveCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
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()
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join cu in Funs.DB.Base_Unit on x.CheckUnitId equals cu.UnitId into cuGroup
|
|
|
|
|
from cu in cuGroup.DefaultIfEmpty()
|
|
|
|
|
where cu.UnitId == CommonService.GetThisUnitId() && x.CheckMainType == "0" && x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业综合检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetCompanyComprehensiveCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanyComprehensiveCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业专项检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetCompanySpecialCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
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()
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join cu in Funs.DB.Base_Unit on x.CheckUnitId equals cu.UnitId into cuGroup
|
|
|
|
|
from cu in cuGroup.DefaultIfEmpty()
|
|
|
|
|
where cu.UnitId == CommonService.GetThisUnitId() && x.CheckMainType == "0" && x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业专项检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetCompanySpecialCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanySpecialCheck);
|
|
|
|
|
}
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 分支机构
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构企业负责人带班检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetBranchLeadShiftCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
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()
|
|
|
|
|
join cu in Funs.DB.Base_Unit on x.CheckUnitId equals cu.UnitId into cuGroup
|
|
|
|
|
from cu in cuGroup.DefaultIfEmpty()
|
|
|
|
|
where cu.IsBranch == true && x.CheckMainType == "0" && x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构企业负责人带班检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetBranchLeadShiftCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchLeadShiftCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构企业综合检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetBranchComprehensiveCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
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()
|
|
|
|
|
join cu in Funs.DB.Base_Unit on x.CheckUnitId equals cu.UnitId into cuGroup
|
|
|
|
|
from cu in cuGroup.DefaultIfEmpty()
|
|
|
|
|
where cu.IsBranch == true && x.CheckMainType == "0" && x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构企业综合检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetBranchComprehensiveCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchComprehensiveCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构企业专项检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetBranchSpecialCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
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()
|
|
|
|
|
join cu in Funs.DB.Base_Unit on x.CheckUnitId equals cu.UnitId into cuGroup
|
|
|
|
|
from cu in cuGroup.DefaultIfEmpty()
|
|
|
|
|
where cu.IsBranch == true && x.CheckMainType == "0" && x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构企业专项检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetBranchSpecialCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchSpecialCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 项目级
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目负责人带班检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetProjectLeadShiftCheck()
|
|
|
|
|
{
|
2025-06-19 16:55:10 +08:00
|
|
|
|
// 先批量获取所有需要的UnitIds和LeaderIds
|
|
|
|
|
var unitIds = Funs.DB.Check_ProjectLeaderCheck
|
|
|
|
|
.Where(x => BeUnderConstructionList.Contains(x.ProjectId) && x.CheckDate > Const.DtmarkTime)
|
|
|
|
|
.Select(x => x.UnitIds).Distinct().ToList();
|
|
|
|
|
Dictionary<string, string> unitNames = new Dictionary<string, string>();
|
|
|
|
|
foreach (var item in unitIds)
|
|
|
|
|
{
|
|
|
|
|
unitNames.Add(item ?? "null", UnitService.getUnitNamesUnitIds(item));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var leaderIds = Funs.DB.Check_ProjectLeaderCheck
|
|
|
|
|
.Where(x => BeUnderConstructionList.Contains(x.ProjectId) && x.CheckDate > Const.DtmarkTime)
|
|
|
|
|
.Select(x => x.LeaderIds).Distinct().ToList();
|
|
|
|
|
Dictionary<string, string> leaderNames = new Dictionary<string, string>();
|
|
|
|
|
foreach (var item in leaderIds)
|
|
|
|
|
{
|
|
|
|
|
leaderNames.Add(item ?? "null", UserService.getUserNamesUserIds(item));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = (from x in Funs.DB.Check_ProjectLeaderCheck
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
UnitName = unitNames[x.UnitIds ?? "null"], // 从预加载的字典中获取
|
2024-12-24 19:04:32 +08:00
|
|
|
|
Id = x.ProjectLeaderCheckId,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
CheckTeam = leaderNames[x.LeaderIds ?? "null"], // 从预加载的字典中获取
|
2024-12-24 19:04:32 +08:00
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目负责人带班检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetProjectLeadShiftCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectLeadShiftCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目专项检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetProjectSpecialCheck()
|
|
|
|
|
{
|
2025-06-19 16:55:10 +08:00
|
|
|
|
var unitIds = Funs.DB.Check_CheckSpecial
|
|
|
|
|
.Where(x => BeUnderConstructionList.Contains(x.ProjectId) && x.CheckTime > Const.DtmarkTime)
|
|
|
|
|
.Select(x => x.PartInUnits).Distinct().ToList();
|
|
|
|
|
Dictionary<string, string> unitNames = new Dictionary<string, string>();
|
|
|
|
|
foreach (var item in unitIds)
|
|
|
|
|
{
|
|
|
|
|
unitNames.Add(item ?? "null", UnitService.getUnitNamesUnitIds(item));
|
|
|
|
|
|
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var result = (from x in Funs.DB.Check_CheckSpecial
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && x.CheckTime > Const.DtmarkTime
|
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
2025-06-19 16:55:10 +08:00
|
|
|
|
UnitName = unitNames[x.PartInUnits ?? "null"],
|
2024-12-24 19:04:32 +08:00
|
|
|
|
Id = x.CheckSpecialId,
|
|
|
|
|
CheckTeam = x.PartInPersonNames,
|
|
|
|
|
CheckDate = x.CheckTime,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目专项检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetProjectSpecialCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectSpecialCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目专业检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<CheckOutput> GetProjectMajorCheck()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|
|
|
|
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.ResponsibleUnit equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
join user in Funs.DB.Sys_User on x.CheckManId equals user.UserId into userGroup
|
2024-12-24 19:04:32 +08:00
|
|
|
|
from user in userGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && x.CheckTime > Const.DtmarkTime
|
|
|
|
|
select new Model.CheckOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitId = x.ResponsibleUnit,
|
|
|
|
|
UnitName = u.UnitName,
|
|
|
|
|
Id = x.HazardRegisterId,
|
|
|
|
|
CheckTeam = user.UserName,
|
|
|
|
|
CheckDate = x.CheckTime,
|
|
|
|
|
});
|
|
|
|
|
return result.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目专业检查次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<CheckOutput>> GetProjectMajorCheckAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectMajorCheck);
|
|
|
|
|
}
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 应急管理数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级综合预案数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetCompanyComprehensivePlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.UnitId == CommonService.GetThisUnitId() && y.EmergencyTypeName.Contains("综合") && x.CompileDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级综合预案数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetCompanyComprehensivePlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanyComprehensivePlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级专项预案数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetCompanySpecialPlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.UnitId == CommonService.GetThisUnitId() && y.EmergencyTypeName.Contains("专项") && x.CompileDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级专项预案数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetCompanySpecialPlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanySpecialPlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级现场处置预案
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetCompanyOnSiteDisposalPlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.UnitId == CommonService.GetThisUnitId() && y.EmergencyTypeName.Contains("现场处置") && x.CompileDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级现场处置预案(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetCompanyOnSiteDisposalPlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanyOnSiteDisposalPlan);
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构综合预案数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetBranchComprehensivePlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.IsBranch == true && y.EmergencyTypeName.Contains("综合") && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构综合预案数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetBranchComprehensivePlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchComprehensivePlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构专项预案数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetBranchSpecialPlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.IsBranch == true && y.EmergencyTypeName.Contains("专项") && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构专项预案数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetBranchSpecialPlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchSpecialPlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构现场处置预案
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetBranchOnSiteDisposalPlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.IsBranch == true && y.EmergencyTypeName.Contains("现场处置") && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构现场处置预案(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetBranchOnSiteDisposalPlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchOnSiteDisposalPlan);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级演练次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetCompanyDrill()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
|
|
|
|
|
join y in Funs.DB.Sys_Const on x.DrillRecordType equals y.ConstValue
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitIds equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.UnitId == CommonService.GetThisUnitId() && y.GroupId == "DrillRecordType" && x.CompileDate > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitIds,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
|
|
|
|
Id = x.DrillRecordListId,
|
|
|
|
|
EmergencyName = x.DrillRecordName,
|
|
|
|
|
EmergencyTypeName = y.ConstText,
|
|
|
|
|
Date = x.DrillRecordDate,
|
|
|
|
|
DrillCost = x.DrillCost,
|
|
|
|
|
JointPersonNum = x.JointPersonNum,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业级演练次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetCompanyDrillAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCompanyDrill);
|
|
|
|
|
}
|
2025-06-19 16:55:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构演练次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetBranchDrill()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
|
|
|
|
|
join y in Funs.DB.Sys_Const on x.DrillRecordType equals y.ConstValue
|
|
|
|
|
join u in Funs.DB.Base_Unit on x.UnitIds equals u.UnitId into uGroup
|
|
|
|
|
from u in uGroup.DefaultIfEmpty()
|
|
|
|
|
where u.IsBranch == true && y.GroupId == "DrillRecordType" && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitIds,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
|
|
|
|
Id = x.DrillRecordListId,
|
|
|
|
|
EmergencyName = x.DrillRecordName,
|
|
|
|
|
EmergencyTypeName = y.ConstText,
|
|
|
|
|
Date = x.DrillRecordDate,
|
|
|
|
|
DrillCost = x.DrillCost,
|
|
|
|
|
JointPersonNum = x.JointPersonNum,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分支机构演练次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetBranchDrillAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBranchDrill);
|
|
|
|
|
}
|
2024-12-24 19:04:32 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级综合预案
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetProjectComprehensivePlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && y.EmergencyTypeName.Contains("综合") &&
|
|
|
|
|
x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级综合预案(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetProjectComprehensivePlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectComprehensivePlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级专项预案数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetProjectSpecialPlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && y.EmergencyTypeName.Contains("专项") &&
|
|
|
|
|
x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级专项预案数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetProjectSpecialPlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectSpecialPlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级现场处置预案
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetProjectOnSiteDisposalPlan()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_EmergencyList
|
|
|
|
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && y.EmergencyTypeName.Contains("现场处置") &&
|
|
|
|
|
x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
|
|
|
|
Id = x.EmergencyListId,
|
|
|
|
|
EmergencyName = x.EmergencyName,
|
|
|
|
|
EmergencyTypeName = y.EmergencyTypeName,
|
|
|
|
|
VersionCode = x.VersionCode,
|
|
|
|
|
Date = x.CompileDate,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级现场处置预案(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetProjectOnSiteDisposalPlanAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectOnSiteDisposalPlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级演练次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EmergencyOutput> GetProjectDrill()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Emergency_DrillRecordList
|
|
|
|
|
join y in Funs.DB.Sys_Const on x.DrillRecordType equals y.ConstValue
|
|
|
|
|
where y.GroupId == "DrillRecordType"
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EmergencyOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
|
|
|
|
UnitId = x.UnitIds,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
|
|
|
|
Id = x.DrillRecordListId,
|
|
|
|
|
EmergencyName = x.DrillRecordName,
|
|
|
|
|
EmergencyTypeName = y.ConstText,
|
|
|
|
|
Date = x.DrillRecordDate,
|
|
|
|
|
DrillCost = x.DrillCost,
|
|
|
|
|
JointPersonNum = x.JointPersonNum,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取项目级演练次数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EmergencyOutput>> GetProjectDrillAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetProjectDrill);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 基础信息
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在建项目数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.ProjectOutput> GetBeUnderConstruction()
|
|
|
|
|
{
|
|
|
|
|
var projectInfos = from project in Funs.DB.Base_Project
|
|
|
|
|
join unit in Funs.DB.Base_Unit on project.UnitId equals unit.UnitId into unitJoin
|
|
|
|
|
from unit in unitJoin.DefaultIfEmpty()
|
|
|
|
|
join projectType in Funs.DB.Base_ProjectType on project.ProjectType equals projectType.ProjectTypeId into projectTypeJoin
|
|
|
|
|
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) && project.ProjectState == "1"
|
|
|
|
|
select new ProjectOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = project.ProjectId,
|
|
|
|
|
ProjectCode = project.ProjectCode,
|
|
|
|
|
ProjectName = project.ProjectName,
|
|
|
|
|
UnitId = project.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
StartDate = project.StartDate,
|
|
|
|
|
EndDate = project.EndDate,
|
|
|
|
|
ProjectAddress = project.ProjectAddress,
|
|
|
|
|
ShortName = project.ShortName,
|
|
|
|
|
ConstructionMoney = project.ConstructionMoney,
|
|
|
|
|
ProjectStateName = project.ProjectState == BLL.Const.ProjectState_2 ? "暂停中" : (project.ProjectState == BLL.Const.ProjectState_3 ? "已完工" : "施工中"),
|
|
|
|
|
ProjectState = project.ProjectState,
|
|
|
|
|
ProjectAttributeName = project.ProjectAttribute == "GONGCHENG" ? "工程" : (project.ProjectAttribute == "SHIYE" ? "实业" : ""),
|
|
|
|
|
ProjectMoney = project.ProjectMoney,
|
|
|
|
|
DayCount = DateTime.Now.Subtract(project.StartDate.Value).Days,
|
|
|
|
|
ProjectTypeName = projectType.ProjectTypeName,
|
|
|
|
|
ProjectStateName2 = sysConst.ConstText
|
|
|
|
|
};
|
|
|
|
|
var result = projectInfos.ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在建项目数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.ProjectOutput>> GetBeUnderConstructionAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBeUnderConstruction);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取停工项目数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.ProjectOutput> GetShutdown()
|
|
|
|
|
{
|
|
|
|
|
var projectInfos = from project in Funs.DB.Base_Project
|
|
|
|
|
join unit in Funs.DB.Base_Unit on project.UnitId equals unit.UnitId into unitJoin
|
|
|
|
|
from unit in unitJoin.DefaultIfEmpty()
|
|
|
|
|
join projectType in Funs.DB.Base_ProjectType on project.ProjectType equals projectType.ProjectTypeId into projectTypeJoin
|
|
|
|
|
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) && project.ProjectState == "2"
|
|
|
|
|
select new ProjectOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = project.ProjectId,
|
|
|
|
|
ProjectCode = project.ProjectCode,
|
|
|
|
|
ProjectName = project.ProjectName,
|
|
|
|
|
UnitId = project.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
StartDate = project.StartDate,
|
|
|
|
|
EndDate = project.EndDate,
|
|
|
|
|
ProjectAddress = project.ProjectAddress,
|
|
|
|
|
ShortName = project.ShortName,
|
|
|
|
|
ConstructionMoney = project.ConstructionMoney,
|
|
|
|
|
ProjectStateName = project.ProjectState == BLL.Const.ProjectState_2 ? "暂停中" : (project.ProjectState == BLL.Const.ProjectState_3 ? "已完工" : "施工中"),
|
|
|
|
|
ProjectState = project.ProjectState,
|
|
|
|
|
ProjectAttributeName = project.ProjectAttribute == "GONGCHENG" ? "工程" : (project.ProjectAttribute == "SHIYE" ? "实业" : ""),
|
|
|
|
|
ProjectMoney = project.ProjectMoney,
|
|
|
|
|
DayCount = DateTime.Now.Subtract(project.StartDate.Value).Days,
|
|
|
|
|
ProjectTypeName = projectType.ProjectTypeName,
|
|
|
|
|
ProjectStateName2 = sysConst.ConstText
|
|
|
|
|
};
|
|
|
|
|
var result = projectInfos.ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取停工项目数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.ProjectOutput>> GetShutdownAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetShutdown);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取完工项目数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.ProjectOutput> GetCompletedProject()
|
|
|
|
|
{
|
|
|
|
|
var projectInfos = from project in Funs.DB.Base_Project
|
|
|
|
|
join unit in Funs.DB.Base_Unit on project.UnitId equals unit.UnitId into unitJoin
|
|
|
|
|
from unit in unitJoin.DefaultIfEmpty()
|
|
|
|
|
join projectType in Funs.DB.Base_ProjectType on project.ProjectType equals projectType.ProjectTypeId into projectTypeJoin
|
|
|
|
|
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) && project.ProjectState == "3"
|
|
|
|
|
select new ProjectOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = project.ProjectId,
|
|
|
|
|
ProjectCode = project.ProjectCode,
|
|
|
|
|
ProjectName = project.ProjectName,
|
|
|
|
|
UnitId = project.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
StartDate = project.StartDate,
|
|
|
|
|
EndDate = project.EndDate,
|
|
|
|
|
ProjectAddress = project.ProjectAddress,
|
|
|
|
|
ShortName = project.ShortName,
|
|
|
|
|
ConstructionMoney = project.ConstructionMoney,
|
|
|
|
|
ProjectStateName = project.ProjectState == BLL.Const.ProjectState_2 ? "暂停中" : (project.ProjectState == BLL.Const.ProjectState_3 ? "已完工" : "施工中"),
|
|
|
|
|
ProjectState = project.ProjectState,
|
|
|
|
|
ProjectAttributeName = project.ProjectAttribute == "GONGCHENG" ? "工程" : (project.ProjectAttribute == "SHIYE" ? "实业" : ""),
|
|
|
|
|
ProjectMoney = project.ProjectMoney,
|
|
|
|
|
DayCount = DateTime.Now.Subtract(project.StartDate.Value).Days,
|
|
|
|
|
ProjectTypeName = projectType.ProjectTypeName,
|
|
|
|
|
ProjectStateName2 = sysConst.ConstText
|
|
|
|
|
};
|
|
|
|
|
var result = projectInfos.ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取所有项目数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.ProjectOutput> GetALLProject()
|
|
|
|
|
{
|
|
|
|
|
var projectInfos = from project in Funs.DB.Base_Project
|
|
|
|
|
join unit in Funs.DB.Base_Unit on project.UnitId equals unit.UnitId into unitJoin
|
|
|
|
|
from unit in unitJoin.DefaultIfEmpty()
|
|
|
|
|
join projectType in Funs.DB.Base_ProjectType on project.ProjectType equals projectType.ProjectTypeId into projectTypeJoin
|
|
|
|
|
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()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false)
|
2024-12-24 19:04:32 +08:00
|
|
|
|
select new ProjectOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = project.ProjectId,
|
|
|
|
|
ProjectCode = project.ProjectCode,
|
|
|
|
|
ProjectName = project.ProjectName,
|
|
|
|
|
UnitId = project.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
StartDate = project.StartDate,
|
|
|
|
|
EndDate = project.EndDate,
|
|
|
|
|
ProjectAddress = project.ProjectAddress,
|
|
|
|
|
ShortName = project.ShortName,
|
|
|
|
|
ConstructionMoney = project.ConstructionMoney,
|
|
|
|
|
ProjectStateName = project.ProjectState == BLL.Const.ProjectState_2 ? "暂停中" : (project.ProjectState == BLL.Const.ProjectState_3 ? "已完工" : "施工中"),
|
|
|
|
|
ProjectState = project.ProjectState,
|
|
|
|
|
ProjectAttributeName = project.ProjectAttribute == "GONGCHENG" ? "工程" : (project.ProjectAttribute == "SHIYE" ? "实业" : ""),
|
|
|
|
|
ProjectMoney = project.ProjectMoney,
|
|
|
|
|
DayCount = DateTime.Now.Subtract(project.StartDate.Value).Days,
|
|
|
|
|
ProjectTypeName = projectType.ProjectTypeName,
|
|
|
|
|
ProjectStateName2 = sysConst.ConstText
|
|
|
|
|
};
|
|
|
|
|
var result = projectInfos.ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取参建人数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.BaseEntities> GetJoinConstructionPerson()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.SitePerson_Person
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsUsed == true
|
|
|
|
|
select new Model.BaseEntities
|
|
|
|
|
{
|
|
|
|
|
Id = x.PersonId,
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
UnitId = x.UnitId
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取参建人数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.BaseEntities>> GetJoinConstructionPersonAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetJoinConstructionPerson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在施危大工程数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.BaseEntities> GetMajorProjectsUnderConstruction()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "2" &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select new Model.BaseEntities
|
|
|
|
|
{
|
|
|
|
|
Id = x.HazardId,
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在施危大工程数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<Model.BaseEntities>> GetMajorProjectsUnderConstructionAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetMajorProjectsUnderConstruction);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 工时数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取总工时数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetTotalWorkingHour()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var thisUnitid = CommonService.GetThisUnitId();
|
|
|
|
|
var yearSumItems = (from x in Funs.DB.Information_MillionsMonthlyReportItem
|
|
|
|
|
join y in Funs.DB.Information_MillionsMonthlyReport
|
|
|
|
|
on x.MillionsMonthlyReportId equals y.MillionsMonthlyReportId
|
|
|
|
|
where y.UnitId == thisUnitid && y.Year == DateTime.Now.Year && y.Month <= DateTime.Now.Month
|
|
|
|
|
&& x.Affiliation == "本月合计"
|
|
|
|
|
select x).Distinct().ToList();
|
|
|
|
|
var result = Convert.ToInt32(yearSumItems.Sum(x => x.TotalWorkNum ?? 0));
|
|
|
|
|
return result;
|
|
|
|
|
/*var result = (from x in Funs.DB.SitePerson_DayReportDetail
|
|
|
|
|
join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
|
|
|
|
|
where BeUnderConstructionList.Contains(y.ProjectId) && y.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x.PersonWorkTime ?? 0).ToList().Sum();
|
|
|
|
|
var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取总工时数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<int> GetTotalWorkingHourAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetTotalWorkingHour);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取损失工时数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetLostWorkingHour()
|
|
|
|
|
{
|
|
|
|
|
//var result =
|
|
|
|
|
// (from x in Funs.DB.Accident_AccidentHandle
|
|
|
|
|
// where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
// select x.WorkHoursLoss)
|
|
|
|
|
// .ToList().Sum(x => x.Value)
|
|
|
|
|
// + (from x in Funs.DB.Accident_AccidentReport
|
|
|
|
|
// where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
// select x.WorkingHoursLoss)
|
|
|
|
|
// .ToList().Sum(x => x.Value);
|
|
|
|
|
//var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
|
|
|
|
|
var q = 0;
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取损失工时数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<int> GetLostWorkingHourAsync()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetLostWorkingHour);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取安全工时数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetSafeWorkingHour()
|
|
|
|
|
{
|
|
|
|
|
/*var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
|
|
|
|
|
join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
|
|
|
|
|
where BeUnderConstructionList.Contains(y.ProjectId) && y.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x.PersonWorkTime ?? 0).ToList().Sum();
|
|
|
|
|
var result2 =
|
|
|
|
|
(from x in Funs.DB.Accident_AccidentHandle
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x.WorkHoursLoss)
|
|
|
|
|
.ToList().Sum(x => x.Value)
|
|
|
|
|
+ (from x in Funs.DB.Accident_AccidentReport
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x.WorkingHoursLoss)
|
|
|
|
|
.ToList().Sum(x => x.Value);
|
|
|
|
|
var result = result1 - result2;
|
|
|
|
|
var q = Funs.GetNewIntOrZero(result.ToString().Split('.')[0]);
|
|
|
|
|
|
|
|
|
|
return q;*/
|
|
|
|
|
var thisUnitid = CommonService.GetThisUnitId();
|
|
|
|
|
var yearSumItems = (from x in Funs.DB.Information_MillionsMonthlyReportItem
|
|
|
|
|
join y in Funs.DB.Information_MillionsMonthlyReport
|
|
|
|
|
on x.MillionsMonthlyReportId equals y.MillionsMonthlyReportId
|
|
|
|
|
where y.UnitId == thisUnitid && y.Year == DateTime.Now.Year && y.Month <= DateTime.Now.Month
|
|
|
|
|
&& x.Affiliation == "本月合计"
|
|
|
|
|
select x).Distinct().ToList();
|
|
|
|
|
var result = Convert.ToInt32(yearSumItems.Sum(x => x.TotalWorkNum ?? 0));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取安全工时数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<int> GetSafeWorkingHourAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSafeWorkingHour);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 安全教育培训
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取三级安全教育培训数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EduTrainOutput> GetSafeTrain()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.EduTrain_TrainRecord
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && y.TrainType == "1" &&
|
|
|
|
|
x.TrainStartDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EduTrainOutput()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
|
|
|
|
Id = x.TrainingId,
|
|
|
|
|
TrainTitle = x.TrainTitle,
|
|
|
|
|
TrainStartDate = x.TrainStartDate,
|
|
|
|
|
TrainEndDate = x.TrainEndDate,
|
|
|
|
|
TrainPersonNum = x.TrainPersonNum ?? 0,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取三级安全教育培训数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EduTrainOutput>> GetSafeTrainAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSafeTrain);
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 10:34:14 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取三级安全教育培训数——博晟培训
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EduTrainOutput> GetBoShengSafeTrain()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Bo_Sheng_Train
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
2025-07-09 19:10:09 +08:00
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && (x.TrainType.Contains("入场") || x.TrainType.Contains("入厂"))
|
2025-06-10 10:34:14 +08:00
|
|
|
|
&& (x.DeleteTag == "False" || x.DeleteTag == null) && x.TrainStartDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EduTrainOutput()
|
|
|
|
|
{
|
|
|
|
|
Id = x.ID,
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = x.TrainDepart,
|
|
|
|
|
TrainTitle = x.RecordName,
|
|
|
|
|
TrainStartDate = x.TrainStartDate,
|
|
|
|
|
TrainEndDate = x.TrainEndDate,
|
|
|
|
|
TrainPersonNum = x.PersonCount ?? 0,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取三级安全教育培训数——博晟培训(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EduTrainOutput>> GetBoShengSafeTrainAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetBoShengSafeTrain);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取专项培训数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EduTrainOutput> GetSpecialTrain()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.EduTrain_TrainRecord
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && y.TrainType == "2" &&
|
|
|
|
|
x.TrainStartDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EduTrainOutput()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
|
|
|
|
Id = x.TrainingId,
|
|
|
|
|
TrainTitle = x.TrainTitle,
|
|
|
|
|
TrainStartDate = x.TrainStartDate,
|
|
|
|
|
TrainEndDate = x.TrainEndDate,
|
|
|
|
|
TrainPersonNum = x.TrainPersonNum ?? 0,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取专项培训数(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<EduTrainOutput>> GetSpecialTrainAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSpecialTrain);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取特种作业培训数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<EduTrainOutput> GetSpecialOperationTrain()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.EduTrain_TrainRecord
|
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
|
|
|
|
where BeUnderConstructionList.Contains(p.ProjectId) && y.TrainType == "3" &&
|
|
|
|
|
x.TrainStartDate > Const.DtmarkTime
|
|
|
|
|
select new Model.EduTrainOutput()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
|
|
|
|
Id = x.TrainingId,
|
|
|
|
|
TrainTitle = x.TrainTitle,
|
|
|
|
|
TrainStartDate = x.TrainStartDate,
|
|
|
|
|
TrainEndDate = x.TrainEndDate,
|
|
|
|
|
TrainPersonNum = x.TrainPersonNum ?? 0,
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<List<EduTrainOutput>> GetSpecialOperationTrainAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSpecialOperationTrain);
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-04 23:40:57 +08:00
|
|
|
|
/// <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);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-12 10:39:28 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取安全技术交底
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<LicenseHSETechnicalOutput> GetHseTechnical()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.License_HSETechnical
|
2025-06-19 16:55:10 +08:00
|
|
|
|
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId)
|
|
|
|
|
select new Model.LicenseHSETechnicalOutput()
|
|
|
|
|
{
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
UnitName = UnitService.getUnitNamesUnitIds(x.UnitId),
|
|
|
|
|
Id = x.HSETechnicalId,
|
|
|
|
|
HSETechnicalCode = x.HSETechnicalCode,
|
|
|
|
|
WorkContents = x.WorkContents
|
|
|
|
|
}).ToList();
|
2025-06-12 10:39:28 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取安全技术交底(异步)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<List<LicenseHSETechnicalOutput>> GetHseTechnicalAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetHseTechnical);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取能耗总量
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetTotalEnergyConsumption()
|
|
|
|
|
{
|
|
|
|
|
var result = 0;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取万元营业收入综合能耗
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetIncomeComprehensiveEnergyConsumption()
|
|
|
|
|
{
|
|
|
|
|
var result = 0;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取二氧化碳
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetNewWaterConsumption()
|
|
|
|
|
{
|
|
|
|
|
var result = 0;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 事故事件数据
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取未遂事件数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.AccidentOutput> GetNearMiss()
|
|
|
|
|
{
|
|
|
|
|
var result = (from Record in Funs.DB.Accident_AccidentPersonRecord
|
|
|
|
|
join AccidentType in Funs.DB.Base_AccidentType on Record.AccidentTypeId equals AccidentType.AccidentTypeId 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 Person in Funs.DB.SitePerson_Person on Record.PersonId equals Person.PersonId into PersonGroup
|
|
|
|
|
from Person in PersonGroup.DefaultIfEmpty()
|
|
|
|
|
join Unit in Funs.DB.Base_Unit on Person.UnitId equals Unit.UnitId into UnitGroup
|
|
|
|
|
from Unit in UnitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(Record.ProjectId) && Record.IsAttempt == "1" && Record.AccidentDate > Const.DtmarkTime
|
|
|
|
|
select new AccidentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = Record.AccidentPersonRecordId,
|
|
|
|
|
ProjectId = Record.ProjectId,
|
|
|
|
|
ProjectCode = Project.ProjectCode,
|
|
|
|
|
ProjectName = Project.ProjectName,
|
|
|
|
|
AccidentTypeName = AccidentType.AccidentTypeName,
|
|
|
|
|
AccidentDate = Record.AccidentDate,
|
|
|
|
|
UnitId = Unit.UnitId,
|
|
|
|
|
UnitName = Unit.UnitName,
|
|
|
|
|
PeopleNum = 1,
|
|
|
|
|
Info = Record.Injury == "1" ? "死亡" : (Record.Injury == "2" ? "重伤" : "轻伤")
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<List<Model.AccidentOutput>> GetNearMissAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetNearMiss);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取可记录事件数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.AccidentOutput> GetRecordableEvent()
|
|
|
|
|
{
|
|
|
|
|
var result = (from Record in Funs.DB.Accident_AccidentPersonRecord
|
|
|
|
|
join AccidentType in Funs.DB.Base_AccidentType on Record.AccidentTypeId equals AccidentType.AccidentTypeId 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 Person in Funs.DB.SitePerson_Person on Record.PersonId equals Person.PersonId into PersonGroup
|
|
|
|
|
from Person in PersonGroup.DefaultIfEmpty()
|
|
|
|
|
join Unit in Funs.DB.Base_Unit on Person.UnitId equals Unit.UnitId into UnitGroup
|
|
|
|
|
from Unit in UnitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDate > Const.DtmarkTime
|
|
|
|
|
select new AccidentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = Record.AccidentPersonRecordId,
|
|
|
|
|
ProjectId = Record.ProjectId,
|
|
|
|
|
ProjectCode = Project.ProjectCode,
|
|
|
|
|
ProjectName = Project.ProjectName,
|
|
|
|
|
AccidentTypeName = AccidentType.AccidentTypeName,
|
|
|
|
|
AccidentDate = Record.AccidentDate,
|
|
|
|
|
UnitId = Unit.UnitId,
|
|
|
|
|
UnitName = Unit.UnitName,
|
|
|
|
|
PeopleNum = 1,
|
|
|
|
|
Info = Record.Injury == "1" ? "死亡" : (Record.Injury == "2" ? "重伤" : "轻伤")
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<List<Model.AccidentOutput>> GetRecordableEventAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetRecordableEvent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取一般事故数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.AccidentOutput> GetGeneralAccident()
|
|
|
|
|
{
|
|
|
|
|
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 == "1"
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<List<Model.AccidentOutput>> GetGeneralAccidentAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetGeneralAccident);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<List<Model.AccidentOutput>> GetMajorAccidentAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetMajorAccident);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<List<Model.AccidentOutput>> GetSpecialSeriousAccidentAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSpecialSeriousAccident);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 安全费用
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取费用提取(万元)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.CostSmallDetailOutput> GetCostExtract()
|
|
|
|
|
{
|
|
|
|
|
var query = from cost in Funs.DB.CostGoods_CostSmallDetail
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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)
|
|
|
|
|
};
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return query.ToList();
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.CostSmallDetailOutput>> GetCostExtractAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCostExtract);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取费用使用(万元)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.CostSmallDetailOutput> GetCostUse()
|
|
|
|
|
{
|
|
|
|
|
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()
|
|
|
|
|
let sumCost = (from item in Funs.DB.CostGoods_CostSmallDetailItem
|
|
|
|
|
where item.CostSmallDetailId == cost.CostSmallDetailId
|
|
|
|
|
select item.CostMoney).Sum() * 1.0m // 10000
|
|
|
|
|
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 = sumCost//Math.Round(sumCost, 2)
|
|
|
|
|
};
|
|
|
|
|
/*var result = 0;
|
|
|
|
|
var costs = (from x in Funs.DB.CostGoods_CostSmallDetailItem
|
|
|
|
|
join y in Funs.DB.CostGoods_CostSmallDetail
|
|
|
|
|
on x.CostSmallDetailId equals y.CostSmallDetailId
|
|
|
|
|
where BeUnderConstructionList.Contains(y.ProjectId) && y.CompileDate > Const.DtmarkTime
|
|
|
|
|
select x.CostMoney ?? 0).ToList().Sum();
|
|
|
|
|
result = Funs.GetNewIntOrZero(costs.ToString().Split('.')[0]);*/
|
|
|
|
|
return query.ToList();
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.CostSmallDetailOutput>> GetCostUseAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetCostUse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 施工机具
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取施工机具在用数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.ConstructionEquipmentOutput> GetUseEquipment()
|
|
|
|
|
{
|
2025-06-26 22:14:34 +08:00
|
|
|
|
var query = (from item in Funs.DB.QualityAudit_EquipmentQuality
|
|
|
|
|
//join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup
|
|
|
|
|
//from eq in eqGroup.DefaultIfEmpty()
|
|
|
|
|
//join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup
|
|
|
|
|
//from spe in speGroup.DefaultIfEmpty()
|
|
|
|
|
join p in Funs.DB.Base_Project on item.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join unit in Funs.DB.Base_Unit on item.UnitId equals unit.UnitId into unitGroup
|
|
|
|
|
from unit in unitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(item.ProjectId)
|
|
|
|
|
select new ConstructionEquipmentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = item.EquipmentQualityId,
|
|
|
|
|
ProjectId = item.ProjectId,
|
|
|
|
|
//ProjectCode = p.ProjectCode,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
//UnitId = item.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
SpecialEquipmentName = item.EquipmentQualityName,
|
2025-06-26 23:50:40 +08:00
|
|
|
|
//SizeModel = item.SizeModel,
|
2025-06-26 22:14:34 +08:00
|
|
|
|
CertificateNum = item.CertificateCode,
|
|
|
|
|
CompileDate = item.CompileDate,
|
|
|
|
|
EQType = "特种设备"
|
|
|
|
|
})
|
|
|
|
|
.Union(
|
|
|
|
|
from item in Funs.DB.QualityAudit_GeneralEquipmentQuality
|
|
|
|
|
join eq in Funs.DB.Base_SpecialEquipment on item.GeneralEquipmentQualityId equals eq.SpecialEquipmentId into eqGroup
|
|
|
|
|
from eq in eqGroup.DefaultIfEmpty()
|
|
|
|
|
//join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup
|
|
|
|
|
//from spe in speGroup.DefaultIfEmpty()
|
|
|
|
|
join p in Funs.DB.Base_Project on item.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join unit in Funs.DB.Base_Unit on item.UnitId equals unit.UnitId into unitGroup
|
|
|
|
|
from unit in unitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(item.ProjectId)
|
|
|
|
|
select new ConstructionEquipmentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = item.GeneralEquipmentQualityId,
|
|
|
|
|
ProjectId = item.ProjectId,
|
|
|
|
|
// ProjectCode = p.ProjectCode,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
// UnitId = item.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
// SpecialEquipmentId = item.SpecialEquipmentId,
|
|
|
|
|
SpecialEquipmentName = eq.SpecialEquipmentName,
|
|
|
|
|
//SizeModel = eq.SizeModel,
|
|
|
|
|
//OwnerCheck = item.OwnerCheck,
|
|
|
|
|
CertificateNum = item.GeneralEquipmentQualityCode,
|
|
|
|
|
//IsUsed = item.IsUsed,
|
|
|
|
|
CompileDate = item.CompileDate,
|
|
|
|
|
EQType = "一般设备"
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/* 通用版业务逻辑【弃用】
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var query = (from item in Funs.DB.InApproveManager_EquipmentInItem
|
|
|
|
|
join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup
|
|
|
|
|
from eq in eqGroup.DefaultIfEmpty()
|
|
|
|
|
join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup
|
|
|
|
|
from spe in speGroup.DefaultIfEmpty()
|
|
|
|
|
join p in Funs.DB.Base_Project on eq.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join unit in Funs.DB.Base_Unit on eq.UnitId equals unit.UnitId into unitGroup
|
|
|
|
|
from unit in unitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(eq.ProjectId)
|
|
|
|
|
select new ConstructionEquipmentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = item.EquipmentInItemId,
|
|
|
|
|
ProjectId = eq.ProjectId,
|
|
|
|
|
//ProjectCode = p.ProjectCode,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
//UnitId = eq.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
//SpecialEquipmentId = item.SpecialEquipmentId,
|
|
|
|
|
SpecialEquipmentName = spe.SpecialEquipmentName,
|
|
|
|
|
SizeModel = item.SizeModel,
|
|
|
|
|
OwnerCheck = item.OwnerCheck,
|
|
|
|
|
CertificateNum = item.CertificateNum,
|
|
|
|
|
IsUsed = item.IsUsed,
|
|
|
|
|
CompileDate = eq.CompileDate,
|
|
|
|
|
EQType = "特种设备"
|
|
|
|
|
})
|
|
|
|
|
.Union(
|
|
|
|
|
from item in Funs.DB.InApproveManager_GeneralEquipmentInItem
|
|
|
|
|
join eq in Funs.DB.InApproveManager_GeneralEquipmentIn on item.GeneralEquipmentInId equals eq.GeneralEquipmentInId into eqGroup
|
|
|
|
|
from eq in eqGroup.DefaultIfEmpty()
|
|
|
|
|
join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup
|
|
|
|
|
from spe in speGroup.DefaultIfEmpty()
|
|
|
|
|
join p in Funs.DB.Base_Project on eq.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join unit in Funs.DB.Base_Unit on eq.UnitId equals unit.UnitId into unitGroup
|
|
|
|
|
from unit in unitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(eq.ProjectId)
|
|
|
|
|
select new ConstructionEquipmentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = item.GeneralEquipmentInItemId,
|
|
|
|
|
ProjectId = eq.ProjectId,
|
|
|
|
|
// ProjectCode = p.ProjectCode,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
// UnitId = eq.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
// SpecialEquipmentId = item.SpecialEquipmentId,
|
|
|
|
|
SpecialEquipmentName = spe.SpecialEquipmentName,
|
|
|
|
|
SizeModel = item.SizeModel,
|
|
|
|
|
OwnerCheck = item.OwnerCheck,
|
|
|
|
|
CertificateNum = item.CertificateNum,
|
|
|
|
|
IsUsed = item.IsUsed,
|
|
|
|
|
CompileDate = eq.CompileDate,
|
|
|
|
|
EQType = "一般设备"
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-06-26 22:14:34 +08:00
|
|
|
|
*/
|
2024-12-24 19:04:32 +08:00
|
|
|
|
|
|
|
|
|
return query.ToList();
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.ConstructionEquipmentOutput>> GetUseEquipmentAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetUseEquipment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取施工机具特种设备数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.ConstructionEquipmentOutput> GetSpecialEquipment()
|
|
|
|
|
{
|
2025-06-26 22:14:34 +08:00
|
|
|
|
var query = (from item in Funs.DB.QualityAudit_EquipmentQuality
|
|
|
|
|
//join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup
|
|
|
|
|
//from eq in eqGroup.DefaultIfEmpty()
|
|
|
|
|
//join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup
|
|
|
|
|
//from spe in speGroup.DefaultIfEmpty()
|
|
|
|
|
join p in Funs.DB.Base_Project on item.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join unit in Funs.DB.Base_Unit on item.UnitId equals unit.UnitId into unitGroup
|
|
|
|
|
from unit in unitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(item.ProjectId)
|
|
|
|
|
select new ConstructionEquipmentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = item.EquipmentQualityId,
|
|
|
|
|
ProjectId = item.ProjectId,
|
|
|
|
|
//ProjectCode = p.ProjectCode,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
//UnitId = item.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
SpecialEquipmentName = item.EquipmentQualityName,
|
|
|
|
|
SizeModel = item.SizeModel,
|
|
|
|
|
CertificateNum = item.CertificateCode,
|
|
|
|
|
CompileDate = item.CompileDate,
|
|
|
|
|
EQType = "特种设备"
|
|
|
|
|
});
|
|
|
|
|
/* 通用版业务逻辑【弃用】
|
2024-12-24 19:04:32 +08:00
|
|
|
|
var query = (from item in Funs.DB.InApproveManager_EquipmentInItem
|
|
|
|
|
join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into
|
|
|
|
|
eqGroup
|
|
|
|
|
from eq in eqGroup.DefaultIfEmpty()
|
|
|
|
|
join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into
|
|
|
|
|
speGroup
|
|
|
|
|
from spe in speGroup.DefaultIfEmpty()
|
|
|
|
|
join p in Funs.DB.Base_Project on eq.ProjectId equals p.ProjectId into pGroup
|
|
|
|
|
from p in pGroup.DefaultIfEmpty()
|
|
|
|
|
join unit in Funs.DB.Base_Unit on eq.UnitId equals unit.UnitId into unitGroup
|
|
|
|
|
from unit in unitGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(eq.ProjectId)
|
|
|
|
|
select new ConstructionEquipmentOutput
|
|
|
|
|
{
|
|
|
|
|
Id = item.EquipmentInItemId,
|
|
|
|
|
ProjectId = eq.ProjectId,
|
|
|
|
|
//ProjectCode = p.ProjectCode,
|
|
|
|
|
ProjectName = p.ProjectName,
|
|
|
|
|
//UnitId = eq.UnitId,
|
|
|
|
|
UnitName = unit.UnitName,
|
|
|
|
|
//SpecialEquipmentId = item.SpecialEquipmentId,
|
|
|
|
|
SpecialEquipmentName = spe.SpecialEquipmentName,
|
|
|
|
|
SizeModel = item.SizeModel,
|
|
|
|
|
OwnerCheck = item.OwnerCheck,
|
|
|
|
|
CertificateNum = item.CertificateNum,
|
|
|
|
|
IsUsed = item.IsUsed,
|
|
|
|
|
CompileDate = eq.CompileDate,
|
|
|
|
|
EQType = "特种设备"
|
|
|
|
|
});
|
2025-06-26 22:14:34 +08:00
|
|
|
|
*/
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return query.ToList();
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.ConstructionEquipmentOutput>> GetSpecialEquipmentAsync()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetSpecialEquipment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 高风险作业许可
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取作业许可项数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<LicenseOutput> GetLicenses()
|
|
|
|
|
{
|
|
|
|
|
var result = (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 = x.UnitTypeName,
|
|
|
|
|
IsHighRisk = x.IsHighRisk,
|
|
|
|
|
WorkAreaName = x.WorkStates,
|
|
|
|
|
CompileDate = x.CompileDate,
|
|
|
|
|
StartDate = x.StartDate,
|
|
|
|
|
EndDate = x.EndDate,
|
|
|
|
|
WorkStatesStr = x.WorkStatesStr
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<LicenseOutput>> GetLicensesAsync()
|
|
|
|
|
{
|
2025-06-04 23:40:57 +08:00
|
|
|
|
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetLicenses);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取作业许可关闭项数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<LicenseOutput> GetLicensesClose()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.View_License_LicenseManager
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsHighRisk == true && x.WorkStates == "3" &&
|
|
|
|
|
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 = x.UnitTypeName,
|
|
|
|
|
IsHighRisk = x.IsHighRisk,
|
|
|
|
|
WorkAreaName = x.WorkStates,
|
|
|
|
|
CompileDate = x.CompileDate,
|
|
|
|
|
StartDate = x.StartDate,
|
|
|
|
|
EndDate = x.EndDate,
|
|
|
|
|
WorkStatesStr = x.WorkStatesStr
|
|
|
|
|
}).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<LicenseOutput>> GetLicensesCloseAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetLicensesClose);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 隐患整改
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取一般隐患数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.HiddenRectificationOutput> GetGeneralHiddenRectificationOutputs()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
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()
|
2025-06-26 16:25:49 +08:00
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.Risk_Level == "一般事故隐患" && y.CheckTime > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
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,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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") /
|
2024-12-24 19:04:32 +08:00
|
|
|
|
gg.Count(y => y.States != "4" && y.States != "-1") * 100), 2, MidpointRounding.AwayFromZero).ToString()
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
foreach (var item in query)
|
|
|
|
|
{
|
2025-06-04 23:40:57 +08:00
|
|
|
|
item.RecRate = Math.Round(Convert.ToDecimal(item.RecRate), 2).ToString(); // 转换为字符串并格式化为两位小数
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}
|
|
|
|
|
return query;
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.HiddenRectificationOutput>> GetGeneralHiddenRectificationOutputsAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetGeneralHiddenRectificationOutputs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取重大隐患数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.HiddenRectificationOutput> GetMajorHiddenRectificationOutputs()
|
|
|
|
|
{
|
|
|
|
|
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()
|
2025-06-26 16:25:49 +08:00
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.Risk_Level == "重大事故隐患" && y.CheckTime > Const.DtmarkTime
|
2024-12-24 19:04:32 +08:00
|
|
|
|
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,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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()
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}).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>> GetMajorHiddenRectificationOutputsAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetMajorHiddenRectificationOutputs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 风险数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取风险数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.SecurityRiskOutput> GetSecurityRiskOutputs()
|
|
|
|
|
{
|
|
|
|
|
var query = (from x in Funs.DB.Base_Project
|
2025-06-04 23:40:57 +08:00
|
|
|
|
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();
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return query;
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.SecurityRiskOutput>> GetSecurityRiskOutputsAsync()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(GetSecurityRiskOutputs);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 危大工程数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取危大工程数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.LargeEngineeringOutput> GetLargeEngineeringOutputs()
|
|
|
|
|
{
|
|
|
|
|
var query = (from x in Funs.DB.Base_Project
|
|
|
|
|
join y in Funs.DB.Solution_LargerHazard on x.ProjectId equals y.ProjectId into yGroup
|
|
|
|
|
from y in yGroup.DefaultIfEmpty()
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && y.RecordTime > Const.DtmarkTime
|
|
|
|
|
group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
|
|
|
|
select new LargeEngineeringOutput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = gg.Key.ProjectId,
|
|
|
|
|
ProjectName = gg.Key.ProjectName,
|
|
|
|
|
ProjectCode = gg.Key.ProjectCode,
|
2025-07-11 18:07:04 +08:00
|
|
|
|
OperativesNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.OperativesNum) ?? 0,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.TrainPersonNum) ?? 0,
|
2025-07-11 18:07:04 +08:00
|
|
|
|
CompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == false),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
FinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == false),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
ArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == false),
|
2025-07-11 18:07:04 +08:00
|
|
|
|
SuperOperativesNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.OperativesNum) ?? 0,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
SuperTrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.TrainPersonNum) ?? 0,
|
2025-07-11 18:07:04 +08:00
|
|
|
|
SuperCompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == true),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
SuperConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == true),
|
|
|
|
|
SuperFinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == true),
|
2025-06-04 23:40:57 +08:00
|
|
|
|
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
|
2024-12-24 19:04:32 +08:00
|
|
|
|
}).ToList();
|
|
|
|
|
return query;
|
|
|
|
|
}
|
|
|
|
|
public static async Task<List<Model.LargeEngineeringOutput>> GetLargeEngineeringOutputsAsync()
|
2025-06-04 23:40:57 +08:00
|
|
|
|
{
|
2024-12-24 19:04:32 +08:00
|
|
|
|
return await Task.Run(GetLargeEngineeringOutputs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取危大工程审批完成数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetCompletedNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "1" &&
|
|
|
|
|
x.IsSuperLargerHazard == false &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取危大工程培训人次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetTrainPersonNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsSuperLargerHazard == false &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x.TrainPersonNum).ToList().Sum(x => x.Value);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取危大工程施工个数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetConstructionNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "2" &&
|
|
|
|
|
x.IsSuperLargerHazard == false &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取危大工程完工个数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetFinishedNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "3" &&
|
|
|
|
|
x.IsSuperLargerHazard == false &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取超危大工程审批完成数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetSuperCompletedNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "1" &&
|
|
|
|
|
x.IsSuperLargerHazard == true &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取超危大工程培训人次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetSuperTrainPersonNum()
|
|
|
|
|
{
|
|
|
|
|
var result =
|
|
|
|
|
(from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsSuperLargerHazard == true &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x.TrainPersonNum).ToList().Sum(x => x.Value);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取超危大工程施工个数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetSuperConstructionNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "2" &&
|
|
|
|
|
x.IsSuperLargerHazard == true &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取超危大工程完工个数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetSuperFinishedNum()
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|
|
|
|
where BeUnderConstructionList.Contains(x.ProjectId) && x.States == "3" &&
|
|
|
|
|
x.IsSuperLargerHazard == true &&
|
|
|
|
|
x.RecordTime > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取列表
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 记录数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static int Count { get; set; }
|
|
|
|
|
|
|
|
|
|
public static List<HSSEData_HSSE> GetHSSEData_HSSEByModle(HSSEData_HSSE table)
|
|
|
|
|
{
|
|
|
|
|
var db = Funs.DB;
|
|
|
|
|
var q = from x in db.HSSEData_HSSE
|
|
|
|
|
where
|
|
|
|
|
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
|
|
|
|
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
|
|
|
|
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
|
|
|
|
|
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
|
|
|
|
|
orderby x.ReportDate descending
|
|
|
|
|
select x
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
return q.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once InvalidXmlDocComment
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static IEnumerable GetListData(HSSEData_HSSE table, Grid Grid1)
|
|
|
|
|
{
|
|
|
|
|
var q = GetHSSEData_HSSEByModle(table);
|
|
|
|
|
Count = q.Count();
|
|
|
|
|
if (Count == 0) return null;
|
|
|
|
|
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
|
|
|
|
return from x in q
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
x.Id,
|
|
|
|
|
x.UnitId,
|
|
|
|
|
x.CollCropCode,
|
|
|
|
|
x.UnitName,
|
|
|
|
|
x.ReportDate,
|
|
|
|
|
x.BeUnderConstructionNum,
|
|
|
|
|
x.ShutdownNum,
|
|
|
|
|
x.JoinConstructionPersonNum,
|
|
|
|
|
x.MajorProjectsUnderConstructionNum,
|
|
|
|
|
x.TotalWorkingHour,
|
|
|
|
|
x.LostWorkingHour,
|
|
|
|
|
x.SafeWorkingHour,
|
|
|
|
|
x.SafeTrainNum,
|
|
|
|
|
x.SpecialTrainNum,
|
|
|
|
|
x.SpecialOperationTrainNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
x.HseTechnicalNum,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
x.EnvironmentalTrainNum,
|
|
|
|
|
x.TotalEnergyConsumption,
|
|
|
|
|
x.IncomeComprehensiveEnergyConsumption,
|
|
|
|
|
x.NewWaterConsumption,
|
|
|
|
|
x.HeadOfficeInspectorGeneralNum,
|
|
|
|
|
x.HeadOfficeFullTimeNum,
|
|
|
|
|
x.BranchInspectorGeneralNum,
|
|
|
|
|
x.BranchFullTimeNum,
|
|
|
|
|
x.ProjectInspectorGeneralNum,
|
|
|
|
|
x.ProjectFullTimeNum,
|
|
|
|
|
x.ProjectSafetyMonitorNum,
|
|
|
|
|
x.SafetyInjectionEngineer,
|
|
|
|
|
x.CertificateANum,
|
|
|
|
|
x.CertificateBNum,
|
|
|
|
|
x.CertificateCNum,
|
|
|
|
|
x.SafetyCommitteeMeetingNum,
|
|
|
|
|
x.EnterpriseTopicsMeetingNum,
|
|
|
|
|
x.ProjectSafetyLeadingGroupMeetingNum,
|
|
|
|
|
x.ProjectSafetyMeetingNum,
|
|
|
|
|
x.CompanyLeadShiftCheckNum,
|
|
|
|
|
x.CompanyComprehensiveCheckNum,
|
|
|
|
|
x.CompanySpecialCheckNum,
|
|
|
|
|
x.ProjectLeadShiftCheckNum,
|
|
|
|
|
x.ProjectSpecialCheckNum,
|
|
|
|
|
x.ProjectMajorCheckNum,
|
|
|
|
|
x.NearMissNum,
|
|
|
|
|
x.RecordableEventNum,
|
|
|
|
|
x.GeneralAccidentNum,
|
|
|
|
|
x.MajorAccidentNum,
|
|
|
|
|
x.SeriousAccidentNum,
|
|
|
|
|
x.SpecialSeriousAccidentNum,
|
|
|
|
|
x.CompanyComprehensivePlanNum,
|
|
|
|
|
x.CompanySpecialPlanNum,
|
|
|
|
|
x.CompanyOnSiteDisposalPlan,
|
|
|
|
|
x.CompanyDrillNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
x.CompanyDrillPersonNum,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
x.ProjectComprehensivePlanNum,
|
|
|
|
|
x.ProjectSpecialPlanNum,
|
|
|
|
|
x.ProjectOnSiteDisposalPlan,
|
|
|
|
|
x.ProjectDrillNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
x.ProjectDrillPersonNum,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
x.CostExtract,
|
|
|
|
|
x.CostUse,
|
|
|
|
|
x.UseEquipmentNum,
|
|
|
|
|
x.SpecialEquipmentNum,
|
|
|
|
|
x.LicensesNum,
|
|
|
|
|
x.LicensesCloseNum,
|
|
|
|
|
x.GeneralClosedNum,
|
|
|
|
|
x.GeneralNotClosedNum,
|
|
|
|
|
x.MajorClosedNum,
|
|
|
|
|
x.MajorNotClosedNum,
|
|
|
|
|
x.GeneralRiskNum,
|
|
|
|
|
x.LowRiskNum,
|
|
|
|
|
x.MediumRiskNum,
|
|
|
|
|
x.HighRiskNum,
|
|
|
|
|
x.CompletedNum,
|
|
|
|
|
x.TrainPersonNum,
|
|
|
|
|
x.ConstructionNum,
|
|
|
|
|
x.FinishedNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
x.ArgumentNum,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
x.SuperCompletedNum,
|
|
|
|
|
x.SuperTrainPersonNum,
|
|
|
|
|
x.SuperConstructionNum,
|
|
|
|
|
x.SuperFinishedNum,
|
2025-06-04 23:40:57 +08:00
|
|
|
|
x.SuperArgumentNum,
|
2024-12-24 19:04:32 +08:00
|
|
|
|
x.State,
|
|
|
|
|
x.CreateDate,
|
|
|
|
|
x.CreateMan
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion 获取列表
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业安委会会议数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetSafetyCommitteeMeetingNum()
|
|
|
|
|
{
|
|
|
|
|
var result =
|
|
|
|
|
(from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompileDate > Const.DtmarkTime select x)
|
|
|
|
|
.Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业负责人带班检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetCompanyLeadShiftCheckNum(string[] pids = null)
|
|
|
|
|
{
|
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
&& pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业综合检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetCompanyComprehensiveCheckNum(string[] pids = null)
|
|
|
|
|
{
|
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
&& pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业专项检查次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetCompanySpecialCheckNum(string[] pids = null)
|
|
|
|
|
{
|
|
|
|
|
if (pids == null)
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
|
|
|
|
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
|
|
|
|
&& pids.Contains(x.ProjectId)
|
|
|
|
|
select x).Count();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-19 16:55:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 推送企业级检查明细数据检查
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 推送企业级检查明细数据检查
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static ReturnData PushSuperviseCheckReportData(int pushNum)
|
|
|
|
|
{
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
|
|
|
|
|
var items = (from x in db.Supervise_SuperviseCheckReport
|
|
|
|
|
join P in db.Base_Project on x.ProjectId equals P.ProjectId into PJ
|
|
|
|
|
from P in PJ.DefaultIfEmpty()
|
|
|
|
|
join U in db.Base_Unit on x.UnitId equals U.UnitId into UJ
|
|
|
|
|
from U in UJ.DefaultIfEmpty()
|
|
|
|
|
join CU in db.Base_Unit on x.CheckUnitId equals CU.UnitId into CUJ
|
|
|
|
|
from CU in CUJ.DefaultIfEmpty()
|
|
|
|
|
where (x.IsUpdate == null || x.IsUpdate == false) && x.CheckDate > BLL.Const.DtmarkTime
|
|
|
|
|
select new Model.SuperviseCheckReportItem
|
|
|
|
|
{
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
SourceUnitId = thisUnit.UnitId,
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
CollCropCode = thisUnit.CollCropCode,
|
|
|
|
|
DataDate = x.CheckDate,
|
|
|
|
|
AttachFile = AttachFileService.getFileUrl(x.SuperviseCheckReportId.ToString()),
|
|
|
|
|
SuperviseCheckReportCode = x.SuperviseCheckReportCode,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = U.UnitName,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckType = x.CheckType,
|
|
|
|
|
CheckTypeName = x.CheckType == "1" ? "企业负责人带班检查" :
|
|
|
|
|
x.CheckType == "2" ? "企业综合检查" :
|
|
|
|
|
x.CheckType == "3" ? "企业专项检查" : "",
|
|
|
|
|
CheckMainType = x.CheckMainType,
|
|
|
|
|
CheckMainTypeName = x.CheckMainType == "0" ? "安全" :
|
|
|
|
|
x.CheckMainType == "1" ? "质量" : "",
|
|
|
|
|
CheckUnitId = x.CheckUnitId,
|
|
|
|
|
CheckUnitName = CU.UnitName,
|
|
|
|
|
}).Take(pushNum).ToList();
|
|
|
|
|
Model.ReturnData responeData = new Model.ReturnData();
|
|
|
|
|
if (items.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var superviseCheckReportItem in items)
|
|
|
|
|
{
|
|
|
|
|
List<SuperviseCheckReportDetailItem> detailItems = getDetail(superviseCheckReportItem.Id, thisUnit);
|
|
|
|
|
superviseCheckReportItem.SuperviseCheckReportDetail = detailItems;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
|
|
|
|
|
var str = JsonConvert.SerializeObject(newItem);
|
|
|
|
|
var baseurl = "/api/HSSEData/SaveSuperviseCheckReportData";
|
|
|
|
|
responeData = ServerService.PushCNCEC(str, baseurl);
|
|
|
|
|
if (responeData.code == 1)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in items)
|
|
|
|
|
{
|
|
|
|
|
var data = db.Supervise_SuperviseCheckReport.FirstOrDefault(x =>
|
|
|
|
|
x.SuperviseCheckReportId == item.Id && (x.IsUpdate == null || x.IsUpdate == false));
|
|
|
|
|
data.IsUpdate = true;
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
responeData.code = 0;
|
|
|
|
|
responeData.message = "当前没有企业级检查明细数据检查数据";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return responeData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 转换字符串
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取明细
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="workStage"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<SuperviseCheckReportDetailItem> getDetail(string SuperviseCheckReportId,
|
|
|
|
|
Model.Base_Unit thisUnit)
|
|
|
|
|
{
|
|
|
|
|
List<SuperviseCheckReportDetailItem> detailItems = null;
|
|
|
|
|
if (!string.IsNullOrEmpty(SuperviseCheckReportId))
|
|
|
|
|
{
|
|
|
|
|
detailItems = (from x in Funs.DB.View_Supervise_SuperviseCheckReportItem
|
|
|
|
|
where x.SuperviseCheckReportId == SuperviseCheckReportId
|
|
|
|
|
select new Model.SuperviseCheckReportDetailItem
|
|
|
|
|
{
|
|
|
|
|
Id = x.SuperviseCheckReportItemId,
|
|
|
|
|
SourceUnitId = thisUnit.UnitId,
|
|
|
|
|
// ProjectId = x.ProjectId,
|
|
|
|
|
CollCropCode = thisUnit.CollCropCode,
|
|
|
|
|
// DataDate = x.CheckDate,
|
|
|
|
|
AttachFile = AttachFileService.getFileUrl(x.SuperviseCheckReportItemId.ToString()),
|
|
|
|
|
SuperviseCheckReportId = x.SuperviseCheckReportId,
|
|
|
|
|
RectifyItemId = x.RectifyItemId,
|
|
|
|
|
IsSelected = x.IsSelected,
|
|
|
|
|
HazardSourcePoint = x.HazardSourcePoint,
|
|
|
|
|
RiskAnalysis = x.RiskAnalysis,
|
|
|
|
|
RiskPrevention = x.RiskPrevention,
|
|
|
|
|
SimilarRisk = x.SimilarRisk,
|
|
|
|
|
RectifyName = x.RectifyName,
|
|
|
|
|
RectifyCode = x.RectifyCode,
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return detailItems;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 删除企业级检查明细数据检查
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除企业级检查明细数据检查
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static ReturnData DeleteSuperviseCheckReportData(string Id)
|
|
|
|
|
{
|
|
|
|
|
Model.ReturnData responeData = new Model.ReturnData();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
var items = (from x in db.Supervise_SuperviseCheckReport
|
|
|
|
|
join P in db.Base_Project on x.ProjectId equals P.ProjectId into PJ
|
|
|
|
|
from P in PJ.DefaultIfEmpty()
|
|
|
|
|
join U in db.Base_Unit on x.UnitId equals U.UnitId into UJ
|
|
|
|
|
from U in UJ.DefaultIfEmpty()
|
|
|
|
|
join CU in db.Base_Unit on x.CheckUnitId equals CU.UnitId into CUJ
|
|
|
|
|
from CU in CUJ.DefaultIfEmpty()
|
|
|
|
|
where x.SuperviseCheckReportId == Id
|
|
|
|
|
select new Model.SuperviseCheckReportItem
|
|
|
|
|
{
|
|
|
|
|
Id = x.SuperviseCheckReportId,
|
|
|
|
|
SourceUnitId = thisUnit.UnitId,
|
|
|
|
|
ProjectId = x.ProjectId,
|
|
|
|
|
CollCropCode = thisUnit.CollCropCode,
|
|
|
|
|
DataDate = x.CheckDate,
|
|
|
|
|
AttachFile = AttachFileService.getFileUrl(x.SuperviseCheckReportId.ToString()),
|
|
|
|
|
SuperviseCheckReportCode = x.SuperviseCheckReportCode,
|
|
|
|
|
CheckDate = x.CheckDate,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = U.UnitName,
|
|
|
|
|
CheckTeam = x.CheckTeam,
|
|
|
|
|
CheckType = x.CheckType,
|
|
|
|
|
CheckTypeName = x.CheckType == "1" ? "企业负责人带班检查" :
|
|
|
|
|
x.CheckType == "2" ? "企业综合检查" :
|
|
|
|
|
x.CheckType == "3" ? "企业专项检查" : "",
|
|
|
|
|
CheckMainType = x.CheckMainType,
|
|
|
|
|
CheckMainTypeName = x.CheckMainType == "0" ? "安全" :
|
|
|
|
|
x.CheckMainType == "1" ? "质量" : "",
|
|
|
|
|
CheckUnitId = x.CheckUnitId,
|
|
|
|
|
CheckUnitName = CU.UnitName,
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
if (items.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
|
|
|
|
|
var str = JsonConvert.SerializeObject(newItem);
|
|
|
|
|
var baseurl = "/api/HSSEData/DeleteSuperviseCheckReportData";
|
|
|
|
|
responeData = ServerService.PushCNCEC(str, baseurl);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
responeData.code = 0;
|
|
|
|
|
responeData.message = "集团数据删除失败";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
responeData.code = 0;
|
|
|
|
|
responeData.message = "集团数据删除失败";
|
|
|
|
|
}
|
|
|
|
|
return responeData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2022-12-26 14:34:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|