692 lines
26 KiB
C#
692 lines
26 KiB
C#
|
using BLL;
|
|||
|
using Newtonsoft.Json;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
using System.Web.UI;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
|
|||
|
namespace FineUIPro.Web.common
|
|||
|
{
|
|||
|
public partial class main_new0 : PageBase
|
|||
|
{
|
|||
|
public static List<Model.Solution_LargerHazard> LargerHazard = new List<Model.Solution_LargerHazard>();
|
|||
|
|
|||
|
//页面加载
|
|||
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!IsPostBack)
|
|||
|
{
|
|||
|
//安监人员数据
|
|||
|
getPersonNum();
|
|||
|
|
|||
|
//项目信息
|
|||
|
getProjectInfo();
|
|||
|
|
|||
|
//安全会议数据
|
|||
|
getSafeMettingCount();
|
|||
|
|
|||
|
//加载项目全部和待整改的
|
|||
|
getProjectYh();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#region 加载人数
|
|||
|
protected void getPersonNum()
|
|||
|
{
|
|||
|
//企业总部总监人数
|
|||
|
div_qyzbzjrs.InnerHtml = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralNum().ToString();
|
|||
|
div_qyzbrs1.InnerHtml = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralNum().ToString();
|
|||
|
//企业总部专职人数
|
|||
|
div_qyzbzzrs.InnerHtml = HSSEData_HSSEService.GetHeadOfficeFullTimeNum().ToString();
|
|||
|
div_qyzbzzrs1.InnerHtml = HSSEData_HSSEService.GetHeadOfficeFullTimeNum().ToString();
|
|||
|
//分支机构总监人数
|
|||
|
div_fzjgzjrs.InnerHtml = HSSEData_HSSEService.GetBranchInspectorGeneralNum().ToString();
|
|||
|
//分支机构专职人数
|
|||
|
div_fzjgzzrs.InnerHtml = HSSEData_HSSEService.GetBranchFullTimeNum().ToString();
|
|||
|
//企业总部参建人数
|
|||
|
div_qyzbcjrs.InnerHtml = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true select x).Count().ToString();
|
|||
|
|
|||
|
//项目总监
|
|||
|
div_xmrs.InnerHtml = (from x in Funs.DB.SitePerson_Person
|
|||
|
where x.WorkPostId == Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true
|
|||
|
select x).Count().ToString();
|
|||
|
//项目专职
|
|||
|
div_xmzzrs.InnerHtml = (from x in Funs.DB.SitePerson_Person
|
|||
|
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|||
|
where y.IsHsse == true && x.IsUsed == true
|
|||
|
select x).Count().ToString();
|
|||
|
//项目参建
|
|||
|
div_xmcjrs.InnerHtml = (from x in Funs.DB.SitePerson_Person
|
|||
|
where x.IsUsed == true
|
|||
|
select x).Count().ToString();
|
|||
|
|
|||
|
//注安师
|
|||
|
div_zasrs.InnerHtml = (from x in Funs.DB.SitePerson_Person
|
|||
|
join y in Funs.DB.Base_Certificate on x.CertificateId equals y.CertificateId
|
|||
|
where y.IsRegisterHSSE == true && x.IsUsed == true
|
|||
|
select x).Count().ToString();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 加载项目信息
|
|||
|
protected void getProjectInfo()
|
|||
|
{
|
|||
|
var list = Funs.DB.Base_Project;
|
|||
|
//在建项目
|
|||
|
div_zjxm.InnerHtml = list.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).Count().ToString();
|
|||
|
//停工项目
|
|||
|
div_tgxm.InnerHtml = list.Where(x => (x.ProjectState == Const.ProjectState_2 || x.ProjectState == null)).Count().ToString();
|
|||
|
//在施危大工程
|
|||
|
div_wdxm.InnerHtml = Funs.DB.Solution_LargerHazard.Where(x => x.States == Const.State_2).Count().ToString();
|
|||
|
//安全工时数
|
|||
|
int wHours = Funs.DB.SitePerson_PersonInOutNumber.Max(x => x.WorkHours) ?? 0;
|
|||
|
this.div_safeworktime.InnerHtml = wHours.ToString();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 加载项目全部和待整改的
|
|||
|
protected string yhXmmc;
|
|||
|
protected string allYhYb;
|
|||
|
protected string dzgYhYb;
|
|||
|
|
|||
|
protected string allYhZd;
|
|||
|
protected string dzgYhZd;
|
|||
|
/// <summary>
|
|||
|
/// 加载柱状图数据
|
|||
|
/// </summary>
|
|||
|
/// <param name="type"></param>
|
|||
|
protected void getProjectYh()
|
|||
|
{
|
|||
|
var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
|
|||
|
if (list.Count > 0)
|
|||
|
{
|
|||
|
foreach (var item in list)
|
|||
|
{
|
|||
|
yhXmmc += "'" + item.ShortName + "',";
|
|||
|
|
|||
|
//一般
|
|||
|
allYhYb += "'" +
|
|||
|
(Project_HSSEData_HSSEService.GetGeneralClosedNum(item.ProjectId) +
|
|||
|
Project_HSSEData_HSSEService.GetGeneralNotClosedNum(item.ProjectId)) +
|
|||
|
"',";
|
|||
|
dzgYhYb += "'" + Project_HSSEData_HSSEService.GetGeneralNotClosedNum(item.ProjectId) + "',";
|
|||
|
|
|||
|
//重大
|
|||
|
allYhZd += "'" +
|
|||
|
(Project_HSSEData_HSSEService.GetMajorClosedNum(item.ProjectId) +
|
|||
|
Project_HSSEData_HSSEService.GetMajorNotClosedNum(item.ProjectId)) +
|
|||
|
"',";
|
|||
|
dzgYhZd += "'" + Project_HSSEData_HSSEService.GetMajorNotClosedNum(item.ProjectId) + "',";
|
|||
|
|
|||
|
}
|
|||
|
yhXmmc = yhXmmc.TrimEnd(',');
|
|||
|
allYhYb = allYhYb.TrimEnd(',');
|
|||
|
dzgYhYb = dzgYhYb.TrimEnd(',');
|
|||
|
allYhZd = allYhZd.TrimEnd(',');
|
|||
|
dzgYhZd = dzgYhZd.TrimEnd(',');
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 安全会议数据
|
|||
|
protected void getSafeMettingCount()
|
|||
|
{
|
|||
|
//企业安委会
|
|||
|
div_qyawh.InnerHtml = HSSEData_HSSEService.GetSafetyCommitteeMeetingNum().ToString();
|
|||
|
//企业专题
|
|||
|
div_qyzt.InnerHtml = HSSEData_HSSEService.GetEnterpriseTopicsMeetingNum().ToString();
|
|||
|
//项目安全领导小组
|
|||
|
div_xmaqldxz.InnerHtml = Funs.DB.Meeting_SafetyLeaderGroupMeeting.Where(x=> x.CompileDate > Const.DtmarkTime).Count().ToString();
|
|||
|
//项目安全例会
|
|||
|
DateTime date = DateTime.Now;
|
|||
|
div_xmalh.InnerHtml = ((from x in Funs.DB.Meeting_WeekMeeting where 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.MonthMeetingDate.Value.Year == date.Year && x.MonthMeetingDate.Value.Month == date.Month && x.MonthMeetingDate.Value.Day == date.Day select x).Count()).ToString();
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 右侧 安全费用数据、施工机具设备数据、高风险作业许可数据
|
|||
|
/// <summary>
|
|||
|
/// 获取费用使用(万元)
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCostUse()
|
|||
|
{
|
|||
|
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 y.CompileDate > Const.DtmarkTime
|
|||
|
select x.CostMoney ?? 0).ToList().Sum();
|
|||
|
result = Funs.GetNewIntOrZero(costs.ToString().Split('.')[0]);
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取施工机具在用数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetUseEquipmentNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
|
|||
|
join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
|
|||
|
where 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 x.IsUsed == true
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取施工机具特种设备数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetSpecialEquipmentNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
|
|||
|
join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
|
|||
|
where x.IsUsed == true
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取作业许可项数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetLicensesNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.License_LicenseManager
|
|||
|
where x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取作业许可关闭项数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetLicensesCloseNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.License_LicenseManager
|
|||
|
where x.IsHighRisk == true && x.WorkStates == "3" &&
|
|||
|
x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取一般隐患整改闭环项
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetGeneralClosedNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.Risk_Level == "一般" && x.States == "3" &&
|
|||
|
x.CheckTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取一般隐患未整改完成项
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetGeneralNotClosedNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.Risk_Level == "一般" && x.States != "3" &&
|
|||
|
x.CheckTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 一般整改率
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetGeneralZgl()
|
|||
|
{
|
|||
|
var num1 = Math.Round(100.0 * GetGeneralClosedNum() / (GetGeneralClosedNum() + GetGeneralNotClosedNum()), 0).ToString();
|
|||
|
return num1;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取重大隐患整改闭环项
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetMajorClosedNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.Risk_Level == "重大" && x.States == "3" &&
|
|||
|
x.CheckTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取重大隐患未整改完成项
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetMajorNotClosedNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.Risk_Level == "重大" && x.States != "3" &&
|
|||
|
x.CheckTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 重大整改率
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetMajorZgl()
|
|||
|
{
|
|||
|
var num1 = Math.Round(100.0 * GetMajorClosedNum() / (GetMajorClosedNum() + GetMajorNotClosedNum()), 0).ToString();
|
|||
|
return num1;
|
|||
|
}
|
|||
|
|
|||
|
#region 安全监督检查数据
|
|||
|
/// <summary>
|
|||
|
/// 获取企业负责人带班检查次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanyLeadShiftCheckNum()
|
|||
|
{
|
|||
|
return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取企业综合检查次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanyComprehensiveCheckNum()
|
|||
|
{
|
|||
|
return HSSEData_HSSEService.GetCompanyComprehensiveCheckNum();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取企业专项检查次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanySpecialCheckNum()
|
|||
|
{
|
|||
|
return HSSEData_HSSEService.GetCompanySpecialCheckNum();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取项目负责人带班检查次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetProjectLeadShiftCheckNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Check_ProjectLeaderCheck
|
|||
|
where x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取项目专项检查次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetProjectSpecialCheckNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Check_CheckSpecial
|
|||
|
where x.CheckTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取项目专业检查次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetProjectMajorCheckNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
|||
|
where x.CheckTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 事故事件数据
|
|||
|
/// <summary>
|
|||
|
/// 获取未遂事件数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetNearMissNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
|||
|
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
|||
|
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取可记录事件数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetRecordableEventNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
|||
|
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
|||
|
where x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取一般事故数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetGeneralAccidentNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Accident_AccidentReport
|
|||
|
where x.AccidentDegree == "1" && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取较大事故数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetMajorAccidentNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Accident_AccidentReport
|
|||
|
where x.AccidentDegree == "2" && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取重大事故数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetSeriousAccidentNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Accident_AccidentReport
|
|||
|
where x.AccidentDegree == "3" && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取特别重大事故数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetSpecialSeriousAccidentNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Accident_AccidentReport
|
|||
|
where x.AccidentDegree == "4"
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 应急管理数据
|
|||
|
/// <summary>
|
|||
|
/// 获取企业级综合预案数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanyComprehensivePlanNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|||
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|||
|
where y.EmergencyTypeName.Contains("综合") && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取企业级专项预案数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanySpecialPlanNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|||
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|||
|
where y.EmergencyTypeName.Contains("专项") && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取企业级现场处置预案
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanyOnSiteDisposalPlan()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Emergency_EmergencyList_Unit
|
|||
|
join y in Funs.DB.Base_EmergencyType on x.EmergencyTypeId equals y.EmergencyTypeId
|
|||
|
where y.EmergencyTypeName.Contains("现场处置") && x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取企业级演练次数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompanyDrillNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit
|
|||
|
where x.CompileDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 安全教育培训人次数数据
|
|||
|
/// <summary>
|
|||
|
/// 获取三级安全教育培训数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetSafeTrainNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.EduTrain_TrainRecord
|
|||
|
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
|||
|
where y.TrainType == "1" && x.TrainStartDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取专项培训数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetSpecialTrainNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.EduTrain_TrainRecord
|
|||
|
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
|||
|
where y.TrainType == "2" && x.TrainStartDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取特种作业培训数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetSpecialOperationTrainNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.EduTrain_TrainRecord
|
|||
|
join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId
|
|||
|
where y.TrainType == "3" && x.TrainStartDate > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 安全数据分析
|
|||
|
/// <summary>
|
|||
|
/// 获取一般风险数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetGeneralRiskNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
|||
|
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
|||
|
where y.RiskLevel == 2 && x.IsStart == true
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取低风险数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetLowRiskNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
|||
|
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
|||
|
where y.RiskLevel == 1 && x.IsStart == true
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取中风险数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetMediumRiskNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
|||
|
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
|||
|
where y.RiskLevel == 3 && x.IsStart == true
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取高风险数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetHighRiskNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
|||
|
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
|||
|
where y.RiskLevel == 4 && x.IsStart == true
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 应急管理程序
|
|||
|
/// <summary>
|
|||
|
/// 获取危大工程审批完成数
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetCompletedNum()
|
|||
|
{
|
|||
|
var result = (from x in Funs.DB.Solution_LargerHazard
|
|||
|
where 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 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 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 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 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 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 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 x.States == "3" && x.IsSuperLargerHazard == true &&
|
|||
|
x.RecordTime > Const.DtmarkTime
|
|||
|
select x).Count();
|
|||
|
return result;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|