diff --git a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs index 0b97b843..8e69fd56 100644 --- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs @@ -3865,7 +3865,8 @@ namespace BLL /// public static List GetLicenses() { - var result = (from x in Funs.DB.View_License_LicenseManager + List result = new List(); + var result1 = (from x in Funs.DB.View_License_LicenseManager where BeUnderConstructionList.Contains(x.ProjectId) && x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime select new Model.LicenseOutput @@ -3884,6 +3885,159 @@ namespace BLL EndDate = x.EndDate, WorkStatesStr = "" }).ToList(); + var result2 = (from x in Funs.DB.License_FireWork + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.FireWorkId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "动火作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result3 = (from x in Funs.DB.License_HeightWork + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.HeightWorkId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "高处作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result4 = (from x in Funs.DB.License_LimitedSpace + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.LimitedSpaceId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "受限空间作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result5 = (from x in Funs.DB.License_RadialWork + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.RadialWorkId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "射线作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result6 = (from x in Funs.DB.License_OpenCircuit + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.OpenCircuitId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "断路(占道)作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result7 = (from x in Funs.DB.License_BreakGround + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.BreakGroundId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "动土作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result8 = (from x in Funs.DB.License_NightWork + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.NightWorkId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "夜间施工作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + var result9 = (from x in Funs.DB.License_LiftingWork + where BeUnderConstructionList.Contains(x.ProjectId) + select new Model.LicenseOutput + { + Id = x.LiftingWorkId, + ProjectId = x.ProjectId, + ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId), + UnitId = x.ApplyUnitId, + UnitName = UnitService.GetUnitNameByUnitId(x.ApplyUnitId), + LicenseTypeName = "吊装作业票", + UnitTypeName = "", + IsHighRisk = false, + WorkAreaName = "", + CompileDate = x.ApplyDate, + StartDate = x.ValidityStartTime, + EndDate = x.ValidityEndTime, + WorkStatesStr = "" + }).ToList(); + result.AddRange(result1); + result.AddRange(result2); + result.AddRange(result3); + result.AddRange(result4); + result.AddRange(result5); + result.AddRange(result6); + result.AddRange(result7); + result.AddRange(result8); + result.AddRange(result9); return result; } public static async Task> GetLicensesAsync()