Ejemplo n.º 1
0
        public async Task <PagedResultDto <PmProjectOutput> > GetWorkPmProject(GetPmProjectInput input)
        {
            var userId = base.AbpSession.UserId;
            var query  = (from p in _projectBaseRepository.GetAll()
                          let count = _projectRegistrationRepository.GetAll().Count(x => x.ProjectId == p.Id && x.PersonOnCharge == userId && !x.IsSummary)
                                      where count > 0
                                      select new PmProjectOutput
            {
                Id = p.Id,
                Name = p.ProjectName,
                Count = count
            });

            var total = await query.CountAsync();

            var list = await query.Skip(input.SkipCount).Take(input.MaxResultCount).ToListAsync();

            return(new PagedResultDto <PmProjectOutput>(total, list));
        }
Ejemplo n.º 2
0
        public async Task <PagedResultDto <PmOldProjectOutput> > GetWorkOldPmProject(GetPmProjectInput input)
        {
            var userId = base.AbpSession.UserId;
            var query  = (from p in _projectRegistrationRepository.GetAll()
                          join pBase in _projectBaseRepository.GetAll() on p.ProjectId equals pBase.Id
                          where p.PersonOnChargeType == PersonOnChargeTypeEnum.负责人 && p.SendUserId == userId
                          select new PmOldProjectOutput
            {
                Id = p.Id,
                ProjectName = pBase.ProjectName,
                Title = p.Title,
                Code = p.Code,
                CreateTime = p.CreationTime
            });

            var total = await query.CountAsync();

            var list = await query.OrderByDescending(x => x.CreateTime).Skip(input.SkipCount).Take(input.MaxResultCount).ToListAsync();

            return(new PagedResultDto <PmOldProjectOutput>(total, list));
        }