Browse Source

去掉多余代码

wangliang 2 years ago
parent
commit
355982e979
26 changed files with 29 additions and 1015 deletions
  1. 0 6
      themis-admin/src/main/java/com/qmth/themis/admin/start/StartRunning.java
  2. 0 259
      themis-admin/src/main/java/com/qmth/themis/admin/websocket/WebSocketAdminServer.java
  3. 0 54
      themis-admin/src/main/java/com/qmth/themis/admin/websocket/interceptor/WebSocketAdminHandshakeInterceptor.java
  4. 0 45
      themis-admin/src/main/java/com/qmth/themis/admin/websocketTemplete/WebSocketAdminMessageTemplete.java
  5. 7 1
      themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java
  6. 0 5
      themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java
  7. 0 68
      themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java
  8. 0 5
      themis-business/src/main/java/com/qmth/themis/business/service/TEExamBreachLogService.java
  9. 0 5
      themis-business/src/main/java/com/qmth/themis/business/service/TEExamCourseService.java
  10. 0 2
      themis-business/src/main/java/com/qmth/themis/business/service/TEExamStudentService.java
  11. 0 59
      themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java
  12. 0 7
      themis-business/src/main/java/com/qmth/themis/business/service/WarningService.java
  13. 0 73
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamBreachLogServiceImpl.java
  14. 0 8
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamCourseServiceImpl.java
  15. 4 5
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java
  16. 0 8
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamStudentServiceImpl.java
  17. 3 108
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java
  18. 0 10
      themis-business/src/main/java/com/qmth/themis/business/service/impl/WarningServiceImpl.java
  19. 6 10
      themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskExamPaperImportTemplete.java
  20. 0 66
      themis-business/src/main/resources/mapper/TEExamStudentMapper.xml
  21. 0 199
      themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml
  22. 2 0
      themis-common/src/main/java/com/qmth/themis/common/contanst/Constants.java
  23. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketMobileServer.java
  24. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketOeServer.java
  25. 4 6
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/interceptor/WebSocketMobileHandshakeInterceptor.java
  26. 1 4
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/interceptor/WebSocketOeHandshakeInterceptor.java

+ 0 - 6
themis-admin/src/main/java/com/qmth/themis/admin/start/StartRunning.java

@@ -17,12 +17,6 @@ import org.springframework.stereotype.Component;
 public class StartRunning implements CommandLineRunner {
     private final static Logger log = LoggerFactory.getLogger(StartRunning.class);
 
-//    @Resource
-//    RocketMessageConsumer rocketMessageConsumer;
-
-//    @Value("${rocketmq.name-server}")
-//    String nameServer;
-
     @Override
     public void run(String... args) throws Exception {
         log.info("服务器启动时执行 start");

+ 0 - 259
themis-admin/src/main/java/com/qmth/themis/admin/websocket/WebSocketAdminServer.java

@@ -1,259 +0,0 @@
-package com.qmth.themis.admin.websocket;
-
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.Gson;
-import com.qmth.themis.admin.websocket.interceptor.WebSocketAdminHandshakeInterceptor;
-import com.qmth.themis.admin.websocketTemplete.WebSocketAdminMessageTemplete;
-import com.qmth.themis.business.constant.SpringContextHolder;
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.dto.WebsocketDto;
-import com.qmth.themis.business.entity.TBSession;
-import com.qmth.themis.business.enums.WebsocketTypeEnum;
-import com.qmth.themis.business.util.JacksonUtil;
-import com.qmth.themis.business.util.RedisUtil;
-import com.qmth.themis.business.util.UidUtil;
-import com.qmth.themis.business.util.WebsocketUtil;
-import com.qmth.themis.common.contanst.Constants;
-import com.qmth.themis.common.enums.ExceptionResultEnum;
-import com.qmth.themis.common.exception.BusinessException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.*;
-import javax.websocket.server.ServerEndpoint;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.net.InetSocketAddress;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * @Description: websocker管理端
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/10
- */
-@ServerEndpoint(value = "/ws/admin", configurator = WebSocketAdminHandshakeInterceptor.class)
-@Component
-public class WebSocketAdminServer
-//        implements Orderly
-{
-    private final static Logger log = LoggerFactory.getLogger(WebSocketAdminServer.class);
-    public volatile static ConcurrentHashMap<Long, WebSocketAdminServer> webSocketMap = new ConcurrentHashMap<>();
-    /**
-     * 与某个客户端的连接会话,需要通过它来给客户端发送数据
-     */
-    private Session session = null;
-    private String sessionId = null, ip = null, deviceId = null, websocketSessionId = null;
-    private Long userId = null, updateTime = null;
-    private RedisUtil redisUtil;
-    private Map<String, Object> tranMap = null;
-
-    /**
-     * 连接建立成功调用的方法
-     */
-    @OnOpen
-    public void onOpen(Session session) {
-        this.redisUtil = SpringContextHolder.getBean(RedisUtil.class);
-        this.userId = (Long) session.getUserProperties().get(Constants.HEADER_USER_ID);
-        this.deviceId = (String) session.getUserProperties().get(Constants.HEADER_DEVICE_ID);
-        TBSession tbSession = (TBSession) session.getUserProperties().get(Constants.HEADER_TB_SESSION);
-        session.setMaxIdleTimeout(SystemConstant.WEBSOCKET_MAX_TIME_OUT);
-        this.sessionId = tbSession.getId();
-        websocketSessionId = String.valueOf(UidUtil.nextId());
-        if (webSocketMap.containsKey(this.userId)) {
-            throw new BusinessException(ExceptionResultEnum.REPEAT_CONNECT_ERROR);
-        } else {
-            webSocketMap.put(this.userId, this);
-            addOnlineCount();
-        }
-        log.info("用户连接:{},当前在线人数为:{}", this.websocketSessionId, getOnlineCount());
-        InetSocketAddress addr = (InetSocketAddress) WebsocketUtil.getFieldInstance(this.session.getAsyncRemote(), "base#socketWrapper#socket#sc#remoteAddress");
-        this.ip = addr.toString().replace("/", "").split(":")[0];
-        log.info("ip[:{}]连接成功", this.ip);
-        this.updateTime = System.currentTimeMillis();
-        tranMap = WebsocketUtil.initWebsocket(null, userId, deviceId, ip, updateTime);
-    }
-
-    /**
-     * 连接关闭调用的方法
-     */
-    @OnClose
-    public void onClose() {
-        log.info("onClose is come in");
-        if (webSocketMap.containsKey(this.userId)) {
-            webSocketMap.remove(this.userId);
-            //从set中删除
-            subOnlineCount();
-            //管理端无需发送延时mq消息
-        }
-        log.info("用户退出:{},当前在线人数为:{},updateTime:{}", this.websocketSessionId, getOnlineCount(), this.updateTime);
-    }
-
-    /**
-     * 收到客户端消息后调用的方法
-     *
-     * @param message
-     * @param session
-     */
-    @OnMessage
-    public void onMessage(String message, Session session) {
-        //可以群发消息
-        //消息保存到数据库、redis
-        if (Objects.nonNull(message) && session.isOpen()) {
-            try {
-                //解析发送的报文
-                JSONObject jsonObject = JSONObject.parseObject(message);
-                log.info("onMessage:{}", jsonObject.toJSONString());
-                if (Objects.nonNull(jsonObject)) {
-                    WebSocketAdminMessageTemplete webSocketAdminMessageTemplete = SpringContextHolder.getBean(WebSocketAdminMessageTemplete.class);
-                    Gson gson = new Gson();
-                    WebsocketDto websocketDto = gson.fromJson(gson.toJson(jsonObject), WebsocketDto.class);
-                    Method method = webSocketAdminMessageTemplete.getClass().getDeclaredMethod(WebsocketTypeEnum.valueOf(websocketDto.getType().toUpperCase()).getDesc(), String.class, Long.class);
-                    WebsocketDto result = (WebsocketDto) method.invoke(webSocketAdminMessageTemplete, String.valueOf(websocketDto.getBody()), websocketDto.getTime());
-                    this.sendMessage(result);
-                }
-            } catch (Exception e) {
-                log.error(SystemConstant.LOG_ERROR, e);
-            }
-        }
-    }
-
-    /**
-     * 错误
-     *
-     * @param session
-     * @param error
-     */
-    @OnError
-    public void onError(Session session, Throwable error) throws IOException {
-        log.error("用户错误:{},原因:{}", this.websocketSessionId, error.getMessage());
-        close(this);
-        throw new BusinessException(error.getMessage());
-    }
-
-    /**
-     * 实现服务器主动推送
-     *
-     * @param message
-     * @throws IOException
-     */
-    public void sendMessage(Object message) {
-        log.info("message:{}", message);
-        this.session.getAsyncRemote().sendText(JacksonUtil.parseJson(message));
-        this.updateTime = System.currentTimeMillis();
-    }
-
-    /**
-     * 获取在线人数
-     *
-     * @return
-     */
-    public synchronized int getOnlineCount() {
-        Object o = redisUtil.get(SystemConstant.WEBSOCKET_ADMIN_ONLINE_COUNT);
-        return Objects.isNull(o) ? 0 : (int) o;
-    }
-
-    /**
-     * 在线人数加一
-     */
-    public synchronized void addOnlineCount() {
-        if (redisUtil.lock(SystemConstant.REDIS_LOCK_WEBSOCKET_PREFIX + this.websocketSessionId, SystemConstant.REDIS_LOCK_WEBSOCKET_TIME_OUT)) {
-            try {
-                Object o = redisUtil.get(SystemConstant.WEBSOCKET_ADMIN_ONLINE_COUNT);
-                int count = 0;
-                if (Objects.nonNull(o)) {
-                    count = (int) o;
-                }
-                count++;
-                redisUtil.set(SystemConstant.WEBSOCKET_ADMIN_ONLINE_COUNT, count);
-            } finally {
-                if (Objects.nonNull(this.websocketSessionId)) {
-                    redisUtil.releaseLock(SystemConstant.REDIS_LOCK_WEBSOCKET_PREFIX + this.websocketSessionId);
-                }
-            }
-        }
-    }
-
-    /**
-     * 在线人数减一
-     */
-    public synchronized void subOnlineCount() {
-        if (redisUtil.lock(SystemConstant.REDIS_LOCK_WEBSOCKET_PREFIX + this.websocketSessionId, SystemConstant.REDIS_LOCK_WEBSOCKET_TIME_OUT)) {
-            try {
-                Object o = redisUtil.get(SystemConstant.WEBSOCKET_ADMIN_ONLINE_COUNT);
-                int count = 0;
-                if (Objects.nonNull(o)) {
-                    count = (int) o;
-                }
-                count--;
-                redisUtil.set(SystemConstant.WEBSOCKET_ADMIN_ONLINE_COUNT, count < 0 ? 0 : count);
-            } finally {
-                if (Objects.nonNull(this.websocketSessionId)) {
-                    redisUtil.releaseLock(SystemConstant.REDIS_LOCK_WEBSOCKET_PREFIX + this.websocketSessionId);
-                }
-            }
-        }
-    }
-
-//    @Override
-//    public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext consumeOrderlyContext) {
-//        RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
-//        MqAdminLogicService mqAdminLogicService = SpringContextHolder.getBean(MqAdminLogicService.class);
-//        MqDto mqDto = null;
-//        try {
-//            long threadId = Thread.currentThread().getId();
-//            String threadName = Thread.currentThread().getName();
-//            for (MessageExt messageExt : msgs) {
-//                log.info(":{}-:{} websocket oe Consumer重试次数:{}", threadId, threadName, messageExt.getReconsumeTimes());
-//                mqDto = JacksonUtil.readJson(new String(messageExt.getBody(), Constants.CHARSET), MqDto.class);
-//                log.info(":{}-:{} websocket oe Consumer接收到的消息:{}", threadId, threadName, JacksonUtil.parseJson(mqDto));
-//                int reconsumeTime = messageExt.getReconsumeTimes();
-//                if (reconsumeTime >= SystemConstant.MAXRECONSUMETIMES) {
-//                    mqAdminLogicService.execMqMaxReconsumeTime(mqDto, SystemConstant.MQ_TOPIC_BUFFER_LIST);
-//                } else {
-//                    if (Objects.nonNull(mqDto.getAck()) && mqDto.getAck().intValue() != SystemConstant.STANDARD_ACK_TYPE && Objects.nonNull(redisUtil.get(SystemConstant.MQ_TOPIC_BUFFER_LIST, mqDto.getId())) && redisUtil.lock(SystemConstant.REDIS_LOCK_MQ_PREFIX + mqDto.getId(), SystemConstant.REDIS_LOCK_MQ_TIME_OUT)) {
-//                        mqAdminLogicService.execMqAdminLogic(mqDto, SystemConstant.MQ_TOPIC_BUFFER_LIST);
-//                        return ConsumeOrderlyStatus.SUCCESS;
-//                    } else {
-//                        log.info(":{}-:{} 消息ack未确认,重发", threadId, threadName);
-//                        return ConsumeConcurrentlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;//重试
-//                    }
-//                }
-//            }
-//        } catch (Exception e) {
-//            log.error("mq websocket admin,消息消费出错", e);
-//            e.printStackTrace();
-//            return ConsumeOrderlyStatus.RECONSUME_LATER;//重试
-//        } finally {
-//            if (Objects.nonNull(mqDto)) {
-//                redisUtil.releaseLock(SystemConstant.REDIS_LOCK_MQ_PREFIX + mqDto.getId());
-//            }
-//        }
-//        return ConsumeOrderlyStatus.SUCCESS;//成功
-//    }
-
-    /**
-     * 关闭session
-     *
-     * @param webSocketAdminServer
-     */
-    public static void close(WebSocketAdminServer webSocketAdminServer) throws IOException {
-        //判断当前连接是否还在线
-        if (Objects.nonNull(webSocketAdminServer) && Objects.nonNull(webSocketAdminServer.session) && webSocketAdminServer.session.isOpen()) {
-            webSocketAdminServer.session.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, SystemConstant.WEBSOCKET_CLOSE));
-        }
-    }
-
-    public static ConcurrentHashMap<Long, WebSocketAdminServer> getWebSocketMap() {
-        return webSocketMap;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-}
-

+ 0 - 54
themis-admin/src/main/java/com/qmth/themis/admin/websocket/interceptor/WebSocketAdminHandshakeInterceptor.java

@@ -1,54 +0,0 @@
-package com.qmth.themis.admin.websocket.interceptor;
-
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.entity.TBSession;
-import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
-import com.qmth.themis.business.util.AuthUtil;
-import com.qmth.themis.common.contanst.Constants;
-import com.qmth.themis.common.enums.ExceptionResultEnum;
-import com.qmth.themis.common.enums.Platform;
-import com.qmth.themis.common.exception.BusinessException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.websocket.HandshakeResponse;
-import javax.websocket.server.HandshakeRequest;
-import javax.websocket.server.ServerEndpointConfig;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * @Description: websocket后台
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/10
- */
-public class WebSocketAdminHandshakeInterceptor extends ServerEndpointConfig.Configurator {
-    private final static Logger log = LoggerFactory.getLogger(WebSocketAdminHandshakeInterceptor.class);
-
-    public static final String url = "/ws/admin";
-
-    @Override
-    public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
-        Map<String, List<String>> mapParameter = request.getParameterMap();
-        if (Objects.isNull(mapParameter.get(Constants.HEADER_PLATFORM)) || mapParameter.get(Constants.HEADER_PLATFORM).size() == 0) {
-            throw new BusinessException(ExceptionResultEnum.PLATFORM_INVALID);
-        }
-        Platform platform = Platform.valueOf(mapParameter.get(Constants.HEADER_PLATFORM).get(0));
-        if (Objects.isNull(mapParameter.get(Constants.HEADER_DEVICE_ID)) || mapParameter.get(Constants.HEADER_DEVICE_ID).size() == 0) {
-            throw new BusinessException(ExceptionResultEnum.DEVICE_ID_INVALID);
-        }
-        String deviceId = mapParameter.get(Constants.HEADER_DEVICE_ID).get(0);
-        String authorization = mapParameter.get(Constants.HEADER_AUTHORIZATION).get(0);
-        Long time = Long.parseLong(mapParameter.get(Constants.HEADER_TIME).get(0));
-        Long userId = Long.parseLong(mapParameter.get(Constants.HEADER_USER_ID).get(0));
-        MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(mapParameter.get(Constants.HEADER_SOURCE).get(0));
-
-        TBSession tbSession = AuthUtil.websocketAuthInterceptor(platform, deviceId, authorization, time, SystemConstant.GET, url);
-        config.getUserProperties().put(Constants.HEADER_USER_ID, userId);
-        config.getUserProperties().put(Constants.HEADER_DEVICE_ID, deviceId);
-        config.getUserProperties().put(Constants.HEADER_TB_SESSION, tbSession);
-    }
-}

+ 0 - 45
themis-admin/src/main/java/com/qmth/themis/admin/websocketTemplete/WebSocketAdminMessageTemplete.java

@@ -1,45 +0,0 @@
-package com.qmth.themis.admin.websocketTemplete;
-
-import com.alibaba.fastjson.JSONObject;
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.dto.WebsocketDto;
-import com.qmth.themis.business.enums.WebsocketTypeEnum;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import java.util.Collections;
-
-/**
- * @Description: 管理端websocket模版
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/24
- */
-@Component
-public class WebSocketAdminMessageTemplete {
-    private final static Logger log = LoggerFactory.getLogger(WebSocketAdminMessageTemplete.class);
-
-    /**
-     * 状态同步
-     *
-     * @param body
-     * @param time
-     * @return
-     */
-    public WebsocketDto syncStatus(String body, Long time) {
-        JSONObject jsonObject = JSONObject.parseObject(body);
-        log.info("syncStatus jsonObject:{}", jsonObject.toJSONString());
-        return this.syncAck(body, time);
-    }
-
-    /**
-     * 同步确认
-     *
-     * @return
-     */
-    public WebsocketDto syncAck(String body, Long time) {
-        return new WebsocketDto(WebsocketTypeEnum.convertToName(Thread.currentThread().getStackTrace()[1].getMethodName()), Collections.singletonMap(SystemConstant.ACK_MESSAGE, time));
-    }
-}

+ 7 - 1
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -35,6 +35,8 @@ public class SystemConstant {
 
     public static final String PATTERN = "^[A-Za-z0-9]*";
 
+    public static final String PATTERN_NUMBER = "^[0-9]*$";
+
     /**
      * 鉴权
      */
@@ -64,6 +66,10 @@ public class SystemConstant {
     /**
      * 腾讯云
      */
+    //    public static final String TENCENT_APPID = "appId";
+
+    //    public static final String TENCENT_KEY = "key";
+
     public static final long TENCENT_EXPIRE_TIME = 24 * 3600 * 30;//30天过期
 
     public static final String HEADER_AUTHORIZATION = "Authorization";
@@ -712,7 +718,7 @@ public class SystemConstant {
      * @return
      */
     public static boolean checkNumber(String str) {
-        Pattern pattern = Pattern.compile("^[0-9]*$");
+        Pattern pattern = Pattern.compile(PATTERN_NUMBER);
         Matcher matcher = pattern.matcher(str.trim());
         return matcher.matches();
     }

+ 0 - 5
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java

@@ -73,11 +73,6 @@ public interface TEExamStudentMapper extends CustomBaseMapper<TEExamStudent> {
                                                               @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 
 
-    public List<TEExamStudentDto> examStudentList(@Param("examId") Long examId,
-                                                  @Param("activityId") Long activityId, @Param("identity") String identity, @Param("name") String name,
-                                                  @Param("roomCode") String roomCode, @Param("courseCode") String courseCode, @Param("grade") String grade,
-                                                  @Param("enable") Integer enable, @Param("classNo") String classNo, @Param("hasPhoto") Integer hasPhoto);
-
     public void updateAlreadyExamCount(@Param("examStudentId") Long examStudentId, @Param("alreadyExamCount") Integer alreadyExamCount);
 
     public void updateCurrentRecordId(@Param("examStudentId") Long examStudentId, @Param("currentRecordId") Long currentRecordId);

+ 0 - 68
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -23,56 +23,6 @@ import java.util.Set;
 @Mapper
 public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
 
-    /**
-     * 获取考试未完列表
-     *
-     * @param studentId
-     * @param examId
-     * @param orgId
-     * @return
-     */
-    public TEExamUnFinishDto getUnFinishExam(@Param("studentId") Long studentId, @Param("examId") Long examId, @Param("orgId") Long orgId);
-
-    /**
-     * 数据更新
-     *
-     * @param recordId
-     * @param colName
-     * @param colValue
-     */
-    public void dataUpdate(@Param("recordId") Long recordId, @Param("colName") String colName, @Param("colValue") Object colValue);
-
-    /**
-     * 查询实时监控台列表
-     *
-     * @param iPage
-     * @param examId
-     * @param examActivityId
-     * @param roomCode
-     * @param paperDownload
-     * @param status
-     * @param name
-     * @param identity
-     * @param minWarningCount
-     * @param maxWarningCount
-     * @param clientWebsocketStatus
-     * @param monitorStatusSource
-     * @param userId
-     * @return
-     */
-    public IPage<InvigilateListBean> invigilatePageList(IPage<Map> iPage, @Param("examId") Long examId,
-                                                        @Param("examActivityId") Long examActivityId,
-                                                        @Param("roomCode") String roomCode,
-                                                        @Param("paperDownload") Integer paperDownload,
-                                                        @Param("status") String status,
-                                                        @Param("name") String name,
-                                                        @Param("identity") String identity,
-                                                        @Param("minWarningCount") Integer minWarningCount,
-                                                        @Param("maxWarningCount") Integer maxWarningCount,
-                                                        @Param("clientWebsocketStatus") String clientWebsocketStatus,
-                                                        @Param("monitorStatusSource") String monitorStatusSource,
-                                                        @Param("userId") Long userId);
-
     /**
      * 查询实时监控台视频列表
      *
@@ -439,24 +389,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      */
     List<Integer> findByOnlineInfo(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet);
 
-    /**
-     * 查找在线消息
-     *
-     * @param examId
-     * @param roomCodeSet
-     * @return
-     */
-    List<TOeExamRecord> findByOnlineInfoRecord(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet);
-
-    /**
-     * 监考结束
-     *
-     * @param examId
-     * @param roomCodeSet
-     * @return
-     */
-    List<Integer> findByFinish(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet);
-
     /**
      * 管理员报表
      *

+ 0 - 5
themis-business/src/main/java/com/qmth/themis/business/service/TEExamBreachLogService.java

@@ -15,9 +15,4 @@ import java.util.Map;
  */
 public interface TEExamBreachLogService extends IService<TEExamBreachLog> {
 
-    /**
-     * 违纪处理
-     * @param mapParameter
-     */
-    void breachOper(Map<String, Object> mapParameter);
 }

+ 0 - 5
themis-business/src/main/java/com/qmth/themis/business/service/TEExamCourseService.java

@@ -33,7 +33,6 @@ public interface TEExamCourseService extends IService<TEExamCourse> {
      */
     public IPage<TEExamCourseDto> examCourseQuery(IPage<Map> iPage, Long id, Long examId, String courseCode, String courseName, Integer hasPaper);
 
-
     ExamCourseCacheBean getExamCourseCacheBean(Long examId, String courseCode);
 
     /**
@@ -55,10 +54,6 @@ public interface TEExamCourseService extends IService<TEExamCourse> {
 
     TEExamCourse findByExamIdAndCourseCode(Long examId, String courseCode);
 
-
-	List<TEExamCourse> findByExamId(Long examId);
-
-
 	public IPage<OpenExamCourseBean> examCourseQueryForOpen(Page<OpenExamCourseBean> ipage, Long examId,
 			String courseCode, Boolean hasPaper);
 }

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

@@ -38,8 +38,6 @@ public interface TEExamStudentService extends IService<TEExamStudent> {
      */
     public IPage<TEExamStudentDto> examStudentQuery(IPage<Map> iPage, Long examId, Long examActivityId, String identity, String name, String roomCode, String courseCode, String grade, Integer enable, String classNo, Integer hasPhoto);
 
-    public List<TEExamStudentDto> examStudentList(Long examId, Long examActivityId, String identity, String name, String roomCode, String courseCode, String grade, Integer enable, String classNo, Integer hasPhoto);
-
     ExamStudentCacheBean getExamStudentCacheBean(Long examStudentId);
 
     /**

+ 0 - 59
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -23,16 +23,6 @@ import java.util.Set;
  */
 public interface TOeExamRecordService extends IService<TOeExamRecord> {
 
-    /**
-     * 获取考试未完列表
-     *
-     * @param studentId
-     * @param examId
-     * @param orgId
-     * @return
-     */
-    public Map getUnFinishExam(Long studentId, Long examId, Long orgId);
-
     Long saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId, Integer serialNumber, Long studentId);
 
     /**
@@ -70,37 +60,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      */
     void sendExamRecordDataSaveMq(Long recordId, Long timestamp);
 
-    /**
-     * 查询实时监控台列表
-     *
-     * @param iPage
-     * @param examId
-     * @param examActivityId
-     * @param roomCode
-     * @param paperDownload
-     * @param status
-     * @param name
-     * @param identity
-     * @param minWarningCount
-     * @param maxWarningCount
-     * @param clientWebsocketStatus
-     * @param monitorStatusSource
-     * @param userId
-     * @return
-     */
-    public IPage<InvigilateListBean> invigilatePageList(IPage<Map> iPage, Long examId,
-                                                        Long examActivityId,
-                                                        String roomCode,
-                                                        Integer paperDownload,
-                                                        String status,
-                                                        String name,
-                                                        String identity,
-                                                        Integer minWarningCount,
-                                                        Integer maxWarningCount,
-                                                        String clientWebsocketStatus,
-                                                        String monitorStatusSource,
-                                                        Long userId);
-
     /**
      * 查询实时监控台视频列表
      *
@@ -476,24 +435,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      */
     List<Integer> findByOnlineInfo(Long examId, Set<String> roomCodeSet);
 
-    /**
-     * 查找在线消息
-     *
-     * @param examId
-     * @param roomCodeSet
-     * @return
-     */
-    List<TOeExamRecord> findByOnlineInfoRecord(Long examId, Set<String> roomCodeSet);
-
-    /**
-     * 监考结束
-     *
-     * @param examId
-     * @param roomCodeSet
-     * @return
-     */
-    List<Integer> findByFinish(Long examId, Set<String> roomCodeSet);
-
     /**
      * 管理员报表
      *

+ 0 - 7
themis-business/src/main/java/com/qmth/themis/business/service/WarningService.java

@@ -32,13 +32,6 @@ public interface WarningService {
      */
     public void eyeCloseError(WarningDto warningDto);
 
-    /**
-     * 活体动作异常
-     *
-     * @param warningDto
-     */
-    public void livenessActionError(WarningDto warningDto);
-
     /**
      * 真实性异常
      *

+ 0 - 73
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamBreachLogServiceImpl.java

@@ -1,26 +1,10 @@
 package com.qmth.themis.business.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.themis.business.cache.ExamRecordCacheUtil;
-import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dao.TEExamBreachLogMapper;
-import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEExamBreachLog;
-import com.qmth.themis.business.entity.TOeExamRecord;
-import com.qmth.themis.business.enums.BreachCancelTypeEnum;
-import com.qmth.themis.business.enums.BreachTypeEnum;
 import com.qmth.themis.business.service.TEExamBreachLogService;
-import com.qmth.themis.business.service.TOeExamRecordService;
-import com.qmth.themis.business.util.ServletUtil;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 
 /**
  * @Description: 考生违纪处理 服务实现类
@@ -32,61 +16,4 @@ import java.util.Objects;
 @Service
 public class TEExamBreachLogServiceImpl extends ServiceImpl<TEExamBreachLogMapper, TEExamBreachLog> implements TEExamBreachLogService {
 
-    @Resource
-    TOeExamRecordService tOeExamRecordService;
-
-    /**
-     * 违纪处理
-     *
-     * @param mapParameter
-     */
-    @Override
-    @Transactional
-    public void breachOper(Map<String, Object> mapParameter) {
-        Integer status = Integer.parseInt(String.valueOf(mapParameter.get(SystemConstant.STATUS)));
-        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        List<String> recordIdList = (List<String>) mapParameter.get(SystemConstant.EXAM_RECORD_ID);
-        List<TEExamBreachLog> teExamBreachLogList = new ArrayList<>();
-        if (status == 0) {//新建违纪
-            BreachTypeEnum type = BreachTypeEnum.valueOf(String.valueOf(mapParameter.get(SystemConstant.TYPE)));
-            List<TEExamBreachLog> finalTeExamBreachLogList = teExamBreachLogList;
-            for (int i = 0; i < recordIdList.size(); i++) {
-                Long l = Long.parseLong(String.valueOf(recordIdList.get(i)));
-                Long examId = ExamRecordCacheUtil.getExamId(l);
-                Long examStudentId = null;
-                Long examActivityId = null;
-                if (Objects.isNull(examId)) {
-                    TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(l);
-                    examId = tOeExamRecord.getExamId();
-                    examStudentId = tOeExamRecord.getExamStudentId();
-                    examActivityId = tOeExamRecord.getExamActivityId();
-                } else {
-                    examId = ExamRecordCacheUtil.getExamId(l);
-                    examStudentId = ExamRecordCacheUtil.getExamStudentId(l);
-                    examActivityId = ExamRecordCacheUtil.getExamActivityId(l);
-                }
-                TEExamBreachLog teExamBreachLog = new TEExamBreachLog(examId, examActivityId, l, examStudentId, type.name(), String.valueOf(mapParameter.get("description")), status);
-                teExamBreachLog.setCreateId(tbUser.getId());
-                finalTeExamBreachLogList.add(teExamBreachLog);
-                Long timestamp = System.currentTimeMillis();
-                ExamRecordCacheUtil.setBreachStatus(l, 0, timestamp);
-                tOeExamRecordService.sendExamRecordDataSaveMq(l, timestamp);
-            }
-        } else {//撤销违纪
-            BreachCancelTypeEnum type = BreachCancelTypeEnum.valueOf(String.valueOf(mapParameter.get(SystemConstant.TYPE)));
-            QueryWrapper<TEExamBreachLog> teExamBreachLogQueryWrapper = new QueryWrapper<>();
-            teExamBreachLogQueryWrapper.lambda().in(TEExamBreachLog::getExamRecordId, recordIdList)
-                    .eq(TEExamBreachLog::getStatus, 0);
-            teExamBreachLogList = this.list(teExamBreachLogQueryWrapper);
-            teExamBreachLogList.forEach(s -> {
-                s.setType(type.name());
-                s.setDescription(String.valueOf(mapParameter.get("description")));
-                s.setStatus(status);
-                s.setUpdateId(tbUser.getId());
-                Long timestamp = System.currentTimeMillis();
-                ExamRecordCacheUtil.setBreachStatus(s.getExamRecordId(), 1, timestamp);
-                tOeExamRecordService.sendExamRecordDataSaveMq(s.getExamRecordId(), timestamp);
-            });
-        }
-    }
 }

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

@@ -139,14 +139,6 @@ public class TEExamCourseServiceImpl extends ServiceImpl<TEExamCourseMapper, TEE
         return ret;
     }
     
-    @Override
-    public List<TEExamCourse> findByExamId(Long examId) {
-        if (examId == null) {
-            throw new BusinessException("examId is null");
-        }
-        return teExamCourseMapper.findByExamId(examId);
-    }
-
 	@Override
 	public IPage<OpenExamCourseBean> examCourseQueryForOpen(Page<OpenExamCourseBean> ipage, Long examId,
 			String courseCode, Boolean hasPaper) {

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

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.aliyun.oss.common.utils.BinaryUtil;
@@ -31,6 +32,7 @@ import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.*;
+import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.HexUtils;
@@ -49,7 +51,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -65,8 +66,6 @@ import java.util.stream.Collectors;
 @Service
 public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> implements TEExamService {
 
-    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
-
     @Resource
     TEExamMapper teExamMapper;
 
@@ -864,7 +863,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         }
 
         String filePath =
-                "upload" + File.separator + sdf.format(new Date()) + File.separator + SystemConstant.getUuid() + "."
+                "upload" + File.separator + DateUtil.format(new Date(), Constants.DATE_PATTERN) + File.separator + SystemConstant.getUuid() + "."
                         + suffix;
         InputStream in = null;
         try {
@@ -1539,7 +1538,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             task.setStatus(TaskStatusEnum.FINISH);
             task.setFinishTime(System.currentTimeMillis());
             JSONObject json = new JSONObject();
-            String reportFilePath = sdf.format(new Date()) + "/" + SystemConstant.getUuid() + SystemConstant.TXT_PREFIX;
+            String reportFilePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + SystemConstant.TXT_PREFIX;
             json.put(SystemConstant.PATH, reportFilePath);
             json.put(SystemConstant.TYPE, SystemConstant.OSS);
             ossUtil.upload(false, reportFilePath, e.getMessage());

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

@@ -131,14 +131,6 @@ public class TEExamStudentServiceImpl extends ServiceImpl<TEExamStudentMapper, T
         return ret;
     }
 
-    @Override
-    public List<TEExamStudentDto> examStudentList(Long examId, Long examActivityId, String identity, String name,
-                                                  String roomCode, String courseCode, String grade, Integer enable, String classNo, Integer hasPhoto) {
-        return teExamStudentMapper
-                .examStudentList(examId, examActivityId, identity, name, roomCode, courseCode, grade, enable, classNo,
-                        hasPhoto);
-    }
-
     @Transactional
     @Override
     public void updateByMqMsg(Map<String, Object> param) {

+ 3 - 108
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -24,6 +25,7 @@ import com.qmth.themis.business.entity.TSyncExamStudentScore;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.*;
+import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.FileUtil;
@@ -40,7 +42,6 @@ import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
-import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -56,8 +57,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
 
     private final static Logger log = LoggerFactory.getLogger(TOeExamRecordServiceImpl.class);
 
-    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
-
     @Resource
     MqDtoService mqDtoService;
 
@@ -103,57 +102,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     @Resource
     TSyncExamStudentScoreService tSyncExamStudentScoreService;
 
-    /**
-     * 获取考试未完列表
-     *
-     * @param studentId
-     * @param examId
-     * @param orgId
-     * @return
-     */
-    @SuppressWarnings({"rawtypes", "unchecked"})
-    @Override
-    public Map getUnFinishExam(Long studentId, Long examId, Long orgId) {
-        TEExamUnFinishDto teExamUnFinishDto = tOeExamRecordMapper.getUnFinishExam(studentId, examId, orgId);
-        if (Objects.nonNull(teExamUnFinishDto)) {
-            Map finalMap = new HashMap();
-            Map<String, Object> waitingMap = new HashMap();
-            waitingMap.put(SystemConstant.ID, teExamUnFinishDto.getId());
-            waitingMap.put("examActivityId", teExamUnFinishDto.getExamActivityId());
-            waitingMap.put(SystemConstant.NAME, teExamUnFinishDto.getName());
-            waitingMap.put("mode", teExamUnFinishDto.getMode());
-            waitingMap.put("preNotice", teExamUnFinishDto.getPreNotice());
-            waitingMap.put("preNoticeStaySeconds", teExamUnFinishDto.getPreNoticeStaySeconds());
-            waitingMap.put("postNotice", teExamUnFinishDto.getPostNotice());
-            finalMap.put("waiting", waitingMap);
-
-            Map<String, Object> activityMap = new HashMap();
-            activityMap.put(SystemConstant.RECORD_ID, teExamUnFinishDto.getRecordId());
-            activityMap.put("minDurationSeconds", teExamUnFinishDto.getMinDurationSeconds());
-            activityMap.put("cameraPhotoUpload", teExamUnFinishDto.getCameraPhotoUpload());
-            activityMap.put(SystemConstant.COURSE_CODE, teExamUnFinishDto.getCourseCode());
-            activityMap.put(SystemConstant.EXAM_STUDENT_ID, teExamUnFinishDto.getExamStudentId());
-            activityMap.put("inProcessLivenessVerify", teExamUnFinishDto.getInProcessLivenessVerify());
-            activityMap.put("inProcessRealnessVerify", teExamUnFinishDto.getInProcessRealnessVerify());
-            activityMap.put("inProcessFaceStrangerIgnore", teExamUnFinishDto.getInProcessFaceStrangerIgnore());
-            activityMap.put("inProcessFaceVerify", teExamUnFinishDto.getInProcessFaceVerify());
-            activityMap.put(SystemConstant.COURSE_NAME, teExamUnFinishDto.getCourseName());
-            activityMap.put("inProcessLivenessFixedRange", teExamUnFinishDto.getInProcessLivenessFixedRange());
-            activityMap.put("prepareSeconds", teExamUnFinishDto.getPrepareSeconds());
-            activityMap.put("fouceFinish", teExamUnFinishDto.getFouceFinish());
-            activityMap.put("entryAuthenticationPolicy", teExamUnFinishDto.getEntryAuthenticationPolicy());
-            activityMap.put("maxDurationSeconds", teExamUnFinishDto.getMaxDurationSeconds());
-            activityMap.put("examCount", teExamUnFinishDto.getExamCount());
-            activityMap.put("inProcessLivenessJudgePolicy", teExamUnFinishDto.getInProcessLivenessJudgePolicy());
-            activityMap.put(SystemConstant.ID, teExamUnFinishDto.getExamActivityId());
-
-            finalMap.put("activity", activityMap);
-            return finalMap;
-        } else {
-            return null;
-        }
-    }
-
     @Transactional
     @Override
     public Long saveByPrepare(Long examId, Long examActivityId, Long examStudentId, Long paperId,
@@ -423,7 +371,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         File dfile = new File(dir);
         try {
             dfile.mkdirs();
-            String structFilePath = sdf.format(new Date()) + "/" + SystemConstant.getUuid() + ".json";
+            String structFilePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
             ExamStudentPaperStructCacheBean struct = (ExamStudentPaperStructCacheBean) redisUtil
                     .get(RedisKeyHelper.studentPaperStructKey(recordId));
 
@@ -671,35 +619,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         mqDtoService.assembleSendOneWayMsg(mqDto);
     }
 
-    /**
-     * 查询实时监控台列表
-     *
-     * @param iPage
-     * @param examId
-     * @param examActivityId
-     * @param roomCode
-     * @param paperDownload
-     * @param status
-     * @param name
-     * @param identity
-     * @param minWarningCount
-     * @param maxWarningCount
-     * @param clientWebsocketStatus
-     * @param monitorStatusSource
-     * @param userId
-     * @return
-     */
-    @SuppressWarnings("rawtypes")
-    @Override
-    public IPage<InvigilateListBean> invigilatePageList(IPage<Map> iPage, Long examId, Long examActivityId,
-                                                        String roomCode, Integer paperDownload, String status, String name, String identity,
-                                                        Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource,
-                                                        Long userId) {
-        return tOeExamRecordMapper
-                .invigilatePageList(iPage, examId, examActivityId, roomCode, paperDownload, status, name, identity,
-                        minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
-    }
-
     /**
      * 查询实时监控台视频列表
      *
@@ -1363,30 +1282,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         return tOeExamRecordMapper.findByOnlineInfo(examId, roomCodeSet);
     }
 
-    /**
-     * 查找在线消息
-     *
-     * @param examId
-     * @param roomCodeSet
-     * @return
-     */
-    @Override
-    public List<TOeExamRecord> findByOnlineInfoRecord(Long examId, Set<String> roomCodeSet) {
-        return tOeExamRecordMapper.findByOnlineInfoRecord(examId, roomCodeSet);
-    }
-
-    /**
-     * 监考结束
-     *
-     * @param examId
-     * @param roomCodeSet
-     * @return
-     */
-    @Override
-    public List<Integer> findByFinish(Long examId, Set<String> roomCodeSet) {
-        return tOeExamRecordMapper.findByFinish(examId, roomCodeSet);
-    }
-
     /**
      * 管理员报表
      *

+ 0 - 10
themis-business/src/main/java/com/qmth/themis/business/service/impl/WarningServiceImpl.java

@@ -173,16 +173,6 @@ public class WarningServiceImpl implements WarningService {
         }
     }
 
-    /**
-     * 活体动作异常
-     *
-     * @param warningDto
-     */
-    @Override
-    public void livenessActionError(WarningDto warningDto) {
-
-    }
-
     /**
      * 真实性异常
      *

+ 6 - 10
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskExamPaperImportTemplete.java

@@ -40,7 +40,6 @@ import javax.annotation.Resource;
 import java.io.*;
 import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
-import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -50,11 +49,8 @@ import java.util.*;
  */
 @Service("taskExamPaperImportTemplete")
 public class TaskExamPaperImportTemplete implements TaskImportTemplete {
-
     private final static Logger log = LoggerFactory.getLogger(TaskExamPaperImportTemplete.class);
 
-    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
-
     @Resource
     TEExamService teExamService;
 
@@ -328,7 +324,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
                 }
             }
         }
-        String filePath = sdf.format(new Date()) + "/" + SystemConstant.getUuid() + ".json";
+        String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
         paper.setPaperViewPath(filePath);
         ossUtil.upload(false, filePath, structJson.toJSONString());
     }
@@ -400,7 +396,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
         FileUtil.doZip(zip, files);
         File encryptZip = new File(rootDir + SystemConstant.getUuid() + ".zip");
         FileUtil.encryptFile(zip, encryptZip, paper.getDecryptSecret(), paper.getDecryptVector());
-        String filePath = sdf.format(new Date()) + "/" + SystemConstant.getUuid() + ".zip";
+        String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".zip";
         paper.setPaperPath(filePath);
         paper.setPaperMd5(BinaryUtil.encodeMD5(FileUtil.fileConvertToByteArray(encryptZip)));
         ossUtil.upload(false, filePath, encryptZip);
@@ -452,7 +448,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
                 }
             }
         }
-        String filePath = sdf.format(new Date()) + "/" + SystemConstant.getUuid() + ".json";
+        String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
         paper.setStructPath(filePath);
         ByteArrayOutputStream out = null;
         try {
@@ -512,7 +508,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
                 }
             }
         }
-        String filePath = sdf.format(new Date()) + "/" + SystemConstant.getUuid() + ".json";
+        String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
         paper.setAnswerPath(filePath);
         ossUtil.upload(false, filePath, answerJson.toJSONString());
     }
@@ -553,14 +549,14 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
                 String suff = value.substring(11, value.indexOf(";"));
                 byte[] bytes = Base64.decodeBase64(value.substring(value.indexOf(",") + 1));
                 String filePath =
-                        "upload" + File.separator + sdf.format(new Date()) + File.separator + SystemConstant.getUuid() + "." + suff;
+                        "upload" + File.separator + DateUtil.format(new Date(), Constants.DATE_PATTERN) + File.separator + SystemConstant.getUuid() + "." + suff;
                 String md5 = BinaryUtil.toBase64String(BinaryUtil.calculateMd5(bytes));
                 ossUtil.upload(true, filePath, new ByteArrayInputStream(bytes), md5);
                 blockInfo.put("value", ossUtil.getAliYunOssPublicDomain().getPublicUrl() + "/" + filePath);
             } else {
                 String suff = value.substring(value.indexOf("."));
                 String filePath =
-                        "upload" + File.separator + sdf.format(new Date()) + File.separator + SystemConstant.getUuid() + "." + suff;
+                        "upload" + File.separator + DateUtil.format(new Date(), Constants.DATE_PATTERN) + File.separator + SystemConstant.getUuid() + "." + suff;
                 File audioFile = new File(attachmentDir.getAbsolutePath() + "/" + value);
                 ossUtil.upload(true, filePath, audioFile);
                 blockInfo.put("value", ossUtil.getAliYunOssPublicDomain().getPublicUrl() + "/" + filePath);

+ 0 - 66
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -70,72 +70,6 @@
         order by tees.id
     </select>
 
-    <select id="examStudentList"
-            resultType="com.qmth.themis.business.dto.response.TEExamStudentDto">
-        select
-        tees.id,
-        tee.id as examId,
-        tee.name as examName,
-        tees.name,
-        tees.`identity`,
-        teea.code,
-        tees.course_code as courseCode,
-        tees.course_name as courseName,
-        tees.enable,
-        tees.room_code as roomCode,
-        tees.room_name as roomName,
-        tees.grade,
-        tees.class_no as classNo,
-        teea.id as examActivityId,
-        teea.code as activityCode,
-        stu.base_photo_path basePhotoUrl
-        from
-        t_e_exam_student tees
-        left join t_e_student stu on tees.student_id=stu.id
-        left join t_e_exam tee on
-        tees.exam_id = tee.id
-        left join t_e_exam_activity teea on
-        tees.exam_activity_id = teea.id
-        <where>
-            <if test="examId != null and examId != ''">
-                and tees.exam_id = #{examId}
-            </if>
-            <if test="activityId != null and activityId != ''">
-                and tees.exam_activity_id = #{activityId}
-            </if>
-            <if test="identity != null and identity != ''">
-                and tees.identity like concat('%', #{identity}, '%')
-            </if>
-            <if test="name != null and name != ''">
-                and tees.name like concat('%', #{name}, '%')
-            </if>
-            <if test="roomCode != null and roomCode != ''">
-                and tees.room_code like concat('%', #{roomCode}, '%')
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and tees.course_code = #{courseCode}
-            </if>
-            <if test="enable != null and enable != '' or enable == 0">
-                and tees.enable = #{enable}
-            </if>
-            <if test="grade != null and grade != ''">
-                and tees.grade like concat('%', #{grade}, '%')
-            </if>
-            <if test="classNo != null and classNo != ''">
-                and tees.class_no like concat('%', #{classNo}, '%')
-            </if>
-            <if test="hasPhoto != null and hasPhoto != ''">
-                <if test="hasPhoto == 0">
-                    and stu.base_photo_path is null
-                </if>
-                <if test="hasPhoto == 1">
-                    and stu.base_photo_path is not null
-                </if>
-            </if>
-        </where>
-        order by tees.id
-    </select>
-
     <select id="getTotalCount" resultType="java.util.Map">
         select t.exam_activity_id activityId,count(1) cc from t_e_exam_student
         t left join t_e_student f on t.student_id=f.id

+ 0 - 199
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -3,85 +3,6 @@
 <mapper
         namespace="com.qmth.themis.business.dao.TOeExamRecordMapper">
 
-    <select id="getUnFinishExam"
-            resultType="com.qmth.themis.business.dto.response.TEExamUnFinishDto">
-        select
-        tee.id,
-        teea.id as examActivityId,
-        toer.id as recordId,
-        tees.id as
-        examStudentId,
-        tee.name,
-        tee.mode,
-        tee.pre_notice as preNotice,
-        tee.pre_notice_stay_seconds as preNoticeStaySeconds,
-        tee.post_notice as
-        postNotice,
-        tee.code as examCode,
-        teea.code as examActivityCode,
-        tee.start_time as examStartTime,
-        tee.end_time as examEndTime,
-        teea.start_time as examActivityStartTime,
-        teea.finish_time as
-        examActivityFinishTime,
-        tees.course_code as courseCode,
-        teec.course_name as courseName,
-        tee.prepare_seconds as prepareSeconds,
-        tee.min_duration_seconds as minDurationSeconds,
-        tee.max_duration_seconds as maxDurationSeconds,
-        tee.exam_count as
-        examCount,
-        tee.force_finish as fouceFinish,
-        tee.entry_authentication_policy as entryAuthenticationPolicy,
-        tee.in_process_face_verify as inProcessFaceVerify,
-        tee.in_process_face_stranger_ignore as inProcessFaceStrangerIgnore,
-        tee.in_process_liveness_verify as inProcessLivenessVerify,
-        tee.in_process_realness_verify as inProcessRealnessVerify,
-        tee.in_process_liveness_fixed_range as inProcessLivenessFixedRange,
-        tee.in_process_liveness_judge_policy as inProcessLivenessJudgePolicy,
-        tee.camera_photo_upload as cameraPhotoUpload,
-        tee.mobile_photo_upload
-        as mobilePhotoUpload,
-        tee.break_expire_seconds as breakExpireSeconds,
-        tee.break_resume_count as breakResumeCount,
-        toer.duration_seconds as
-        durationSeconds,
-        toer.client_last_sync_time as clientLastSyncTime
-        from
-        t_oe_exam_record toer
-        left join t_e_exam_student tees on
-        tees.id =
-        toer.exam_student_id
-        left join t_e_exam_course teec on
-        teec.course_code
-        = tees.course_code
-        left join t_e_exam tee on
-        tee.id = tees.exam_id
-        left
-        join t_e_exam_activity teea on
-        teea.id = tees.exam_activity_id
-        <where>
-            <if test="studentId != null and studentId != ''">
-                and tees.student_id = #{studentId}
-            </if>
-            and tee.enable = 1
-            and teea.enable = 1
-            and tees.enable = 1
-            <if test="orgId != null and orgId != ''">
-                and tee.org_id = #{orgId}
-            </if>
-            <if test="examId != null and examId != ''">
-                and tee.id = #{examId}
-            </if>
-        </where>
-    </select>
-
-    <update id="dataUpdate">
-        update t_oe_exam_record t
-        set t.${colName}=#{colValue}
-        where t.id = #{recordId}
-    </update>
-
     <sql id="invigilatePageHead">
         select distinct t.exam_id          examId,
                         tee.name  as       examName,
@@ -206,29 +127,6 @@
         </where>
     </sql>
 
-    <select id="invigilatePageList" resultType="com.qmth.themis.business.bean.admin.InvigilateListBean">
-        select
-        (@i := @i + 1) as seq,
-        t.*
-        from
-        (
-        <include refid="invigilatePageHead"/>
-        ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and
-        tiiwi.approve_status = 0) as warningNew
-        <include refid="invigilatePageMiddle"/>
-        <include refid="invigilatePageFoot"/>
-        <if test="paperDownload != null and paperDownload != '' or paperDownload == 0">
-            and t.paper_download = #{paperDownload}
-        </if>
-        <if test="status == null or status == ''">
-            and (t.status = 'FIRST_PREPARE' or t.status = 'ANSWERING' or t.status = 'BREAK_OFF' or t.status =
-            'RESUME_PREPARE')
-        </if>
-        ) t,
-        (SELECT @i := 0) as i
-        order by t.warningNew desc
-    </select>
-
     <select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.admin.InvigilateListVideoBean">
         select (@i := @i + 1) as seq,t.* from(
         select
@@ -1423,103 +1321,6 @@
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
         </foreach>
-        <!--
-        union all
-        select
-        count(distinct toer.exam_student_id) as c
-        from
-        t_oe_exam_record toer
-        left join t_e_exam_student t on
-        t.id = toer.exam_student_id
-        and t.exam_id = toer.exam_id
-        and t.exam_activity_id = toer.exam_activity_id
-        left join t_e_exam_activity f on
-        t.exam_activity_id = f.id
-        left join t_e_exam tee on
-        tee.id = t.exam_id
-        where
-        toer.exam_id = #{examId} and t.room_code in
-        <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
-            #{roomCode}
-        </foreach>
-        and (toer.first_start_time is null or toer.first_prepare_time is null)
-        and not exists(
-        select
-        *
-        from
-        (
-        select
-        distinct t.exam_student_id as id
-        from
-        t_oe_exam_record t
-        left join t_e_exam_student s on
-        t.exam_student_id = s.id
-        where
-        t.exam_id = #{examId}
-        and (t.STATUS = 'FINISHED' or t.STATUS = 'PERSISTED')
-        and t.first_start_time is not null
-        and s.room_code in
-        <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
-            #{roomCode}
-        </foreach>
-        ) temp
-        where
-        temp.id = toer.exam_student_id)
-        -->
-    </select>
-
-    <select id="findByOnlineInfoRecord" resultType="com.qmth.themis.business.entity.TOeExamRecord">
-        select * from
-        t_oe_exam_record t
-        left join t_e_exam_student s on
-        t.exam_student_id = s.id
-        where
-        t.exam_id = #{examId}
-        and s.room_code in
-        <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
-            #{roomCode}
-        </foreach>
-    </select>
-
-    <select id="findByFinish" resultType="java.lang.Integer">
-        select
-            count(1) as c
-        from
-            t_ie_invigilate_exception_info t
-                left join t_e_exam_student s on
-                t.exam_student_id = s.id
-        where
-            t.exam_id = #{examId}
-            and s.room_code in
-            <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
-                #{roomCode}
-            </foreach>
-        union all
-        select
-            count(1) as c
-        from
-            t_ie_invigilate_warn_info t
-                left join t_e_exam_student s on
-                t.exam_student_id = s.id
-        where
-            t.exam_id = #{examId}
-            and s.room_code in
-            <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
-                #{roomCode}
-            </foreach>
-        union all
-        select
-            count(1) as c
-        from
-            t_e_exam_reexam t
-                left join t_e_exam_student s on
-                t.exam_student_id = s.id
-        where
-            t.exam_id = #{examId}
-            and s.room_code in
-            <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
-                #{roomCode}
-            </foreach>
     </select>
 
     <select id="findByViewAdmin" resultType="java.lang.Integer">

+ 2 - 0
themis-common/src/main/java/com/qmth/themis/common/contanst/Constants.java

@@ -12,6 +12,8 @@ public interface Constants {
 
     public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
 
+    public static final String DATE_PATTERN = "yyyy/MM/dd";
+
     public static final String CHARSET_NAME = "UTF-8";
 
     public static final Charset CHARSET = Charset.forName(CHARSET_NAME);

+ 1 - 1
themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketMobileServer.java

@@ -45,7 +45,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * @Author: wangliang
  * @Date: 2020/7/10
  */
-@ServerEndpoint(value = "/ws/mobile", configurator = WebSocketMobileHandshakeInterceptor.class)
+@ServerEndpoint(value = SystemConstant.WEBSOCKET_MOBILE_PREFIX, configurator = WebSocketMobileHandshakeInterceptor.class)
 @Component
 public class WebSocketMobileServer implements Concurrently {
 

+ 1 - 1
themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketOeServer.java

@@ -48,7 +48,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * @Author: wangliang
  * @Date: 2020/7/10
  */
-@ServerEndpoint(value = "/ws/oe", configurator = WebSocketOeHandshakeInterceptor.class)
+@ServerEndpoint(value = SystemConstant.WEBSOCKET_OE_PREFIX, configurator = WebSocketOeHandshakeInterceptor.class)
 @Component
 public class WebSocketOeServer implements Concurrently {
 

+ 4 - 6
themis-exam/src/main/java/com/qmth/themis/exam/websocket/interceptor/WebSocketMobileHandshakeInterceptor.java

@@ -2,8 +2,8 @@ package com.qmth.themis.exam.websocket.interceptor;
 
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.entity.TBSession;
-import com.qmth.themis.business.enums.*;
-import com.qmth.themis.business.util.*;
+import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
+import com.qmth.themis.business.util.AuthUtil;
 import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.enums.Platform;
@@ -11,7 +11,7 @@ import com.qmth.themis.common.exception.BusinessException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.websocket.*;
+import javax.websocket.HandshakeResponse;
 import javax.websocket.server.HandshakeRequest;
 import javax.websocket.server.ServerEndpointConfig;
 import java.util.List;
@@ -28,8 +28,6 @@ import java.util.Objects;
 public class WebSocketMobileHandshakeInterceptor extends ServerEndpointConfig.Configurator {
     private final static Logger log = LoggerFactory.getLogger(WebSocketMobileHandshakeInterceptor.class);
 
-    public static final String url = "/ws/mobile";
-
     @Override
     public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
         Map<String, List<String>> mapParameter = request.getParameterMap();
@@ -46,7 +44,7 @@ public class WebSocketMobileHandshakeInterceptor extends ServerEndpointConfig.Co
         Long recordId = Long.parseLong(mapParameter.get(Constants.HEADER_RECORD_ID).get(0));
         MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(mapParameter.get(Constants.HEADER_SOURCE).get(0));
 
-        TBSession tbSession = AuthUtil.websocketAuthInterceptor(platform, deviceId, authorization, time, SystemConstant.GET, url);
+        TBSession tbSession = AuthUtil.websocketAuthInterceptor(platform, deviceId, authorization, time, SystemConstant.GET, SystemConstant.WEBSOCKET_MOBILE_PREFIX);
         SystemConstant.checkExamStatus(recordId);
         config.getUserProperties().put(Constants.HEADER_RECORD_ID, recordId);
         config.getUserProperties().put(Constants.HEADER_DEVICE_ID, deviceId);

+ 1 - 4
themis-exam/src/main/java/com/qmth/themis/exam/websocket/interceptor/WebSocketOeHandshakeInterceptor.java

@@ -2,7 +2,6 @@ package com.qmth.themis.exam.websocket.interceptor;
 
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.entity.TBSession;
-import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
 import com.qmth.themis.business.util.AuthUtil;
 import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
@@ -28,8 +27,6 @@ import java.util.Objects;
 public class WebSocketOeHandshakeInterceptor extends ServerEndpointConfig.Configurator {
     private final static Logger log = LoggerFactory.getLogger(WebSocketOeHandshakeInterceptor.class);
 
-    public static final String url = "/ws/oe";
-
     @Override
     public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) {
         Map<String, List<String>> mapParameter = request.getParameterMap();
@@ -45,7 +42,7 @@ public class WebSocketOeHandshakeInterceptor extends ServerEndpointConfig.Config
         Long time = Long.parseLong(mapParameter.get(Constants.HEADER_TIME).get(0));
         Long recordId = Long.parseLong(mapParameter.get(Constants.HEADER_RECORD_ID).get(0));
 
-        TBSession tbSession = AuthUtil.websocketAuthInterceptor(platform, deviceId, authorization, time, SystemConstant.GET, url);
+        TBSession tbSession = AuthUtil.websocketAuthInterceptor(platform, deviceId, authorization, time, SystemConstant.GET, SystemConstant.WEBSOCKET_OE_PREFIX);
         SystemConstant.checkExamStatus(recordId);
         config.getUserProperties().put(Constants.HEADER_RECORD_ID, recordId);
         config.getUserProperties().put(Constants.HEADER_DEVICE_ID, deviceId);