/// <summary> /// 获取应急预案列表信息 /// </summary> /// <param name="projectId"></param> /// <param name="unitId"></param> /// <param name="strParam"></param> /// <returns></returns> public static List <Model.FileInfoItem> getEmergencyList(string projectId, string unitId, string strParam) { var getDataList = from x in Funs.DB.Emergency_EmergencyList where x.ProjectId == projectId && (x.UnitId == unitId || unitId == null) && (strParam == null || x.EmergencyName.Contains(strParam) || x.EmergencyCode.Contains(strParam)) orderby x.EmergencyCode descending select new Model.FileInfoItem { FileId = x.EmergencyListId, ProjectId = x.ProjectId, FileCode = x.EmergencyCode, FileName = x.EmergencyName, FileType = Funs.DB.Base_EmergencyType.First(y => y.EmergencyTypeId == x.EmergencyTypeId).EmergencyTypeName, FileTypeId = x.EmergencyTypeId, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName, FileContent = x.EmergencyContents, CompileManId = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate), AuditManId = x.AuditMan, AuditManName = Funs.DB.Sys_User.First(u => u.UserId == x.AuditMan).UserName, ApproveManId = x.ApproveMan, ApproveManName = Funs.DB.Sys_User.First(u => u.UserId == x.ApproveMan).UserName, States = x.States, MenuType = "1", AttachUrl = APIUpLoadFileService.getFileUrl(x.EmergencyListId, x.AttachUrl), }; return(getDataList.ToList()); }
/// <summary> /// 根据主键ID获取应急预案信息 /// </summary> /// <param name="emergencyListId"></param> /// <returns></returns> public static Model.FileInfoItem getEmergencyListByEmergencyListId(string emergencyListId) { var getInfo = from x in Funs.DB.Emergency_EmergencyList where x.EmergencyListId == emergencyListId select new Model.FileInfoItem { FileId = x.EmergencyListId, ProjectId = x.ProjectId, FileCode = x.EmergencyCode, FileName = x.EmergencyName, FileType = Funs.DB.Base_EmergencyType.First(y => y.EmergencyTypeId == x.EmergencyTypeId).EmergencyTypeName, FileTypeId = x.EmergencyTypeId, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName, FileContent = System.Web.HttpUtility.HtmlDecode(x.EmergencyContents), CompileManId = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate), AuditManId = x.AuditMan, AuditManName = Funs.DB.Sys_User.First(u => u.UserId == x.AuditMan).UserName, ApproveManId = x.ApproveMan, ApproveManName = Funs.DB.Sys_User.First(u => u.UserId == x.ApproveMan).UserName, States = x.States, MenuType = "1", AttachUrl = APIUpLoadFileService.getFileUrl(x.EmergencyListId, x.AttachUrl), }; return(getInfo.FirstOrDefault()); }
/// <summary> /// 根据ReceiveFileManagerId获取来文详细信息 /// </summary> /// <param name="receiveFileManagerId">来文ID</param> /// <param name="fileType">来文类型(0-项目发文;1-公司来文)</param> /// <returns>来文详细</returns> public static Model.ReceiveFileManagerItem getReceiveFileManagerById(string receiveFileManagerId, string fileType) { var getReceiveFileManagerItem = (from x in Funs.DB.InformationProject_ReceiveFileManager where x.ReceiveFileManagerId == receiveFileManagerId && x.FileType == fileType select new Model.ReceiveFileManagerItem { ReceiveFileManagerId = x.ReceiveFileManagerId, ProjectId = x.ProjectId, ReceiveFileCode = x.ReceiveFileCode, ReceiveFileName = x.ReceiveFileName, Version = x.Version, FileUnitId = x.FileUnitId, FileUnitName = Funs.DB.Base_Unit.First(u => u.UnitId == x.FileUnitId).UnitName, FileCode = x.FileCode, FilePageNum = x.FilePageNum, GetFileDate = string.Format("{0:yyyy-MM-dd}", x.GetFileDate), SendPersonId = x.SendPersonId, SendPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.SendPersonId).UserName, MainContent = x.MainContent, UnitIds = x.UnitIds, UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds), FileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId, null), ReplyFileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId + "#1", null), }).FirstOrDefault(); return(getReceiveFileManagerItem); }
/// <summary> /// 获取工程暂停令列表信息 /// </summary> /// <param name="projectId"></param> /// <param name="unitId"></param> /// <param name="strParam"></param> /// <returns></returns> public static List <Model.PauseNoticeItem> getPauseNoticeList(string projectId, string unitId, string strParam, string states) { var getPauseNotice = from x in Funs.DB.Check_PauseNotice where x.ProjectId == projectId && (x.UnitId == unitId || unitId == null) && x.States == states select new Model.PauseNoticeItem { PauseNoticeId = x.PauseNoticeId, ProjectId = x.ProjectId, PauseNoticeCode = x.PauseNoticeCode, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, ProjectPlace = x.ProjectPlace, WrongContent = x.WrongContent, PauseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.PauseTime), PauseContent = x.PauseContent, IsConfirm = x.IsConfirm, IsConfirmName = (x.IsConfirm == true ? "已确认" : "待确认"), CompileManId = x.CompileManId, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == x.CompileManId).UserName, CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate), States = x.States, PauseStates = x.PauseStates, PauseNoticeAttachUrl = APIUpLoadFileService.getFileUrl(x.PauseNoticeId, null), }; if (!string.IsNullOrEmpty(strParam)) { getPauseNotice = getPauseNotice.Where(x => x.PauseNoticeCode.Contains(strParam) || x.WrongContent.Contains(strParam) || x.PauseContent.Contains(strParam)); } return(getPauseNotice.OrderByDescending(x => x.PauseNoticeCode).ToList()); }
/// <summary> /// 获取专项检查列表信息 /// </summary> /// <param name="projectId"></param> /// <param name="states"></param> /// <returns></returns> public static List <Model.CheckSpecialItem> getCheckSpecialList(string projectId, string states) { var getCheckSpecial = from x in Funs.DB.Check_CheckSpecial where x.ProjectId == projectId && (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2"))) orderby x.CheckSpecialCode descending select new Model.CheckSpecialItem { CheckSpecialId = x.CheckSpecialId, ProjectId = x.ProjectId, CheckSpecialCode = Funs.DB.Sys_CodeRecords.First(y => y.DataId == x.CheckSpecialId).Code ?? x.CheckSpecialCode, CheckType = x.CheckType == "0" ? "周检" : (x.CheckType == "1" ? "月检" : "其他"), CheckItemSetId = x.CheckItemSetId, CheckItemSetName = Funs.DB.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName, CheckPersonId = x.CheckPerson, CheckPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.CheckPerson).UserName, CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime), DaySummary = x.DaySummary, PartInUnitIds = x.PartInUnits, PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits), PartInPersonIds = x.PartInPersonIds, PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds), PartInPersonNames2 = x.PartInPersonNames, CompileManId = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompileMan).UserName, States = x.States, AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null), }; return(getCheckSpecial.ToList()); }
/// <summary> /// 获取专项检查明细项详细 /// </summary> /// <param name="checkSpecialDetailId"></param> /// <returns></returns> public static Model.CheckSpecialDetailItem getCheckSpecialDetailById(string checkSpecialDetailId) { var getInfo = from x in Funs.DB.Check_CheckSpecialDetail where x.CheckSpecialDetailId == checkSpecialDetailId select new Model.CheckSpecialDetailItem { CheckSpecialDetailId = x.CheckSpecialDetailId, CheckSpecialId = x.CheckSpecialId, CheckItemSetId = x.CheckItem, CheckItemSetName = Funs.DB.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName, CheckContent = x.CheckContent, Unqualified = x.Unqualified, Suggestions = x.Suggestions, WorkArea = Funs.DB.ProjectData_WorkArea.First(y => y.WorkAreaId == x.CheckArea).WorkAreaName, WorkAreaId = x.CheckArea, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName, HandleStep = x.HandleStep, HandleStepName = Funs.DB.Sys_Const.First(y => y.GroupId == ConstValue.Group_HandleStep && y.ConstValue == x.HandleStep).ConstText, LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate), CompleteStatus = x.CompleteStatus, CompleteStatusName = x.CompleteStatus == true ? "已完成" : "待完成", AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null), }; return(getInfo.First()); }
/// <summary> /// 获取专项检查详细 /// </summary> /// <param name="CheckSpecialId"></param> /// <returns></returns> public static Model.CheckSpecialItem getCheckSpecialById(string CheckSpecialId) { var getInfo = from x in Funs.DB.Check_CheckSpecial where x.CheckSpecialId == CheckSpecialId select new Model.CheckSpecialItem { CheckSpecialId = x.CheckSpecialId, ProjectId = x.ProjectId, CheckSpecialCode = x.CheckSpecialCode, CheckType = x.CheckType == "0"? "周检":(x.CheckType == "1" ? "月检" :"其他"), CheckItemSetId = x.CheckItemSetId, CheckItemSetName = Funs.DB.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName, CheckPersonId = x.CheckPerson, CheckPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.CheckPerson).UserName, CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime), DaySummary = x.DaySummary, PartInUnitIds = x.PartInUnits, PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits), PartInPersonIds = x.PartInPersonIds, PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds), PartInPersonNames2 = x.PartInPersonNames, CompileManId = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompileMan).UserName, States = x.States, AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null), CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId), }; return(getInfo.FirstOrDefault()); }
/// <summary> /// 根据 PauseNoticeId获取工程暂停令 /// </summary> /// <param name="PauseNoticeId"></param> /// <returns></returns> public static Model.PauseNoticeItem getPauseNoticeById(string PauseNoticeId) { var getInfo = from x in Funs.DB.Check_PauseNotice where x.PauseNoticeId == PauseNoticeId select new Model.PauseNoticeItem { PauseNoticeId = x.PauseNoticeId, ProjectId = x.ProjectId, PauseNoticeCode = x.PauseNoticeCode, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, ProjectPlace = x.ProjectPlace, WrongContent = x.WrongContent, PauseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.PauseTime), PauseContent = x.PauseContent, OneContent = x.OneContent, SecondContent = x.SecondContent, ThirdContent = x.ThirdContent, IsConfirm = x.IsConfirm, IsConfirmName = (x.IsConfirm == true ? "已确认" : "待确认"), CompileManId = x.CompileManId, CompileManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompileManId).UserName, CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate), SignManId = x.SignManId, SignManName = Funs.DB.Sys_User.First(u => u.UserId == x.SignManId).UserName, SignDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.SignDate), ApproveManId = x.ApproveManId, ApproveManName = Funs.DB.Sys_User.First(u => u.UserId == x.ApproveManId).UserName, ApproveDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.ApproveDate), DutyPersonId = x.DutyPersonId, DutyPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.DutyPersonId).UserName, DutyPersonDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.DutyPersonDate), ProfessionalEngineerId = x.ProfessionalEngineerId, ProfessionalEngineerName = Funs.DB.Sys_User.First(u => u.UserId == x.ProfessionalEngineerId).UserName, ProfessionalEngineerTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProfessionalEngineerTime), ConstructionManagerId = x.ConstructionManagerId, ConstructionManagerName = Funs.DB.Sys_User.First(u => u.UserId == x.ConstructionManagerId).UserName, ConstructionManagerTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ConstructionManagerTime), UnitHeadManId = x.UnitHeadManId, UnitHeadManName = Funs.DB.Sys_User.First(u => u.UserId == x.UnitHeadManId).UserName, UnitHeadManTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.UnitHeadManTime), SupervisorManId = x.SupervisorManId, SupervisorManName = Funs.DB.Sys_User.First(u => u.UserId == x.SupervisorManId).UserName, SupervisorManTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.SupervisorManTime), OwnerId = x.OwnerId, OwnerName = Funs.DB.Sys_User.First(u => u.UserId == x.OwnerId).UserName, OwnerTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.OwnerTime), States = x.States, PauseStates = x.PauseStates, PauseNoticeAttachUrl = APIUpLoadFileService.getFileUrl(x.PauseNoticeId, null), FlowOperateItem = getFlowOperateItem(x.PauseNoticeId), }; return(getInfo.FirstOrDefault()); }
/// <summary> /// 根据培训教材主键获取培训教材详细信息 /// </summary> /// <param name="trainingId"></param> /// <returns></returns> public static Model.BaseInfoItem getTrainingItemByTrainingItemId(string trainingItemId) { var getDataInfo = from x in Funs.DB.Training_TrainingItem where x.TrainingItemId == trainingItemId select new Model.BaseInfoItem { BaseInfoId = x.TrainingItemId, BaseInfoCode = x.TrainingItemCode, BaseInfoName = x.TrainingItemName, ImageUrl = APIUpLoadFileService.getFileUrl(x.TrainingItemId, x.AttachUrl), }; return(getDataInfo.FirstOrDefault()); }
/// <summary> /// 获取公司制度详细信息 /// </summary> /// <param name="safetyInstitutionId"></param> /// <returns></returns> public static Model.BaseInfoItem getCompanySafetyInstitutionInfo(string safetyInstitutionId) { var getDataInfo = from x in Funs.DB.HSSESystem_SafetyInstitution where x.SafetyInstitutionId == safetyInstitutionId select new Model.BaseInfoItem { BaseInfoId = x.SafetyInstitutionId, BaseInfoCode = string.Format("{0:yyyy-MM-dd}", x.EffectiveDate), BaseInfoName = x.SafetyInstitutionName, ImageUrl = APIUpLoadFileService.getFileUrl(x.SafetyInstitutionId, x.AttachUrl), }; return(getDataInfo.FirstOrDefault()); }
/// <summary> /// 获取公司制度列表 /// </summary> /// <param name="trainingId"></param> /// <returns></returns> public static List <Model.BaseInfoItem> getCompanySafetyInstitutionList() { var getDataLists = (from x in Funs.DB.HSSESystem_SafetyInstitution orderby x.EffectiveDate descending select new Model.BaseInfoItem { BaseInfoId = x.SafetyInstitutionId, BaseInfoCode = string.Format("{0:yyyy-MM-dd}", x.EffectiveDate), BaseInfoName = x.SafetyInstitutionName, ImageUrl = APIUpLoadFileService.getFileUrl(x.SafetyInstitutionId, x.AttachUrl), }).ToList(); return(getDataLists); }
/// <summary> /// 根据projectId、fileType获取来文列表 /// </summary> /// <param name="projectId"></param> /// <param name="fileType">来文类型(0-项目发文;1-公司来文)</param> /// <param name="unitId">单位ID</param> /// <param name="states">状态(0待提交;1-已提交;2:已回复)</param> /// <returns></returns> public static List <Model.ReceiveFileManagerItem> getReceiveFileManagerList(string projectId, string fileType, string unitId, string states) { var getReceiveFileManagerItem = (from x in Funs.DB.InformationProject_ReceiveFileManager where x.ProjectId == projectId && x.FileType == fileType select new Model.ReceiveFileManagerItem { ReceiveFileManagerId = x.ReceiveFileManagerId, ProjectId = x.ProjectId, FileType = x.FileType, ReceiveFileCode = x.ReceiveFileCode, ReceiveFileName = x.ReceiveFileName, Version = x.Version, FileUnitId = x.FileUnitId, FileUnitName = Funs.DB.Base_Unit.First(u => u.UnitId == x.FileUnitId).UnitName, FileCode = x.FileCode, FilePageNum = x.FilePageNum, GetFileDate = string.Format("{0:yyyy-MM-dd}", x.GetFileDate), SendPersonId = x.SendPersonId, SendPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.SendPersonId).UserName, MainContent = x.MainContent, UnitIds = x.UnitIds, UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds), FileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId, null), ReplyFileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId + "#1", null), States = x.States, }).AsEnumerable(); if (getReceiveFileManagerItem.Count() > 0) { if (!string.IsNullOrEmpty(unitId) && !CommonService.GetIsThisUnit(unitId)) { getReceiveFileManagerItem = getReceiveFileManagerItem.Where(x => x.FileUnitId == unitId || (x.UnitIds != null && x.UnitIds.Contains(unitId))); } if (states == Const.State_0) { getReceiveFileManagerItem = getReceiveFileManagerItem.Where(x => x.States == Const.State_0 || x.States == null); } else if (states == Const.State_1) { getReceiveFileManagerItem = getReceiveFileManagerItem.Where(x => x.States == Const.State_2 && (x.ReplyFileAttachUrl == null || x.ReplyFileAttachUrl == "")); } else if (states == Const.State_2) { getReceiveFileManagerItem = getReceiveFileManagerItem.Where(x => x.States == Const.State_2 && x.ReplyFileAttachUrl != null && x.ReplyFileAttachUrl != ""); } } return(getReceiveFileManagerItem.OrderByDescending(x => x.ReceiveFileCode).ToList()); }
/// <summary> /// 根据 PunishNoticeId获取处罚通知单 /// </summary> /// <param name="PunishNoticeId"></param> /// <returns></returns> public static Model.PunishNoticeItem getPunishNoticeById(string PunishNoticeId) { var getInfo = from x in Funs.DB.Check_PunishNotice where x.PunishNoticeId == PunishNoticeId select new Model.PunishNoticeItem { PunishNoticeId = x.PunishNoticeId, ProjectId = x.ProjectId, PunishNoticeCode = x.PunishNoticeCode, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, ContractNum = x.ContractNum, PunishNoticeDate = string.Format("{0:yyyy-MM-dd}", x.PunishNoticeDate), BasicItem = x.BasicItem, IncentiveReason = x.IncentiveReason, PunishMoney = x.PunishMoney ?? 0, Currency = x.Currency, FileContents = System.Web.HttpUtility.HtmlDecode(x.FileContents), CompileManId = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate), SignManId = x.SignMan, SignManName = Funs.DB.Sys_User.First(u => u.UserId == x.SignMan).UserName, SignDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.SignDate), ApproveManId = x.ApproveMan, ApproveManName = Funs.DB.Sys_User.First(u => u.UserId == x.ApproveMan).UserName, ApproveDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.ApproveDate), DutyPersonId = x.DutyPersonId, DutyPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.DutyPersonId).UserName, DutyPersonDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.DutyPersonDate), ProfessionalEngineerId = x.ProfessionalEngineerId, ProfessionalEngineerName = Funs.DB.Sys_User.First(u => u.UserId == x.ProfessionalEngineerId).UserName, ProfessionalEngineerTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProfessionalEngineerTime), ConstructionManagerId = x.ConstructionManagerId, ConstructionManagerName = Funs.DB.Sys_User.First(u => u.UserId == x.ConstructionManagerId).UserName, ConstructionManagerTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ConstructionManagerTime), UnitHeadManId = x.UnitHeadManId, UnitHeadManName = Funs.DB.Sys_User.First(u => u.UserId == x.UnitHeadManId).UserName, UnitHeadManTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.UnitHeadManTime), States = x.States, PunishStates = x.PunishStates, PunishUrl = APIUpLoadFileService.getFileUrl(Const.ProjectPunishNoticeStatisticsMenuId, x.PunishNoticeId, null), ReceiptUrl = APIUpLoadFileService.getFileUrl(Const.ProjectPunishNoticeMenuId, x.PunishNoticeId, null), FlowOperateItem = getFlowOperateItem(x.PunishNoticeId), }; return(getInfo.FirstOrDefault()); }
/// <summary> /// 根据ID 获取审核信息 /// </summary> /// <returns></returns> public static List <Model.FlowOperateItem> getFlowOperateItem(string punishNoticeId) { var getInfo = from x in Funs.DB.Check_PunishNoticeFlowOperate where x.PunishNoticeId == punishNoticeId orderby x.OperateTime descending select new Model.FlowOperateItem { FlowOperateId = x.FlowOperateId, DataId = x.PunishNoticeId, AuditFlowName = x.OperateName, OperaterId = x.OperateManId, OperaterName = Funs.DB.Sys_User.First(z => z.UserId == x.OperateManId).UserName, OperaterTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", x.OperateTime), IsAgree = x.IsAgree, Opinion = x.Opinion, SignatureUrl = APIUpLoadFileService.getFileUrl(string.Empty, x.SignatureUrl), }; return(getInfo.ToList()); }
/// <summary> /// 根据隐患整改单ID 获取整改单明细信息 /// </summary> /// <returns></returns> public static List <Model.RectifyNoticesItemItem> getRectifyNoticesItemItem(string rectifyNoticesId) { var getInfo = from x in Funs.DB.Check_RectifyNoticesItem where x.RectifyNoticesId == rectifyNoticesId orderby x.LimitTime descending select new Model.RectifyNoticesItemItem { RectifyNoticesItemId = x.RectifyNoticesItemId, RectifyNoticesId = x.RectifyNoticesId, WrongContent = x.WrongContent, Requirement = x.Requirement, LimitTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", x.LimitTime), RectifyResults = x.RectifyResults, IsRectify = x.IsRectify, PhotoBeforeUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesItemId + "#1", null), PhotoAfterUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesItemId + "#2", null), }; return(getInfo.ToList()); }
/// <summary> /// 根据RectifyNoticesId获取风险巡检信息详细信息 /// </summary> /// <param name="rectifyNoticesId"></param> /// <returns></returns> public static Model.RectifyNoticesItem getRectifyNoticesById(string rectifyNoticesId) { var getRectifyNotices = from x in Funs.DB.Check_RectifyNotices where x.RectifyNoticesId == rectifyNoticesId select new Model.RectifyNoticesItem { RectifyNoticesId = x.RectifyNoticesId, ProjectId = x.ProjectId, ProjectName = Funs.DB.Base_Project.First(z => z.ProjectId == x.ProjectId).ProjectName, RectifyNoticesCode = x.RectifyNoticesCode, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, WorkAreaId = x.WorkAreaId, WorkAreaName = WorkAreaService.getWorkAreaNamesIds(x.WorkAreaId), CheckManNames = x.CheckManNames, CheckManIds = x.CheckManIds, CheckManIdNames = UserService.getUserNamesUserIds(x.CheckManIds), CheckManAllNames = getCheckAllManName(x.CheckManIds, x.CheckManNames), CheckedDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CheckedDate), CheckedDateD = x.CheckedDate, HiddenHazardType = x.HiddenHazardType, HiddenHazardTypeName = x.HiddenHazardType == "2" ? "较大" : (x.HiddenHazardType == "3" ? "重大" : "一般"), CompleteManId = x.CompleteManId, CompleteManName = Funs.DB.Sys_User.First(u => u.UserId == x.CompleteManId).UserName, SignPersonId = x.SignPerson, SignPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.SignPerson).UserName, SignDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.SignDate), ProfessionalEngineerId = x.ProfessionalEngineerId, ProfessionalEngineerName = Funs.DB.Sys_User.First(u => u.UserId == x.ProfessionalEngineerId).UserName, ProfessionalEngineerTime1 = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProfessionalEngineerTime1), ProfessionalEngineerTime2 = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProfessionalEngineerTime2), ConstructionManagerId = x.ConstructionManagerId, ConstructionManagerName = Funs.DB.Sys_User.First(u => u.UserId == x.ConstructionManagerId).UserName, ConstructionManagerTime1 = string.Format("{0:yyyy-MM-dd HH:mm}", x.ConstructionManagerTime1), ConstructionManagerTime2 = string.Format("{0:yyyy-MM-dd HH:mm}", x.ConstructionManagerTime2), ProjectManagerId = x.ProjectManagerId, ProjectManagerName = Funs.DB.Sys_User.First(u => u.UserId == x.ProjectManagerId).UserName, ProjectManagerTime1 = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProjectManagerTime1), ProjectManagerTime2 = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProjectManagerTime2), DutyPersonId = x.DutyPersonId, DutyPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.DutyPersonId).UserName, DutyPersonTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.DutyPersonTime), CompleteDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompleteDate), UnitHeadManId = x.UnitHeadManId, UnitHeadManName = Funs.DB.Sys_User.First(u => u.UserId == x.UnitHeadManId).UserName, UnitHeadManDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.UnitHeadManDate), CheckPersonId = x.CheckPerson, CheckPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.CheckPerson).UserName, ReCheckDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.ReCheckDate), ReCheckOpinion = x.ReCheckOpinion, //WrongContent =x.WrongContent, //CompleteStatus=x.CompleteStatus, //RectificationName=x.DutyPerson, IsRectify = x.IsRectify ?? false, States = x.States, AttachUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesId, null), BeAttachUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesId + "#0", null), AfAttachUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesId + "#1", null), RectifyNoticesItemItem = getRectifyNoticesItemItem(x.RectifyNoticesId), RectifyNoticesFlowOperateItem = getRectifyNoticesFlowOperateItem(x.RectifyNoticesId), }; return(getRectifyNotices.FirstOrDefault()); }
/// <summary> /// 根据projectId、unitid获取特岗人员资质信息 /// </summary> /// <param name="projectId">项目ID</param> /// <param name="unitId">单位ID</param> /// <param name="qualityType">资质类型</param> /// <param name="states">0-待提交;1-待审核;2-已审核;-1打回</param> /// <param name="unitIdQ">查询单位ID</param> /// <returns></returns> public static List <Model.PersonQualityItem> getPersonQualityList(string projectId, string unitId, string qualityType, string states, string unitIdQ) { List <Model.PersonQualityItem> getLists = new List <Model.PersonQualityItem>(); if (qualityType == "1") { getLists = (from x in Funs.DB.SitePerson_Person join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId into jonPerson from y in jonPerson.DefaultIfEmpty() where x.ProjectId == projectId && z.PostType == Const.PostType_2 && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now) orderby x.CardNo select new Model.PersonQualityItem { PersonQualityId = y.PersonQualityId, QualityType = qualityType, PersonId = x.PersonId, PersonName = x.PersonName, CardNo = x.CardNo, IdentityCard = x.IdentityCard, ProjectId = x.ProjectId, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName, CertificateId = y.CertificateId, CertificateName = Funs.DB.Base_Certificate.First(z => z.CertificateId == y.CertificateId).CertificateName, WorkPostId = x.WorkPostId, WorkPostName = z.WorkPostName, CertificateNo = y.CertificateNo, Grade = y.Grade, SendUnit = y.SendUnit, SendDate = string.Format("{0:yyyy-MM-dd}", y.SendDate), LimitDate = string.Format("{0:yyyy-MM-dd}", y.LimitDate), LimitDateD = y.LimitDate, LateCheckDate = string.Format("{0:yyyy-MM-dd}", y.LateCheckDate), ApprovalPerson = y.ApprovalPerson, Remark = y.Remark, CompileMan = y.CompileMan, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == y.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", y.CompileDate), AuditDate = string.Format("{0:yyyy-MM-dd}", y.AuditDate), AuditorName = Funs.DB.Sys_User.First(z => z.UserId == y.AuditorId).UserName, AuditOpinion = y.AuditOpinion, States = y.States, AttachUrl = APIUpLoadFileService.getFileUrl(y.PersonQualityId, null), }).ToList(); } else if (qualityType == "2") { getLists = (from x in Funs.DB.SitePerson_Person join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId join y in Funs.DB.QualityAudit_SafePersonQuality on x.PersonId equals y.PersonId into jonPerson from y in jonPerson.DefaultIfEmpty() where x.ProjectId == projectId && z.IsHsse == true && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now) orderby y.LimitDate select new Model.PersonQualityItem { PersonQualityId = y.SafePersonQualityId, QualityType = qualityType, PersonId = x.PersonId, PersonName = x.PersonName, CardNo = x.CardNo, IdentityCard = x.IdentityCard, ProjectId = x.ProjectId, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName, //CertificateId = y.CertificateId, CertificateName = y.CertificateName, WorkPostId = x.WorkPostId, WorkPostName = z.WorkPostName, CertificateNo = y.CertificateNo, Grade = y.Grade, SendUnit = y.SendUnit, SendDate = string.Format("{0:yyyy-MM-dd}", y.SendDate), LimitDate = string.Format("{0:yyyy-MM-dd}", y.LimitDate), LimitDateD = y.LimitDate, LateCheckDate = string.Format("{0:yyyy-MM-dd}", y.LateCheckDate), ApprovalPerson = y.ApprovalPerson, Remark = y.Remark, CompileMan = y.CompileMan, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == y.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", y.CompileDate), AuditDate = string.Format("{0:yyyy-MM-dd}", y.AuditDate), AuditorName = Funs.DB.Sys_User.First(z => z.UserId == y.AuditorId).UserName, AuditOpinion = y.AuditOpinion, States = y.States, AttachUrl = APIUpLoadFileService.getFileUrl(y.SafePersonQualityId, null), }).ToList(); } else if (qualityType == "3") { getLists = (from x in Funs.DB.SitePerson_Person join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId join y in Funs.DB.QualityAudit_EquipmentPersonQuality on x.PersonId equals y.PersonId into jonPerson from y in jonPerson.DefaultIfEmpty() where x.ProjectId == projectId && z.PostType == Const.PostType_5 && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now) orderby y.LimitDate select new Model.PersonQualityItem { PersonQualityId = y.EquipmentPersonQualityId, QualityType = qualityType, PersonId = x.PersonId, PersonName = x.PersonName, CardNo = x.CardNo, IdentityCard = x.IdentityCard, ProjectId = x.ProjectId, UnitId = x.UnitId, UnitName = Funs.DB.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName, CertificateId = y.CertificateId, CertificateName = Funs.DB.Base_Certificate.First(z => z.CertificateId == y.CertificateId).CertificateName, WorkPostId = x.WorkPostId, WorkPostName = z.WorkPostName, CertificateNo = y.CertificateNo, Grade = y.Grade, SendUnit = y.SendUnit, SendDate = string.Format("{0:yyyy-MM-dd}", y.SendDate), LimitDate = string.Format("{0:yyyy-MM-dd}", y.LimitDate), LimitDateD = y.LimitDate, LateCheckDate = string.Format("{0:yyyy-MM-dd}", y.LateCheckDate), ApprovalPerson = y.ApprovalPerson, Remark = y.Remark, CompileMan = y.CompileMan, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == y.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", y.CompileDate), AuditDate = string.Format("{0:yyyy-MM-dd}", y.AuditDate), AuditorName = Funs.DB.Sys_User.First(z => z.UserId == y.AuditorId).UserName, AuditOpinion = y.AuditOpinion, States = y.States, AttachUrl = APIUpLoadFileService.getFileUrl(y.EquipmentPersonQualityId, null), }).ToList(); } if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId)) { getLists = getLists.Where(x => x.UnitId == unitId).ToList(); } if (!string.IsNullOrEmpty(unitIdQ)) { getLists = getLists.Where(x => x.UnitId == unitIdQ).ToList(); } if (states == Const.State_0) { getLists = getLists.Where(x => x.States == null || x.States == states || x.PersonQualityId == null || x.LimitDateD < DateTime.Now.AddMonths(1)).ToList(); } else if (states == Const.State_1) { getLists = getLists.Where(x => x.States == states).ToList(); } else if (states == Const.State_2) { getLists = getLists.Where(x => x.States == states && x.LimitDateD >= DateTime.Now.AddMonths(1)).ToList(); } else if (states == Const.State_R) { getLists = getLists.Where(x => x.States == states).ToList(); } return(getLists); }
/// <summary> /// 根据identityCard获取人员资质信息 /// </summary> /// <param name="identityCard"></param> /// <returns></returns> public static Model.PersonQualityItem getPersonQualityInfo(string type, string dataId) { Model.PersonQualityItem getQualityItem = new Model.PersonQualityItem(); if (type == "1") { ////特种作业人员 getQualityItem = (from x in Funs.DB.QualityAudit_PersonQuality join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId where x.PersonQualityId == dataId || x.PersonId == dataId orderby y.CardNo select new Model.PersonQualityItem { PersonQualityId = x.PersonQualityId, QualityType = type, PersonId = x.PersonId, PersonName = y.PersonName, CardNo = y.CardNo, IdentityCard = y.IdentityCard, ProjectId = y.ProjectId, UnitId = y.UnitId, UnitName = Funs.DB.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, UnitCode = Funs.DB.Base_Unit.First(z => z.UnitId == y.UnitId).UnitCode, WorkPostId = y.WorkPostId, WorkPostName = Funs.DB.Base_WorkPost.First(z => z.WorkPostId == y.WorkPostId).WorkPostName, CertificateId = x.CertificateId, CertificateName = Funs.DB.Base_Certificate.First(z => z.CertificateId == x.CertificateId).CertificateName, CertificateNo = x.CertificateNo, Grade = x.Grade, SendUnit = x.SendUnit, SendDate = string.Format("{0:yyyy-MM-dd}", x.SendDate), LimitDate = string.Format("{0:yyyy-MM-dd}", x.LimitDate), LateCheckDate = string.Format("{0:yyyy-MM-dd}", x.LateCheckDate), Remark = x.Remark, CompileMan = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == x.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate), AuditDate = string.Format("{0:yyyy-MM-dd}", x.AuditDate), AuditorId = x.AuditorId, AuditorName = Funs.DB.Sys_User.First(z => z.UserId == x.AuditorId).UserName, AuditOpinion = x.AuditOpinion, States = x.States, AttachUrl = APIUpLoadFileService.getFileUrl(x.PersonQualityId, null), }).FirstOrDefault(); } //// 安管人员 else if (type == "2") { getQualityItem = (from x in Funs.DB.QualityAudit_SafePersonQuality join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId where x.SafePersonQualityId == dataId || x.PersonId == dataId orderby y.CardNo select new Model.PersonQualityItem { PersonQualityId = x.SafePersonQualityId, QualityType = type, PersonId = x.PersonId, PersonName = y.PersonName, CardNo = y.CardNo, IdentityCard = y.IdentityCard, ProjectId = y.ProjectId, UnitId = y.UnitId, UnitName = Funs.DB.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, UnitCode = Funs.DB.Base_Unit.First(z => z.UnitId == y.UnitId).UnitCode, WorkPostId = y.WorkPostId, WorkPostName = Funs.DB.Base_WorkPost.First(z => z.WorkPostId == y.WorkPostId).WorkPostName, //CertificateId = x.CertificateId, CertificateName = x.CertificateName, CertificateNo = x.CertificateNo, Grade = x.Grade, SendUnit = x.SendUnit, SendDate = string.Format("{0:yyyy-MM-dd}", x.SendDate), LimitDate = string.Format("{0:yyyy-MM-dd}", x.LimitDate), LateCheckDate = string.Format("{0:yyyy-MM-dd}", x.LateCheckDate), Remark = x.Remark, CompileMan = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == x.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate), AuditDate = string.Format("{0:yyyy-MM-dd}", x.AuditDate), AuditorId = x.AuditorId, AuditorName = Funs.DB.Sys_User.First(z => z.UserId == x.AuditorId).UserName, AuditOpinion = x.AuditOpinion, States = x.States, AttachUrl = APIUpLoadFileService.getFileUrl(x.SafePersonQualityId, null), }).FirstOrDefault(); } else if (type == "3") { ////特种设备作业人员 getQualityItem = (from x in Funs.DB.QualityAudit_EquipmentPersonQuality join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId where x.EquipmentPersonQualityId == dataId || x.PersonId == dataId orderby y.CardNo select new Model.PersonQualityItem { PersonQualityId = x.EquipmentPersonQualityId, QualityType = type, PersonId = x.PersonId, PersonName = y.PersonName, CardNo = y.CardNo, IdentityCard = y.IdentityCard, ProjectId = y.ProjectId, UnitId = y.UnitId, UnitName = Funs.DB.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, UnitCode = Funs.DB.Base_Unit.First(z => z.UnitId == y.UnitId).UnitCode, WorkPostId = y.WorkPostId, WorkPostName = Funs.DB.Base_WorkPost.First(z => z.WorkPostId == y.WorkPostId).WorkPostName, CertificateId = x.CertificateId, CertificateName = Funs.DB.Base_Certificate.First(z => z.CertificateId == x.CertificateId).CertificateName, CertificateNo = x.CertificateNo, Grade = x.Grade, SendUnit = x.SendUnit, SendDate = string.Format("{0:yyyy-MM-dd}", x.SendDate), LimitDate = string.Format("{0:yyyy-MM-dd}", x.LimitDate), LateCheckDate = string.Format("{0:yyyy-MM-dd}", x.LateCheckDate), Remark = x.Remark, CompileMan = x.CompileMan, CompileManName = Funs.DB.Sys_User.First(z => z.UserId == x.CompileMan).UserName, CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate), AuditDate = string.Format("{0:yyyy-MM-dd}", x.AuditDate), AuditorId = x.AuditorId, AuditorName = Funs.DB.Sys_User.First(z => z.UserId == x.AuditorId).UserName, AuditOpinion = x.AuditOpinion, States = x.States, AttachUrl = APIUpLoadFileService.getFileUrl(x.EquipmentPersonQualityId, null), }).FirstOrDefault(); } return(getQualityItem); }