ソースを参照

Merge branch 'dev-api' into dev

tom 5 ヶ月 前
コミット
68ee718021
20 ファイル変更452 行追加72 行削除
  1. 0 7
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Main.java
  2. 0 8
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Test2.java
  3. 175 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/custom/BaseService.java
  4. 8 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/custom/RuoYiResponse.java
  5. 127 2
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/AjaxResult.java
  6. 9 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseController.java
  7. 3 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseEntity.java
  8. 3 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseException.java
  9. 19 1
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/TableDataInfo.java
  10. 4 3
      ruoyi-sim/src/main/java/com/ruoyi/sim/constant/Consts.java
  11. 8 6
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCollectionController.java
  12. 24 9
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamController.java
  13. 11 16
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/StudentController.java
  14. 1 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TeacherController.java
  15. 1 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCollection.java
  16. 1 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCollectionMapper.java
  17. 1 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCollectionService.java
  18. 56 16
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/StudentService.java
  19. 1 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TeacherService.java
  20. 0 0
      ruoyi-sim/src/main/resources/mapper/sim/RealExamCollectionMapper.xml

+ 0 - 7
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Main.java

@@ -1,7 +0,0 @@
-package cn.ele6.catalyzer.ruoyi;
-
-public class Main {
-    public static void main(String[] args) {
-        System.out.println("Hello, World!");
-    }
-}

+ 0 - 8
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Test2.java

@@ -1,8 +0,0 @@
-package cn.ele6.catalyzer.ruoyi;
-
-public class Test2 {
-
-    public String getTestString(){
-        return "test";
-    }
-}

+ 175 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/custom/BaseService.java

@@ -0,0 +1,175 @@
+package cn.ele6.catalyzer.ruoyi.custom;
+
+import cn.ele6.catalyzer.ruoyi.enhance.AjaxResult;
+import cn.ele6.catalyzer.ruoyi.enhance.TableDataInfo;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.PageDomain;
+import com.ruoyi.common.core.page.TableSupport;
+import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.sql.SqlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+public abstract class BaseService {
+
+    protected Logger l = LoggerFactory.getLogger(BaseService.class);
+
+    /**
+     * 设置请求分页数据
+     * copy from BaseController.
+     */
+    protected void startPage() {
+        PageUtils.startPage();
+    }
+
+    /**
+     * 设置请求排序数据
+     * copy from BaseController.
+     */
+    protected void startOrderBy() {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) {
+            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+            PageHelper.orderBy(orderBy);
+        }
+    }
+
+    /**
+     * 清理分页的线程变量
+     * copy from BaseController.
+     */
+    protected void clearPage() {
+        PageUtils.clearPage();
+    }
+
+    /**
+     * 响应请求分页数据
+     * copy from BaseController.
+     */
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    protected TableDataInfo getDataTable(List<?> list) {
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setMsg("查询成功");
+        rspData.setRows(list);
+        rspData.setTotal(new PageInfo(list).getTotal());
+        return rspData;
+    }
+
+    /**
+     * 返回成功
+     * copy from BaseController.
+     */
+    public AjaxResult success() {
+        return AjaxResult.success();
+    }
+
+    /**
+     * 返回失败消息
+     * copy from BaseController.
+     */
+    public AjaxResult error() {
+        return AjaxResult.error();
+    }
+
+    /**
+     * 返回成功消息
+     * copy from BaseController.
+     */
+    public AjaxResult success(String message) {
+        return AjaxResult.success(message);
+    }
+
+    /**
+     * 返回成功消息
+     * copy from BaseController.
+     */
+    public AjaxResult success(Object data) {
+        return AjaxResult.success(data);
+    }
+
+    /**
+     * 返回失败消息
+     * copy from BaseController.
+     */
+    public AjaxResult error(String message) {
+        return AjaxResult.error(message);
+    }
+
+    /**
+     * 返回警告消息
+     * copy from BaseController.
+     */
+    public AjaxResult warn(String message) {
+        return AjaxResult.warn(message);
+    }
+
+    /**
+     * 响应返回结果
+     * copy from BaseController.
+     *
+     * @param rows 影响行数
+     * @return 操作结果
+     */
+    protected AjaxResult toAjax(int rows) {
+        return rows > 0 ? AjaxResult.success() : AjaxResult.error();
+    }
+
+    /**
+     * 响应返回结果
+     * copy from BaseController.
+     *
+     * @param result 结果
+     * @return 操作结果
+     */
+    protected AjaxResult toAjax(boolean result) {
+        return result ? success() : error();
+    }
+
+    /**
+     * 页面跳转
+     * copy from BaseController.
+     */
+    public String redirect(String url) {
+        return StringUtils.format("redirect:{}", url);
+    }
+
+    /**
+     * 获取用户缓存信息
+     * copy from BaseController.
+     */
+    public LoginUser getLoginUser() {
+        return SecurityUtils.getLoginUser();
+    }
+
+    /**
+     * 获取登录用户id
+     * copy from BaseController.
+     */
+    public Long getUserId() {
+        return getLoginUser().getUserId();
+    }
+
+    /**
+     * 获取登录部门id
+     * copy from BaseController.
+     */
+    public Long getDeptId() {
+        return getLoginUser().getDeptId();
+    }
+
+    /**
+     * 获取登录用户名
+     * copy from BaseController.
+     */
+    public String getUsername() {
+        return getLoginUser().getUsername();
+    }
+}

+ 8 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/custom/RuoYiResponse.java

@@ -0,0 +1,8 @@
+package cn.ele6.catalyzer.ruoyi.custom;
+
+/**
+ * RuoYiResponse tag interface.
+ */
+public interface RuoYiResponse {
+
+}

+ 127 - 2
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/AjaxResult.java

@@ -1,11 +1,136 @@
 package cn.ele6.catalyzer.ruoyi.enhance;
 
+import cn.ele6.catalyzer.ruoyi.custom.RuoYiResponse;
+import com.ruoyi.common.constant.HttpStatus;
+import org.springframework.beans.BeanUtils;
+
 import java.io.Serializable;
 
 /**
- * 泛型改造。
+ * 改造。
  */
-public class AjaxResult extends com.ruoyi.common.core.domain.AjaxResult implements Serializable {
+public class AjaxResult extends com.ruoyi.common.core.domain.AjaxResult implements Serializable, RuoYiResponse {
+
+    /**
+     * 返回成功消息
+     * copy.
+     *
+     * @return 成功消息
+     */
+    public static AjaxResult success() {
+        return convert(com.ruoyi.common.core.domain.AjaxResult.success("操作成功"));
+    }
+
+    /**
+     * 返回成功数据
+     * copy.
+     *
+     * @return 成功消息
+     */
+    public static AjaxResult success(Object data) {
+        return convert(com.ruoyi.common.core.domain.AjaxResult.success("操作成功", data));
+    }
+
+    /**
+     * 返回成功消息
+     * copy.
+     *
+     * @param msg 返回内容
+     * @return 成功消息
+     */
+    public static AjaxResult success(String msg) {
+        return convert(com.ruoyi.common.core.domain.AjaxResult.success(msg, null));
+    }
+
+    /**
+     * 返回成功消息
+     * copy.
+     *
+     * @param msg  返回内容
+     * @param data 数据对象
+     * @return 成功消息
+     */
+    public static AjaxResult success(String msg, Object data) {
+        return convert(new com.ruoyi.common.core.domain.AjaxResult(HttpStatus.SUCCESS, msg, data));
+    }
+
+    /**
+     * 返回警告消息
+     * copy.
+     *
+     * @param msg 返回内容
+     * @return 警告消息
+     */
+    public static AjaxResult warn(String msg) {
+        return convert(com.ruoyi.common.core.domain.AjaxResult.warn(msg, null));
+    }
+
+    /**
+     * 返回警告消息
+     * copy.
+     *
+     * @param msg  返回内容
+     * @param data 数据对象
+     * @return 警告消息
+     */
+    public static AjaxResult warn(String msg, Object data) {
+        return convert(new com.ruoyi.common.core.domain.AjaxResult(HttpStatus.WARN, msg, data));
+    }
+
+    /**
+     * 返回错误消息
+     * copy.
+     *
+     * @return 错误消息
+     */
+    public static AjaxResult error() {
+        return convert(com.ruoyi.common.core.domain.AjaxResult.error("操作失败"));
+    }
+
+    /**
+     * 返回错误消息
+     * copy.
+     *
+     * @param msg 返回内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(String msg) {
+        return convert(com.ruoyi.common.core.domain.AjaxResult.error(msg, null));
+    }
+
+    /**
+     * 返回错误消息
+     * copy.
+     *
+     * @param msg  返回内容
+     * @param data 数据对象
+     * @return 错误消息
+     */
+    public static AjaxResult error(String msg, Object data) {
+        return convert(new com.ruoyi.common.core.domain.AjaxResult(HttpStatus.ERROR, msg, data));
+    }
 
+    /**
+     * 返回错误消息
+     * copy.
+     *
+     * @param code 状态码
+     * @param msg  返回内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(int code, String msg) {
+        return convert(new com.ruoyi.common.core.domain.AjaxResult(code, msg, null));
+    }
 
+    /**
+     * copy obj and convert type.
+     *
+     * @param o
+     * @return
+     */
+    public static AjaxResult convert(com.ruoyi.common.core.domain.AjaxResult o) {
+        AjaxResult t = new AjaxResult();
+        BeanUtils.copyProperties(o, t);
+        return t;
+    }
 }

+ 9 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseController.java

@@ -1,5 +1,14 @@
 package cn.ele6.catalyzer.ruoyi.enhance;
 
+/**
+ *
+ */
 public class BaseController extends com.ruoyi.common.core.controller.BaseController {
 
+
+
+
+    public static AjaxResult convert(com.ruoyi.common.core.domain.AjaxResult o) {
+        return AjaxResult.convert(o);
+    }
 }

+ 3 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseEntity.java

@@ -1,5 +1,8 @@
 package cn.ele6.catalyzer.ruoyi.enhance;
 
+/**
+ *
+ */
 public class BaseEntity extends com.ruoyi.common.core.domain.BaseEntity {
 
 }

+ 3 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseException.java

@@ -1,5 +1,8 @@
 package cn.ele6.catalyzer.ruoyi.enhance;
 
+/**
+ *
+ */
 public class BaseException extends com.ruoyi.common.exception.base.BaseException {
 
     public BaseException(String module, String code, Object[] args, String defaultMessage) {

+ 19 - 1
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/TableDataInfo.java

@@ -1,7 +1,25 @@
 package cn.ele6.catalyzer.ruoyi.enhance;
 
+import cn.ele6.catalyzer.ruoyi.custom.RuoYiResponse;
+import org.springframework.beans.BeanUtils;
+
 import java.io.Serializable;
 
-public class TableDataInfo extends com.ruoyi.common.core.page.TableDataInfo implements Serializable {
+/**
+ *
+ */
+public class TableDataInfo extends com.ruoyi.common.core.page.TableDataInfo implements Serializable, RuoYiResponse {
+
 
+    /**
+     * copy obj and convert type.
+     *
+     * @param o
+     * @return
+     */
+    public static TableDataInfo convert(com.ruoyi.common.core.page.TableDataInfo o) {
+        TableDataInfo t = new TableDataInfo();
+        BeanUtils.copyProperties(o, t);
+        return t;
+    }
 }

+ 4 - 3
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/Consts.java → ruoyi-sim/src/main/java/com/ruoyi/sim/constant/Consts.java

@@ -1,8 +1,9 @@
-package com.ruoyi.sim.service.impl;
+package com.ruoyi.sim.constant;
 
 public interface Consts {
 
-    Long ROLE_ID_STUDENT = 101L;
+    Long ROLE_ID_ADMIN = 1L;
     Long ROLE_ID_TEACHER = 100L;
-
+    Long ROLE_ID_STUDENT = 101L;
+    Long ROLE_ID_MANAGER = 102L;
 }

+ 8 - 6
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCollectionController.java

@@ -4,6 +4,8 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.sim.service.impl.RealExamCollectionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -26,19 +28,18 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * 考试集合Controller
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-17
  */
 @RestController
 @RequestMapping("/sim/real-exam-collection")
+@Api("考试集合Controller")
 public class RealExamCollectionController extends BaseController {
     @Autowired
     private RealExamCollectionService realExamCollectionService;
 
-    /**
-     * 查询考试集合列表
-     */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:list')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:list')")
     @GetMapping("/list")
+    @ApiOperation("查询考试集合列表")
     public TableDataInfo list(RealExamCollection realExamCollection) {
         startPage();
         List<RealExamCollection> list = realExamCollectionService.selectRealExamCollectionList(realExamCollection);
@@ -60,8 +61,9 @@ public class RealExamCollectionController extends BaseController {
     /**
      * 获取考试集合详细信息
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:query')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:query')")
     @GetMapping(value = "/{examCollectionId}")
+    @ApiOperation("获取考试集合详细信息")
     public AjaxResult getInfo(@PathVariable("examCollectionId") Long examCollectionId) {
         return success(realExamCollectionService.selectRealExamCollectionByExamCollectionId(examCollectionId));
     }

+ 24 - 9
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamController.java

@@ -4,6 +4,8 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.sim.service.impl.RealExamService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -30,6 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/sim/real-exam")
+@Api("考试Controller")
 public class RealExamController extends BaseController {
     @Autowired
     private RealExamService realExamService;
@@ -37,20 +40,31 @@ public class RealExamController extends BaseController {
     /**
      * 查询考试列表
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam:list')")
-    @GetMapping("/list")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam:list')")
+    // @GetMapping("/list")
+    // @ApiOperation("查询考试列表")
     public TableDataInfo list(RealExam realExam) {
         startPage();
         List<RealExam> list = realExamService.selectRealExamList(realExam);
         return getDataTable(list);
     }
 
+    @GetMapping("/listByUserId/{userId}")
+    @ApiOperation("查询userId学生考试列表")
+    public TableDataInfo listByUserId(@PathVariable("userId") Long userId) {
+        // todo:
+        RealExam realExam = new RealExam();
+        startPage();
+        List<RealExam> list = realExamService.selectRealExamList(realExam);
+        return getDataTable(list);
+    }
+
     /**
      * 导出考试列表
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam:export')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam:export')")
     @Log(title = "考试", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
+    // @PostMapping("/export")
     public void export(HttpServletResponse response, RealExam realExam) {
         List<RealExam> list = realExamService.selectRealExamList(realExam);
         ExcelUtil<RealExam> util = new ExcelUtil<RealExam>(RealExam.class);
@@ -60,8 +74,9 @@ public class RealExamController extends BaseController {
     /**
      * 获取考试详细信息
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam:query')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam:query')")
     @GetMapping(value = "/{examId}")
+    @ApiOperation("获取考试详细信息")
     public AjaxResult getInfo(@PathVariable("examId") Long examId) {
         return success(realExamService.selectRealExamByExamId(examId));
     }
@@ -69,7 +84,7 @@ public class RealExamController extends BaseController {
     /**
      * 新增考试
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam:add')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam:add')")
     @Log(title = "考试", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody RealExam realExam) {
@@ -79,7 +94,7 @@ public class RealExamController extends BaseController {
     /**
      * 修改考试
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam:edit')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam:edit')")
     @Log(title = "考试", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody RealExam realExam) {
@@ -89,9 +104,9 @@ public class RealExamController extends BaseController {
     /**
      * 删除考试
      */
-    @PreAuthorize("@ss.hasPermi('sim:real-exam:remove')")
+    // @PreAuthorize("@ss.hasPermi('sim:real-exam:remove')")
     @Log(title = "考试", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{examIds}")
+    // @DeleteMapping("/{examIds}")
     public AjaxResult remove(@PathVariable Long[] examIds) {
         return toAjax(realExamService.deleteRealExamByExamIds(examIds));
     }

+ 11 - 16
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/StudentController.java

@@ -2,29 +2,24 @@ package com.ruoyi.sim.controller;
 
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.sim.domain.Student;
-import com.ruoyi.sim.service.impl.Consts;
+import com.ruoyi.sim.constant.Consts;
 import com.ruoyi.sim.service.impl.StudentService;
 import com.ruoyi.system.service.ISysDeptService;
-import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.ArrayUtils;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
 
 @Api("学生Controller")
 @RestController
@@ -33,16 +28,10 @@ public class StudentController extends BaseController {
 
     @Autowired
     private ISysUserService userService;
-
     @Autowired
     private ISysRoleService roleService;
-
     @Autowired
     private ISysDeptService deptService;
-
-    @Autowired
-    private ISysPostService postService;
-
     @Autowired
     private StudentService studentService;
 
@@ -61,6 +50,12 @@ public class StudentController extends BaseController {
         return getDataTable(list);
     }
 
+    @GetMapping(value = "/letTry/{code}")
+    @ApiOperation("letTry")
+    public void letTry(@PathVariable(value = "code") int code) {
+        studentService.letTry(code);
+    }
+
     /**
      * copy
      * 根据用户编号获取详细信息
@@ -101,11 +96,11 @@ public class StudentController extends BaseController {
         // --------------------------------  --------------------------------
 
         // 自动添加学生权限
-        SysUser find = userService.selectUserByUserName(user.getUserName());
-        logger.info(String.valueOf(find));
-        if (find != null) {
+        SysUser suF = userService.selectUserByUserName(user.getUserName());
+        logger.info(String.valueOf(suF));
+        if (suF != null) {
             // roleService.insertAuthUsers(Consts.ROLE_ID_STUDENT, new Long[]{userId});
-            userService.insertUserAuth(find.getUserId(), new Long[]{Consts.ROLE_ID_STUDENT});
+            userService.insertUserAuth(suF.getUserId(), new Long[]{Consts.ROLE_ID_STUDENT});
         }
         return tempAjax;
     }

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TeacherController.java

@@ -10,7 +10,7 @@ import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.sim.domain.Clazz;
 import com.ruoyi.sim.domain.Major;
 import com.ruoyi.sim.service.impl.AddOnDeptService;
-import com.ruoyi.sim.service.impl.Consts;
+import com.ruoyi.sim.constant.Consts;
 import com.ruoyi.sim.service.impl.TeacherService;
 import com.ruoyi.system.mapper.SysDeptMapper;
 import com.ruoyi.system.service.ISysDeptService;

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCollection.java

@@ -12,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * 考试集合对象 sim_real_exam_collection
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-17
  */
 public class RealExamCollection extends BaseEntity {
     private static final long serialVersionUID = 1L;

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCollectionMapper.java

@@ -8,7 +8,7 @@ import com.ruoyi.sim.domain.RealExamCollection;
  * 考试集合Mapper接口
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-17
  */
 public interface RealExamCollectionMapper {
     /**

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCollectionService.java

@@ -12,7 +12,7 @@ import com.ruoyi.sim.domain.RealExamCollection;
  * 考试集合Service业务层处理
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-17
  */
 @Service
 public class RealExamCollectionService {

+ 56 - 16
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/StudentService.java

@@ -2,12 +2,15 @@ package com.ruoyi.sim.service.impl;
 
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.sim.constant.Consts;
 import com.ruoyi.sim.domain.AddOnDept;
 import com.ruoyi.sim.domain.Major;
 import com.ruoyi.sim.domain.Student;
 import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysDeptService;
+import com.ruoyi.system.service.ISysUserService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -22,7 +25,7 @@ import java.util.Objects;
 @Service
 public class StudentService {
 
-    private static final Logger log = LoggerFactory.getLogger(StudentService.class);
+    private static final Logger l = LoggerFactory.getLogger(StudentService.class);
 
     @Autowired
     private SysUserMapper userMapper;
@@ -31,21 +34,6 @@ public class StudentService {
     private SysRoleMapper roleMapper;
 
     @Autowired
-    private SysPostMapper postMapper;
-
-    @Autowired
-    private SysUserRoleMapper userRoleMapper;
-
-    @Autowired
-    private SysUserPostMapper userPostMapper;
-
-    @Autowired
-    private ISysConfigService configService;
-
-    @Autowired
-    private ISysDeptService deptService;
-
-    @Autowired
     private AddOnDeptService addOnDeptService;
 
     @Autowired
@@ -54,6 +42,9 @@ public class StudentService {
     @Autowired
     protected Validator validator;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
     // @DataScope(deptAlias = "d", userAlias = "u")
     public List<Student> selectStudentList() {
         SysUser su = new SysUser();
@@ -79,6 +70,55 @@ public class StudentService {
         return list2;
     }
 
+    public void letTry(int code) {
+        List<SysUser> list = null;
+        switch (code) {
+            case 1: {
+                SysUser su = new SysUser();
+                list = userMapper.selectUserList(su);
+            }
+            break;
+            case 2: {
+                PageUtils.startPage();
+                SysUser su = new SysUser();
+                list = userMapper.selectUserList(su);
+            }
+            break;
+            case 3: {
+                list = sysUserService.selectUserList(new SysUser());
+            }
+            break;
+            case 4: {
+                PageUtils.startPage();
+                list = sysUserService.selectUserList(new SysUser());
+            }
+            break;
+            case 5: {
+                list = sysUserService.selectAllocatedList(new SysUser());
+            }
+            break;
+            case 6: {
+                PageUtils.startPage();
+                SysUser su = new SysUser();
+                su.setRoleId(Consts.ROLE_ID_STUDENT);
+                list = sysUserService.selectAllocatedList(su);
+            }
+            break;
+            case 7: {
+                list = sysUserService.selectUnallocatedList(new SysUser());
+            }
+            break;
+            case 8: {
+                PageUtils.startPage();
+                list = sysUserService.selectUnallocatedList(new SysUser());
+            }
+            break;
+        }
+        for (SysUser o : list) {
+            l.info(o.toString());
+        }
+    }
+
 
     public Student selectStudentByUserId(Long userId) {
         SysUser sysUser = userMapper.selectUserById(userId);

+ 1 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TeacherService.java

@@ -2,6 +2,7 @@ package com.ruoyi.sim.service.impl;
 
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.sim.constant.Consts;
 import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysDeptService;

+ 0 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamCollection.xml → ruoyi-sim/src/main/resources/mapper/sim/RealExamCollectionMapper.xml