|
@@ -1,162 +1,162 @@
|
|
|
-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.interfaces.MPJBaseJoin;
|
|
|
-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.TreeUtil;
|
|
|
-import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
-import com.xjrsoft.module.organization.vo.PostTreeVo;
|
|
|
-import com.xjrsoft.module.student.dto.AddBaseStudentAssessmentProjectDto;
|
|
|
-import com.xjrsoft.module.student.dto.BaseStudentAssessmentProjectPageDto;
|
|
|
-import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentProjectDto;
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-
|
|
|
-import com.xjrsoft.module.student.dto.BaseStudentAssessmentProjectListDto;
|
|
|
-import com.xjrsoft.module.student.entity.BaseStudentAssessmentCategory;
|
|
|
-import com.xjrsoft.module.student.entity.BaseStudentAssessmentProject;
|
|
|
-import com.xjrsoft.module.student.entity.BaseStudentCadre;
|
|
|
-import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
-import com.xjrsoft.module.student.service.IBaseStudentAssessmentCategoryService;
|
|
|
-import com.xjrsoft.module.student.service.IBaseStudentAssessmentProjectService;
|
|
|
-import com.xjrsoft.module.student.vo.*;
|
|
|
-
|
|
|
-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.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * @title: 学生考核项目
|
|
|
- * @Author fanxp
|
|
|
- * @Date: 2023-11-14
|
|
|
- * @Version 1.0
|
|
|
- */
|
|
|
-@RestController
|
|
|
-@RequestMapping("/student" + "/basestudentassessmentproject")
|
|
|
-@Api(value = "/student" + "/basestudentassessmentproject", tags = "学生考核项目代码")
|
|
|
-@AllArgsConstructor
|
|
|
-public class BaseStudentAssessmentProjectController {
|
|
|
-
|
|
|
-
|
|
|
- private final IBaseStudentAssessmentCategoryService baseStudentAssessmentCategoryService;
|
|
|
-
|
|
|
- private final IBaseStudentAssessmentProjectService baseStudentAssessmentProjectService;
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping(value = "/tree")
|
|
|
- @ApiOperation(value = "学生考核项目列表(树)")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
- public RT<List<BaseStudentAssessmentProjectTreeVo>> tree() {
|
|
|
-
|
|
|
- List<BaseStudentAssessmentProjectTreeVo> voList = new ArrayList<>();
|
|
|
- baseStudentAssessmentCategoryService.list().forEach((node) -> {
|
|
|
- voList.add(new BaseStudentAssessmentProjectTreeVo(){{
|
|
|
- setId(node.getId());
|
|
|
- setName(node.getName());
|
|
|
- }});
|
|
|
- });
|
|
|
-
|
|
|
- baseStudentAssessmentProjectService.list().forEach((node)->{
|
|
|
- voList.add(new BaseStudentAssessmentProjectTreeVo(){{
|
|
|
- setId(node.getId());
|
|
|
- setName(node.getName());
|
|
|
- setParentId(node.getBaseStudentAssessmentCategoryId());
|
|
|
- }});
|
|
|
- });
|
|
|
- List<BaseStudentAssessmentProjectTreeVo> treeVoList = TreeUtil.build(voList);
|
|
|
-
|
|
|
- return RT.ok(treeVoList);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/page")
|
|
|
- @ApiOperation(value = "学生考核项目列表(分页)")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
- public RT<PageOutput<BaseStudentAssessmentProjectPageVo>> page(@Valid BaseStudentAssessmentProjectPageDto dto) {
|
|
|
-
|
|
|
- MPJBaseJoin<BaseStudentAssessmentProject> queryWrapper = MPJWrappers.<BaseStudentAssessmentProject>lambdaJoin()
|
|
|
- .disableSubLogicDel()
|
|
|
- .orderByDesc(BaseStudentAssessmentProject::getId)
|
|
|
- .eq(ObjectUtil.isNotEmpty(dto.getBaseStudentAssessmentCategoryId()), BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId, dto.getBaseStudentAssessmentCategoryId())
|
|
|
- .select(BaseStudentAssessmentProject.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentProjectPageVo.class).contains(x.getProperty()))
|
|
|
- .leftJoin(BaseStudentAssessmentCategory.class, BaseStudentAssessmentCategory::getId, BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId)
|
|
|
- .select(BaseStudentAssessmentProject::getId)
|
|
|
- .selectAs(BaseStudentAssessmentCategory::getName,BaseStudentAssessmentProjectPageVo::getBaseStudentAssessmentCategoryName);
|
|
|
-
|
|
|
- IPage<BaseStudentAssessmentProjectPageVo> page = baseStudentAssessmentProjectService.selectJoinListPage(ConventPage.getPage(dto),BaseStudentAssessmentProjectPageVo.class,queryWrapper);
|
|
|
- PageOutput<BaseStudentAssessmentProjectPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentAssessmentProjectPageVo.class);
|
|
|
- return RT.ok(pageOutput);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping(value = "/list")
|
|
|
- @ApiOperation(value = "学生考核项目列表(不分页)")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
- public RT<List<BaseStudentAssessmentProjectListVo>> list(@Valid BaseStudentAssessmentProjectListDto dto) {
|
|
|
-
|
|
|
- LambdaQueryWrapper<BaseStudentAssessmentProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper
|
|
|
- .orderByDesc(BaseStudentAssessmentProject::getId)
|
|
|
- .eq(ObjectUtil.isNotEmpty(dto.getBaseStudentAssessmentCategoryId()), BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId, dto.getBaseStudentAssessmentCategoryId())
|
|
|
- .select(BaseStudentAssessmentProject.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentProjectListVo.class).contains(x.getProperty()));
|
|
|
-
|
|
|
- List<BaseStudentAssessmentProject> list = baseStudentAssessmentProjectService.list(queryWrapper);
|
|
|
- List<BaseStudentAssessmentProjectListVo> listVos = BeanUtil.copyToList(list, BaseStudentAssessmentProjectListVo.class);
|
|
|
- return RT.ok(listVos);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping(value = "/info")
|
|
|
- @ApiOperation(value = "根据id查询学生考核项目信息")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
- public RT<BaseStudentAssessmentProjectVo> info(@RequestParam Long id) {
|
|
|
- BaseStudentAssessmentProject baseStudentAssessmentProject = baseStudentAssessmentProjectService.getById(id);
|
|
|
- if (baseStudentAssessmentProject == null) {
|
|
|
- return RT.error("找不到此数据!");
|
|
|
- }
|
|
|
- return RT.ok(BeanUtil.toBean(baseStudentAssessmentProject, BaseStudentAssessmentProjectVo.class));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PostMapping
|
|
|
- @ApiOperation(value = "新增学生考核项目")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:add")
|
|
|
- public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentProjectDto dto) {
|
|
|
- BaseStudentAssessmentProject baseStudentAssessmentProject = BeanUtil.toBean(dto, BaseStudentAssessmentProject.class);
|
|
|
- boolean isSuccess = baseStudentAssessmentProjectService.save(baseStudentAssessmentProject);
|
|
|
- return RT.ok(isSuccess);
|
|
|
- }
|
|
|
-
|
|
|
- @PutMapping
|
|
|
- @ApiOperation(value = "修改学生考核项目")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:edit")
|
|
|
- public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentAssessmentProjectDto dto) {
|
|
|
-
|
|
|
- BaseStudentAssessmentProject baseStudentAssessmentProject = BeanUtil.toBean(dto, BaseStudentAssessmentProject.class);
|
|
|
- return RT.ok(baseStudentAssessmentProjectService.updateById(baseStudentAssessmentProject));
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @DeleteMapping
|
|
|
- @ApiOperation(value = "删除学生考核项目")
|
|
|
- @SaCheckPermission("basestudentassessmentproject:delete")
|
|
|
- public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
|
|
|
- return RT.ok(baseStudentAssessmentProjectService.removeBatchByIds(ids));
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+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.interfaces.MPJBaseJoin;
|
|
|
+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.TreeUtil;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.organization.vo.PostTreeVo;
|
|
|
+import com.xjrsoft.module.student.dto.AddBaseStudentAssessmentProjectDto;
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentAssessmentProjectPageDto;
|
|
|
+import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentProjectDto;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentAssessmentProjectListDto;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentCategory;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentProject;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentCadre;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentAssessmentCategoryService;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentAssessmentProjectService;
|
|
|
+import com.xjrsoft.module.student.vo.*;
|
|
|
+
|
|
|
+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.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @title: 学生考核项目
|
|
|
+ * @Author fanxp
|
|
|
+ * @Date: 2023-11-14
|
|
|
+ * @Version 1.0
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/student" + "/basestudentassessmentproject")
|
|
|
+@Api(value = "/student" + "/basestudentassessmentproject", tags = "学生考核项目代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class BaseStudentAssessmentProjectController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IBaseStudentAssessmentCategoryService baseStudentAssessmentCategoryService;
|
|
|
+
|
|
|
+ private final IBaseStudentAssessmentProjectService baseStudentAssessmentProjectService;
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/tree")
|
|
|
+ @ApiOperation(value = "学生考核项目列表(树)")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
+ public RT<List<BaseStudentAssessmentProjectTreeVo>> tree() {
|
|
|
+
|
|
|
+ List<BaseStudentAssessmentProjectTreeVo> voList = new ArrayList<>();
|
|
|
+ baseStudentAssessmentCategoryService.list().forEach((node) -> {
|
|
|
+ voList.add(new BaseStudentAssessmentProjectTreeVo(){{
|
|
|
+ setId(node.getId());
|
|
|
+ setName(node.getName());
|
|
|
+ }});
|
|
|
+ });
|
|
|
+
|
|
|
+ baseStudentAssessmentProjectService.list().forEach((node)->{
|
|
|
+ voList.add(new BaseStudentAssessmentProjectTreeVo(){{
|
|
|
+ setId(node.getId());
|
|
|
+ setName(node.getName());
|
|
|
+ setParentId(node.getBaseStudentAssessmentCategoryId());
|
|
|
+ }});
|
|
|
+ });
|
|
|
+ List<BaseStudentAssessmentProjectTreeVo> treeVoList = TreeUtil.build(voList);
|
|
|
+
|
|
|
+ return RT.ok(treeVoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value = "学生考核项目列表(分页)")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
+ public RT<PageOutput<BaseStudentAssessmentProjectPageVo>> page(@Valid BaseStudentAssessmentProjectPageDto dto) {
|
|
|
+
|
|
|
+ MPJBaseJoin<BaseStudentAssessmentProject> queryWrapper = MPJWrappers.<BaseStudentAssessmentProject>lambdaJoin()
|
|
|
+ .disableSubLogicDel()
|
|
|
+ .orderByDesc(BaseStudentAssessmentProject::getId)
|
|
|
+ .eq(ObjectUtil.isNotEmpty(dto.getBaseStudentAssessmentCategoryId()), BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId, dto.getBaseStudentAssessmentCategoryId())
|
|
|
+ .select(BaseStudentAssessmentProject.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentProjectPageVo.class).contains(x.getProperty()))
|
|
|
+ .leftJoin(BaseStudentAssessmentCategory.class, BaseStudentAssessmentCategory::getId, BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId)
|
|
|
+ .select(BaseStudentAssessmentProject::getId)
|
|
|
+ .selectAs(BaseStudentAssessmentCategory::getName,BaseStudentAssessmentProjectPageVo::getBaseStudentAssessmentCategoryName);
|
|
|
+
|
|
|
+ IPage<BaseStudentAssessmentProjectPageVo> page = baseStudentAssessmentProjectService.selectJoinListPage(ConventPage.getPage(dto),BaseStudentAssessmentProjectPageVo.class,queryWrapper);
|
|
|
+ PageOutput<BaseStudentAssessmentProjectPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentAssessmentProjectPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ @ApiOperation(value = "学生考核项目列表(不分页)")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
+ public RT<List<BaseStudentAssessmentProjectListVo>> list(@Valid BaseStudentAssessmentProjectListDto dto) {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<BaseStudentAssessmentProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .orderByDesc(BaseStudentAssessmentProject::getId)
|
|
|
+ .eq(ObjectUtil.isNotEmpty(dto.getBaseStudentAssessmentCategoryId()), BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId, dto.getBaseStudentAssessmentCategoryId())
|
|
|
+ .select(BaseStudentAssessmentProject.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentProjectListVo.class).contains(x.getProperty()));
|
|
|
+
|
|
|
+ List<BaseStudentAssessmentProject> list = baseStudentAssessmentProjectService.list(queryWrapper);
|
|
|
+ List<BaseStudentAssessmentProjectListVo> listVos = BeanUtil.copyToList(list, BaseStudentAssessmentProjectListVo.class);
|
|
|
+ return RT.ok(listVos);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value = "根据id查询学生考核项目信息")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
+ public RT<BaseStudentAssessmentProjectVo> info(@RequestParam Long id) {
|
|
|
+ BaseStudentAssessmentProject baseStudentAssessmentProject = baseStudentAssessmentProjectService.getById(id);
|
|
|
+ if (baseStudentAssessmentProject == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(baseStudentAssessmentProject, BaseStudentAssessmentProjectVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增学生考核项目")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentProjectDto dto) {
|
|
|
+ BaseStudentAssessmentProject baseStudentAssessmentProject = BeanUtil.toBean(dto, BaseStudentAssessmentProject.class);
|
|
|
+ boolean isSuccess = baseStudentAssessmentProjectService.save(baseStudentAssessmentProject);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改学生考核项目")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentAssessmentProjectDto dto) {
|
|
|
+
|
|
|
+ BaseStudentAssessmentProject baseStudentAssessmentProject = BeanUtil.toBean(dto, BaseStudentAssessmentProject.class);
|
|
|
+ return RT.ok(baseStudentAssessmentProjectService.updateById(baseStudentAssessmentProject));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除学生考核项目")
|
|
|
+ @SaCheckPermission("basestudentassessmentproject:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
|
|
|
+ return RT.ok(baseStudentAssessmentProjectService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|