ClassStudentController.java 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. package com.zhongzheng.controller.grade;
  2. import cn.hutool.core.lang.Validator;
  3. import com.zhongzheng.common.annotation.Log;
  4. import com.zhongzheng.common.core.controller.BaseController;
  5. import com.zhongzheng.common.core.domain.AjaxResult;
  6. import com.zhongzheng.common.core.page.TableDataInfo;
  7. import com.zhongzheng.common.core.redis.RedisCache;
  8. import com.zhongzheng.common.enums.BusinessType;
  9. import com.zhongzheng.common.utils.ServletUtils;
  10. import com.zhongzheng.modules.grade.bo.*;
  11. import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
  12. import com.zhongzheng.modules.grade.service.IClassGradeService;
  13. import com.zhongzheng.modules.grade.service.IClassGradeSysService;
  14. import com.zhongzheng.modules.grade.service.IClassGradeUserService;
  15. import com.zhongzheng.modules.grade.vo.*;
  16. import com.zhongzheng.modules.user.bo.*;
  17. import com.zhongzheng.modules.user.service.IUserService;
  18. import com.zhongzheng.modules.user.service.IUserStudyRecordService;
  19. import com.zhongzheng.modules.user.service.IUserUpdateService;
  20. import com.zhongzheng.modules.user.vo.*;
  21. import io.swagger.annotations.Api;
  22. import io.swagger.annotations.ApiOperation;
  23. import lombok.RequiredArgsConstructor;
  24. import org.springframework.beans.factory.annotation.Autowired;
  25. import org.springframework.security.access.prepost.PreAuthorize;
  26. import org.springframework.web.bind.annotation.*;
  27. import java.util.ArrayList;
  28. import java.util.List;
  29. /**
  30. * 班级Controller
  31. *
  32. * @author ruoyi
  33. * @date 2021-11-10
  34. */
  35. @Api(value = "学员控制器", tags = {"学员控制器"})
  36. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  37. @RestController
  38. @RequestMapping("/grade/student")
  39. public class ClassStudentController extends BaseController {
  40. private final IClassGradeUserService iClassGradeUserService;
  41. private final IUserStudyRecordService iUserStudyRecordService;
  42. private final IUserService iUserService;
  43. private final IUserUpdateService iUserUpdateService;
  44. /**
  45. * 查询學員用户列表
  46. */
  47. @ApiOperation("查询學員用户列表")
  48. @PreAuthorize("@ss.hasPermi('app:user:list')")
  49. @GetMapping("/listStudent")
  50. public TableDataInfo<UserVo> listStudent(UserQueryBo bo) {
  51. startPage();
  52. List<UserVo> list = iUserService.selectList(bo);
  53. return getDataTable(list);
  54. }
  55. /**
  56. * 修改客户端用户
  57. */
  58. @ApiOperation("修改學員用户")
  59. @PreAuthorize("@ss.hasPermi('app:user:edit')")
  60. @Log(title = "修改學員用户", businessType = BusinessType.UPDATE)
  61. @PostMapping("/edit")
  62. public AjaxResult<Void> edit(@RequestBody UserEditBo bo) throws IllegalAccessException {
  63. return toAjax(iUserService.updateByEditBo(bo) ? 1 : 0);
  64. }
  65. /**
  66. * 查询学员商品学习记录
  67. */
  68. @ApiOperation("查询学员商品学习记录")
  69. @PreAuthorize("@ss.hasPermi('grade:student:list')")
  70. @GetMapping("/list")
  71. public TableDataInfo<GoodsStudyRecordVo> list(UserQueryBo bo) {
  72. startPage();
  73. List<GoodsStudyRecordVo> list = iUserStudyRecordService.queryGoods(bo);
  74. return getDataTable(list);
  75. }
  76. /**
  77. * 查询学员课程科目学习记录
  78. */
  79. @ApiOperation("查询学员课程科目学习记录")
  80. @PreAuthorize("@ss.hasPermi('grade:student:listSubject')")
  81. @GetMapping("/listSubject")
  82. public TableDataInfo<SubjectStudyRecordVo> listSubject(SubjectStudyRecordQueryBo bo) {
  83. startPage();
  84. List<SubjectStudyRecordVo> list = iUserStudyRecordService.listSubject(bo);
  85. return getDataTable(list);
  86. }
  87. /**
  88. * 查询学员课程节学习记录
  89. */
  90. @ApiOperation("查询学员课程节学习记录")
  91. @PreAuthorize("@ss.hasPermi('grade:student:listSection')")
  92. @GetMapping("/listSection")
  93. public TableDataInfo<SectionStudyRecordVo> listSection(SubjectStudyRecordQueryBo bo) {
  94. startPage();
  95. List<SectionStudyRecordVo> list = iUserStudyRecordService.listSection(bo);
  96. return getDataTable(list);
  97. }
  98. /**
  99. * 查询班级记录列表
  100. */
  101. @ApiOperation("查询班级记录列表")
  102. @PreAuthorize("@ss.hasPermi('system:user:list')")
  103. @GetMapping("/listUser")
  104. public TableDataInfo<ClassGradeUserGoodsVo> listUser(ClassGradeUserQueryBo bo) {
  105. startPage();
  106. List<ClassGradeUserGoodsVo> list = iClassGradeUserService.listUser(bo);
  107. return getDataTable(list);
  108. }
  109. /**
  110. * 查询学员商品题库学习记录
  111. */
  112. @ApiOperation("查询学员商品题库学习记录")
  113. @PreAuthorize("@ss.hasPermi('grade:student:list')")
  114. @GetMapping("/listExam")
  115. public TableDataInfo<ExamStudyRecordVo> listExam(UserQueryBo bo) {
  116. startPage();
  117. List<ExamStudyRecordVo> list = iUserStudyRecordService.querExamStudy(bo);
  118. return getDataTable(list);
  119. }
  120. /**
  121. * 查询学员商品学习记录
  122. */
  123. @ApiOperation("查询学员商品卷学习记录")
  124. @PreAuthorize("@ss.hasPermi('grade:student:list')")
  125. @GetMapping("/listExamSon")
  126. public TableDataInfo<ExamSonStudyRecordVo> listExamSon(SubjectStudyRecordQueryBo bo) {
  127. startPage();
  128. List<ExamSonStudyRecordVo> list = iUserStudyRecordService.listExamSon(bo);
  129. return getDataTable(list);
  130. }
  131. /**
  132. * 查询用户修改记录列表
  133. */
  134. @ApiOperation("查询用户修改记录列表")
  135. @PreAuthorize("@ss.hasPermi('system:update:list')")
  136. @GetMapping("/userUpdateList")
  137. public TableDataInfo<UserUpdateVo> list(UserUpdateQueryBo bo) {
  138. startPage();
  139. List<UserUpdateVo> list = iUserUpdateService.queryList(bo);
  140. return getDataTable(list);
  141. }
  142. /**
  143. * 修改用户修改记录
  144. */
  145. @ApiOperation("修改用户修改记录")
  146. @PreAuthorize("@ss.hasPermi('system:update:edit')")
  147. @Log(title = "用户修改记录", businessType = BusinessType.UPDATE)
  148. @PostMapping("userUpdate")
  149. public AjaxResult<Void> edit(@RequestBody UserUpdateEditBo bo) {
  150. return toAjax(iUserUpdateService.updateByEditBo(bo) ? 1 : 0);
  151. }
  152. /**
  153. * 官方信息推送
  154. */
  155. @ApiOperation("批量官方信息推送")
  156. @PreAuthorize("@ss.hasPermi('app:user:edit')")
  157. @PostMapping("/pushInfo")
  158. public AjaxResult pushInfo(@RequestBody List<ClassGradeUserQueryBo> list) {
  159. return AjaxResult.success(iClassGradeUserService.pushOfficialInfoMore(list));
  160. }
  161. /**
  162. * 查看用户学时状态
  163. */
  164. @ApiOperation("查看用户学时状态")
  165. @PreAuthorize("@ss.hasPermi('app:user:edit')")
  166. @PostMapping("/getUserPeriodStatus")
  167. public AjaxResult getUserPeriodStatus(@RequestBody ClassGradeUserQueryBo bo) {
  168. return AjaxResult.success(iClassGradeUserService.getUserPeriodStatus(bo));
  169. }
  170. /**
  171. * 用户学时状态
  172. */
  173. @ApiOperation("用户学时状态")
  174. @PreAuthorize("@ss.hasPermi('app:user:edit')")
  175. @PostMapping("/updateUserPeriodStatus")
  176. public AjaxResult updateUserPeriodStatus(@RequestBody ClassGradeUserQueryBo bo) {
  177. return AjaxResult.success(iClassGradeUserService.updateUserPeriodStatus(bo));
  178. }
  179. /**
  180. * 学时信息推送
  181. */
  182. @ApiOperation("批量学时信息推送")
  183. @PreAuthorize("@ss.hasPermi('app:user:edit')")
  184. @PostMapping("/pushPeriod")
  185. public AjaxResult pushPeriod(@RequestBody List<ClassGradeUserQueryBo> list) {
  186. return AjaxResult.success(iClassGradeUserService.pushOfficialPeriodMore(list));
  187. }
  188. }