|
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
@@ -13,15 +14,19 @@ import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.module.student.dto.AddSchoolRollReasonDto;
|
|
import com.xjrsoft.module.student.dto.AddSchoolRollReasonDto;
|
|
|
|
+import com.xjrsoft.module.student.dto.SchoolRollReasonListDto;
|
|
import com.xjrsoft.module.student.dto.UpdateSchoolRollReasonDto;
|
|
import com.xjrsoft.module.student.dto.UpdateSchoolRollReasonDto;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
|
import com.xjrsoft.module.student.dto.SchoolRollReasonPageDto;
|
|
import com.xjrsoft.module.student.dto.SchoolRollReasonPageDto;
|
|
|
|
+import com.xjrsoft.module.student.entity.SchoolRollCategory;
|
|
import com.xjrsoft.module.student.entity.SchoolRollReason;
|
|
import com.xjrsoft.module.student.entity.SchoolRollReason;
|
|
import com.xjrsoft.module.student.service.ISchoolRollReasonService;
|
|
import com.xjrsoft.module.student.service.ISchoolRollReasonService;
|
|
|
|
+import com.xjrsoft.module.student.vo.SchoolRollCategoryPageVo;
|
|
import com.xjrsoft.module.student.vo.SchoolRollReasonPageVo;
|
|
import com.xjrsoft.module.student.vo.SchoolRollReasonPageVo;
|
|
|
|
|
|
import com.xjrsoft.module.student.vo.SchoolRollReasonVo;
|
|
import com.xjrsoft.module.student.vo.SchoolRollReasonVo;
|
|
|
|
+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;
|
|
@@ -42,20 +47,39 @@ import java.util.List;
|
|
@Api(value = "/student" + "/schoolRollReason",tags = "学籍异动原因代码")
|
|
@Api(value = "/student" + "/schoolRollReason",tags = "学籍异动原因代码")
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class SchoolRollReasonController {
|
|
public class SchoolRollReasonController {
|
|
-
|
|
|
|
-
|
|
|
|
private final ISchoolRollReasonService schoolRollReasonService;
|
|
private final ISchoolRollReasonService schoolRollReasonService;
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/list")
|
|
|
|
+ @ApiOperation(value="学籍异动原因列表(不分页)")
|
|
|
|
+ @SaCheckPermission("schoolrollreason:detail")
|
|
|
|
+ public RT<List<SchoolRollReasonVo>> list(@Valid SchoolRollReasonListDto dto){
|
|
|
|
+
|
|
|
|
+ MPJLambdaWrapper<SchoolRollReason> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
|
+ queryWrapper.selectAs(SchoolRollReason::getId, SchoolRollReasonVo::getId)
|
|
|
|
+ .selectAs(SchoolRollCategory::getName, SchoolRollReasonVo::getSchoolRollCategoryIdCN)
|
|
|
|
+ .select(SchoolRollReason.class, x -> VoToColumnUtil.fieldsToColumns(SchoolRollReasonVo.class).contains(x.getProperty()))
|
|
|
|
+ .leftJoin(SchoolRollCategory.class, SchoolRollCategory::getId, SchoolRollReason::getSchoolRollCategoryId)
|
|
|
|
+ .eq(ObjectUtil.isNotNull(dto) && ObjectUtil.isNotNull(dto.getSchoolRollCategoryId()) && dto.getSchoolRollCategoryId() != "",SchoolRollReason::getSchoolRollCategoryId,dto.getSchoolRollCategoryId())
|
|
|
|
+ .orderByDesc(SchoolRollReason::getId);
|
|
|
|
+
|
|
|
|
+ List<SchoolRollReasonVo> list = schoolRollReasonService.selectJoinList(SchoolRollReasonVo.class, queryWrapper);
|
|
|
|
+ return RT.ok(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
@GetMapping(value = "/page")
|
|
@GetMapping(value = "/page")
|
|
@ApiOperation(value="学籍异动原因列表(分页)")
|
|
@ApiOperation(value="学籍异动原因列表(分页)")
|
|
@SaCheckPermission("schoolrollreason:detail")
|
|
@SaCheckPermission("schoolrollreason:detail")
|
|
public RT<PageOutput<SchoolRollReasonPageVo>> page(@Valid SchoolRollReasonPageDto dto){
|
|
public RT<PageOutput<SchoolRollReasonPageVo>> page(@Valid SchoolRollReasonPageDto dto){
|
|
|
|
|
|
- LambdaQueryWrapper<SchoolRollReason> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- queryWrapper
|
|
|
|
- .orderByDesc(SchoolRollReason::getId)
|
|
|
|
- .select(SchoolRollReason.class,x -> VoToColumnUtil.fieldsToColumns(SchoolRollReasonPageVo.class).contains(x.getProperty()));
|
|
|
|
- IPage<SchoolRollReason> page = schoolRollReasonService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
|
|
|
+ MPJLambdaWrapper<SchoolRollReason> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
|
+ queryWrapper.selectAs(SchoolRollReason::getId, SchoolRollReasonPageVo::getId)
|
|
|
|
+ .selectAs(SchoolRollCategory::getName, SchoolRollReasonPageVo::getSchoolRollCategoryIdCN)
|
|
|
|
+ .select(SchoolRollReason.class, x -> VoToColumnUtil.fieldsToColumns(SchoolRollReasonPageVo.class).contains(x.getProperty()))
|
|
|
|
+ .leftJoin(SchoolRollCategory.class, SchoolRollCategory::getId, SchoolRollReason::getSchoolRollCategoryId)
|
|
|
|
+ .eq(ObjectUtil.isNotNull(dto) && ObjectUtil.isNotNull(dto.getSchoolRollCategoryId()) && dto.getSchoolRollCategoryId() != "",SchoolRollReason::getSchoolRollCategoryId,dto.getSchoolRollCategoryId())
|
|
|
|
+ .orderByDesc(SchoolRollReason::getId);
|
|
|
|
+
|
|
|
|
+ IPage<SchoolRollReasonPageVo> page = schoolRollReasonService.selectJoinListPage(ConventPage.getPage(dto),SchoolRollReasonPageVo.class, queryWrapper);
|
|
PageOutput<SchoolRollReasonPageVo> pageOutput = ConventPage.getPageOutput(page, SchoolRollReasonPageVo.class);
|
|
PageOutput<SchoolRollReasonPageVo> pageOutput = ConventPage.getPageOutput(page, SchoolRollReasonPageVo.class);
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
}
|
|
}
|