ExamTeacherSalaryController.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package com.keao.edu.user.controller;
  2. import com.keao.edu.common.controller.BaseController;
  3. import com.keao.edu.common.entity.HttpResponseResult;
  4. import com.keao.edu.common.page.PageInfo;
  5. import com.keao.edu.user.dto.BaseUserInfoDto;
  6. import com.keao.edu.user.dto.ExamTeacherSalaryDto;
  7. import com.keao.edu.user.dto.ExamTeacherSalaryStaticsInfo;
  8. import com.keao.edu.user.dto.TeacherDto;
  9. import com.keao.edu.user.entity.ExamTeacherSalary;
  10. import com.keao.edu.user.page.ExamTeacherSalaryQueryInfo;
  11. import com.keao.edu.user.service.ExamTeacherSalaryService;
  12. import io.swagger.annotations.Api;
  13. import io.swagger.annotations.ApiOperation;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.GetMapping;
  16. import org.springframework.web.bind.annotation.PostMapping;
  17. import org.springframework.web.bind.annotation.RequestMapping;
  18. import org.springframework.web.bind.annotation.RestController;
  19. import java.math.BigDecimal;
  20. import java.util.Date;
  21. import java.util.List;
  22. /**
  23. * @Author Joburgess
  24. * @Date 2020.07.01
  25. */
  26. @RestController
  27. @RequestMapping("examTeacherSalary")
  28. @Api(tags = "考级项目教师服务")
  29. public class ExamTeacherSalaryController extends BaseController {
  30. @Autowired
  31. private ExamTeacherSalaryService examTeacherSalaryService;
  32. @ApiOperation("分页查询")
  33. @GetMapping(value = "/list")
  34. public HttpResponseResult<PageInfo<ExamTeacherSalaryDto>> getList(ExamTeacherSalaryQueryInfo queryInfo) {
  35. return succeed(examTeacherSalaryService.queryExamTeacherSalary(queryInfo));
  36. }
  37. @ApiOperation("新增")
  38. @PostMapping(value = "/add")
  39. public HttpResponseResult add(ExamTeacherSalary examTeacherSalary) {
  40. examTeacherSalary.setTotalInvigilationNum(0);
  41. examTeacherSalary.setTotalInvigilationStudentNum(0);
  42. examTeacherSalary.setTotalSettlementCost(BigDecimal.ZERO);
  43. examTeacherSalaryService.insert(examTeacherSalary);
  44. return succeed();
  45. }
  46. @ApiOperation("新增考级教师")
  47. @PostMapping(value = "/addExamTeacherSalary")
  48. public HttpResponseResult addExamTeacherSalary(Long examId, String teacherIdsStr) {
  49. examTeacherSalaryService.addExamTeacherSalary(examId, teacherIdsStr);
  50. return succeed();
  51. }
  52. @ApiOperation("获取指定考级项目可排考教师")
  53. @GetMapping(value = "/getExamTeachers")
  54. public HttpResponseResult<List<BaseUserInfoDto>> getExamTeachers(Integer examId){
  55. return succeed(examTeacherSalaryService.getExamTeachers(examId));
  56. }
  57. @ApiOperation("更新")
  58. @PostMapping(value = "/update")
  59. public HttpResponseResult update(ExamTeacherSalary examTeacherSalary) {
  60. examTeacherSalary.setUpdateTime(new Date());
  61. examTeacherSalaryService.updateExamTeacherSalary(examTeacherSalary);
  62. return succeed();
  63. }
  64. @ApiOperation("删除")
  65. @PostMapping(value = "/del")
  66. public HttpResponseResult add(Long id) {
  67. examTeacherSalaryService.deleteExamTeacherSalary(id);
  68. return succeed();
  69. }
  70. @ApiOperation("获取与考级项目无关的教师")
  71. @GetMapping(value = "/getUnRelatedWithExamTeachers")
  72. public HttpResponseResult<PageInfo<TeacherDto>> getUnRelatedWithExamTeachers(ExamTeacherSalaryQueryInfo queryInfo){
  73. return succeed(examTeacherSalaryService.getUnRelatedWithExamTeachers(queryInfo));
  74. }
  75. @ApiOperation("获取考级项目关联教师统计信息")
  76. @GetMapping(value = "/getExamTeacherSalaryStaticsInfo")
  77. public HttpResponseResult<ExamTeacherSalaryStaticsInfo> getExamTeacherSalaryStaticsInfo(Integer examId){
  78. return succeed(examTeacherSalaryService.getExamTeacherSalaryStaticsInfo(examId));
  79. }
  80. }