示例#1
0
        /// <summary>
        /// 根据projectId、states获取风险信息(状态 0待提交;1待签发;2待整改;3待审核;4待复查;5已完成)
        /// </summary>
        /// <param name="projectId"></param>
        /// <param name="states"></param>
        /// <returns></returns>
        public static List <Model.RectifyNoticesItem> getRectifyNoticesByProjectIdStates(string projectId, string states)
        {
            var getDataLists = (from x in Funs.DB.Check_RectifyNotices
                                where x.ProjectId == projectId && x.States == states
                                orderby x.RectifyNoticesCode descending
                                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,
                CheckedDate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", 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:ss}", x.SignDate),

                DutyPersonId = x.DutyPersonId,
                DutyPersonName = Funs.DB.Sys_User.First(u => u.UserId == x.DutyPersonId).UserName,
                DutyPersonTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", x.DutyPersonTime),

                CompleteDate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", 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:ss}", 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,
                IsRectify = x.IsRectify,
                States = x.States,
                AttachUrl = Funs.DB.AttachFile.First(z => z.ToKeyId == (x.RectifyNoticesId)).AttachUrl.Replace('\\', '/'),
            }).ToList();

            return(getDataLists);
        }
示例#2
0
        /// <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());
        }