ChengDa_English/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEServic...

1402 lines
64 KiB
C#
Raw Normal View History

2022-12-20 17:45:42 +08:00
using FineUIPro;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using Newtonsoft.Json;
using static BLL.Project_HJGLData_HJGLService;
namespace BLL
{
public static class Project_HSSEData_HSSEService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// HSSE数据类型
/// </summary>
public enum HSSEDateType
{
/// <summary>
/// 全部数据
/// </summary>
All,
/// <summary>
/// 项目信息数据
/// </summary>
ProjectInformation,
/// <summary>
/// 工时数据
/// </summary>
WorkingHours,
/// <summary>
/// 教育培训数据
/// </summary>
EducationAndTraining,
/// <summary>
/// 环保数据
/// </summary>
Environmental,
/// <summary>
/// 安监人员数据
/// </summary>
OfSafetySupervisors,
/// <summary>
/// 安全会议数据
/// </summary>
SafetyMeeting,
/// <summary>
/// 监督检查数据
/// </summary>
SupervisionAndInspection,
/// <summary>
/// 事故事件数据
/// </summary>
AccidentEvent,
/// <summary>
/// 应急管理数据
/// </summary>
EmergencyManagement,
/// <summary>
/// 安全费用数据
/// </summary>
SecurityCost,
/// <summary>
/// 施工机具数据
/// </summary>
ConstructionEquipment,
/// <summary>
/// 作业许可数据
/// </summary>
WorkPermit,
/// <summary>
/// 隐患排查数据
/// </summary>
HiddenDangerTroubleshooting,
/// <summary>
/// 安全风险数据
/// </summary>
SecurityRisk,
/// <summary>
/// 隐患类别数据
/// </summary>
HiddenDangerCategory,
/// <summary>
/// 危大工程数据
/// </summary>
DangerousProject
};
#region
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
public static List<Model.Project_HSSEData_HSSE> GetProject_HSSEData_HSSEByModle(Model.Project_HSSEData_HSSE table)
{
var q = from x in db.Project_HSSEData_HSSE
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
(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))
select x
;
return q.ToList();
}
/// 获取分页列表
/// </summary>
/// <param name="PageIndex">页码</param>
/// <param name="PageSize">每页数量</param>
/// <returns></returns>
public static IEnumerable getListData(Model.Project_HSSEData_HSSE table, Grid Grid1)
{
var q = GetProject_HSSEData_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.ProjectId,
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,
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,
x.ProjectComprehensivePlanNum,
x.ProjectSpecialPlanNum,
x.ProjectOnSiteDisposalPlan,
x.ProjectDrillNum,
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,
x.SuperCompletedNum,
x.SuperTrainPersonNum,
x.SuperConstructionNum,
x.SuperFinishedNum,
};
}
#endregion
/// <summary>
/// 新增实体
/// </summary>
/// <param name="newtable"></param>
public static void AddProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
{
Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
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,
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,
ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum,
SafetyInjectionEngineer = newtable.SafetyInjectionEngineer,
CertificateANum = newtable.CertificateANum,
CertificateBNum = newtable.CertificateBNum,
CertificateCNum = newtable.CertificateCNum,
SafetyCommitteeMeetingNum = newtable.SafetyCommitteeMeetingNum,
EnterpriseTopicsMeetingNum = newtable.EnterpriseTopicsMeetingNum,
ProjectSafetyLeadingGroupMeetingNum = newtable.ProjectSafetyLeadingGroupMeetingNum,
ProjectSafetyMeetingNum = newtable.ProjectSafetyMeetingNum,
CompanyLeadShiftCheckNum = newtable.CompanyLeadShiftCheckNum,
CompanyComprehensiveCheckNum = newtable.CompanyComprehensiveCheckNum,
CompanySpecialCheckNum = newtable.CompanySpecialCheckNum,
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,
CompanyDrillNum = newtable.CompanyDrillNum,
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
ProjectDrillNum = newtable.ProjectDrillNum,
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,
ConstructionNum = newtable.ConstructionNum,
FinishedNum = newtable.FinishedNum,
SuperCompletedNum = newtable.SuperCompletedNum,
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
SuperConstructionNum = newtable.SuperConstructionNum,
SuperFinishedNum = newtable.SuperFinishedNum,
};
db.Project_HSSEData_HSSE.InsertOnSubmit(table);
db.SubmitChanges();
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="Id"></param>
public static void DeleteProject_HSSEData_HSSEById(string Id)
{
Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_HSSEData_HSSE.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
/// <summary>
/// 根据id获取实体
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Project_HSSEData_HSSE GetProject_HSSEData_HSSEById(string Id)
{
return db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == Id);
}
public static List<Model.Project_HSSEData_HSSE> GetProject_HSSEData_HSSEByProjectid(string Projectid)
{
var q = (from x in db.Project_HSSEData_HSSE
where x.ProjectId == Projectid
select x).ToList();
return q;
}
public static void UpdateProject_HSSEData_HSSE(Model.Project_HSSEData_HSSE newtable)
{
Model.Project_HSSEData_HSSE table = db.Project_HSSEData_HSSE.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
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;
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;
table.ProjectSafetyMonitorNum = newtable.ProjectSafetyMonitorNum;
table.SafetyInjectionEngineer = newtable.SafetyInjectionEngineer;
table.CertificateANum = newtable.CertificateANum;
table.CertificateBNum = newtable.CertificateBNum;
table.CertificateCNum = newtable.CertificateCNum;
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;
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;
table.CompanyDrillNum = newtable.CompanyDrillNum;
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
table.ProjectDrillNum = newtable.ProjectDrillNum;
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;
table.ConstructionNum = newtable.ConstructionNum;
table.FinishedNum = newtable.FinishedNum;
table.SuperCompletedNum = newtable.SuperCompletedNum;
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
table.SuperConstructionNum = newtable.SuperConstructionNum;
table.SuperFinishedNum = newtable.SuperFinishedNum;
db.SubmitChanges();
}
}
/// <summary>
/// 判断该项目的该日期是否统计数据
/// </summary>
/// <param name="dateTime"></param>
/// <param name="projectid"></param>
/// <returns></returns>
public static bool IsReportByDate(DateTime dateTime, string projectid)
{
var result = false;
var q = (from x in Funs.DB.Project_HSSEData_HSSE
where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date) && x.ProjectId == projectid
select x).ToList();
if (q != null && q.Count > 0)
{
result = true;
}
return result;
}
/// <summary>
/// 判断当天是否已上报
/// </summary>
/// <returns></returns>
public static bool IsReportByToday(string projectid)
{
var result = false;
var q = (from x in Funs.DB.Project_HSSEData_HSSE
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
select x).ToList();
if (q != null && q.Count > 0)
{
result = true;
}
return result;
}
/// <summary>
/// 根据projectid获取该项目当天的统计数据
/// </summary>
/// <param name="projectid"></param>
/// <returns></returns>
public static Model.Project_HSSEData_HSSE getProject_HSSEData_HSSEByDate(string projectid)
{
var q = (from x in Funs.DB.Project_HSSEData_HSSE
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && x.ProjectId == projectid
select x).FirstOrDefault();
return q;
}
/// <summary>
/// 统计所有在建项目数据
/// </summary>
public static void StatisticalAllProjectData()
{
var projectlist = ProjectService.GetProjectWorkList();
foreach (var item in projectlist)
{
StatisticalData(item.ProjectId, HSSEDateType.All);
}
}
/// <summary>
/// 统计数据
/// </summary>
/// <param name="projectid"></param>
public static void StatisticalData(string projectid, HSSEDateType hSSEDateType)
{
string thisUnitId = BLL.Const.UnitId_CD;
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
Model.Project_HSSEData_HSSE table = new Model.Project_HSSEData_HSSE();
if (IsReportByToday(projectid))
{
table = getProject_HSSEData_HSSEByDate(projectid);
}
else
{
table.Id = SQLHelper.GetNewID();
}
table.UnitId = thisUnitId;
table.CollCropCode = base_Unit.CollCropCode;
table.UnitName = base_Unit.UnitName;
table.ProjectId = projectid;
table.ReportDate = DateTime.Now.Date;
if (hSSEDateType == HSSEDateType.ProjectInformation || hSSEDateType == HSSEDateType.All)
{
table.BeUnderConstructionNum = GetBeUnderConstructionNum(projectid);
table.ShutdownNum = GetShutdownNum(projectid);
table.JoinConstructionPersonNum = GetJoinConstructionPersonNum(projectid);
table.MajorProjectsUnderConstructionNum = GetMajorProjectsUnderConstructionNum(projectid);
}
if (hSSEDateType == HSSEDateType.WorkingHours || hSSEDateType == HSSEDateType.All)
{
table.TotalWorkingHour = GetTotalWorkingHour(projectid);
table.LostWorkingHour = GetLostWorkingHour(projectid);
table.SafeWorkingHour = GetSafeWorkingHour(projectid);
}
if (hSSEDateType == HSSEDateType.EducationAndTraining || hSSEDateType == HSSEDateType.All)
{
table.SafeTrainNum = GetSafeTrainNum(projectid);
table.SpecialTrainNum = GetSpecialTrainNum(projectid);
table.SpecialOperationTrainNum = GetSpecialOperationTrainNum(projectid);
}
if (hSSEDateType == HSSEDateType.Environmental || hSSEDateType == HSSEDateType.All)
{
table.TotalEnergyConsumption = GetTotalEnergyConsumption(projectid);
table.IncomeComprehensiveEnergyConsumption = GetIncomeComprehensiveEnergyConsumption(projectid);
table.NewWaterConsumption = GetNewWaterConsumption(projectid);
}
if (hSSEDateType == HSSEDateType.OfSafetySupervisors || hSSEDateType == HSSEDateType.All)
{
table.HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneralNum(projectid);
table.HeadOfficeFullTimeNum = GetHeadOfficeFullTimeNum(projectid);
table.BranchInspectorGeneralNum = GetBranchInspectorGeneralNum(projectid);
table.BranchFullTimeNum = GetBranchFullTimeNum(projectid);
table.ProjectInspectorGeneralNum = GetProjectInspectorGeneralNum(projectid);
table.ProjectFullTimeNum = GetProjectFullTimeNum(projectid);
table.ProjectSafetyMonitorNum = GetProjectSafetyMonitorNum(projectid);
table.SafetyInjectionEngineer = GetSafetyInjectionEngineer(projectid);
table.CertificateANum = GetCertificateANum(projectid);
table.CertificateBNum = GetCertificateBNum(projectid);
table.CertificateCNum = GetCertificateCNum(projectid);
}
if (hSSEDateType == HSSEDateType.SafetyMeeting || hSSEDateType == HSSEDateType.All)
{
table.SafetyCommitteeMeetingNum = GetSafetyCommitteeMeetingNum(projectid);
table.EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(projectid);
table.ProjectSafetyLeadingGroupMeetingNum = GetProjectSafetyLeadingGroupMeetingNum(projectid);
table.ProjectSafetyMeetingNum = GetProjectSafetyMeetingNum(projectid);
}
if (hSSEDateType == HSSEDateType.SupervisionAndInspection || hSSEDateType == HSSEDateType.All)
{
table.CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheckNum(projectid);
table.CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheckNum(projectid);
table.CompanySpecialCheckNum = GetCompanySpecialCheckNum(projectid);
table.ProjectLeadShiftCheckNum = GetProjectLeadShiftCheckNum(projectid);
table.ProjectSpecialCheckNum = GetProjectSpecialCheckNum(projectid);
table.ProjectMajorCheckNum = GetProjectMajorCheckNum(projectid);
}
if (hSSEDateType == HSSEDateType.AccidentEvent || hSSEDateType == HSSEDateType.All)
{
table.NearMissNum = GetNearMissNum(projectid);
table.RecordableEventNum = GetRecordableEventNum(projectid);
table.GeneralAccidentNum = GetGeneralAccidentNum(projectid);
table.MajorAccidentNum = GetMajorAccidentNum(projectid);
table.SeriousAccidentNum = GetSeriousAccidentNum(projectid);
table.SpecialSeriousAccidentNum = GetSpecialSeriousAccidentNum(projectid);
}
if (hSSEDateType == HSSEDateType.EmergencyManagement || hSSEDateType == HSSEDateType.All)
{
table.CompanyComprehensivePlanNum = GetCompanyComprehensivePlanNum(projectid);
table.CompanySpecialPlanNum = GetCompanySpecialPlanNum(projectid);
table.CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan(projectid);
table.CompanyDrillNum = GetCompanyDrillNum(projectid);
table.ProjectComprehensivePlanNum = GetProjectComprehensivePlanNum(projectid);
table.ProjectSpecialPlanNum = GetProjectSpecialPlanNum(projectid);
table.ProjectOnSiteDisposalPlan = GetProjectOnSiteDisposalPlan(projectid);
table.ProjectDrillNum = GetProjectDrillNum(projectid);
}
if (hSSEDateType == HSSEDateType.SecurityCost || hSSEDateType == HSSEDateType.All)
{
table.CostExtract = GetCostExtract(projectid);
table.CostUse = GetCostUse(projectid);
}
if (hSSEDateType == HSSEDateType.ConstructionEquipment || hSSEDateType == HSSEDateType.All)
{
table.UseEquipmentNum = GetUseEquipmentNum(projectid);
table.SpecialEquipmentNum = GetSpecialEquipmentNum(projectid);
}
if (hSSEDateType == HSSEDateType.WorkPermit || hSSEDateType == HSSEDateType.All)
{
table.LicensesNum = GetLicensesNum(projectid);
table.LicensesCloseNum = GetLicensesCloseNum(projectid);
}
if (hSSEDateType == HSSEDateType.HiddenDangerTroubleshooting || hSSEDateType == HSSEDateType.All)
{
table.GeneralClosedNum = GetGeneralClosedNum(projectid);
table.GeneralNotClosedNum = GetGeneralNotClosedNum(projectid);
table.MajorClosedNum = GetMajorClosedNum(projectid);
table.MajorNotClosedNum = GetMajorNotClosedNum(projectid);
}
if (hSSEDateType == HSSEDateType.SecurityRisk || hSSEDateType == HSSEDateType.All)
{
table.GeneralRiskNum = GetGeneralRiskNum(projectid);
table.LowRiskNum = GetLowRiskNum(projectid);
table.MediumRiskNum = GetMediumRiskNum(projectid);
table.HighRiskNum = GetHighRiskNum(projectid);
}
if (hSSEDateType == HSSEDateType.HiddenDangerCategory || hSSEDateType == HSSEDateType.All)
{
Project_HSSEData_HiddenDangerDetailService.StatisticalData(projectid);
}
if (hSSEDateType == HSSEDateType.DangerousProject || hSSEDateType == HSSEDateType.All)
{
table.CompletedNum = GetCompletedNum(projectid);
table.TrainPersonNum = GetTrainPersonNum(projectid);
table.ConstructionNum = GetConstructionNum(projectid);
table.FinishedNum = GetFinishedNum(projectid);
table.SuperCompletedNum = GetSuperCompletedNum(projectid);
table.SuperTrainPersonNum = GetSuperTrainPersonNum(projectid);
table.SuperConstructionNum = GetSuperConstructionNum(projectid);
table.SuperFinishedNum = GetSuperFinishedNum(projectid);
}
if (IsReportByToday(projectid))
{
UpdateProject_HSSEData_HSSE(table);
}
else
{
AddProject_HSSEData_HSSE(table);
}
HSSEData_HSSEService.UpdateTodyData_State();
}
/// <summary>
/// 获取在建项目数
/// </summary>
/// <returns></returns>
public static int GetBeUnderConstructionNum(string projectid)
{
int result = (from x in Funs.DB.Base_Project where x.ProjectState == "1" && x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
/// 获取停工项目数
/// </summary>
/// <returns></returns>
public static int GetShutdownNum(string projectid)
{
int result = (from x in Funs.DB.Base_Project where x.ProjectState == "2" && x.ProjectId == projectid select x).Count();
return result;
}
/// <summary>
/// 获取参建人数
/// </summary>
/// <returns></returns>
public static int GetJoinConstructionPersonNum(string projectid)
{
int result = (from x in Funs.DB.SitePerson_Person where x.ProjectId == projectid && x.IsUsed == 1 select x).Count();
return result;
}
/// <summary>
/// 获取在施危大工程数
/// </summary>
/// <returns></returns>
public static int GetMajorProjectsUnderConstructionNum(string projectid)
{
int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.States == "2" select x).Count();
return result;
}
/// <summary>
/// 获取总工时数
/// </summary>
/// <returns></returns>
public static int GetTotalWorkingHour(string projectid)
{
DateTime date = DateTime.Now;
var result = (from x in Funs.DB.SitePerson_DayReportDetail
join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
select x.PersonWorkTime ).ToList().Sum(x=>x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
/// <summary>
/// 获取损失工时数
/// </summary>
/// <returns></returns>
public static int GetLostWorkingHour(string projectid)
{
DateTime date = DateTime.Now;
var result = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
+ (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
/// <summary>
/// 获取安全工时数
/// </summary>
/// <returns></returns>
public static int GetSafeWorkingHour(string projectid)
{
DateTime date = DateTime.Now;
var result1 = (from x in Funs.DB.SitePerson_DayReportDetail
join y in Funs.DB.SitePerson_DayReport on x.DayReportId equals y.DayReportId
where y.ProjectId == projectid && y.CompileDate.Value.Year == date.Year && y.CompileDate.Value.Month == date.Month && y.CompileDate.Value.Day == date.Day
select x.PersonWorkTime).ToList().Sum(x => x.Value);
var result2 = (from x in Funs.DB.Accident_AccidentHandle where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day select x.WorkHoursLoss).ToList().Sum(x => x.Value)
+ (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day select x.WorkingHoursLoss).ToList().Sum(x => x.Value);
var result = result1 - result2;
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
/// <summary>
/// 获取三级安全教育培训数
/// </summary>
/// <returns></returns>
public static int GetSafeTrainNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.EduTrain_TrainRecord
// join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
// where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "1"
// select x).Count();
return 0;
}
/// <summary>
/// 获取专项培训数
/// </summary>
/// <returns></returns>
public static int GetSpecialTrainNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.EduTrain_TrainRecord
// join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
// where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "2"
// select x).Count();
return 0;
}
/// <summary>
/// 获取特种作业培训数
/// </summary>
/// <returns></returns>
public static int GetSpecialOperationTrainNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.EduTrain_TrainRecord
// join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
// where x.ProjectId == projectid && x.TrainStartDate.Value.Year == date.Year && x.TrainStartDate.Value.Month == date.Month && x.TrainStartDate.Value.Day == date.Day && y.TrainType == "3"
// select x).Count();
return 0;
}
/// <summary>
/// 获取能耗总量
/// </summary>
/// <returns></returns>
public static int GetTotalEnergyConsumption(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取万元营业收入综合能耗
/// </summary>
/// <returns></returns>
public static int GetIncomeComprehensiveEnergyConsumption(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取用新水量
/// </summary>
/// <returns></returns>
public static int GetNewWaterConsumption(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业总部总监人数
/// </summary>
/// <returns></returns>
public static int GetHeadOfficeInspectorGeneralNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业总部专职人数
/// </summary>
/// <returns></returns>
public static int GetHeadOfficeFullTimeNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取分支机构总监人数
/// </summary>
/// <returns></returns>
public static int GetBranchInspectorGeneralNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取分支机构专职人数
/// </summary>
/// <returns></returns>
public static int GetBranchFullTimeNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取项目总监人数
/// </summary>
/// <returns></returns>
public static int GetProjectInspectorGeneralNum(string projectid)
{
//int result = (from x in Funs.DB.SitePerson_Person
// where x.ProjectId == projectid && x.WorkPostId == BLL.Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取项目专职人数
/// </summary>
/// <returns></returns>
public static int GetProjectFullTimeNum(string projectid)
{
int result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.ProjectId == projectid && y.IsHsse == true && x.IsUsed == 1
select x).Count();
return result;
}
/// <summary>
/// 获取项目安全监护人数
/// </summary>
/// <returns></returns>
public static int GetProjectSafetyMonitorNum(string projectid)
{
//int result = (from x in Funs.DB.SitePerson_Person
// where x.ProjectId == projectid && x.IsSafetyMonitoring == true && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取在岗执业注安师
/// </summary>
/// <returns></returns>
public static int GetSafetyInjectionEngineer(string projectid)
{
//int result = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
// where x.ProjectId == projectid && y.IsRegisterHSSE == true && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取A证人员
/// </summary>
/// <returns></returns>
public static int GetCertificateANum(string projectid)
{
//int result = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
// where x.ProjectId == projectid && y.CertificateType == "A" && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取B证人员
/// </summary>
/// <returns></returns>
public static int GetCertificateBNum(string projectid)
{
//int result = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
// where x.ProjectId == projectid && y.CertificateType == "B" && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取C证人员
/// </summary>
/// <returns></returns>
public static int GetCertificateCNum(string projectid)
{
//int result = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
// where x.ProjectId == projectid && y.CertificateType == "C" && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取企业安委会会议数
/// </summary>
/// <returns></returns>
public static int GetSafetyCommitteeMeetingNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业专题会议数
/// </summary>
/// <returns></returns>
public static int GetEnterpriseTopicsMeetingNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取项目安全领导小组会议数
/// </summary>
/// <returns></returns>
public static int GetProjectSafetyLeadingGroupMeetingNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.ProjectId == projectid && x.SafetyLeaderGroupMeetingDate.Value.Year == date.Year && x.SafetyLeaderGroupMeetingDate.Value.Month == date.Month && x.SafetyLeaderGroupMeetingDate.Value.Day == date.Day select x).Count();
return 0;
}
/// <summary>
/// 获取项目安全例会数
/// </summary>
/// <returns></returns>
public static int GetProjectSafetyMeetingNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Meeting_WeekMeeting where x.ProjectId == projectid && x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count()
+ (from x in Funs.DB.Meeting_MonthMeeting where x.ProjectId == projectid && x.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count();
return result;
}
/// <summary>
/// 获取企业负责人带班检查次数
/// </summary>
/// <returns></returns>
public static int GetCompanyLeadShiftCheckNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业综合检查次数
/// </summary>
/// <returns></returns>
public static int GetCompanyComprehensiveCheckNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业专项检查次数
/// </summary>
/// <returns></returns>
public static int GetCompanySpecialCheckNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取项目负责人带班检查次数
/// </summary>
/// <returns></returns>
public static int GetProjectLeadShiftCheckNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Check_ProjectLeaderCheck where x.ProjectId == projectid && x.CheckDate.Value.Year == date.Year && x.CheckDate.Value.Month == date.Month && x.CheckDate.Value.Day == date.Day select x).Count();
return 0;
}
/// <summary>
/// 获取项目专项检查次数
/// </summary>
/// <returns></returns>
public static int GetProjectSpecialCheckNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
return result;
}
/// <summary>
/// 获取项目专业检查次数
/// </summary>
/// <returns></returns>
public static int GetProjectMajorCheckNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.ProjectId == projectid && x.CheckTime.Value.Year == date.Year && x.CheckTime.Value.Month == date.Month && x.CheckTime.Value.Day == date.Day select x).Count();
return result;
}
/// <summary>
/// 获取未遂事件数
/// </summary>
/// <returns></returns>
public static int GetNearMissNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentPersonRecord
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && y.AccidentTypeName.Contains("未遂")
select x).Count();
return result;
}
/// <summary>
/// 获取可记录事件数
/// </summary>
/// <returns></returns>
public static int GetRecordableEventNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Accident_AccidentPersonRecord
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
where x.ProjectId == projectid && x.AccidentDate.Year == date.Year && x.AccidentDate.Month == date.Month && x.AccidentDate.Day == date.Day && !y.AccidentTypeName.Contains("未遂")
select x).Count();
return result;
}
/// <summary>
/// 获取一般事故数
/// </summary>
/// <returns></returns>
public static int GetGeneralAccidentNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "1" select x).Count();
return 0;
}
/// <summary>
/// 获取较大事故数
/// </summary>
/// <returns></returns>
public static int GetMajorAccidentNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "2" select x).Count();
return 0;
}
/// <summary>
/// 获取重大事故数
/// </summary>
/// <returns></returns>
public static int GetSeriousAccidentNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "3" select x).Count();
return 0;
}
/// <summary>
/// 获取特别重大事故数
/// </summary>
/// <returns></returns>
public static int GetSpecialSeriousAccidentNum(string projectid)
{
//DateTime date = DateTime.Now;
//int result = (from x in Funs.DB.Accident_AccidentReport where x.ProjectId == projectid && x.AccidentDate.Value.Year == date.Year && x.AccidentDate.Value.Month == date.Month && x.AccidentDate.Value.Day == date.Day && x.AccidentDegree == "4" select x).Count();
return 0;
}
/// <summary>
/// 获取企业级综合预案数
/// </summary>
/// <returns></returns>
public static int GetCompanyComprehensivePlanNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业级专项预案数
/// </summary>
/// <returns></returns>
public static int GetCompanySpecialPlanNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业级现场处置预案
/// </summary>
/// <returns></returns>
public static int GetCompanyOnSiteDisposalPlan(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取企业级演练次数
/// </summary>
/// <returns></returns>
public static int GetCompanyDrillNum(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取项目级综合预案
/// </summary>
/// <returns></returns>
public static int GetProjectComprehensivePlanNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_EmergencyList
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
&& x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("综合")
select x).Count();
return result;
}
/// <summary>
/// 获取项目级专项预案数
/// </summary>
/// <returns></returns>
public static int GetProjectSpecialPlanNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_EmergencyList
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
&& x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("专项")
select x).Count();
return result;
}
/// <summary>
/// 获取项目级现场处置预案
/// </summary>
/// <returns></returns>
public static int GetProjectOnSiteDisposalPlan(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_EmergencyList
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
where x.ProjectId == projectid && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month
&& x.CompileDate.Value.Day == date.Day && y.EmergencyTypeName.Contains("现场处置")
select x).Count();
return result;
}
/// <summary>
/// 获取项目级演练次数
/// </summary>
/// <returns></returns>
public static int GetProjectDrillNum(string projectid)
{
DateTime date = DateTime.Now;
int result = (from x in Funs.DB.Emergency_DrillRecordList
where x.ProjectId == projectid && x.DrillRecordDate.Value.Year == date.Year && x.DrillRecordDate.Value.Month == date.Month
&& x.DrillRecordDate.Value.Day == date.Day
select x).Count();
return result;
}
/// <summary>
/// 获取费用提取(万元)
/// </summary>
/// <returns></returns>
public static int GetCostExtract(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取费用使用(万元)
/// </summary>
/// <returns></returns>
public static int GetCostUse(string projectid)
{
int result = 0;
return result;
}
/// <summary>
/// 获取施工机具在用数
/// </summary>
/// <returns></returns>
public static int GetUseEquipmentNum(string projectid)
{
//int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
// join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
// where y.ProjectId == projectid && x.IsUsed == true
// select x).Count() +
// (from x in Funs.DB.InApproveManager_GeneralEquipmentInItem
// join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y.GeneralEquipmentInId
// where y.ProjectId == projectid && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取施工机具特种设备数
/// </summary>
/// <returns></returns>
public static int GetSpecialEquipmentNum(string projectid)
{
//int result = (from x in Funs.DB.InApproveManager_EquipmentInItem
// join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
// where y.ProjectId == projectid && x.IsUsed == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取作业许可项数
/// </summary>
/// <returns></returns>
public static int GetLicensesNum(string projectid)
{
//int result = (from x in Funs.DB.License_LicenseManager
// where x.ProjectId == projectid && x.IsHighRisk == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取作业许可关闭项数
/// </summary>
/// <returns></returns>
public static int GetLicensesCloseNum(string projectid)
{
//int result = (from x in Funs.DB.License_LicenseManager
// where x.ProjectId == projectid && x.IsHighRisk == true && x.WorkStates == "3"
// select x).Count();
return 0;
}
/// <summary>
/// 获取一般隐患整改闭环项
/// </summary>
/// <returns></returns>
public static int GetGeneralClosedNum(string projectid)
{
int result = (from x in Funs.DB.Check_RectifyNoticesItem
join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
where y.ProjectId == projectid && y.HiddenHazardType == "1" && x.IsRectify == true
select x).Count();
return result;
}
/// <summary>
/// 获取一般隐患未整改完成项
/// </summary>
/// <returns></returns>
public static int GetGeneralNotClosedNum(string projectid)
{
int result = (from x in Funs.DB.Check_RectifyNoticesItem
join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
where y.ProjectId == projectid && y.HiddenHazardType == "1" && (x.IsRectify == false || x.IsRectify == null)
select x).Count();
return result;
}
/// <summary>
/// 获取重大隐患整改闭环项
/// </summary>
/// <returns></returns>
public static int GetMajorClosedNum(string projectid)
{
int result = (from x in Funs.DB.Check_RectifyNoticesItem
join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
where y.ProjectId == projectid && y.HiddenHazardType == "3" && x.IsRectify == true
select x).Count();
return result;
}
/// <summary>
/// 获取重大隐患未整改完成项
/// </summary>
/// <returns></returns>
public static int GetMajorNotClosedNum(string projectid)
{
int result = (from x in Funs.DB.Check_RectifyNoticesItem
join y in Funs.DB.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
where y.ProjectId == projectid && y.HiddenHazardType == "3" && (x.IsRectify == false || x.IsRectify == null)
select x).Count();
return result;
}
/// <summary>
/// 获取一般风险数
/// </summary>
/// <returns></returns>
public static int GetGeneralRiskNum(string projectid)
{
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
// where x.ProjectId == projectid && y.RiskLevel == 2 && x.IsStart == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取低风险数
/// </summary>
/// <returns></returns>
public static int GetLowRiskNum(string projectid)
{
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
// where x.ProjectId == projectid && y.RiskLevel == 1 && x.IsStart == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取中风险数
/// </summary>
/// <returns></returns>
public static int GetMediumRiskNum(string projectid)
{
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
// where x.ProjectId == projectid && y.RiskLevel == 3 && x.IsStart == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取高风险数
/// </summary>
/// <returns></returns>
public static int GetHighRiskNum(string projectid)
{
//int result = (from x in Funs.DB.Hazard_HazardSelectedItem
// join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
// where x.ProjectId == projectid && y.RiskLevel == 4 && x.IsStart == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取危大工程审批完成数
/// </summary>
/// <returns></returns>
public static int GetCompletedNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == false
// select x).Count();
return 0;
}
/// <summary>
/// 获取危大工程培训人次数
/// </summary>
/// <returns></returns>
public static int GetTrainPersonNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.IsSuperLargerHazard == false
// select x.TrainPersonNum ).ToList().Sum(x=>x.Value);
return 0;
}
/// <summary>
/// 获取危大工程施工个数
/// </summary>
/// <returns></returns>
public static int GetConstructionNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == false
// select x).Count();
return 0;
}
/// <summary>
/// 获取危大工程完工个数
/// </summary>
/// <returns></returns>
public static int GetFinishedNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == false
// select x).Count();
return 0;
}
/// <summary>
/// 获取超危大工程审批完成数
/// </summary>
/// <returns></returns>
public static int GetSuperCompletedNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.States == "1" && x.IsSuperLargerHazard == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取超危大工程培训人次数
/// </summary>
/// <returns></returns>
public static int GetSuperTrainPersonNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.IsSuperLargerHazard == true select x.TrainPersonNum).ToList().Sum(x => x.Value);
return 0;
}
/// <summary>
/// 获取超危大工程施工个数
/// </summary>
/// <returns></returns>
public static int GetSuperConstructionNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.States == "2" && x.IsSuperLargerHazard == true
// select x).Count();
return 0;
}
/// <summary>
/// 获取超危大工程完工个数
/// </summary>
/// <returns></returns>
public static int GetSuperFinishedNum(string projectid)
{
//int result = (from x in Funs.DB.Solution_LargerHazard
// where x.ProjectId == projectid && x.States == "3" && x.IsSuperLargerHazard == true
// select x).Count();
return 0;
}
}
}