|
@@ -0,0 +1,129 @@
|
|
|
+package com.xjrsoft.module.student.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.student.dto.AddSchoolRollCategoryDto;
|
|
|
+import com.xjrsoft.module.student.dto.UpdateSchoolRollCategoryDto;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.dto.SchoolRollCategoryPageDto;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentPost;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentScholarshipCategory;
|
|
|
+import com.xjrsoft.module.student.entity.SchoolRollCategory;
|
|
|
+import com.xjrsoft.module.student.service.ISchoolRollCategoryService;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentScholarshipCategoryPageVo;
|
|
|
+import com.xjrsoft.module.student.vo.SchoolRollCategoryPageVo;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.vo.SchoolRollCategoryVo;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryItem;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+* @title: 学籍异动类别
|
|
|
+* @Author szs
|
|
|
+* @Date: 2023-11-29
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/student" + "/schoolRollCategory")
|
|
|
+@Api(value = "/student" + "/schoolRollCategory",tags = "学籍异动类别代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class SchoolRollCategoryController {
|
|
|
+
|
|
|
+
|
|
|
+ private final ISchoolRollCategoryService schoolRollCategoryService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ @ApiOperation(value="学籍异动类别列表(不分页)")
|
|
|
+ @SaCheckPermission("schoolrollcategory:detail")
|
|
|
+ public RT<List<SchoolRollCategoryVo>> list(@Valid SchoolRollCategoryPageDto dto){
|
|
|
+ MPJLambdaWrapper<SchoolRollCategory> queryWrapper= new MPJLambdaWrapper<>();
|
|
|
+ List<SchoolRollCategoryVo> list = schoolRollCategoryService.selectJoinList(SchoolRollCategoryVo.class,
|
|
|
+ queryWrapper.select(SchoolRollCategory::getId)
|
|
|
+ .select(BaseStudentScholarshipCategory.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentScholarshipCategoryPageVo.class).contains(x.getProperty()))
|
|
|
+
|
|
|
+
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return RT.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="学籍异动类别列表(分页)")
|
|
|
+ @SaCheckPermission("schoolrollcategory:detail")
|
|
|
+ public RT<PageOutput<SchoolRollCategoryPageVo>> page(@Valid SchoolRollCategoryPageDto dto){
|
|
|
+
|
|
|
+ LambdaQueryWrapper<SchoolRollCategory> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .orderByDesc(SchoolRollCategory::getId)
|
|
|
+ .select(SchoolRollCategory.class,x -> VoToColumnUtil.fieldsToColumns(SchoolRollCategoryPageVo.class).contains(x.getProperty()));
|
|
|
+ IPage<SchoolRollCategory> page = schoolRollCategoryService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
+ PageOutput<SchoolRollCategoryPageVo> pageOutput = ConventPage.getPageOutput(page, SchoolRollCategoryPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询学籍异动类别信息")
|
|
|
+ @SaCheckPermission("schoolrollcategory:detail")
|
|
|
+ public RT<SchoolRollCategoryVo> info(@RequestParam Long id){
|
|
|
+ SchoolRollCategory schoolRollCategory = schoolRollCategoryService.getById(id);
|
|
|
+ if (schoolRollCategory == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(schoolRollCategory, SchoolRollCategoryVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增学籍异动类别")
|
|
|
+ @SaCheckPermission("schoolrollcategory:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddSchoolRollCategoryDto dto){
|
|
|
+ SchoolRollCategory schoolRollCategory = BeanUtil.toBean(dto, SchoolRollCategory.class);
|
|
|
+ boolean isSuccess = schoolRollCategoryService.save(schoolRollCategory);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改学籍异动类别")
|
|
|
+ @SaCheckPermission("schoolrollcategory:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateSchoolRollCategoryDto dto){
|
|
|
+
|
|
|
+ SchoolRollCategory schoolRollCategory = BeanUtil.toBean(dto, SchoolRollCategory.class);
|
|
|
+ return RT.ok(schoolRollCategoryService.updateById(schoolRollCategory));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除学籍异动类别")
|
|
|
+ @SaCheckPermission("schoolrollcategory:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(schoolRollCategoryService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|