| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- package com.zhongzheng.controller.grade;
- import cn.hutool.core.lang.Validator;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import com.zhongzheng.common.core.redis.RedisCache;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.common.utils.ServletUtils;
- import com.zhongzheng.modules.grade.bo.*;
- import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
- import com.zhongzheng.modules.grade.service.IClassGradeService;
- import com.zhongzheng.modules.grade.service.IClassGradeSysService;
- import com.zhongzheng.modules.grade.service.IClassGradeUserService;
- import com.zhongzheng.modules.grade.vo.*;
- import com.zhongzheng.modules.user.bo.*;
- import com.zhongzheng.modules.user.service.IUserService;
- import com.zhongzheng.modules.user.service.IUserStudyRecordService;
- import com.zhongzheng.modules.user.service.IUserUpdateService;
- import com.zhongzheng.modules.user.vo.*;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.web.bind.annotation.*;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * 班级Controller
- *
- * @author ruoyi
- * @date 2021-11-10
- */
- @Api(value = "学员控制器", tags = {"学员控制器"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/grade/student")
- public class ClassStudentController extends BaseController {
- private final IClassGradeUserService iClassGradeUserService;
- private final IUserStudyRecordService iUserStudyRecordService;
- private final IUserService iUserService;
- private final IUserUpdateService iUserUpdateService;
- /**
- * 查询學員用户列表
- */
- @ApiOperation("查询學員用户列表")
- @PreAuthorize("@ss.hasPermi('app:user:list')")
- @GetMapping("/listStudent")
- public TableDataInfo<UserVo> listStudent(UserQueryBo bo) {
- startPage();
- List<UserVo> list = iUserService.selectList(bo);
- return getDataTable(list);
- }
- /**
- * 修改客户端用户
- */
- @ApiOperation("修改學員用户")
- @PreAuthorize("@ss.hasPermi('app:user:edit')")
- @Log(title = "修改學員用户", businessType = BusinessType.UPDATE)
- @PostMapping("/edit")
- public AjaxResult<Void> edit(@RequestBody UserEditBo bo) throws IllegalAccessException {
- return toAjax(iUserService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 查询学员商品学习记录
- */
- @ApiOperation("查询学员商品学习记录")
- @PreAuthorize("@ss.hasPermi('grade:student:list')")
- @GetMapping("/list")
- public TableDataInfo<GoodsStudyRecordVo> list(UserQueryBo bo) {
- startPage();
- List<GoodsStudyRecordVo> list = iUserStudyRecordService.queryGoods(bo);
- return getDataTable(list);
- }
- /**
- * 查询学员课程科目学习记录
- */
- @ApiOperation("查询学员课程科目学习记录")
- @PreAuthorize("@ss.hasPermi('grade:student:listSubject')")
- @GetMapping("/listSubject")
- public TableDataInfo<SubjectStudyRecordVo> listSubject(SubjectStudyRecordQueryBo bo) {
- startPage();
- List<SubjectStudyRecordVo> list = iUserStudyRecordService.listSubject(bo);
- return getDataTable(list);
- }
- /**
- * 查询学员课程节学习记录
- */
- @ApiOperation("查询学员课程节学习记录")
- @PreAuthorize("@ss.hasPermi('grade:student:listSection')")
- @GetMapping("/listSection")
- public TableDataInfo<SectionStudyRecordVo> listSection(SubjectStudyRecordQueryBo bo) {
- startPage();
- List<SectionStudyRecordVo> list = iUserStudyRecordService.listSection(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级记录列表
- */
- @ApiOperation("查询班级记录列表")
- @PreAuthorize("@ss.hasPermi('system:user:list')")
- @GetMapping("/listUser")
- public TableDataInfo<ClassGradeUserGoodsVo> listUser(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassGradeUserGoodsVo> list = iClassGradeUserService.listUser(bo);
- return getDataTable(list);
- }
- /**
- * 查询学员商品题库学习记录
- */
- @ApiOperation("查询学员商品题库学习记录")
- @PreAuthorize("@ss.hasPermi('grade:student:list')")
- @GetMapping("/listExam")
- public TableDataInfo<ExamStudyRecordVo> listExam(UserQueryBo bo) {
- startPage();
- List<ExamStudyRecordVo> list = iUserStudyRecordService.querExamStudy(bo);
- return getDataTable(list);
- }
- /**
- * 查询学员商品学习记录
- */
- @ApiOperation("查询学员商品卷学习记录")
- @PreAuthorize("@ss.hasPermi('grade:student:list')")
- @GetMapping("/listExamSon")
- public TableDataInfo<ExamSonStudyRecordVo> listExamSon(SubjectStudyRecordQueryBo bo) {
- startPage();
- List<ExamSonStudyRecordVo> list = iUserStudyRecordService.listExamSon(bo);
- return getDataTable(list);
- }
- /**
- * 查询用户修改记录列表
- */
- @ApiOperation("查询用户修改记录列表")
- @PreAuthorize("@ss.hasPermi('system:update:list')")
- @GetMapping("/userUpdateList")
- public TableDataInfo<UserUpdateVo> list(UserUpdateQueryBo bo) {
- startPage();
- List<UserUpdateVo> list = iUserUpdateService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 修改用户修改记录
- */
- @ApiOperation("修改用户修改记录")
- @PreAuthorize("@ss.hasPermi('system:update:edit')")
- @Log(title = "用户修改记录", businessType = BusinessType.UPDATE)
- @PostMapping("userUpdate")
- public AjaxResult<Void> edit(@RequestBody UserUpdateEditBo bo) {
- return toAjax(iUserUpdateService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 官方信息推送
- */
- @ApiOperation("批量官方信息推送")
- @PreAuthorize("@ss.hasPermi('app:user:edit')")
- @PostMapping("/pushInfo")
- public AjaxResult pushInfo(@RequestBody List<ClassGradeUserQueryBo> list) {
- return AjaxResult.success(iClassGradeUserService.pushOfficialInfoMore(list));
- }
- /**
- * 查看用户学时状态
- */
- @ApiOperation("查看用户学时状态")
- @PreAuthorize("@ss.hasPermi('app:user:edit')")
- @PostMapping("/getUserPeriodStatus")
- public AjaxResult getUserPeriodStatus(@RequestBody ClassGradeUserQueryBo bo) {
- return AjaxResult.success(iClassGradeUserService.getUserPeriodStatus(bo));
- }
- /**
- * 用户学时状态
- */
- @ApiOperation("用户学时状态")
- @PreAuthorize("@ss.hasPermi('app:user:edit')")
- @PostMapping("/updateUserPeriodStatus")
- public AjaxResult updateUserPeriodStatus(@RequestBody ClassGradeUserQueryBo bo) {
- return AjaxResult.success(iClassGradeUserService.updateUserPeriodStatus(bo));
- }
- /**
- * 学时信息推送
- */
- @ApiOperation("批量学时信息推送")
- @PreAuthorize("@ss.hasPermi('app:user:edit')")
- @PostMapping("/pushPeriod")
- public AjaxResult pushPeriod(@RequestBody List<ClassGradeUserQueryBo> list) {
- return AjaxResult.success(iClassGradeUserService.pushOfficialPeriodMore(list));
- }
- }
|