public object GetApplyJobList(CheckingDto checkingDto)
        {
            //从通知表里找出该用户需要审核的条目
            int workerId = _ctx.Worker.SingleOrDefault(w => w.Account.Equals(checkingDto.Account) && w.CompanyId == checkingDto.CompId).Id;
            var applyIds = (from info in _ctx.Inform
                            where info.WorkId == workerId && info.Type.Equals("Job")
                            select info.ApplicationId).ToArray();
            //再找出申请列表
            var applys = (from apply in _ctx.ApplyFoJob
                          join worker in _ctx.Worker on apply.WorkerId equals worker.Id
                          join deparment in _ctx.Deparment on apply.DeparmentId equals deparment.Id
                          where applyIds.Contains(apply.Id) && worker.Name.Contains(checkingDto.Query)
                          select new
            {
                id = apply.Id,
                workerName = worker.Name,
                deparment = deparment.Name,
                type = "Job",
                type1 = apply.Type,
                typeName = apply.Type.Equals("correction")?"转正申请":"离职申请",
                content = apply.Content,
                createTime = _commonServer.ChangeTime(apply.CreateTime),
            }).ToList();
            var result = new object();

            result = new
            {
                count = applys.Count(),
                data  = applys.Skip((checkingDto.CurrentPage - 1) * checkingDto.CurrentPageSize).Take(checkingDto.CurrentPageSize),
            };
            return(result);
        }
        public object GetCheckingList(CheckingDto checkingDto)
        {
            //从通知表里找出该用户需要审核的条目
            int workerId       = _ctx.Worker.SingleOrDefault(w => w.Account.Equals(checkingDto.Account) && w.CompanyId == checkingDto.CompId).Id;
            var applicationIds = (from info in _ctx.Inform
                                  where info.WorkId == workerId && info.Type.Equals("Leave")
                                  select info.ApplicationId).ToArray();
            //再找出请假申请列表
            var applications = (from apply in _ctx.Apply
                                join worker in _ctx.Worker on apply.WorkerId equals worker.Id
                                join deparment in _ctx.Deparment on apply.DeparmentId equals deparment.Id
                                where applicationIds.Contains(apply.Id) && worker.Name.Contains(checkingDto.Query)
                                select new
            {
                id = apply.Id,
                workerName = worker.Name,
                deparment = deparment.Name,
                type = "Leave",
                typeName = _approvalService.GetApplicationType(apply.Type1, apply.Type2),
                state = apply.State,
                stateName = _approvalService.GetStateName(apply.State),
                startTime = apply.StartTime,
                endTime = apply.EndTime,
                content = apply.Account,
                createTime = _commonServer.ChangeTime(apply.CreateTime),
            }).ToList();
            var result = new object();

            result = new
            {
                count = applications.Count(),
                data  = applications.Skip((checkingDto.CurrentPage - 1) * checkingDto.CurrentPageSize).Take(checkingDto.CurrentPageSize),
            };
            return(result);
        }
示例#3
0
        public async Task <object> GetApplyJobList([FromBody] CheckingDto checkingDto)
        {
            var context = HttpContext;

            checkingDto.Account = await _jwtUtil.GetMessageByToken(context);

            checkingDto.CompId = _commonAppService.GetUserCompId(checkingDto.Account);
            return(_approvalAppService.GetApplyJobList(checkingDto));
        }
 public object GetApplyJobList(CheckingDto checkingDto)
 {
     return(_approvalManager.GetApplyJobList(checkingDto));
 }