|
|
@@ -1,4 +1,4 @@
|
|
|
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03;
|
|
|
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp;
|
|
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
@@ -6,13 +6,13 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentPageReqVO;
|
|
|
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentRespVO;
|
|
|
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpRespVO;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpSaveReqVO;
|
|
|
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
|
|
|
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
|
|
|
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
|
|
|
-import cn.iocoder.yudao.module.infra.service.demo.demo03.Demo03StudentService;
|
|
|
+import cn.iocoder.yudao.module.infra.service.demo.demo03.erp.Demo03StudentErpService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
@@ -31,25 +31,25 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
@Tag(name = "管理后台 - 学生")
|
|
|
@RestController
|
|
|
-@RequestMapping("/infra/demo03-student")
|
|
|
+@RequestMapping("/infra/demo03-student-erp")
|
|
|
@Validated
|
|
|
-public class Demo03StudentController {
|
|
|
+public class Demo03StudentErpController {
|
|
|
|
|
|
@Resource
|
|
|
- private Demo03StudentService demo03StudentService;
|
|
|
+ private Demo03StudentErpService demo03StudentErpService;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建学生")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
|
|
|
- public CommonResult<Long> createDemo03Student(@Valid @RequestBody Demo03StudentSaveReqVO createReqVO) {
|
|
|
- return success(demo03StudentService.createDemo03Student(createReqVO));
|
|
|
+ public CommonResult<Long> createDemo03Student(@Valid @RequestBody Demo03StudentErpSaveReqVO createReqVO) {
|
|
|
+ return success(demo03StudentErpService.createDemo03Student(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
@Operation(summary = "更新学生")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
|
|
|
- public CommonResult<Boolean> updateDemo03Student(@Valid @RequestBody Demo03StudentSaveReqVO updateReqVO) {
|
|
|
- demo03StudentService.updateDemo03Student(updateReqVO);
|
|
|
+ public CommonResult<Boolean> updateDemo03Student(@Valid @RequestBody Demo03StudentErpSaveReqVO updateReqVO) {
|
|
|
+ demo03StudentErpService.updateDemo03Student(updateReqVO);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@@ -58,7 +58,16 @@ public class Demo03StudentController {
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
public CommonResult<Boolean> deleteDemo03Student(@RequestParam("id") Long id) {
|
|
|
- demo03StudentService.deleteDemo03Student(id);
|
|
|
+ demo03StudentErpService.deleteDemo03Student(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete-batch")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除学生")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
+ public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) {
|
|
|
+ demo03StudentErpService.deleteDemo03StudentByIds(ids);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@@ -66,30 +75,30 @@ public class Demo03StudentController {
|
|
|
@Operation(summary = "获得学生")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
- public CommonResult<Demo03StudentRespVO> getDemo03Student(@RequestParam("id") Long id) {
|
|
|
- Demo03StudentDO demo03Student = demo03StudentService.getDemo03Student(id);
|
|
|
- return success(BeanUtils.toBean(demo03Student, Demo03StudentRespVO.class));
|
|
|
+ public CommonResult<Demo03StudentErpRespVO> getDemo03Student(@RequestParam("id") Long id) {
|
|
|
+ Demo03StudentDO demo03Student = demo03StudentErpService.getDemo03Student(id);
|
|
|
+ return success(BeanUtils.toBean(demo03Student, Demo03StudentErpRespVO.class));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得学生分页")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
- public CommonResult<PageResult<Demo03StudentRespVO>> getDemo03StudentPage(@Valid Demo03StudentPageReqVO pageReqVO) {
|
|
|
- PageResult<Demo03StudentDO> pageResult = demo03StudentService.getDemo03StudentPage(pageReqVO);
|
|
|
- return success(BeanUtils.toBean(pageResult, Demo03StudentRespVO.class));
|
|
|
+ public CommonResult<PageResult<Demo03StudentErpRespVO>> getDemo03StudentPage(@Valid Demo03StudentErpPageReqVO pageReqVO) {
|
|
|
+ PageResult<Demo03StudentDO> pageResult = demo03StudentErpService.getDemo03StudentPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, Demo03StudentErpRespVO.class));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
@Operation(summary = "导出学生 Excel")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
- public void exportDemo03StudentExcel(@Valid Demo03StudentPageReqVO pageReqVO,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
+ public void exportDemo03StudentExcel(@Valid Demo03StudentErpPageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<Demo03StudentDO> list = demo03StudentService.getDemo03StudentPage(pageReqVO).getList();
|
|
|
+ List<Demo03StudentDO> list = demo03StudentErpService.getDemo03StudentPage(pageReqVO).getList();
|
|
|
// 导出 Excel
|
|
|
- ExcelUtils.write(response, "学生.xls", "数据", Demo03StudentRespVO.class,
|
|
|
- BeanUtils.toBean(list, Demo03StudentRespVO.class));
|
|
|
+ ExcelUtils.write(response, "学生.xls", "数据", Demo03StudentErpRespVO.class,
|
|
|
+ BeanUtils.toBean(list, Demo03StudentErpRespVO.class));
|
|
|
}
|
|
|
|
|
|
// ==================== 子表(学生课程) ====================
|
|
|
@@ -100,21 +109,21 @@ public class Demo03StudentController {
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
public CommonResult<PageResult<Demo03CourseDO>> getDemo03CoursePage(PageParam pageReqVO,
|
|
|
@RequestParam("studentId") Long studentId) {
|
|
|
- return success(demo03StudentService.getDemo03CoursePage(pageReqVO, studentId));
|
|
|
+ return success(demo03StudentErpService.getDemo03CoursePage(pageReqVO, studentId));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/demo03-course/create")
|
|
|
@Operation(summary = "创建学生课程")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
|
|
|
public CommonResult<Long> createDemo03Course(@Valid @RequestBody Demo03CourseDO demo03Course) {
|
|
|
- return success(demo03StudentService.createDemo03Course(demo03Course));
|
|
|
+ return success(demo03StudentErpService.createDemo03Course(demo03Course));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/demo03-course/update")
|
|
|
@Operation(summary = "更新学生课程")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
|
|
|
public CommonResult<Boolean> updateDemo03Course(@Valid @RequestBody Demo03CourseDO demo03Course) {
|
|
|
- demo03StudentService.updateDemo03Course(demo03Course);
|
|
|
+ demo03StudentErpService.updateDemo03Course(demo03Course);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@@ -123,7 +132,16 @@ public class Demo03StudentController {
|
|
|
@Operation(summary = "删除学生课程")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
public CommonResult<Boolean> deleteDemo03Course(@RequestParam("id") Long id) {
|
|
|
- demo03StudentService.deleteDemo03Course(id);
|
|
|
+ demo03StudentErpService.deleteDemo03Course(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/demo03-course/delete-batch")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除学生课程")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
+ public CommonResult<Boolean> deleteDemo03Course(@RequestParam("ids") List<Long> ids) {
|
|
|
+ demo03StudentErpService.deleteDemo03CourseByIds(ids);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@@ -132,15 +150,7 @@ public class Demo03StudentController {
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
public CommonResult<Demo03CourseDO> getDemo03Course(@RequestParam("id") Long id) {
|
|
|
- return success(demo03StudentService.getDemo03Course(id));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/demo03-course/list-by-student-id")
|
|
|
- @Operation(summary = "获得学生课程列表")
|
|
|
- @Parameter(name = "studentId", description = "学生编号")
|
|
|
- @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
- public CommonResult<List<Demo03CourseDO>> getDemo03CourseListByStudentId(@RequestParam("studentId") Long studentId) {
|
|
|
- return success(demo03StudentService.getDemo03CourseListByStudentId(studentId));
|
|
|
+ return success(demo03StudentErpService.getDemo03Course(id));
|
|
|
}
|
|
|
|
|
|
// ==================== 子表(学生班级) ====================
|
|
|
@@ -151,21 +161,21 @@ public class Demo03StudentController {
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
public CommonResult<PageResult<Demo03GradeDO>> getDemo03GradePage(PageParam pageReqVO,
|
|
|
@RequestParam("studentId") Long studentId) {
|
|
|
- return success(demo03StudentService.getDemo03GradePage(pageReqVO, studentId));
|
|
|
+ return success(demo03StudentErpService.getDemo03GradePage(pageReqVO, studentId));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/demo03-grade/create")
|
|
|
@Operation(summary = "创建学生班级")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
|
|
|
public CommonResult<Long> createDemo03Grade(@Valid @RequestBody Demo03GradeDO demo03Grade) {
|
|
|
- return success(demo03StudentService.createDemo03Grade(demo03Grade));
|
|
|
+ return success(demo03StudentErpService.createDemo03Grade(demo03Grade));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/demo03-grade/update")
|
|
|
@Operation(summary = "更新学生班级")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
|
|
|
public CommonResult<Boolean> updateDemo03Grade(@Valid @RequestBody Demo03GradeDO demo03Grade) {
|
|
|
- demo03StudentService.updateDemo03Grade(demo03Grade);
|
|
|
+ demo03StudentErpService.updateDemo03Grade(demo03Grade);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@@ -174,7 +184,16 @@ public class Demo03StudentController {
|
|
|
@Operation(summary = "删除学生班级")
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
public CommonResult<Boolean> deleteDemo03Grade(@RequestParam("id") Long id) {
|
|
|
- demo03StudentService.deleteDemo03Grade(id);
|
|
|
+ demo03StudentErpService.deleteDemo03Grade(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/demo03-grade/delete-batch")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除学生班级")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
+ public CommonResult<Boolean> deleteDemo03Grade(@RequestParam("ids") List<Long> ids) {
|
|
|
+ demo03StudentErpService.deleteDemo03GradeByIds(ids);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@@ -183,15 +202,7 @@ public class Demo03StudentController {
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
public CommonResult<Demo03GradeDO> getDemo03Grade(@RequestParam("id") Long id) {
|
|
|
- return success(demo03StudentService.getDemo03Grade(id));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/demo03-grade/get-by-student-id")
|
|
|
- @Operation(summary = "获得学生班级")
|
|
|
- @Parameter(name = "studentId", description = "学生编号")
|
|
|
- @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
- public CommonResult<Demo03GradeDO> getDemo03GradeByStudentId(@RequestParam("studentId") Long studentId) {
|
|
|
- return success(demo03StudentService.getDemo03GradeByStudentId(studentId));
|
|
|
+ return success(demo03StudentErpService.getDemo03Grade(id));
|
|
|
}
|
|
|
|
|
|
}
|