|
@@ -2,14 +2,12 @@ package com.xjrsoft.module.banding.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
-import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskDto;
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskDto;
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskRuleDto;
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskRuleDto;
|
|
import com.xjrsoft.module.banding.dto.AutomaticBandingTaskDto;
|
|
import com.xjrsoft.module.banding.dto.AutomaticBandingTaskDto;
|
|
@@ -25,8 +23,6 @@ import com.xjrsoft.module.banding.service.IBandingTaskService;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskPageVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskPageVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskRuleVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskRuleVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskVo;
|
|
-import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
|
-import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
@@ -68,16 +64,7 @@ public class BandingTaskController {
|
|
@SaCheckPermission("bandingtask:detail")
|
|
@SaCheckPermission("bandingtask:detail")
|
|
public RT<PageOutput<BandingTaskPageVo>> page(@Valid BandingTaskPageDto dto){
|
|
public RT<PageOutput<BandingTaskPageVo>> page(@Valid BandingTaskPageDto dto){
|
|
|
|
|
|
- IPage<BandingTaskPageVo> page = bandingTaskService.selectJoinListPage(ConventPage.getPage(dto), BandingTaskPageVo.class,
|
|
|
|
- new MPJLambdaWrapper<BandingTask>()
|
|
|
|
- .select(BandingTask::getId)
|
|
|
|
- .select(BandingTask.class, x -> VoToColumnUtil.fieldsToColumns(BandingTaskPageVo.class).contains(x.getProperty()))
|
|
|
|
- .selectAs(DictionaryDetail::getName, BandingTaskPageVo::getEnrollTypeCn)
|
|
|
|
- .selectAs(BaseGrade::getName, BandingTaskPageVo::getGradeName)
|
|
|
|
- .eq(StrUtil.isNotEmpty(dto.getEnrollType()), BandingTask::getEnrollType, dto.getEnrollType())
|
|
|
|
- .leftJoin(BaseGrade.class, BaseGrade::getId, BandingTask::getGradeId)
|
|
|
|
- .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BandingTask::getEnrollType)
|
|
|
|
- );
|
|
|
|
|
|
+ IPage<BandingTaskPageVo> page = bandingTaskService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
PageOutput<BandingTaskPageVo> pageOutput = ConventPage.getPageOutput(page, BandingTaskPageVo.class);
|
|
PageOutput<BandingTaskPageVo> pageOutput = ConventPage.getPageOutput(page, BandingTaskPageVo.class);
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
}
|
|
}
|