| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace BLL | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public static class MillionsMonthlyReportService | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// 企业安全数据统计月报 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// <param name="MillionsMonthlyReportId">企业安全数据统计月报Id</param> | 
					
						
							|  |  |  |  |         /// <returns>企业安全数据统计月报</returns> | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByMillionsMonthlyReportId(string MillionsMonthlyReportId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// 企业安全数据统计月报 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="unitId">单位Id</param> | 
					
						
							|  |  |  |  |         /// <param name = "year" > 年度 </ param > | 
					
						
							|  |  |  |  |         /// <param name="month">月份</param> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// <returns>企业安全数据统计月报</returns> | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByUnitIdAndYearAndMonth(string unitId, int year, int month) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Month == month && e.Year == year); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// 根据单位Id获取企业安全数据统计月报集合 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="UnitId">单位Id</param> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// <returns>企业安全数据统计月报集合</returns> | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         public static List<Model.View_Information_MillionsMonthlyReport> GetMillionsMonthlyReportsByUnitId(string UnitId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return (from x in Funs.DB.View_Information_MillionsMonthlyReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// 增加企业安全数据统计月报 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// <param name="MillionsMonthlyReport">企业安全数据统计月报实体</param> | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         public static void AddMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = new Model.Information_MillionsMonthlyReport | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 MillionsMonthlyReportId = MillionsMonthlyReport.MillionsMonthlyReportId, | 
					
						
							|  |  |  |  |                 Year = MillionsMonthlyReport.Year, | 
					
						
							|  |  |  |  |                 Month = MillionsMonthlyReport.Month, | 
					
						
							|  |  |  |  |                 UnitId = MillionsMonthlyReport.UnitId, | 
					
						
							|  |  |  |  |                 FillingDate = MillionsMonthlyReport.FillingDate, | 
					
						
							|  |  |  |  |                 DutyPerson = MillionsMonthlyReport.DutyPerson, | 
					
						
							|  |  |  |  |                 RecordableIncidentRate = MillionsMonthlyReport.RecordableIncidentRate, | 
					
						
							|  |  |  |  |                 LostTimeRate = MillionsMonthlyReport.LostTimeRate, | 
					
						
							|  |  |  |  |                 LostTimeInjuryRate = MillionsMonthlyReport.LostTimeInjuryRate, | 
					
						
							|  |  |  |  |                 DeathAccidentFrequency = MillionsMonthlyReport.DeathAccidentFrequency, | 
					
						
							|  |  |  |  |                 AccidentMortality = MillionsMonthlyReport.AccidentMortality, | 
					
						
							|  |  |  |  |                 FillingMan = MillionsMonthlyReport.FillingMan, | 
					
						
							|  |  |  |  |                 UpState = MillionsMonthlyReport.UpState, | 
					
						
							|  |  |  |  |                 HandleState = MillionsMonthlyReport.HandleState, | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |                 HandleMan = MillionsMonthlyReport.HandleMan, | 
					
						
							|  |  |  |  |                 InputCosts = MillionsMonthlyReport.InputCosts, | 
					
						
							|  |  |  |  |                 TrainNum = MillionsMonthlyReport.TrainNum, | 
					
						
							|  |  |  |  |                 GeneralHazardNum = MillionsMonthlyReport.GeneralHazardNum, | 
					
						
							|  |  |  |  |                 MajorHazardNum = MillionsMonthlyReport.MajorHazardNum, | 
					
						
							|  |  |  |  |                 NotProofLargeProjectNum = MillionsMonthlyReport.NotProofLargeProjectNum, | 
					
						
							|  |  |  |  |                 ProofLargeProjectNum = MillionsMonthlyReport.ProofLargeProjectNum, | 
					
						
							|  |  |  |  |                 FireLicenseNum = MillionsMonthlyReport.FireLicenseNum, | 
					
						
							|  |  |  |  |                 LimitLicenseNum = MillionsMonthlyReport.LimitLicenseNum, | 
					
						
							|  |  |  |  |                 HighLicenseNum = MillionsMonthlyReport.HighLicenseNum, | 
					
						
							|  |  |  |  |                 HoistingLicenseNum = MillionsMonthlyReport.HoistingLicenseNum, | 
					
						
							|  |  |  |  |                 BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum, | 
					
						
							|  |  |  |  |                 ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum, | 
					
						
							|  |  |  |  |                 RTLicenseNum = MillionsMonthlyReport.RTLicenseNum, | 
					
						
							| 
									
										
										
										
											2025-07-18 18:05:12 +08:00
										 |  |  |  |                 KeyWorkNum = MillionsMonthlyReport.KeyWorkNum, | 
					
						
							|  |  |  |  |                 KeyWorkOKNum = MillionsMonthlyReport.KeyWorkOKNum, | 
					
						
							|  |  |  |  |                 KeyWorkOKRate = MillionsMonthlyReport.KeyWorkOKRate, | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |                 NightLicenseNum = MillionsMonthlyReport.NightLicenseNum, | 
					
						
							|  |  |  |  |                 CommissionerNum = MillionsMonthlyReport.CommissionerNum, | 
					
						
							|  |  |  |  |                 SoleDutyNum = MillionsMonthlyReport.SoleDutyNum, | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |             }; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             Funs.DB.Information_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport); | 
					
						
							|  |  |  |  |             Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// 修改企业安全数据统计月报 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |         /// <param name="MillionsMonthlyReport">企业安全数据统计月报实体</param> | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         public static void UpdateMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReport.MillionsMonthlyReportId); | 
					
						
							|  |  |  |  |             if (newMillionsMonthlyReport != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.Year = MillionsMonthlyReport.Year; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.Month = MillionsMonthlyReport.Month; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.UnitId = MillionsMonthlyReport.UnitId; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.FillingDate = MillionsMonthlyReport.FillingDate; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.DutyPerson = MillionsMonthlyReport.DutyPerson; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.RecordableIncidentRate = MillionsMonthlyReport.RecordableIncidentRate; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.LostTimeRate = MillionsMonthlyReport.LostTimeRate; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.LostTimeInjuryRate = MillionsMonthlyReport.LostTimeInjuryRate; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.DeathAccidentFrequency = MillionsMonthlyReport.DeathAccidentFrequency; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.AccidentMortality = MillionsMonthlyReport.AccidentMortality; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.UpState = MillionsMonthlyReport.UpState; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.HandleState = MillionsMonthlyReport.HandleState; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.HandleMan = MillionsMonthlyReport.HandleMan; | 
					
						
							| 
									
										
										
										
											2023-03-30 13:51:33 +08:00
										 |  |  |  |                 newMillionsMonthlyReport.InputCosts = MillionsMonthlyReport.InputCosts; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.TrainNum = MillionsMonthlyReport.TrainNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.GeneralHazardNum = MillionsMonthlyReport.GeneralHazardNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.MajorHazardNum = MillionsMonthlyReport.MajorHazardNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.NotProofLargeProjectNum = MillionsMonthlyReport.NotProofLargeProjectNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.ProofLargeProjectNum = MillionsMonthlyReport.ProofLargeProjectNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.FireLicenseNum = MillionsMonthlyReport.FireLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.LimitLicenseNum = MillionsMonthlyReport.LimitLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.HighLicenseNum = MillionsMonthlyReport.HighLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.HoistingLicenseNum = MillionsMonthlyReport.HoistingLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.RTLicenseNum = MillionsMonthlyReport.RTLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.NightLicenseNum = MillionsMonthlyReport.NightLicenseNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.CommissionerNum = MillionsMonthlyReport.CommissionerNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.SoleDutyNum = MillionsMonthlyReport.SoleDutyNum; | 
					
						
							| 
									
										
										
										
											2025-07-18 18:05:12 +08:00
										 |  |  |  |                 newMillionsMonthlyReport.KeyWorkNum = MillionsMonthlyReport.KeyWorkNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.KeyWorkOKNum = MillionsMonthlyReport.KeyWorkOKNum; | 
					
						
							|  |  |  |  |                 newMillionsMonthlyReport.KeyWorkOKRate = MillionsMonthlyReport.KeyWorkOKRate; | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                 Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据Id获取数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="MillionsMonthlyReportId"></param> | 
					
						
							|  |  |  |  |         public static void DeleteMillionsMonthlyReportByMillionsMonthlyReportId(string MillionsMonthlyReportId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId); | 
					
						
							|  |  |  |  |             if (newMillionsMonthlyReport != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.DB.Information_MillionsMonthlyReport.DeleteOnSubmit(newMillionsMonthlyReport); | 
					
						
							|  |  |  |  |                 Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据报表单位,报表时间判断是否存在 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="Id">Id</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByUnitIdDate(string unitId, int year, int Month) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Month == Month); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |