| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.common.enums.business.ProjectStatusEnum; |
| | | import com.ycl.common.enums.business.ProjectTypeEnum; |
| | | import com.ycl.domain.entity.Plan; |
| | | import com.ycl.domain.vo.ProjectPlanResponseVO; |
| | | import com.ycl.framework.utils.PageUtil; |
| | |
| | | public Result page(PlanQuery query) { |
| | | IPage<ProjectPlanResponseVO> page = PageUtil.getPage(query, ProjectPlanResponseVO.class); |
| | | baseMapper.getPage(page, query); |
| | | // 对分页后的属性进行处理 |
| | | List<ProjectPlanResponseVO> records = page.getRecords(); |
| | | for (ProjectPlanResponseVO record : records) { |
| | | record.setProjectType(ProjectTypeEnum.getDescByType(record.getProjectType())); |
| | | record.setProjectStatus(ProjectStatusEnum.getDescByType(record.getProjectStatus())); |
| | | record.setProjectColorCode("green"); |
| | | } |
| | | |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |