ソースを参照

Merge branch 'dev_v1.2.0' into release_v1.2.0
merge

wangliang 2 年 前
コミット
8b7699d309

+ 14 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TBUserController.java

@@ -762,7 +762,7 @@ public class TBUserController {
     @Transactional
     public Result userUpdatePwd(@ApiJsonObject(name = "userUpdatePwd", value = {
             @ApiJsonProperty(key = "id", type = "long", example = "1", description = "用户ID"),
-            @ApiJsonProperty(key = "password", description = "新密码")}) @ApiParam(value = "用户信息", required = true) @RequestBody Map<String, Object> mapParameter) {
+            @ApiJsonProperty(key = "password", description = "新密码")}) @ApiParam(value = "用户信息", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException {
         if (Objects.isNull(mapParameter.get(SystemConstant.ID)) || Objects.equals(mapParameter.get(SystemConstant.ID), "")) {
             throw new BusinessException(ExceptionResultEnum.USER_ID_IS_NULL);
         }
@@ -779,7 +779,20 @@ public class TBUserController {
         tbUser.setPassword(password);
         tbUser.setUpdateId(currentUser.getId());
         tbUserService.updateById(tbUser);
+
+        AuthDto authDto = cacheService.addAccountAuthCache(tbUser.getId());
+        if (Objects.nonNull(authDto)) {
+            for (Source s : Source.values()) {
+                String sessionId = SessionUtil
+                        .digest(tbUser.getId(), Math.abs(authDto.getRoleCodes().toString().hashCode()), s.name());
+                if (Objects.nonNull(redisUtil.getUserSession(sessionId))) {
+                    redisUtil.deleteUserSession(sessionId);
+                }
+            }
+        }
+
         cacheService.removeAccountCache(tbUser.getId());
+        cacheService.removeAccountAuthCache(tbUser.getId());
         return ResultUtil.ok(true);
     }
 }

+ 7 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -295,6 +295,13 @@ public class TEExamController {
                         type));
     }
 
+    @ApiOperation(value = "根据考试批次编码查询考场接口")
+    @RequestMapping(value = "/examroom/query", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "考试批次信息", response = TEExam.class)})
+    public Result examroomQuery(@ApiParam(value = "考试批次编码", required = true) @RequestParam String code) {
+        return ResultUtil.ok(teExamService.examroomQuery(code));
+    }
+
     @ApiOperation(value = "考试批次停用/启用接口")
     @RequestMapping(value = "/toggle", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})

+ 2 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -321,8 +321,8 @@ public class TIeInvigilateController {
         QueryWrapper<TEExamStudentLog> teExamStudentLogQueryWrapper = new QueryWrapper<>();
         teExamStudentLogQueryWrapper.lambda().eq(TEExamStudentLog::getExamStudentId, examStudentId)
                 .eq(TEExamStudentLog::getExamRecordId, examRecordId)
-                .ne(TEExamStudentLog::getType, SystemOperationEnum.BREACH_HANDLE.name())
-                .ne(TEExamStudentLog::getType, SystemOperationEnum.BREACH_REVOKE.name())
+//                .ne(TEExamStudentLog::getType, SystemOperationEnum.BREACH_HANDLE.name())
+//                .ne(TEExamStudentLog::getType, SystemOperationEnum.BREACH_REVOKE.name())
                 .orderByAsc(TEExamStudentLog::getCreateTime);
 //                .and(w -> w.ne(TEExamStudentLog::getType, SystemOperationEnum.BREACH_HANDLE.name()).or().ne(TEExamStudentLog::getType, SystemOperationEnum.BREACH_REVOKE.name()));
         List<TEExamStudentLog> teExamStudentLogList = teExamStudentLogService.list(teExamStudentLogQueryWrapper);

+ 8 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamMapper.java

@@ -40,6 +40,14 @@ public interface TEExamMapper extends BaseMapper<TEExam> {
      */
     public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, @Param("userId") Long userId, @Param("id") Long id, @Param("code") String code, @Param("name") String name, @Param("mode") String mode, @Param("enable") Integer enable, @Param("orgId") Long orgId, @Param("type") String type);
 
+    /**
+     * 根据考试批次编码查询考场接口
+     *
+     * @param code
+     * @return
+     */
+    public List<Map> examroomQuery(@Param("code") String code);
+
     /**
      * 获取考试待考列表
      *

+ 8 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TEExamService.java

@@ -43,6 +43,14 @@ public interface TEExamService extends IService<TEExam> {
      */
     public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long userId, Long id, String code, String name, String mode, Integer enable, Long orgId, String type);
 
+    /**
+     * 根据考试批次编码查询考场接口
+     *
+     * @param code
+     * @return
+     */
+    public List<Map> examroomQuery(String code);
+
     /**
      * 获取考试待考列表
      *

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -139,6 +139,17 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         return teExamMapper.examQuery(iPage, userId, id, code, name, mode, enable, orgId, type);
     }
 
+    /**
+     * 根据考试批次编码查询考场接口
+     *
+     * @param code
+     * @return
+     */
+    @Override
+    public List<Map> examroomQuery(String code) {
+        return teExamMapper.examroomQuery(code);
+    }
+
     /**
      * 获取考试待考列表
      *

+ 18 - 0
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -140,6 +140,24 @@
         order by t.createTime desc
     </select>
 
+    <select id="examroomQuery" resultType="java.util.HashMap">
+     select
+        distinct tees.room_code as roomCode,
+        tees.room_name as roomName
+        from
+        t_e_exam t
+        left join t_e_exam_student tees on
+        tees.exam_id = t.id
+        WHERE 1 = 1
+        <if test="code != null and code != ''">
+            and t.code = #{code}
+        </if>
+        and t.monitor_status <![CDATA[ <> ]]> 'FINISHED'
+        and t.start_time <![CDATA[ <= ]]> unix_timestamp(current_timestamp()) * 1000
+        and t.enable = 1
+        order by tees.room_code
+    </select>
+
     <select id="getWaitingExam" resultType="com.qmth.themis.business.dto.response.TEExamWaitDto">
         select
         t.*