wangliang vor 4 Jahren
Ursprung
Commit
63fee4da38

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

@@ -12,6 +12,7 @@ import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamQueryDto;
 import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.DownloadFileEnum;
+import com.qmth.themis.business.enums.InvigilateMonitorStatusEnum;
 import com.qmth.themis.business.enums.RoleEnum;
 import com.qmth.themis.business.enums.UploadFileEnum;
 import com.qmth.themis.business.service.*;
@@ -276,17 +277,20 @@ public class SysController {
     @ApiOperation(value = "考试批次查询接口")
     @RequestMapping(value = "/exam/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "角色信息", response = TEExamQueryDto.class)})
-    public Result examQuery(@ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "批次名称", required = false) @RequestParam(required = false) String name) {
+    public Result examQuery(@ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "类型(区分实时监考台和考务)", required = false) @RequestParam(required = false) String type) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         List<TEExam> teExamList = null;
         if (Objects.nonNull(userId) && !Objects.equals(userId, "")) {
-            teExamList = teExamService.examPrivilegeQuery(userId);
+            teExamList = teExamService.examPrivilegeQuery(userId, tbUser.getOrgId(), type);
         } else {
             QueryWrapper<TEExam> teExamQueryWrapper = new QueryWrapper<>();
             teExamQueryWrapper.lambda().eq(TEExam::getOrgId, tbUser.getOrgId());
             if (Objects.nonNull(name) && !Objects.equals(name, "")) {
                 teExamQueryWrapper.lambda().like(TEExam::getName, name);
             }
+            if (Objects.nonNull(type) && !Objects.equals(type, "") && Objects.equals(type, "monitor")) {
+                teExamQueryWrapper.lambda().ne(TEExam::getMonitorStatus, InvigilateMonitorStatusEnum.FINISHED.name());
+            }
             teExamQueryWrapper.lambda().orderByDesc(TEExam::getCreateTime);
             teExamList = teExamService.list(teExamQueryWrapper);
         }

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

@@ -63,9 +63,11 @@ public interface TEExamMapper extends BaseMapper<TEExam> {
      * 考试批次权限过滤
      *
      * @param userId
+     * @param orgId
+     * @param type
      * @return
      */
-    public List<TEExam> examPrivilegeQuery(@Param("userId") Long userId);
+    public List<TEExam> examPrivilegeQuery(@Param("userId") Long userId, @Param("orgId") Long orgId, @Param("type") String type);
 
     public void updateInvigilateMonitorStatus(@Param("monitorStatus") InvigilateMonitorStatusEnum monitorStatus, @Param("examId") Long examId);
 

+ 17 - 13
themis-business/src/main/java/com/qmth/themis/business/service/TEExamService.java

@@ -41,7 +41,7 @@ public interface TEExamService extends IService<TEExam> {
      * @param type
      * @return
      */
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long userId, Long id, String code, String name, String mode, Integer enable, Long orgId,String type);
+    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long userId, Long id, String code, String name, String mode, Integer enable, Long orgId, String type);
 
     /**
      * 获取考试待考列表
@@ -189,21 +189,25 @@ public interface TEExamService extends IService<TEExam> {
      * 考试批次权限过滤
      *
      * @param userId
+     * @param orgId
+     * @param type
      * @return
      */
-    public List<TEExam> examPrivilegeQuery(Long userId);
-    
-	/**重新算分
-	 * @param examId
-	 * @param taskId
-	 */
-	void calculateScore(Long examId, Long taskId);
+    public List<TEExam> examPrivilegeQuery(Long userId, Long orgId, String type);
+
+    /**
+     * 重新算分
+     *
+     * @param examId
+     * @param taskId
+     */
+    void calculateScore(Long examId, Long taskId);
+
+    void updateInvigilateMonitorStatus(InvigilateMonitorStatusEnum monitorStatus, Long examId);
+
+    void updateScoreStatus(ScoreStatusEnum scoreStatus, Long examId);
 
-	void updateInvigilateMonitorStatus(InvigilateMonitorStatusEnum monitorStatus, Long examId);
+    public IPage<OpenExamBean> examQueryForOpen(Page<OpenExamBean> ipage, Long examId, String examCode);
 
-	void updateScoreStatus(ScoreStatusEnum scoreStatus, Long examId);
 
-	public IPage<OpenExamBean> examQueryForOpen(Page<OpenExamBean> ipage, Long examId, String examCode);
-	
-	
 }

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

@@ -1164,11 +1164,13 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      * 考试批次权限过滤
      *
      * @param userId
+     * @param orgId
+     * @param type
      * @return
      */
     @Override
-    public List<TEExam> examPrivilegeQuery(Long userId) {
-        return teExamMapper.examPrivilegeQuery(userId);
+    public List<TEExam> examPrivilegeQuery(Long userId, Long orgId, String type) {
+        return teExamMapper.examPrivilegeQuery(userId,orgId,type);
     }
 
     /**

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

@@ -194,11 +194,18 @@
                 <if test="userId != null and userId != ''">
                     and tbeiu.user_id = #{userId}
                 </if>
+                <if test="orgId != null and orgId != ''">
+                    and tee.org_id = #{orgId}
+                </if>
+                <if test="type != null and type != '' and type == 'monitor'">
+                    and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
+                </if>
                 and tee.id = tbeiu.exam_id
             </where>
                 )
             order by tee.create_time desc
         </select>
+
     <update id="updateInvigilateMonitorStatus">
     	update t_e_exam set monitor_status=#{monitorStatus} where id=#{examId}
     </update>