diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java index 4718df5..7bc51c4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java @@ -1,6 +1,8 @@ package com.ruoyi.web.controller.manager; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.domain.check.TdCheckReport; import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; @@ -50,7 +52,9 @@ public class UserExamManager { * @return java.util.List */ public List selectExamList(UserExamReqDTO reqDTO) { - reqDTO.setUserId(getUserId()); + if (!SysUser.isAdmin(ShiroUtils.getUserId())){ + reqDTO.setUserId(getUserId()); + } return elUserExamService.selectExamList(reqDTO); } @@ -77,11 +81,14 @@ public class UserExamManager { record.setExamId(examId); record.setMaxScore(score); record.setPassed(passed); + record.setTryCount(1); elUserExamService.save(record); return; } // 修复低分数不加入统计问题 - record.setTryCount(record.getTryCount()+1); + if(Objects.nonNull(record.getTryCount())){ + record.setTryCount(record.getTryCount()+1); + } record.setUpdateTime(new Date()); if(record.getMaxScore() < score){ record.setMaxScore(score);