810 lines
33 KiB
C#
810 lines
33 KiB
C#
using BLL;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
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)
|
|
{
|
|
//安监人员数据
|
|
//企业总部总监人数
|
|
Model.SGGLDB db = Funs.DB;
|
|
var unitId = string.Empty;
|
|
var thisUnit = CommonService.GetIsThisUnit();
|
|
if (thisUnit != null) unitId = thisUnit.UnitId;
|
|
div_qyzbzjrs.InnerHtml = (from x in db.Person_CompanyBranchPerson
|
|
where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId == unitId
|
|
select x).Count().ToString();
|
|
div_qyzbrs1.InnerHtml = (from x in db.SitePerson_Person
|
|
where x.IsUsed == true && x.WorkPostId == Const.WorkPost_HSSEDirector
|
|
select x).Count().ToString();
|
|
//企业总部专职人数
|
|
div_qyzbzzrs.InnerHtml = (from x in db.Person_CompanyBranchPerson
|
|
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
where x.IsOnJob == true && y.IsHsse == true && x.UnitId == unitId
|
|
select x).Count().ToString();
|
|
div_qyzbzzrs1.InnerHtml = (from x in db.SitePerson_Person
|
|
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
where x.IsUsed == true && y.IsHsse == true
|
|
select x).Count().ToString();
|
|
//分支机构总监人数
|
|
div_fzjgzjrs.InnerHtml = (from x in db.Person_CompanyBranchPerson
|
|
where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId != unitId
|
|
select x).Count().ToString();
|
|
//分支机构专职人数
|
|
div_fzjgzzrs.InnerHtml = (from x in db.Person_CompanyBranchPerson
|
|
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
|
where x.IsOnJob == true && y.IsHsse == true && x.UnitId != unitId
|
|
select x).Count().ToString();
|
|
//企业总部参建人数
|
|
div_qyzbcjrs.InnerHtml = (from x in db.SitePerson_Person where x.IsUsed == true select x).Count().ToString();
|
|
|
|
//项目总监
|
|
div_xmrs.InnerHtml = (from x in db.SitePerson_Person
|
|
where x.WorkPostId == Const.WorkPost_HSSEDirector && x.IsUsed == true
|
|
select x).Count().ToString();
|
|
//项目专职
|
|
div_xmzzrs.InnerHtml = (from x in db.SitePerson_Person
|
|
join y in 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 db.SitePerson_Person
|
|
where x.IsUsed == true
|
|
select x).Count().ToString();
|
|
|
|
//注安师
|
|
var ZasSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName,
|
|
Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone
|
|
,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr
|
|
FROM SitePerson_Person AS Person
|
|
LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId
|
|
LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId
|
|
LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId
|
|
WHERE IsUsed=1 AND InTime <=GETDATE() AND (OutTime IS NULL OR OutTime > GETDATE())
|
|
AND (SELECT COUNT(*) FROM QualityAudit_PersonQuality AS Q LEFT JOIN Base_Certificate AS Cer ON Q.CertificateId
|
|
=Cer.CertificateId WHERE Q.PersonId = Person.PersonId AND IsRegisterHSSE =1) > 0";
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
DataTable tb = SQLHelper.GetDataTableRunText(ZasSql, parameter);
|
|
|
|
div_zasrs.InnerHtml = tb.Rows.Count.ToString();
|
|
//项目信息
|
|
getProjectInfo();
|
|
|
|
//安全会议数据
|
|
getSafeMettingCount();
|
|
|
|
//加载项目全部和待整改的
|
|
getProjectYh();
|
|
}
|
|
}
|
|
|
|
protected string VideoURL
|
|
{
|
|
get
|
|
{
|
|
return ConfigurationManager.AppSettings["Video_URL"] + "#/screen";
|
|
}
|
|
}
|
|
|
|
#region 加载项目信息
|
|
protected void getProjectInfo()
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
var list = 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 = 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 = Count3().ToString().Split('.')[0];
|
|
}
|
|
#endregion
|
|
#region 安全人工时穿透数据
|
|
/// <summary>
|
|
/// 安全工时数
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
protected decimal Count3()
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
decimal cout1 = 0;
|
|
var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber
|
|
select x;
|
|
if (getAllPersonInOutList.Count() > 0)
|
|
{
|
|
if (getAllPersonInOutList.Count() > 0)
|
|
{
|
|
cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours);
|
|
}
|
|
}
|
|
|
|
var getD1 = from x in db.Accident_AccidentHandle
|
|
join y in db.Base_Project on x.ProjectId equals y.ProjectId
|
|
where y.ProjectState == Const.ProjectState_1
|
|
select x;
|
|
var getD2 = from x in db.Accident_AccidentReport
|
|
join y in db.Base_Project on x.ProjectId equals y.ProjectId
|
|
where y.ProjectState == Const.ProjectState_1
|
|
select x;
|
|
|
|
|
|
|
|
|
|
if (getD1.Count() > 0)
|
|
{
|
|
cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0);
|
|
}
|
|
if (getD2.Count() > 0)
|
|
{
|
|
cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0);
|
|
}
|
|
return cout1;
|
|
}
|
|
|
|
#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()
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
var list = db.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
|
|
var hazardRegisters = from x in db.HSSE_Hazard_HazardRegister select x;
|
|
if (list.Count > 0)
|
|
{
|
|
foreach (var item in list)
|
|
{
|
|
yhXmmc += "'" + item.ShortName + "',";
|
|
|
|
//一般
|
|
allYhYb += "'" +
|
|
((from x in hazardRegisters
|
|
where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States == "3" &&
|
|
x.CheckTime > Const.DtmarkTime
|
|
select x).Count() +
|
|
(from x in hazardRegisters
|
|
where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States != "3" &&
|
|
x.CheckTime > Const.DtmarkTime
|
|
select x).Count()) + "',";
|
|
dzgYhYb += "'" + (from x in hazardRegisters
|
|
where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States != "3" &&
|
|
x.CheckTime > Const.DtmarkTime
|
|
select x).Count() + "',";
|
|
|
|
//重大
|
|
allYhZd += "'" +
|
|
((from x in hazardRegisters
|
|
where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States == "3" &&
|
|
x.CheckTime > Const.DtmarkTime
|
|
select x).Count() +
|
|
(from x in hazardRegisters
|
|
where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States != "3" &&
|
|
x.CheckTime > Const.DtmarkTime
|
|
select x).Count()) +
|
|
"',";
|
|
dzgYhZd += "'" + (from x in hazardRegisters
|
|
where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States != "3" &&
|
|
x.CheckTime > Const.DtmarkTime
|
|
select x).Count() + "',";
|
|
|
|
}
|
|
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();
|
|
if (num1 == "NaN") num1 = "0";
|
|
|
|
|
|
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() +
|
|
(from x in Funs.DB.Emergency_EmergencyList
|
|
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() +
|
|
(from x in Funs.DB.Emergency_EmergencyList
|
|
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() +
|
|
(from x in Funs.DB.Emergency_EmergencyList
|
|
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() +
|
|
(from x in Funs.DB.Emergency_DrillRecordList
|
|
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_TrainRecordDetail
|
|
join z in Funs.DB.EduTrain_TrainRecord on x.TrainingId equals z.TrainingId
|
|
join y in Funs.DB.Base_TrainType on z.TrainTypeId equals y.TrainTypeId
|
|
where y.TrainType == "1"
|
|
select x).Count();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取专项培训数
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static int GetSpecialTrainNum()
|
|
{
|
|
var result = (from x in Funs.DB.EduTrain_TrainRecordDetail
|
|
join z in Funs.DB.EduTrain_TrainRecord on x.TrainingId equals z.TrainingId
|
|
join y in Funs.DB.Base_TrainType on z.TrainTypeId equals y.TrainTypeId
|
|
where y.TrainType == "2"
|
|
select x).Count();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取特种作业培训数
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static int GetSpecialOperationTrainNum()
|
|
{
|
|
var result = (from x in Funs.DB.EduTrain_TrainRecordDetail
|
|
join z in Funs.DB.EduTrain_TrainRecord on x.TrainingId equals z.TrainingId
|
|
join y in Funs.DB.Base_TrainType on z.TrainTypeId equals y.TrainTypeId
|
|
where y.TrainType == "3"
|
|
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 || x.State == "1")
|
|
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 || x.State == "1")
|
|
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 || x.State == "1")
|
|
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 || x.State == "1")
|
|
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 != "0" && 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 != "0" && 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
|
|
}
|
|
} |