wangliang il y a 4 ans
Parent
commit
7bde2b0703

+ 3 - 3
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -152,7 +152,7 @@ public class TEExamController {
                     teExamActivityList.forEach(s -> {
                         teExamActivityService.updateExamActivityCacheBean(s.getId());
                     });
-                }else{
+                } else {
                     TEExamActivity teExamActivity = new TEExamActivity(teExam.getId(), teExam.getPrepareSeconds(), teExam.getMaxDurationSeconds(), teExam.getOpeningSeconds(), teExam.getStartTime(), teExam.getEndTime(), tbUser.getId());
                     teExamActivity.setCode(String.valueOf(redisUtil.getRedisActivityCodeSequence()));
                     teExamActivity.setEnable(1);
@@ -205,8 +205,8 @@ public class TEExamController {
     @ApiOperation(value = "考试批次查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试批次信息", response = TEExam.class)})
-    public Result query(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "考试批次编码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "考试批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考试批次模式", required = false) @RequestParam(required = false) String mode, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TEExamQueryDto> teExamQueryDtoIPage = teExamService.examQuery(new Page<>(pageNumber, pageSize), id, code, name, mode, enable);
+    public Result query(@ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "考试批次编码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "考试批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考试批次模式", required = false) @RequestParam(required = false) String mode, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        IPage<TEExamQueryDto> teExamQueryDtoIPage = teExamService.examQuery(new Page<>(pageNumber, pageSize), userId, id, code, name, mode, enable);
         BasePage basePage = new BasePage(teExamQueryDtoIPage.getRecords(), teExamQueryDtoIPage.getCurrent(), teExamQueryDtoIPage.getSize(), teExamQueryDtoIPage.getTotal());
         return ResultUtil.ok(basePage);
     }

+ 6 - 6
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateCallMobileController.java

@@ -66,8 +66,8 @@ public class TIeInvigilateCallMobileController {
     @ApiOperation(value = "监考监控通话查询接口")
     @RequestMapping(value = "/call/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCall.class)})
-    public Result callList(@ApiParam(value = "次id", required = false) @RequestParam(required = false) Long examActivityId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TIeExamInvigilateCall> tIeExamInvigilateCallIPage = tIeExamInvigilateCallService.examInvigilateCallQuery(new Page<>(pageNumber, pageSize), examActivityId, MonitorStatusSourceEnum.START.name());
+    public Result callList(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        IPage<TIeExamInvigilateCall> tIeExamInvigilateCallIPage = tIeExamInvigilateCallService.examInvigilateCallQuery(new Page<>(pageNumber, pageSize), examId, MonitorStatusSourceEnum.START.name());
         BasePage basePage = new BasePage(tIeExamInvigilateCallIPage.getRecords(), tIeExamInvigilateCallIPage.getCurrent(), tIeExamInvigilateCallIPage.getSize(), tIeExamInvigilateCallIPage.getTotal());
         return ResultUtil.ok(basePage);
     }
@@ -75,12 +75,12 @@ public class TIeInvigilateCallMobileController {
     @ApiOperation(value = "监考监控通话提醒接口")
     @RequestMapping(value = "/call/count", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = Integer.class)})
-    public Result callCount(@ApiParam(value = "场次id", required = true) @RequestParam Long examActivityId) {
-        if (Objects.isNull(examActivityId) || Objects.equals(examActivityId, "")) {
-            throw new BusinessException(ExceptionResultEnum.EXAM_ACTIVITY_ID_IS_NULL);
+    public Result callCount(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId) {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
         QueryWrapper<TIeExamInvigilateCall> examInvigilateCallQueryWrapper = new QueryWrapper<>();
-        examInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCall::getExamActivityId, examActivityId).eq(TIeExamInvigilateCall::getStatus, MonitorStatusSourceEnum.START.name());
+        examInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCall::getExamId, examId).eq(TIeExamInvigilateCall::getStatus, MonitorStatusSourceEnum.START.name());
         int count = tIeExamInvigilateCallService.count(examInvigilateCallQueryWrapper);
         return ResultUtil.ok(Collections.singletonMap("count", count));
     }

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamMapper.java

@@ -25,6 +25,7 @@ public interface TEExamMapper extends BaseMapper<TEExam> {
      * 查询考试批次
      *
      * @param iPage
+     * @param userId
      * @param id
      * @param code
      * @param name
@@ -32,7 +33,7 @@ public interface TEExamMapper extends BaseMapper<TEExam> {
      * @param enable
      * @return
      */
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, @Param("id") Long id, @Param("code") String code, @Param("name") String name, @Param("mode") String mode, @Param("enable") Integer enable);
+    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);
 
     /**
      * 获取考试待考列表

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/dao/TIeExamInvigilateCallMapper.java

@@ -22,9 +22,9 @@ public interface TIeExamInvigilateCallMapper extends BaseMapper<TIeExamInvigilat
      * 监考监控通话申请查询
      *
      * @param iPage
-     * @param examActivityId
+     * @param examId
      * @param status
      * @return
      */
-    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, @Param("examActivityId") Long examActivityId, @Param("status") String status);
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, @Param("examId") Long examId, @Param("status") String status);
 }

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TEExamService.java

@@ -27,6 +27,7 @@ public interface TEExamService extends IService<TEExam> {
      * 查询考试批次
      *
      * @param iPage
+     * @param userId
      * @param id
      * @param code
      * @param name
@@ -34,7 +35,7 @@ public interface TEExamService extends IService<TEExam> {
      * @param enable
      * @return
      */
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long id, String code, String name, String mode, Integer enable);
+    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage,Long userId, Long id, String code, String name, String mode, Integer enable);
 
     /**
      * 获取考试待考列表

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/service/TIeExamInvigilateCallService.java

@@ -19,9 +19,9 @@ public interface TIeExamInvigilateCallService extends IService<TIeExamInvigilate
      * 监考监控通话申请查询
      *
      * @param iPage
-     * @param examActivityId
+     * @param examId
      * @param status
      * @return
      */
-    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examActivityId, String status);
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examId, String status);
 }

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -85,6 +85,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      * 查询考试批次
      *
      * @param iPage
+     * @param userId
      * @param id
      * @param code
      * @param name
@@ -93,8 +94,8 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      * @return
      */
     @Override
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long id, String code, String name, String mode, Integer enable) {
-        return teExamMapper.examQuery(iPage, id, code, name, mode, enable);
+    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long userId, Long id, String code, String name, String mode, Integer enable) {
+        return teExamMapper.examQuery(iPage, userId, id, code, name, mode, enable);
     }
 
     /**

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeExamInvigilateCallServiceImpl.java

@@ -24,7 +24,7 @@ public class TIeExamInvigilateCallServiceImpl extends ServiceImpl<TIeExamInvigil
     TIeExamInvigilateCallMapper tIeExamInvigilateCallMapper;
 
     @Override
-    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examActivityId, String status) {
-        return tIeExamInvigilateCallMapper.examInvigilateCallQuery(iPage, examActivityId, status);
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examId, String status) {
+        return tIeExamInvigilateCallMapper.examInvigilateCallQuery(iPage, examId, status);
     }
 }

+ 13 - 1
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -64,7 +64,19 @@
         where
         t1.id = t.update_id) as updateName
         from t_e_exam t
-        <where>
+        <where> 1 = 1
+            <if test="userId != null and userId != ''">
+                EXISTS(
+                select
+                DISTINCT tees.exam_id
+                from
+                t_b_exam_invigilate_user tbeiu
+                left join t_e_exam_student tees on
+                tees.room_code = tbeiu.room_code
+                where
+                tbeiu.user_id = #{userId}
+                and t.id = tees.exam_id)
+            </if>
             <if test="id != null and id != ''">
                 and t.id = #{id}
             </if>

+ 2 - 2
themis-business/src/main/resources/mapper/TIeExamInvigilateCallMapper.xml

@@ -8,8 +8,8 @@
         from
             t_ie_exam_invigilate_call tieic
         <where>
-            <if test="examActivityId != null and examActivityId != ''">
-                and tieic.exam_activity_id = #{examActivityId}
+            <if test="examId != null and examId != ''">
+                and tieic.exam_id = #{examId}
             </if>
             <if test="status != null and status != ''">
                 and tieic.status = #{status}