BaseStudentAssessmentInspectionController.java 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package com.xjrsoft.module.student.controller;
  2. import cn.dev33.satoken.annotation.SaCheckPermission;
  3. import cn.hutool.core.bean.BeanUtil;
  4. import com.baomidou.mybatisplus.core.metadata.IPage;
  5. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  6. import com.xjrsoft.common.model.result.RT;
  7. import com.xjrsoft.common.page.ConventPage;
  8. import com.xjrsoft.common.page.PageOutput;
  9. import com.xjrsoft.module.student.dto.*;
  10. import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
  11. import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
  12. import com.xjrsoft.module.student.vo.*;
  13. import io.swagger.annotations.Api;
  14. import io.swagger.annotations.ApiOperation;
  15. import lombok.AllArgsConstructor;
  16. import org.springframework.http.ResponseEntity;
  17. import org.springframework.web.bind.annotation.*;
  18. import javax.validation.Valid;
  19. import java.util.List;
  20. /**
  21. * @title: 学生班级巡查考核
  22. * @Author dzx
  23. * @Date: 2023-11-16
  24. * @Version 1.0
  25. */
  26. @RestController
  27. @RequestMapping("/student" + "/basestudentassessmentinspection")
  28. @Api(value = "/student" + "/basestudentassessmentinspection", tags = "学生班级巡查考核代码")
  29. @AllArgsConstructor
  30. public class BaseStudentAssessmentInspectionController {
  31. private final IBaseStudentAssessmentInspectionService baseStudentAssessmentInspectionService;
  32. @GetMapping(value = "/page")
  33. @ApiOperation(value = "学生班级巡查考核列表(分页)")
  34. @SaCheckPermission("basestudentassessmentinspection:detail")
  35. public RT<PageOutput<BaseStudentAssessmentInspectionPageVo>> page(@Valid BaseStudentAssessmentInspectionPageDto dto) {
  36. Page<BaseStudentAssessmentInspectionPageVo> page = baseStudentAssessmentInspectionService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
  37. return RT.ok(ConventPage.getPageOutput(page, BaseStudentAssessmentInspectionPageVo.class));
  38. }
  39. @GetMapping(value = "/info")
  40. @ApiOperation(value = "根据id查询学生班级巡查考核信息")
  41. @SaCheckPermission("basestudentassessmentinspection:detail")
  42. public RT<BaseStudentAssessmentInspectionVo> info(@RequestParam Long id) {
  43. BaseStudentAssessmentInspectionVo result = baseStudentAssessmentInspectionService.getInfo(id);
  44. return RT.ok(result);
  45. }
  46. @GetMapping(value = "/mobile-page")
  47. @ApiOperation(value = "学生操行分记录管理列表(移动端)")
  48. @SaCheckPermission("basestudentbehaviormanage:detail")
  49. public RT<PageOutput<BaseStudentAssessmentInspectionMobilePageVo>> mobilePage(@Valid BaseStudentAssessmentInspectionMobilePageDto dto) {
  50. Page<BaseStudentAssessmentInspectionMobilePageVo> page = baseStudentAssessmentInspectionService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
  51. if (page == null) {
  52. return RT.ok(ConventPage.getPageOutputNull(BaseStudentAssessmentInspectionMobilePageVo.class));
  53. }
  54. return RT.ok(ConventPage.getPageOutput(page, BaseStudentAssessmentInspectionMobilePageVo.class));
  55. }
  56. @GetMapping(value = "/mobile-info")
  57. @ApiOperation(value = "根据id查询学生班级巡查考核信息(移动端)")
  58. @SaCheckPermission("basestudentassessmentinspection:detail")
  59. public RT<BaseStudentAssessmentInspectionMobileVo> mobileInfo(@Valid Long id) {
  60. BaseStudentAssessmentInspectionMobileVo result = baseStudentAssessmentInspectionService.getMobileInfo(id);
  61. return RT.ok(result);
  62. }
  63. @PostMapping
  64. @ApiOperation(value = "新增学生班级巡查考核")
  65. @SaCheckPermission("basestudentassessmentinspection:add")
  66. public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentInspectionDto dto) {
  67. BaseStudentAssessmentInspection baseStudentAssessmentInspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
  68. boolean isSuccess = baseStudentAssessmentInspectionService.save(baseStudentAssessmentInspection);
  69. return RT.ok(isSuccess);
  70. }
  71. @PutMapping
  72. @ApiOperation(value = "修改学生班级巡查考核")
  73. @SaCheckPermission("basestudentassessmentinspection:edit")
  74. public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentAssessmentInspectionDto dto) {
  75. BaseStudentAssessmentInspection baseStudentAssessmentInspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
  76. return RT.ok(baseStudentAssessmentInspectionService.updateById(baseStudentAssessmentInspection));
  77. }
  78. @DeleteMapping
  79. @ApiOperation(value = "删除学生班级巡查考核")
  80. @SaCheckPermission("basestudentassessmentinspection:delete")
  81. public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
  82. return RT.ok(baseStudentAssessmentInspectionService.removeBatchByIds(ids));
  83. }
  84. @GetMapping(value = "/calss-quantitative-assessment-page")
  85. @ApiOperation(value = "班级量化考核列表(分页)")
  86. @SaCheckPermission("basestudentassessmentinspection:detail")
  87. public RT<PageOutput<CalssQuantitativeAssessmentPageVo>> calssQuantitativeAssessmentPage(@Valid CalssQuantitativeAssessmentPageDto dto) {
  88. IPage<CalssQuantitativeAssessmentPageVo> page = baseStudentAssessmentInspectionService.getCalssQuantitativeAssessmentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
  89. return RT.ok(ConventPage.getPageOutput(page, CalssQuantitativeAssessmentPageVo.class));
  90. }
  91. // @PostMapping("/export-query")
  92. // @ApiOperation(value = "入参导出")
  93. // public ResponseEntity<byte[]> exportDataQuery(@Valid @RequestBody QuantitativeAssessmentExcelDto dto) {
  94. @GetMapping("/export")
  95. @ApiOperation(value = "导出")
  96. public ResponseEntity<byte[]> exportDataQuery() {
  97. return baseStudentAssessmentInspectionService.getQuantitativeAssessmentExcelByte(new QuantitativeAssessmentExcelDto());
  98. }
  99. }