| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Newtonsoft.Json; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  | using System.Configuration; | 
					
						
							| 
									
										
										
										
											2023-10-31 18:03:55 +08:00
										 |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using System.Data.SqlClient; | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 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 | 
					
						
							|  |  |  |  |     { | 
					
						
							| 
									
										
										
										
											2025-09-18 10:20:02 +08:00
										 |  |  |  |         protected string VideoURL | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return ConfigurationManager.AppSettings["Video_URL"]  ; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         protected string PassWord | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var sysSet17 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控密码" select x).ToList().FirstOrDefault(); | 
					
						
							|  |  |  |  |                 if (sysSet17 != null) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     return Funs.EncryptionPassword(sysSet17.SetValue); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 return ""; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |          | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         public static List<Model.Solution_LargerHazard> LargerHazard = new List<Model.Solution_LargerHazard>(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 公司级项目筛选 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public string[] pids { get; set; } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         //页面加载 | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 //安监人员数据 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                 //企业总部总监人数 | 
					
						
							|  |  |  |  |                 Model.SGGLDB db = Funs.DB; | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 if (!string.IsNullOrEmpty(CurrUser.CompanyProjectId)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     pids = CurrUser.CompanyProjectId.Split(','); | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2024-09-23 10:31:03 +08:00
										 |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     //加载所有在建项目的数据 | 
					
						
							|  |  |  |  |                     var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x => x.ProjectId).ToArray(); | 
					
						
							|  |  |  |  |                     if (pidArray.Length > 0) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         pids = pidArray; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                 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(); | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                 //企业总部专职人数 | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                 //分支机构总监人数 | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 if (pids == null) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     //项目总监 | 
					
						
							|  |  |  |  |                     div_xmrs.InnerHtml = (from x in db.SitePerson_Person | 
					
						
							|  |  |  |  |                                           where x.WorkPostId == Const.WorkPost_HSSEDirector && x.IsUsed == true | 
					
						
							|  |  |  |  |                                           select x).Count().ToString(); | 
					
						
							|  |  |  |  |                     div_qyzbrs1.InnerHtml = div_xmrs.InnerHtml; | 
					
						
							|  |  |  |  |                     //项目专职 | 
					
						
							|  |  |  |  |                     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_qyzbzzrs1.InnerHtml = div_xmzzrs.InnerHtml; | 
					
						
							| 
									
										
										
										
											2025-04-23 11:05:07 +08:00
										 |  |  |  |                     //企业总部参建人数 | 
					
						
							|  |  |  |  |                     div_qyzbcjrs.InnerHtml = (from x in db.SitePerson_Person | 
					
						
							|  |  |  |  |                                               where x.IsUsed == true | 
					
						
							|  |  |  |  |                                               select x).Count().ToString(); | 
					
						
							|  |  |  |  |                     //项目在岗人数 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                     div_xmcjrs.InnerHtml = (from x in db.SitePerson_Person | 
					
						
							| 
									
										
										
										
											2025-04-23 11:05:07 +08:00
										 |  |  |  |                                             where x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime.Value > DateTime.Now) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                                             select x).Count().ToString(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //注安师 | 
					
						
							|  |  |  |  |                     var ZasSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName,
 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                         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";
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                     List<SqlParameter> listStr = new List<SqlParameter>(); | 
					
						
							|  |  |  |  |                     SqlParameter[] parameter = listStr.ToArray(); | 
					
						
							|  |  |  |  |                     DataTable tb = SQLHelper.GetDataTableRunText(ZasSql, parameter); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     div_zasrs.InnerHtml = tb.Rows.Count.ToString(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                     //项目总监 | 
					
						
							|  |  |  |  |                     div_xmrs.InnerHtml = (from x in db.SitePerson_Person | 
					
						
							|  |  |  |  |                                           where x.WorkPostId == Const.WorkPost_HSSEDirector && x.IsUsed == true | 
					
						
							|  |  |  |  |                                           && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                                           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 | 
					
						
							|  |  |  |  |                                             && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                                             select x).Count().ToString(); | 
					
						
							| 
									
										
										
										
											2025-04-23 11:05:07 +08:00
										 |  |  |  |                     //项目参建人数 | 
					
						
							|  |  |  |  |                     div_qyzbcjrs.InnerHtml = (from x in db.SitePerson_Person | 
					
						
							|  |  |  |  |                                               where x.IsUsed == true | 
					
						
							|  |  |  |  |                                               && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                                               select x).Count().ToString(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //项目在岗人数 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                     div_xmcjrs.InnerHtml = (from x in db.SitePerson_Person | 
					
						
							| 
									
										
										
										
											2025-04-23 11:05:07 +08:00
										 |  |  |  |                                             where x.IsUsed == true && pids.Contains(x.ProjectId) && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime.Value > DateTime.Now) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                                             select x).Count().ToString(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     string s1 = string.Format("'{0}'", String.Join(",", pids).Replace(",", "','")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //注安师 | 
					
						
							|  |  |  |  |                     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 and  Person.ProjectId in (" + s1 + ")";
 | 
					
						
							|  |  |  |  |                     List<SqlParameter> listStr = new List<SqlParameter>(); | 
					
						
							|  |  |  |  |                     SqlParameter[] parameter = listStr.ToArray(); | 
					
						
							|  |  |  |  |                     DataTable tb = SQLHelper.GetDataTableRunText(ZasSql, parameter); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     div_zasrs.InnerHtml = tb.Rows.Count.ToString(); | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                     div_qyzbrs1.InnerHtml = div_xmrs.InnerHtml; | 
					
						
							|  |  |  |  |                     div_qyzbzzrs1.InnerHtml = div_xmzzrs.InnerHtml; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |                 //项目信息 | 
					
						
							|  |  |  |  |                 getProjectInfo(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //安全会议数据 | 
					
						
							|  |  |  |  |                 getSafeMettingCount(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //加载项目全部和待整改的 | 
					
						
							|  |  |  |  |                 getProjectYh(); | 
					
						
							| 
									
										
										
										
											2025-03-19 15:02:56 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                 getCNEN(); | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-18 10:20:02 +08:00
										 |  |  |  |        | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 加载项目信息 | 
					
						
							|  |  |  |  |         protected void getProjectInfo() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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]; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var list = db.Base_Project.Where(x => pids.Contains(x.ProjectId)); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 //在建项目 | 
					
						
							|  |  |  |  |                 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 && pids.Contains(x.ProjectId)).Count().ToString(); | 
					
						
							|  |  |  |  |                 //安全工时数 | 
					
						
							|  |  |  |  |                 //int wHours = Funs.DB.SitePerson_PersonInOutNumber.Max(x => x.WorkHours) ?? 0; | 
					
						
							|  |  |  |  |                 this.div_safeworktime.InnerHtml = Count3().ToString().Split('.')[0]; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2023-10-31 18:03:55 +08:00
										 |  |  |  |         #endregion | 
					
						
							|  |  |  |  |         #region 安全人工时穿透数据 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 安全工时数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="state"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         protected decimal Count3() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             decimal cout1 = 0; | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber | 
					
						
							|  |  |  |  |                                             select x; | 
					
						
							| 
									
										
										
										
											2023-10-31 18:03:55 +08:00
										 |  |  |  |                 if (getAllPersonInOutList.Count() > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                     if (getAllPersonInOutList.Count() > 0) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours); | 
					
						
							|  |  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2023-10-31 18:03:55 +08:00
										 |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 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; | 
					
						
							| 
									
										
										
										
											2023-10-31 18:03:55 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 if (getD1.Count() > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (getD2.Count() > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0); | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber | 
					
						
							|  |  |  |  |                                             where pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                                             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 | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                             where pids.Contains(x.ProjectId) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                             select x; | 
					
						
							|  |  |  |  |                 var getD2 = from x in db.Accident_AccidentReport | 
					
						
							|  |  |  |  |                             join y in db.Base_Project on x.ProjectId equals y.ProjectId | 
					
						
							|  |  |  |  |                             where pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                             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); | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-31 18:03:55 +08:00
										 |  |  |  |             return cout1; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         #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() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             var list = new List<Model.Base_Project>(); | 
					
						
							|  |  |  |  |             if (pids != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 list = db.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList(); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 list = db.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |             var hazardRegisters = from x in db.HSSE_Hazard_HazardRegister select x; | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |             if (list.Count > 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 foreach (var item in list) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     yhXmmc += "'" + item.ShortName + "',"; | 
					
						
							|  |  |  |  |                     //一般 | 
					
						
							|  |  |  |  |                     allYhYb += "'" + | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                     ((from x in hazardRegisters | 
					
						
							| 
									
										
										
										
											2024-09-04 11:24:59 +08:00
										 |  |  |  |                       where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States == "3" && | 
					
						
							|  |  |  |  |                             x.CheckTime > Const.DtmarkTime | 
					
						
							|  |  |  |  |                       select x).Count() + | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                     (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() + "',"; | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //重大 | 
					
						
							|  |  |  |  |                     allYhZd += "'" + | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                        ((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()) + | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |                        "',"; | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  |                     dzgYhZd += "'" + (from x in hazardRegisters | 
					
						
							|  |  |  |  |                                       where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States != "3" && | 
					
						
							|  |  |  |  |                                             x.CheckTime > Const.DtmarkTime | 
					
						
							|  |  |  |  |                                       select x).Count() + "',"; | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 //项目安全领导小组 | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 //项目安全领导小组 | 
					
						
							|  |  |  |  |                 div_xmaqldxz.InnerHtml = Funs.DB.Meeting_SafetyLeaderGroupMeeting.Where(x => x.CompileDate > Const.DtmarkTime | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                 && pids.Contains(x.ProjectId)).Count().ToString(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 //项目安全例会 | 
					
						
							|  |  |  |  |                 DateTime date = DateTime.Now; | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                 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 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                                         && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                                         select x).Count() | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                     + (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 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                        && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                        select x).Count()).ToString(); | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 右侧 安全费用数据、施工机具设备数据、高风险作业许可数据 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取费用使用(万元) | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCostUse() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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 && pids.Contains(y.ProjectId) | 
					
						
							|  |  |  |  |                              select x.CostMoney ?? 0).ToList().Sum(); | 
					
						
							|  |  |  |  |                 result = Funs.GetNewIntOrZero(costs.ToString().Split('.')[0]); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取施工机具在用数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetUseEquipmentNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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() + | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |                          (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(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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 && pids.Contains(y.ProjectId) | 
					
						
							|  |  |  |  |                               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 && pids.Contains(y.ProjectId) | 
					
						
							|  |  |  |  |                         select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取施工机具特种设备数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSpecialEquipmentNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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 && pids.Contains(y.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取作业许可项数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetLicensesNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.License_LicenseManager | 
					
						
							|  |  |  |  |                               where x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.License_LicenseManager | 
					
						
							|  |  |  |  |                               where x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                                && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取作业许可关闭项数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetLicensesCloseNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.License_LicenseManager | 
					
						
							|  |  |  |  |                               where x.IsHighRisk == true && x.WorkStates == "3" && | 
					
						
							|  |  |  |  |                                     x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取一般隐患整改闭环项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetGeneralClosedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                               where x.Risk_Level == "一般" && x.States == "3" && | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                                     x.CheckTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取一般隐患未整改完成项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetGeneralNotClosedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister | 
					
						
							|  |  |  |  |                               where x.Risk_Level == "一般" && x.States != "3" && | 
					
						
							|  |  |  |  |                                     x.CheckTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 一般整改率 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public string GetGeneralZgl() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             var num1 = Math.Round(100.0 * GetGeneralClosedNum() / (GetGeneralClosedNum() + GetGeneralNotClosedNum()), 0).ToString(); | 
					
						
							|  |  |  |  |             return num1; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取重大隐患整改闭环项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetMajorClosedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister | 
					
						
							|  |  |  |  |                               where x.Risk_Level == "重大" && x.States == "3" && | 
					
						
							|  |  |  |  |                                     x.CheckTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取重大隐患未整改完成项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetMajorNotClosedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister | 
					
						
							|  |  |  |  |                               where x.Risk_Level == "重大" && x.States != "3" && | 
					
						
							|  |  |  |  |                                     x.CheckTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 重大整改率 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public string GetMajorZgl() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             var num1 = Math.Round(100.0 * GetMajorClosedNum() / (GetMajorClosedNum() + GetMajorNotClosedNum()), 0).ToString(); | 
					
						
							| 
									
										
										
										
											2023-11-14 11:53:38 +08:00
										 |  |  |  |             if (num1 == "NaN") num1 = "0"; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |             return num1; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 安全监督检查数据 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业负责人带班检查次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanyLeadShiftCheckNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum(); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum(pids); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-25 17:06:47 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业综合检查次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanyComprehensiveCheckNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |                 return HSSEData_HSSEService.GetCompanyComprehensiveCheckNum(); | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |                 return HSSEData_HSSEService.GetCompanyComprehensiveCheckNum(pids); | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业专项检查次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanySpecialCheckNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |                 return HSSEData_HSSEService.GetCompanySpecialCheckNum(); | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |                 return HSSEData_HSSEService.GetCompanySpecialCheckNum(pids); | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取项目负责人带班检查次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetProjectLeadShiftCheckNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Check_ProjectLeaderCheck | 
					
						
							|  |  |  |  |                               where x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 var result = (from x in Funs.DB.Check_ProjectLeaderCheck | 
					
						
							|  |  |  |  |                               where x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                                && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取项目专项检查次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetProjectSpecialCheckNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Check_CheckSpecial | 
					
						
							|  |  |  |  |                               where x.CheckTime > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 var result = (from x in Funs.DB.Check_CheckSpecial | 
					
						
							|  |  |  |  |                               where x.CheckTime > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取项目专业检查次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetProjectMajorCheckNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister | 
					
						
							|  |  |  |  |                               where x.CheckTime > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister | 
					
						
							|  |  |  |  |                               where x.CheckTime > Const.DtmarkTime | 
					
						
							|  |  |  |  |                                  && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 事故事件数据 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取未遂事件数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetNearMissNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取可记录事件数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetRecordableEventNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取一般事故数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetGeneralAccidentNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "1" && x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "1" && x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取较大事故数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetMajorAccidentNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "2" && x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "2" && x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取重大事故数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSeriousAccidentNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "3" && x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "3" && x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取特别重大事故数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSpecialSeriousAccidentNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                               where x.AccidentDegree == "4" | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Accident_AccidentReport | 
					
						
							|  |  |  |  |                               where x.AccidentDegree == "4" && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 应急管理数据 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业级综合预案数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanyComprehensivePlanNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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() + | 
					
						
							| 
									
										
										
										
											2024-09-04 11:24:59 +08:00
										 |  |  |  |                           (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(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                           select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业级专项预案数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanySpecialPlanNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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() + | 
					
						
							| 
									
										
										
										
											2024-09-04 11:24:59 +08:00
										 |  |  |  |                           (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(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                           select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业级现场处置预案 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanyOnSiteDisposalPlan() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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() + | 
					
						
							| 
									
										
										
										
											2024-09-04 11:24:59 +08:00
										 |  |  |  |                           (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(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               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 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                           select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取企业级演练次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompanyDrillNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit | 
					
						
							|  |  |  |  |                               where x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                               select x).Count() + | 
					
						
							| 
									
										
										
										
											2024-09-04 11:24:59 +08:00
										 |  |  |  |                           (from x in Funs.DB.Emergency_DrillRecordList | 
					
						
							|  |  |  |  |                            where x.CompileDate > Const.DtmarkTime | 
					
						
							|  |  |  |  |                            select x).Count(); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Emergency_DrillRecordList_Unit | 
					
						
							|  |  |  |  |                               where x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count() + | 
					
						
							|  |  |  |  |                           (from x in Funs.DB.Emergency_DrillRecordList | 
					
						
							|  |  |  |  |                            where x.CompileDate > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                            select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 安全教育培训人次数数据 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取三级安全教育培训数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSafeTrainNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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" && pids.Contains(z.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取专项培训数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSpecialTrainNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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" && pids.Contains(z.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取特种作业培训数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSpecialOperationTrainNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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" && pids.Contains(z.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 安全数据分析 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取一般风险数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetGeneralRiskNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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") | 
					
						
							|  |  |  |  |                                && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取低风险数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetLowRiskNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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") | 
					
						
							|  |  |  |  |                                && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取中风险数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetMediumRiskNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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") | 
					
						
							|  |  |  |  |                                 && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取高风险数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetHighRiskNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 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") | 
					
						
							|  |  |  |  |                               && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 应急管理程序 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取危大工程审批完成数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetCompletedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							|  |  |  |  |                               where x.States != "0" && x.IsSuperLargerHazard == false && | 
					
						
							|  |  |  |  |                                     x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取危大工程培训人次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetTrainPersonNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							| 
									
										
										
										
											2025-04-23 10:28:48 +08:00
										 |  |  |  |                               where x.IsSuperLargerHazard == false && x.TrainPersonNum != null && x.RecordTime > Const.DtmarkTime | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                               select x.TrainPersonNum).ToList().Sum(x => x.Value); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							| 
									
										
										
										
											2025-04-23 10:28:48 +08:00
										 |  |  |  |                               where x.IsSuperLargerHazard == false && x.TrainPersonNum != null && x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                               select x.TrainPersonNum).ToList().Sum(x => x.Value); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取危大工程施工个数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetConstructionNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							|  |  |  |  |                               where x.States == "2" && x.IsSuperLargerHazard == false && | 
					
						
							|  |  |  |  |                                     x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取危大工程完工个数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetFinishedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							|  |  |  |  |                               where x.States == "3" && x.IsSuperLargerHazard == false && | 
					
						
							|  |  |  |  |                                     x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取超危大工程审批完成数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSuperCompletedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							|  |  |  |  |                               where x.States != "0" && x.IsSuperLargerHazard == true && | 
					
						
							|  |  |  |  |                                     x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取超危大工程培训人次数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSuperTrainPersonNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |                 (from x in Funs.DB.Solution_LargerHazard | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                  where x.IsSuperLargerHazard == true && x.TrainPersonNum != null && x.RecordTime > Const.DtmarkTime | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |                  select x.TrainPersonNum).ToList().Sum(x => x.Value); | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = | 
					
						
							|  |  |  |  |               (from x in Funs.DB.Solution_LargerHazard | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |                where x.IsSuperLargerHazard == true && x.TrainPersonNum != null && x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |                select x.TrainPersonNum).ToList().Sum(x => x.Value); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取超危大工程施工个数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSuperConstructionNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							|  |  |  |  |                               where x.States == "2" && x.IsSuperLargerHazard == true && | 
					
						
							|  |  |  |  |                                     x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///     获取超危大工程完工个数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2025-04-23 10:23:42 +08:00
										 |  |  |  |         public int GetSuperFinishedNum() | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-09-11 10:36:09 +08:00
										 |  |  |  |             if (pids == null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var result = (from x in Funs.DB.Solution_LargerHazard | 
					
						
							|  |  |  |  |                               where x.States == "3" && x.IsSuperLargerHazard == true && | 
					
						
							|  |  |  |  |                                     x.RecordTime > Const.DtmarkTime && pids.Contains(x.ProjectId) | 
					
						
							|  |  |  |  |                               select x).Count(); | 
					
						
							|  |  |  |  |                 return result; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2025-03-19 15:02:56 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 中英文翻译 | 
					
						
							|  |  |  |  |         protected string main_new_rectificationRate = string.Empty; | 
					
						
							|  |  |  |  |         protected string All = string.Empty; | 
					
						
							|  |  |  |  |         protected string To_be_rectified = string.Empty; | 
					
						
							|  |  |  |  |         protected string Accident_event_data = string.Empty; | 
					
						
							|  |  |  |  |         protected string Emergency_management_data = string.Empty; | 
					
						
							|  |  |  |  |         protected string Particularly_serious_accident = string.Empty; | 
					
						
							|  |  |  |  |         protected string General_accident = string.Empty; | 
					
						
							|  |  |  |  |         protected string Major_accident = string.Empty; | 
					
						
							|  |  |  |  |         protected string Relatively_major_accident = string.Empty; | 
					
						
							|  |  |  |  |         protected string High_risk = string.Empty; | 
					
						
							|  |  |  |  |         protected string Medium_risk = string.Empty; | 
					
						
							|  |  |  |  |         protected string LowRisk = string.Empty; | 
					
						
							|  |  |  |  |         protected string GeneralRisk = string.Empty; | 
					
						
							|  |  |  |  |         protected void getCNEN() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             main_new_rectificationRate = Resources.Lan.main_new_rectificationRate; | 
					
						
							|  |  |  |  |             All = Resources.Lan.All; | 
					
						
							|  |  |  |  |             To_be_rectified = Resources.Lan.To_be_rectified; | 
					
						
							|  |  |  |  |             Accident_event_data = Resources.Lan.Accident_event_data; | 
					
						
							|  |  |  |  |             Emergency_management_data = Resources.Lan.Emergency_management_data; | 
					
						
							|  |  |  |  |             Particularly_serious_accident = Resources.Lan.Particularly_serious_accident; | 
					
						
							|  |  |  |  |             General_accident = Resources.Lan.General_accident; | 
					
						
							|  |  |  |  |             Major_accident = Resources.Lan.Major_accident; | 
					
						
							|  |  |  |  |             Relatively_major_accident = Resources.Lan.Relatively_major_accident; | 
					
						
							|  |  |  |  |             High_risk = Resources.Lan.High_risk; | 
					
						
							|  |  |  |  |             Medium_risk = Resources.Lan.Medium_risk; | 
					
						
							|  |  |  |  |             LowRisk = Resources.Lan.LowRisk; | 
					
						
							|  |  |  |  |             GeneralRisk = Resources.Lan.GeneralRisk; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2023-08-24 10:00:59 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |