Пример #1
0
        public async Task <OATaskDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id     = Guid.Parse(input.InstanceId);
            var oATask = await _oATaskRepository.GetAsync(id);

            var oAusers = await _oATaskUserRepository.GetAll().Where(r => r.OATaskId == oATask.Id).ToListAsync();

            var output  = oATask.MapTo <OATaskDto>();
            var valUser = await UserManager.GetUserByIdAsync(output.ValUser);

            output.ValUser_Name = valUser.Name;
            oAusers.ForEach(r =>
            {
                var entity      = new CreateOrUpdateOATaskUserInput();
                entity.OATaskId = r.OATaskId;
                entity.UserId   = r.UserId;
                output.Users.Add(entity);
            });
            output.ExecutorUser_Name = _workFlowOrganizationUnitsManager.GetNames(output.ExecutorUser);

            output.FileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId = input.InstanceId, BusinessType = (int)AbpFileBusinessType.OA任务附件
            });

            return(output);
        }
Пример #2
0
        //[Microsoft.AspNetCore.Mvc.ServiceFilter(typeof(WorkFlowCommitFilterAttribute))]
        public async Task <SupplyDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id     = Guid.Parse(input.InstanceId);
            var entity = new SupplyDto();
            var model  = await _supplyRepository.GetAsync(id);

            model.MapTo(entity);

            entity.UserId_Name = _workFlowOrganizationUnitsManager.GetNames(model.UserId);
            //entity.StatusTitle = ((SupplyStatus)entity.Status).ToString();
            entity.FileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId = input.InstanceId, BusinessType = (int)AbpFileBusinessType.用品附件
            });

            return(entity);
        }
Пример #3
0
        public async Task <TrainOutputDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id    = Guid.Parse(input.InstanceId);
            var model = await _repository.FirstOrDefaultAsync(x => x.Id == id);

            if (model == null)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "该数据不存在!");
            }
            var tmp    = model.MapTo <TrainOutputDto>();
            var dModel = _dictionaryRepository.GetAll().FirstOrDefault(x => !x.IsDeleted && x.Id == model.Type);

            if (dModel == null)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "该数据不存在!");
            }
            tmp.TypeName = dModel.Title;
            var user = _userRepository.GetAll().FirstOrDefault(x => x.Id == model.InitiatorId);

            if (user == null)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "该数据不存在!");
            }
            tmp.InitiatorName = user.Name;
            var arr = tmp.LecturerUser.Split(',').ToArray();

            tmp.LecturerUserName = string.Join <string>(',', _lecturerRepository.GetAll().Where(x => arr.Contains(x.Id.ToString())).Select(x => x.Name));

            tmp.JoinUserName = _workFlowOrganizationUnitsManager.GetNames(tmp.JoinUser);
            tmp.FileList     = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId   = model.Id.ToString(),
                BusinessType = (int)AbpFileBusinessType.培训
            });

            return(tmp);
        }
Пример #4
0
        public async Task <UserSupplyDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id         = Guid.Parse(input.InstanceId);
            var userSupply = from a in _userSupplyRepository.GetAll()
                             join b in UserManager.Users on a.UserId equals b.Id
                             where a.Id == id
                             select new { a, UserName = b.Name };
            var data = await userSupply.FirstOrDefaultAsync();

            if (data == null)
            {
                throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "个人用品未找到");
            }
            var output = new UserSupplyDto();
            var supply = await _supplyBaseRepository.GetAsync(data.a.SupplyId);

            output.Supply             = supply.MapTo <SupplyDto>();
            output.Supply.UserId_Name = _workFlowOrganizationUnitsManager.GetNames(output.Supply.UserId);
            output.StartTime          = data.a.StartTime;
            output.EndTime            = data.a.EndTime;
            output.UserId             = data.a.UserId;
            output.UserId_Name        = data.UserName;
            return(output);
        }
Пример #5
0
        /// <summary>
        ///获取当前人员面试记录
        /// </summary>
        /// <param name="resumeId"></param>
        /// <returns></returns>
        public async Task <List <EmployeePlanDto> > GetLog(Guid resumeId)
        {
            var resume = _repository.Get(resumeId);
            var plan   = _employeePlanRepository.GetAll().OrderByDescending(ite => ite.ApplyCount).FirstOrDefault(ite => ite.Phone == resume.Phone);

            if (plan != null)
            {
                var log = _employeeResultRepository.GetAll().OrderByDescending(ite => ite.CreationTime).Where(ite => ite.EmployeePlanId == plan.Id).ToList().MapTo <List <EmployeePlanDto> >();
                foreach (var ret in log)
                {
                    if (string.IsNullOrWhiteSpace(ret.AdminUserId) == false)
                    {
                        ret.AdminUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.AdminUserId);
                    }
                    if (string.IsNullOrWhiteSpace(ret.EmployeeUserIds) == false)
                    {
                        ret.EmployeeUserIds_Name = _workFlowOrganizationUnitsManager.GetNames(ret.EmployeeUserIds);
                    }
                    if (string.IsNullOrWhiteSpace(ret.MergeUserId) == false)
                    {
                        ret.MergeUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.MergeUserId);
                    }
                    if (string.IsNullOrWhiteSpace(ret.RecordUserId) == false)
                    {
                        ret.RecordUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.RecordUserId);
                    }
                    if (string.IsNullOrWhiteSpace(ret.VerifyUserId) == false)
                    {
                        ret.VerifyUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.VerifyUserId);
                    }
                }
                log[0].AdminVerifyDiscuss = plan.AdminVerifyDiscuss;
                return(log);
            }
            return(null);
        }
Пример #6
0
        public async Task <OAMeetingDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id        = Guid.Parse(input.InstanceId);
            var oAMeeting = await _oAMeetingRepository.GetAsync(id);

            var output  = oAMeeting.MapTo <OAMeetingDto>();
            var oAusers =
                await _oAMeetingUserRepository.GetAll().Where(r => r.OAMeetingId == oAMeeting.Id).ToListAsync();

            output.FileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId = input.InstanceId, BusinessType = (int)AbpFileBusinessType.OA会议附件
            });

            var hostUser = await UserManager.GetUserByIdAsync(output.HostUser);

            var noteUser = await UserManager.GetUserByIdAsync(output.NoteUser);

            output.HostUser_Name = hostUser?.Name ?? "";
            output.NoteUser_Name = noteUser?.Name ?? "";
            if (output.DepartmentId.HasValue)
            {
                var depEntity = await _organizeRepository.FirstOrDefaultAsync(output.DepartmentId.Value);

                if (depEntity == null)
                {
                    output.DepartmentId_Name = "";
                }
                else
                {
                    output.DepartmentId_Name = depEntity.DisplayName;
                }
            }

            oAusers.ForEach(r =>
            {
                var entity         = new CreateOrUpdateOAMeetingUserInput();
                entity.OAMeetingId = r.OAMeetingId;
                entity.UserId      = r.UserId;
                output.Users.Add(entity);
            });
            if (string.IsNullOrWhiteSpace(output.ParticipateUser) == false)
            {
                output.ParticipateUser_Name = _workFlowOrganizationUnitsManager.GetNames(output.ParticipateUser);
            }

            return(output);
        }
Пример #7
0
        public async Task <OABidProjectCheckDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id = Guid.Parse(input.InstanceId);
            var oABidProjectCheck = await _oABidProjectCheckRepository.GetAsync(id);

            var output = oABidProjectCheck.MapTo <OABidProjectCheckDto>();

            if (output.ProjectId.HasValue)
            {
                output.ProjectId_Name = (await _oABidProjectRepository.GetAsync(output.ProjectId.Value)).ProjectName;
            }
            output.FileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId = input.InstanceId, BusinessType = (int)AbpFileBusinessType.OA投标项目勘察申请附件
            });

            var userGuidId = output.ApplyUser.ToLong();
            var userModel  = await UserManager.GetUserByIdAsync(userGuidId);

            output.ApplyUser_Name   = userModel.Name;
            output.Participant_Name = _workFlowOrganizationUnitsManager.GetNames(output.Participant);
            return(output);
        }
Пример #8
0
        /// <summary>
        /// 根据条件分页获取列表
        /// </summary>
        /// <param name="page">查询实体</param>
        /// <returns></returns>

        public async Task <PagedResultDto <EmployeeProposalListOutputDto> > GetList(GetEmployeeProposalListInput input)
        {
            var user = await base.GetCurrentUserAsync();

            var userId    = user.Id.ToString();
            var queryBase = from a in _repository.GetAll().Where(x => !x.IsDeleted) select a;

            if (input.Type != null)
            {
                queryBase = queryBase.Where(x => x.Type == input.Type);
            }
            var query = from a in queryBase.Where(x => x.CreatorUserId == user.Id
                                                  )
                        let openModel = (from c in _workFlowTaskRepository.GetAll().Where(x =>
                                                                                          x.FlowID == input.FlowId && x.InstanceID == a.Id.ToString() &&
                                                                                          x.ReceiveID == AbpSession.UserId.Value)
                                         select c)
                                        select new EmployeeProposalListOutputDto()
            {
                Id              = a.Id,
                Title           = a.Title,
                CreationTime    = a.CreationTime,
                ParticipateUser = a.ParticipateUser,
                Status          = a.Status ?? 0,
                OpenModel       = openModel.Count(y => y.Type != 6 && (y.Status == 1 || y.Status == 0)) > 0
                                            ? 1
                                            : 2
            };

            if (input.showMyCase == 1)
            {
                query = from a in queryBase.Where(x => (x.DealWithUsers.GetStrContainsArray(userId) ||
                                                        x.CopyForUsers.GetStrContainsArray(userId))
                                                  )
                        let openModel = (from c in _workFlowTaskRepository.GetAll().Where(x =>
                                                                                          x.FlowID == input.FlowId && x.InstanceID == a.Id.ToString() &&
                                                                                          x.ReceiveID == AbpSession.UserId.Value)
                                         select c)
                                        select new EmployeeProposalListOutputDto()
                {
                    Id = a.Id,
                    // DepartmentInfos = post,
                    Title        = a.Title,
                    CreationTime = a.CreationTime,
                    Status       = a.Status ?? 0,
                    OpenModel    = a.Status > -1 && openModel.Count(y => y.Type != 6 && (y.Status == 1 || y.Status == 0)) > 0
                                            ? 1
                                            : 2
                };
            }
            var toalCount = await query.CountAsync();

            var ret = await query.OrderBy(r => r.OpenModel).ThenByDescending(r => r.CreationTime).PageBy(input).ToListAsync();

            var result = ret.MapTo <List <EmployeeProposalListOutputDto> >();

            foreach (var item in result)
            {
                item.InstanceId = item.Id.ToString();
                _workFlowBusinessTaskManager.SupplementWorkFlowBusinessList(input.FlowId, item);

                if (input.showMyCase == 0)
                {
                    if (!string.IsNullOrEmpty(item.ParticipateUser))
                    {
                        //默认取第一个收件人
                        var Postuser = Convert.ToInt32(MemberPerfix.RemovePrefix(item.ParticipateUser)?.Split(',')[0]);
                        item.UserName = _workFlowOrganizationUnitsManager.GetNames(item.ParticipateUser);
                        var userOrgModel = await _unitsAppService.GetUserPostInfo(
                            new NullableIdDto <long>() { Id = Postuser, }, new NullableIdDto <long>() { Id = null });

                        if (userOrgModel != null)
                        {
                            item.DepartmentName = userOrgModel.OrgId_Name;
                            item.PostName       = userOrgModel.UserPosts.FirstOrDefault()?.PostName;
                        }
                    }
                }
                else
                {
                    var a          = _repository.FirstOrDefault(x => x.Id == item.Id);
                    var departinfo = (
                        from b in UserManager.Users.Where(x => x.Id == a.CreatorUserId)
                        join c1 in _userOrganizeRepository.GetAll().DefaultIfEmpty() on b.Id
                        equals c1.UserId into tmp1
                        from c in tmp1.DefaultIfEmpty()
                        join e1 in _organizeRepository.GetAll().DefaultIfEmpty() on c.OrganizationUnitId equals e1.Id into tmp3
                        from e in tmp3.DefaultIfEmpty()
                        join d1 in _userPostRepository.GetAll().DefaultIfEmpty() on b.Id equals d1.UserId into tmp2
                        from d in tmp2.DefaultIfEmpty()
                        join f1 in _postRepository.GetAll().DefaultIfEmpty() on d.PostId equals f1.Id into tmp4
                        from f in tmp4.DefaultIfEmpty()
                        select new DepartmentInfo
                    {
                        WorkNumber = b.WorkNumber,
                        Name = b.Name,
                        PhoneNumber = b.PhoneNumber,
                        DepartmentName = e == null ? "" : e.DisplayName,
                        PostName = f == null ? "" : f.Name
                    }
                        ).ToList();
                    item.DepartmentName = departinfo.FirstOrDefault()?.DepartmentName;
                    item.PostName       = departinfo.FirstOrDefault()?.PostName;
                    item.WorkNumber     = departinfo.FirstOrDefault()?.WorkNumber;
                    item.UserName       = departinfo.FirstOrDefault()?.Name;
                    item.PhoneNumber    = departinfo.FirstOrDefault()?.PhoneNumber;
                }
            }

            return(new PagedResultDto <EmployeeProposalListOutputDto>(toalCount, result));
        }
Пример #9
0
        public async Task <PagedResultDto <MeetingIssueListOutputDto> > GetList(GetMeetingIssueListInput input)
        {
            var userRoles = await UserManager.GetRolesAsync(await UserManager.GetUserByIdAsync(AbpSession.UserId.Value));

            var allData      = false;
            var orgData      = false;
            var projectData  = false;
            var currentUsers = $"u_{AbpSession.UserId.Value}";

            if (userRoles.Any(r => r == "ZJL" || r == "FGLD" || r == "XZRY"))
            {
                allData = true;
            }
            else
            {
                if (userRoles.Any(r => string.Compare(r, "DLEADER", true) == 0))
                {
                    orgData = true;
                }
                if (userRoles.Any(r => r == "XMFZR"))
                {
                    projectData = true;
                }
            }


            var statusArry = new List <string>();

            if (!input.Status.IsNullOrEmpty())
            {
                statusArry = input.Status.Split(",").ToList();
            }
            using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete))
            {
                var query = from a in _repository.GetAll().Where(x => !x.IsDeleted)
                            join b in _workflowOrganizationUnitsRepository.GetAll().Where(x => !x.IsDeleted) on a.OrgId equals b.Id into g
                            from b in g.DefaultIfEmpty()
                            join c in _singleProjectRepository.GetAll() on a.SingleProjectId.Value equals c.Id into f
                            from c in f.DefaultIfEmpty()
                            where !a.IsDeleted && a.Status > 0 &&
                            (allData ||
                             (!allData && ((orgData && a.IssueType == IssueType.部门议题 && b.Leader.GetStrContainsArray(currentUsers)) ||
                                           (projectData && a.ProjectLeaderId.HasValue && a.ProjectLeaderId.Value == AbpSession.UserId.Value))))
                            select new MeetingIssueListOutputDto()
                {
                    Id                 = a.Id,
                    Name               = a.Name,
                    OrgId              = a.OrgId,
                    OrgName            = b == null ? "" : b.DisplayName,
                    UserId             = a.UserId,
                    Content            = a.Content,
                    CreationTime       = a.CreationTime,
                    Status             = a.Status,
                    IssueType          = a.IssueType,
                    SingleProjectId    = a.SingleProjectId,
                    SingleProjecetName = c == null ? "" : c.SingleProjectName,
                };
                query = query.WhereIf(!input.Status.IsNullOrEmpty(), r => statusArry.Contains(((int)r.Status).ToString()));
                if (!string.IsNullOrEmpty(input.SearchKey))
                {
                    query = query.Where(x => x.Name.Contains(input.SearchKey));
                }
                var toalCount = await query.CountAsync();

                var ret = await query.OrderByDescending(r => r.CreationTime).PageBy(input).ToListAsync();

                foreach (var item in ret)
                {
                    if (!item.UserId.IsNullOrEmpty())
                    {
                        item.UserName = _workFlowOrganizationUnitsManager.GetNames(item.UserId);
                    }
                    item.StatusTitle = item.Status.ToString();
                }
                return(new PagedResultDto <MeetingIssueListOutputDto>(toalCount, ret));
            }
        }
Пример #10
0
        /// <summary>
        /// 获取详情
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <EmployeePlanDto> Get(GetWorkFlowTaskCommentInput input)
        {
            var id = Guid.Parse(input.InstanceId);
            //var model =await _repository.GetAsync(id);
            var ret = (from a in _repository.GetAll()
                       //join b in _orgpostrepository.GetAll() on a.ApplyPostId equals b.Id
                       join c in _postrepository.GetAll() on a.ApplyPostId equals c.Id
                       where a.Id == id
                       select new EmployeePlanDto()
            {
                AdminUserId = a.AdminUserId,
                AdminVerifyDiscuss = a.AdminVerifyDiscuss,
                ApplyCount = a.ApplyCount,
                ApplyPostId = a.ApplyPostId,
                ApplyJob = c.Name,
                ApplyNo = a.ApplyNo,
                ApplyTime = a.ApplyTime,
                ApplyUser = a.ApplyUser,
                Comment = a.Comment,
                CreationTime = a.CreationTime,
                Discuss = a.Discuss,
                EmployeePlanId = a.Id,
                EmployeeUserIds = a.EmployeeUserIds,
                Id = a.Id,
                IsJoin = a.IsJoin,
                JoinDes = a.JoinDes,
                MergeUserId = a.MergeUserId,
                NeedAdmin = a.NeedAdmin,
                Phone = a.Phone,
                RecordUserId = a.RecordUserId,
                Result = a.Result,
                VerifyDiscuss = a.VerifyDiscuss,
                VerifyUserId = a.VerifyUserId,
            }).FirstOrDefault();
            var logs = _resultrepository.GetAll().Where(ite => ite.EmployeePlanId == id).OrderByDescending(ite => ite.ApplyCount).ToList();

            if (logs != null && logs.Count > 0)
            {
                ret.Log = logs.MapTo <List <EmployeePlanDto> >();
                foreach (var l in ret.Log)
                {
                    if (string.IsNullOrWhiteSpace(l.AdminUserId) == false)
                    {
                        l.AdminUserId_Name = _workFlowOrganizationUnitsManager.GetNames(l.AdminUserId);
                    }
                    if (string.IsNullOrWhiteSpace(l.EmployeeUserIds) == false)
                    {
                        l.EmployeeUserIds_Name = _workFlowOrganizationUnitsManager.GetNames(l.EmployeeUserIds);
                    }
                    if (string.IsNullOrWhiteSpace(l.MergeUserId) == false)
                    {
                        l.MergeUserId_Name = _workFlowOrganizationUnitsManager.GetNames(l.MergeUserId);
                    }
                    if (string.IsNullOrWhiteSpace(l.RecordUserId) == false)
                    {
                        l.RecordUserId_Name = _workFlowOrganizationUnitsManager.GetNames(l.RecordUserId);
                    }
                    if (string.IsNullOrWhiteSpace(l.VerifyUserId) == false)
                    {
                        l.VerifyUserId_Name = _workFlowOrganizationUnitsManager.GetNames(l.VerifyUserId);
                    }
                    l.FileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
                    {
                        BusinessId = l.EmployeePlanId.ToString(), BusinessType = (int)AbpFileBusinessType.人力资源面试者简历
                    });

                    l.ResultFileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
                    {
                        BusinessId = l.EmployeePlanId.ToString(), BusinessType = (int)AbpFileBusinessType.人力资源面试者结果
                    });
                }
                logs[0].AdminVerifyDiscuss = ret.AdminVerifyDiscuss;
            }

            if (string.IsNullOrWhiteSpace(ret.AdminUserId) == false)
            {
                ret.AdminUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.AdminUserId);
            }
            if (string.IsNullOrWhiteSpace(ret.EmployeeUserIds) == false)
            {
                ret.EmployeeUserIds_Name = _workFlowOrganizationUnitsManager.GetNames(ret.EmployeeUserIds);
            }
            if (string.IsNullOrWhiteSpace(ret.MergeUserId) == false)
            {
                ret.MergeUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.MergeUserId);
            }
            if (string.IsNullOrWhiteSpace(ret.RecordUserId) == false)
            {
                ret.RecordUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.RecordUserId);
            }
            if (string.IsNullOrWhiteSpace(ret.VerifyUserId) == false)
            {
                ret.VerifyUserId_Name = _workFlowOrganizationUnitsManager.GetNames(ret.VerifyUserId);
            }
            ret.FileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId = ret.Id.ToString(), BusinessType = (int)AbpFileBusinessType.人力资源面试者简历
            });

            ret.ResultFileList = await _abpFileRelationAppService.GetListAsync(new GetAbpFilesInput()
            {
                BusinessId = ret.Id.ToString(), BusinessType = (int)AbpFileBusinessType.人力资源面试者结果
            });

            return(ret);
        }