wangliang 4 gadi atpakaļ
vecāks
revīzija
985cab5d0c
39 mainītis faili ar 103 papildinājumiem un 69 dzēšanām
  1. 7 3
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBExamInvigilateUserController.java
  2. 1 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java
  3. 4 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamActivityController.java
  4. 2 2
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java
  5. 4 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamCourseController.java
  6. 5 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamPaperController.java
  7. 4 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamReexamController.java
  8. 1 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java
  9. 0 1
      themis-backend/src/main/java/com/qmth/themis/backend/aspect/ApiControllerAspect.java
  10. 2 3
      themis-backend/src/main/java/com/qmth/themis/backend/websocket/WebSocketAdminServer.java
  11. 6 1
      themis-business/src/main/java/com/qmth/themis/business/config/MapApiReader.java
  12. 4 1
      themis-business/src/main/java/com/qmth/themis/business/config/SystemConfig.java
  13. 2 2
      themis-business/src/main/java/com/qmth/themis/business/service/impl/CacheServiceImpl.java
  14. 8 5
      themis-business/src/main/java/com/qmth/themis/business/service/impl/MqDtoServiceImpl.java
  15. 1 1
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TBAttachmentServiceImpl.java
  16. 4 1
      themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java
  17. 5 2
      themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java
  18. 0 1
      themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskExamStudentImportTemplete.java
  19. 1 1
      themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskRoomCodeExportTemplete.java
  20. 1 1
      themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskRoomCodeImportTemplete.java
  21. 1 1
      themis-business/src/main/java/com/qmth/themis/business/util/ExcelUtil.java
  22. 7 4
      themis-business/src/main/java/com/qmth/themis/business/util/JacksonUtil.java
  23. 1 1
      themis-common/src/main/java/com/qmth/themis/common/exception/GlobalDefultExceptionHandler.java
  24. 5 2
      themis-common/src/main/java/com/qmth/themis/common/util/AesUtil.java
  25. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallMobileController.java
  26. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallOeController.java
  27. 0 1
      themis-exam/src/main/java/com/qmth/themis/exam/aspect/ApiControllerAspect.java
  28. 2 3
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketMobileServer.java
  29. 2 4
      themis-exam/src/main/java/com/qmth/themis/exam/websocket/WebSocketOeServer.java
  30. 1 1
      themis-mq/src/main/java/com/qmth/themis/mq/listener/RocketMessageConsumer.java
  31. 6 2
      themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java
  32. 0 1
      themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/FaceVerifyConcurrentlyImpl.java
  33. 0 1
      themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/LogConcurrentlyImpl.java
  34. 0 1
      themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/SessionConcurrentlyImpl.java
  35. 0 1
      themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/TaskConcurrentlyImpl.java
  36. 0 1
      themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/UserLogConcurrentlyImpl.java
  37. 0 1
      themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/WebsocketUnNormalConcurrentlyImpl.java
  38. 1 2
      themis-task/src/main/java/com/qmth/themis/task/listener/QuartzOrderlyImpl.java
  39. 13 9
      themis-task/src/main/java/com/qmth/themis/task/service/impl/QuartzServiceImpl.java

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

@@ -16,12 +16,15 @@ import com.qmth.themis.business.service.MqDtoService;
 import com.qmth.themis.business.service.TBAttachmentService;
 import com.qmth.themis.business.service.TBExamInvigilateUserService;
 import com.qmth.themis.business.service.TBTaskHistoryService;
+import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.dao.DuplicateKeyException;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -42,6 +45,7 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/${prefix.url.admin}/invigilateUser")
 public class TBExamInvigilateUserController {
+    private final static Logger log = LoggerFactory.getLogger(TBExamInvigilateUserController.class);
 
     @Resource
     TBExamInvigilateUserService tbExamInvigilateUserService;
@@ -112,7 +116,7 @@ public class TBExamInvigilateUserController {
                 tbExamInvigilateUserService.saveBatch(tbExamInvigilateUserList);
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
@@ -161,7 +165,7 @@ public class TBExamInvigilateUserController {
             mqDtoService.assembleSendOneWayMsg(mqDto);
             //mq发送消息end
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(tbAttachment)) {
                 tbAttachmentService.deleteAttachment(mapParameter, tbAttachment);
             }
@@ -201,7 +205,7 @@ public class TBExamInvigilateUserController {
                 return ResultUtil.ok(Collections.singletonMap("success", true));
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof BusinessException) {
                 throw new BusinessException(e.getMessage());
             } else {

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

@@ -627,7 +627,7 @@ public class TBUserController {
                 cacheService.removeAccountCache(tbUser.getId());
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");

+ 4 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamActivityController.java

@@ -24,6 +24,8 @@ import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.dao.DuplicateKeyException;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -42,6 +44,7 @@ import java.util.*;
 @RestController
 @RequestMapping("/${prefix.url.admin}/activity")
 public class TEExamActivityController {
+    private final static Logger log = LoggerFactory.getLogger(TEExamActivityController.class);
 
     @Resource
     TEExamActivityService teExamActivityService;
@@ -91,7 +94,7 @@ public class TEExamActivityController {
                 teExamActivityService.updateExamActivityCacheBean(s.getId());
             });
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(examId) && Objects.nonNull(teExamActivityList) && (Objects.nonNull(teExamActivityList) && teExamActivityList.size() > 0 && Objects.nonNull(teExamActivityList.get(0)))) {
                 redisUtil.setRedisActivityCodeSequence(examId, Integer.parseInt(teExamActivityList.get(0).getCode()) - 1);
             }

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

@@ -175,7 +175,7 @@ public class TEExamController {
                 }
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(teExam) && Objects.nonNull(teExam.getId()) && Objects.nonNull(activityCode)) {
                 redisUtil.setRedisActivityCodeSequence(teExam.getId(), Integer.parseInt(activityCode) - 1);
             }
@@ -314,7 +314,7 @@ public class TEExamController {
                 teExamActivityService.saveOrUpdateBatch(teExamActivityList);
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(examId) && Objects.nonNull(teExam.getId()) && (Objects.nonNull(teExamActivityList) && teExamActivityList.size() > 0 && Objects.nonNull(teExamActivityList.get(0)))) {
                 redisUtil.setRedisActivityCodeSequence(examId, Integer.parseInt(teExamActivityList.get(0).getCode()) - 1);
             }

+ 4 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamCourseController.java

@@ -18,6 +18,8 @@ import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.dao.DuplicateKeyException;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -39,6 +41,7 @@ import java.util.Objects;
 @RestController
 @RequestMapping("/${prefix.url.admin}/exam")
 public class TEExamCourseController {
+    private final static Logger log = LoggerFactory.getLogger(TEExamCourseController.class);
 
     @Resource
     TEExamCourseService teExamCourseService;
@@ -60,7 +63,7 @@ public class TEExamCourseController {
                     .eq(TEExamCourse::getExamId, teExamCourse.getExamId()).eq(TEExamCourse::getCourseCode, teExamCourse.getCourseCode());
             teExamCourseService.update(teExamCourseUpdateWrapper);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");

+ 5 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamPaperController.java

@@ -14,6 +14,8 @@ import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.dao.DuplicateKeyException;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -33,6 +35,7 @@ import java.util.*;
 @RestController
 @RequestMapping("/${prefix.url.admin}/exam/paper")
 public class TEExamPaperController {
+    private final static Logger log = LoggerFactory.getLogger(TEExamPaperController.class);
 
     @Resource
     TEExamPaperService teExamPaperService;
@@ -82,7 +85,7 @@ public class TEExamPaperController {
             });
             teExamPaperService.saveOrUpdateBatch(teExamPaperList);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
@@ -150,6 +153,7 @@ public class TEExamPaperController {
             mqDtoService.assembleSendOneWayMsg(mqDto);
             //mq发送消息end
         } catch (Exception e) {
+            log.error("请求出错", e);
             if (Objects.nonNull(tbAttachment)) {
                 tbAttachmentService.deleteAttachment(mapParameter, tbAttachment);
             }

+ 4 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamReexamController.java

@@ -27,6 +27,8 @@ import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
@@ -44,6 +46,7 @@ import java.util.*;
 @RestController
 @RequestMapping("/${prefix.url.admin}/invigilate/reexam")
 public class TEExamReexamController {
+    private final static Logger log = LoggerFactory.getLogger(TEExamReexamController.class);
 
     @Resource
     TEExamReexamService teExamReexamService;
@@ -175,7 +178,7 @@ public class TEExamReexamController {
             }
             teExamReexamService.updateBatchById(teExamReexamUpdateList);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof BusinessException) {
                 throw new BusinessException(e.getMessage());
             } else {

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -238,7 +238,7 @@ public class TEExamStudentController {
             mqDtoService.assembleSendOneWayMsg(mqDto);
             //mq发送消息end
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(tbAttachment)) {
                 tbAttachmentService.deleteAttachment(mapParameter, tbAttachment);
             }

+ 0 - 1
themis-backend/src/main/java/com/qmth/themis/backend/aspect/ApiControllerAspect.java

@@ -64,7 +64,6 @@ public class ApiControllerAspect {
             return proceed;
         } catch (Exception e) {
             log.error("请求出错", e);
-            e.printStackTrace();
             return ResultUtil.error(e.getMessage());
         }
     }

+ 2 - 3
themis-backend/src/main/java/com/qmth/themis/backend/websocket/WebSocketAdminServer.java

@@ -170,7 +170,7 @@ public class WebSocketAdminServer
                     this.sendMessage(result);
                 }
             } catch (Exception e) {
-                e.printStackTrace();
+                log.error("请求出错", e);
             }
         }
     }
@@ -183,8 +183,7 @@ public class WebSocketAdminServer
      */
     @OnError
     public void onError(Session session, Throwable error) {
-        log.error("用户错误:{},原因:{}", this.sessionId, error.getMessage());
-        error.printStackTrace();
+        log.error("用户错误:{},原因:{}", this.sessionId, error);
         throw new BusinessException(error.getMessage());
     }
 

+ 6 - 1
themis-business/src/main/java/com/qmth/themis/business/config/MapApiReader.java

@@ -4,12 +4,15 @@ import com.fasterxml.classmate.TypeResolver;
 import com.google.common.base.Optional;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
+import com.qmth.themis.business.service.impl.MqDtoServiceImpl;
 import org.apache.ibatis.javassist.*;
 import org.apache.ibatis.javassist.bytecode.AnnotationsAttribute;
 import org.apache.ibatis.javassist.bytecode.ConstPool;
 import org.apache.ibatis.javassist.bytecode.annotation.Annotation;
 import org.apache.ibatis.javassist.bytecode.annotation.BooleanMemberValue;
 import org.apache.ibatis.javassist.bytecode.annotation.StringMemberValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Component;
@@ -31,6 +34,8 @@ import java.util.Map;
 @Component
 @Order   //plugin加载顺序,默认是最后加载
 public class MapApiReader implements ParameterBuilderPlugin {
+    private final static Logger log = LoggerFactory.getLogger(MapApiReader.class);
+
     @Autowired
     private TypeResolver typeResolver;
 
@@ -66,7 +71,7 @@ public class MapApiReader implements ParameterBuilderPlugin {
             }
             return ctClass.toClass();
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             return null;
         }
     }

+ 4 - 1
themis-business/src/main/java/com/qmth/themis/business/config/SystemConfig.java

@@ -2,6 +2,8 @@ package com.qmth.themis.business.config;
 
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.enums.UploadFileEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.support.PropertiesLoaderUtils;
@@ -19,6 +21,7 @@ import java.util.*;
  */
 @Component
 public class SystemConfig {
+    private final static Logger log = LoggerFactory.getLogger(SystemConfig.class);
     private Properties props = null;
 
     public SystemConfig() {
@@ -26,7 +29,7 @@ public class SystemConfig {
             Resource resource = new ClassPathResource("/application.properties");
             props = PropertiesLoaderUtils.loadProperties(resource);
         } catch (IOException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 

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

@@ -87,7 +87,7 @@ public class CacheServiceImpl implements CacheService {
                 authDto = new AuthDto(roleCodes, tbPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()), tbOrg);
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             throw new BusinessException("添加用户缓存失败");
         }
         return authDto;
@@ -132,7 +132,7 @@ public class CacheServiceImpl implements CacheService {
             roleCodes.add(RoleEnum.STUDENT.name());
             authDto = new AuthDto(roleCodes, tbPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()), tbOrg);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             throw new BusinessException("添加学生缓存失败");
         }
         return authDto;

+ 8 - 5
themis-business/src/main/java/com/qmth/themis/business/service/impl/MqDtoServiceImpl.java

@@ -6,6 +6,8 @@ import com.qmth.themis.business.enums.MqTagEnum;
 import com.qmth.themis.business.service.MqDtoService;
 import com.qmth.themis.business.service.ProducerServer;
 import com.qmth.themis.business.util.RedisUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -20,6 +22,7 @@ import java.util.Objects;
  */
 @Service
 public class MqDtoServiceImpl implements MqDtoService {
+    private final static Logger log = LoggerFactory.getLogger(MqDtoServiceImpl.class);
 
     @Resource
     ProducerServer producerServer;
@@ -43,7 +46,7 @@ public class MqDtoServiceImpl implements MqDtoService {
         try {
             producerServer.sendOneWay(mqDto);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(mqDto)) {
                 mqDto.setAck(SystemConstant.UNSEND_ACK_TYPE);
             }
@@ -65,7 +68,7 @@ public class MqDtoServiceImpl implements MqDtoService {
         try {
             producerServer.sendOneWay(mqDto);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(mqDto)) {
                 mqDto.setAck(SystemConstant.UNSEND_ACK_TYPE);
             }
@@ -87,7 +90,7 @@ public class MqDtoServiceImpl implements MqDtoService {
         try {
             producerServer.asyncDelayMsg(mqDto);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(mqDto)) {
                 mqDto.setAck(SystemConstant.UNSEND_ACK_TYPE);
             }
@@ -109,7 +112,7 @@ public class MqDtoServiceImpl implements MqDtoService {
         try {
             producerServer.syncDelayMsg(mqDto);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(mqDto)) {
                 mqDto.setAck(SystemConstant.UNSEND_ACK_TYPE);
             }
@@ -131,7 +134,7 @@ public class MqDtoServiceImpl implements MqDtoService {
         try {
             producerServer.sendMsgTran(mqDto);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (Objects.nonNull(mqDto)) {
                 mqDto.setAck(SystemConstant.UNSEND_ACK_TYPE);
             }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TBAttachmentServiceImpl.java

@@ -141,7 +141,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
             tbAttachment.setCreateId(userId);
             this.save(tbAttachment);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             deleteAttachment(map, tbAttachment);
             if (e instanceof BusinessException) {
                 throw new BusinessException(e.getMessage());

+ 4 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java

@@ -14,6 +14,8 @@ import com.qmth.themis.business.util.OssUtil;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellStyle;
 import org.apache.poi.ss.usermodel.Row;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.*;
 import java.util.*;
@@ -26,6 +28,7 @@ import java.util.*;
  * @Date: 2020/7/19
  */
 public class TaskExportCommon {
+    private final static Logger log = LoggerFactory.getLogger(TaskExportCommon.class);
     private Map<String, Object> map = null;
     private Long orgId = null;
     private Long createId = null;
@@ -150,7 +153,7 @@ public class TaskExportCommon {
             }
             tbTaskHistoryService.updateById(this.tbTaskHistory);
         } catch (IOException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         } finally {
             if (Objects.nonNull(fileWriter)) {
                 fileWriter.flush();

+ 5 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -9,6 +9,8 @@ import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.entity.TBTaskHistory;
 import com.qmth.themis.business.service.TBTaskHistoryService;
 import com.qmth.themis.business.util.OssUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.FileWriter;
@@ -23,6 +25,7 @@ import java.util.*;
  * @Date: 2020/7/19
  */
 public class TaskImportCommon {
+    private final static Logger log = LoggerFactory.getLogger(TaskImportCommon.class);
     private String mode = null;//mode
     private Map<String, Object> map = null;
     private Long orgId = null;
@@ -92,7 +95,7 @@ public class TaskImportCommon {
             try {
                 file = this.ossUtil.ossDownload(this.ossEnv, this.path, this.path);
             } catch (IOException e) {
-                e.printStackTrace();
+                log.error("请求出错", e);
             }
         }
         return file;
@@ -132,7 +135,7 @@ public class TaskImportCommon {
             }
             tbTaskHistoryService.updateById(this.tbTaskHistory);
         } catch (IOException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         } finally {
             if (Objects.nonNull(fileWriter)) {
                 fileWriter.flush();

+ 0 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskExamStudentImportTemplete.java

@@ -112,7 +112,6 @@ public class TaskExamStudentImportTemplete implements TaskImportTemplete {
                 log.info("导入考生数据结束,============耗时============:{}秒", (end - start) / 1000);
             } catch (Exception e) {
                 log.error("导入报错", e);
-                e.printStackTrace();
                 int min = Objects.isNull(map.get("min")) ? 0 : Integer.parseInt(String.valueOf(map.get("min")));
                 int y = Objects.isNull(map.get("y")) ? 0 : Integer.parseInt(String.valueOf(map.get("y")));
                 taskImportCommon.exception(min, y, e, taskImportCommon.getTxtList());

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskRoomCodeExportTemplete.java

@@ -134,7 +134,7 @@ public class TaskRoomCodeExportTemplete implements TaskExportTemplete {
             long end = System.currentTimeMillis();
             log.info("导出考场数据结束,============耗时============:{}秒", (end - start) / 1000);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("导出报错", e);
             taskExportCommon.exception(min, y, e, taskExportCommon.getTxtList());
         } finally {
             if (Objects.nonNull(wb)) {

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskRoomCodeImportTemplete.java

@@ -92,7 +92,7 @@ public class TaskRoomCodeImportTemplete implements TaskImportTemplete {
                 long end = System.currentTimeMillis();
                 log.info("导入考场数据结束,============耗时============:{}秒", (end - start) / 1000);
             } catch (Exception e) {
-                e.printStackTrace();
+                log.error("导入报错", e);
                 int min = Objects.isNull(map.get("min")) ? 0 : Integer.parseInt(String.valueOf(map.get("min")));
                 int y = Objects.isNull(map.get("y")) ? 0 : Integer.parseInt(String.valueOf(map.get("y")));
                 taskImportCommon.exception(min, y, e, taskImportCommon.getTxtList());

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/util/ExcelUtil.java

@@ -113,7 +113,7 @@ public class ExcelUtil {
             log.info("读取excel里的数据结束,============耗时============:{}秒", (end - start) / 1000);
             return callback.callback(finalOList, finalColumnNameList);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("excel读取报错", e);
             if (e instanceof IllegalArgumentException) {
                 String errorColumn = e.getMessage().toString();
                 if (errorColumn.indexOf("Can not set java.lang.String field") != -1 && errorColumn.indexOf("to java.lang.Long") != -1) {

+ 7 - 4
themis-business/src/main/java/com/qmth/themis/business/util/JacksonUtil.java

@@ -3,6 +3,8 @@ package com.qmth.themis.business.util;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.List;
 import java.util.Objects;
@@ -16,6 +18,7 @@ import java.util.Set;
  * @Date: 2020/7/6
  */
 public class JacksonUtil {
+    private final static Logger log = LoggerFactory.getLogger(JacksonUtil.class);
     private volatile static ObjectMapper objectMapper = null;
 
     static {
@@ -44,7 +47,7 @@ public class JacksonUtil {
         try {
             return objectMapper.writeValueAsString(o);
         } catch (JsonProcessingException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return null;
     }
@@ -61,7 +64,7 @@ public class JacksonUtil {
         try {
             return objectMapper.readValue(o, valueType);
         } catch (JsonProcessingException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return null;
     }
@@ -79,7 +82,7 @@ public class JacksonUtil {
             JavaType javaType = objectMapper.getTypeFactory().constructCollectionType(List.class, cla);
             return objectMapper.readValue(o, javaType);
         } catch (JsonProcessingException e) {
-            e.printStackTrace();
+            log.error("请求报错", e);
         }
         return null;
     }
@@ -97,7 +100,7 @@ public class JacksonUtil {
             JavaType javaType = objectMapper.getTypeFactory().constructCollectionType(Set.class, cla);
             return objectMapper.readValue(o, javaType);
         } catch (JsonProcessingException e) {
-            e.printStackTrace();
+            log.error("请求报错", e);
         }
         return null;
     }

+ 1 - 1
themis-common/src/main/java/com/qmth/themis/common/exception/GlobalDefultExceptionHandler.java

@@ -35,7 +35,7 @@ public class GlobalDefultExceptionHandler {
     @ExceptionHandler(Exception.class)
     @ResponseBody
     public <T> Result defultExcepitonHandler(Exception e, HttpServletResponse response) {
-        e.printStackTrace();
+        log.error("请求报错", e);
         if (e instanceof BusinessException) {
             BusinessException businessException = (BusinessException) e;
             response.setStatus(businessException.getStatusCode());

+ 5 - 2
themis-common/src/main/java/com/qmth/themis/common/util/AesUtil.java

@@ -2,6 +2,8 @@ package com.qmth.themis.common.util;
 
 import com.qmth.themis.common.contanst.Constants;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
@@ -18,6 +20,7 @@ import java.util.Base64;
  * @Date: 2019/10/11
  */
 public class AesUtil {
+    private final static Logger log = LoggerFactory.getLogger(AesUtil.class);
 
     /**
      * 加密
@@ -118,7 +121,7 @@ public class AesUtil {
             byte[] result = cipher.doFinal(content.getBytes(Constants.CHARSET_NAME));
             encoderText = Base64.getEncoder().encodeToString(result);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return encoderText;
     }
@@ -139,7 +142,7 @@ public class AesUtil {
             cipher.init(Cipher.DECRYPT_MODE, keySpec, paramSpec);
             decoderText = new String(cipher.doFinal(Base64.getDecoder().decode(content)), Constants.CHARSET_NAME);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return decoderText;
     }

+ 1 - 1
themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallMobileController.java

@@ -89,7 +89,7 @@ public class TIeInvigilateCallMobileController {
             mqDtoService.assembleSendOneWayMsg(mqDto);
             //监考监控通话信息 发送mq end
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");

+ 1 - 1
themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallOeController.java

@@ -83,7 +83,7 @@ public class TIeInvigilateCallOeController {
             mqDtoService.assembleSendOneWayMsg(mqDto);
             //监考监控通话信息 发送mq end
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");

+ 0 - 1
themis-exam/src/main/java/com/qmth/themis/exam/aspect/ApiControllerAspect.java

@@ -64,7 +64,6 @@ public class ApiControllerAspect {
             return proceed;
         } catch (Exception e) {
             log.error("请求出错", e);
-            e.printStackTrace();
             return ResultUtil.error(e.getMessage());
         }
     }

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

@@ -177,7 +177,7 @@ public class WebSocketMobileServer {
                     this.sendMessage(result);
                 }
             } catch (Exception e) {
-                e.printStackTrace();
+                log.error("请求出错", e);
             }
         }
     }
@@ -190,8 +190,7 @@ public class WebSocketMobileServer {
      */
     @OnError
     public void onError(Session session, Throwable error) {
-        log.error("用户错误:{},原因:{}", this.sessionId, error.getMessage());
-        error.printStackTrace();
+        log.error("用户错误:{},原因:{}", this.sessionId, error);
         throw new BusinessException(error.getMessage());
     }
 

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

@@ -196,7 +196,7 @@ public class WebSocketOeServer implements Concurrently {
                     this.sendMessage(result);
                 }
             } catch (Exception e) {
-                e.printStackTrace();
+                log.error("请求出错", e);
             }
         }
     }
@@ -209,8 +209,7 @@ public class WebSocketOeServer implements Concurrently {
      */
     @OnError
     public void onError(Session session, Throwable error) {
-        log.error("用户错误:{},原因:{}", this.sessionId, error.getMessage());
-        error.printStackTrace();
+        log.error("用户错误:{},原因:{}", this.sessionId, error);
         throw new BusinessException(error.getMessage());
     }
 
@@ -293,7 +292,6 @@ public class WebSocketOeServer implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq websocket oe,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 1 - 1
themis-mq/src/main/java/com/qmth/themis/mq/listener/RocketMessageConsumer.java

@@ -53,7 +53,7 @@ public class RocketMessageConsumer {
             consumer.start();
             log.info("consumer is start !!! groupName:{},topic:{},tag:{},namesrvAddr:{}", consumerGroupName, topic, tag, nameSrvAddr);
         } catch (MQClientException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return consumer;
     }

+ 6 - 2
themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

@@ -25,7 +25,10 @@ import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.util.SimpleBeanUtil;
+import com.qmth.themis.mq.listener.RocketMessageConsumer;
 import com.qmth.themis.mq.service.MqLogicService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -42,6 +45,7 @@ import java.util.*;
  */
 @Service
 public class MqLogicServiceImpl implements MqLogicService {
+    private final static Logger log = LoggerFactory.getLogger(MqLogicServiceImpl.class);
 
     @Resource
     RedisUtil redisUtil;
@@ -182,7 +186,7 @@ public class MqLogicServiceImpl implements MqLogicService {
                 try {
                     taskImportTemplete.importTask(map);
                 } catch (IOException e) {
-                    e.printStackTrace();
+                    log.error("请求出错", e);
                 }
             } else {
                 TaskExportTemplete taskExportTemplete = null;
@@ -192,7 +196,7 @@ public class MqLogicServiceImpl implements MqLogicService {
                 try {
                     taskExportTemplete.exportTask(map);
                 } catch (IOException e) {
-                    e.printStackTrace();
+                    log.error("请求出错", e);
                 }
             }
         });

+ 0 - 1
themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/FaceVerifyConcurrentlyImpl.java

@@ -66,7 +66,6 @@ public class FaceVerifyConcurrentlyImpl implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq 人脸验证保存,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 0 - 1
themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/LogConcurrentlyImpl.java

@@ -57,7 +57,6 @@ public class LogConcurrentlyImpl implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq 日志,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 0 - 1
themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/SessionConcurrentlyImpl.java

@@ -61,7 +61,6 @@ public class SessionConcurrentlyImpl implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq 会话,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 0 - 1
themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/TaskConcurrentlyImpl.java

@@ -56,7 +56,6 @@ public class TaskConcurrentlyImpl implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq 任务,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 0 - 1
themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/UserLogConcurrentlyImpl.java

@@ -57,7 +57,6 @@ public class UserLogConcurrentlyImpl implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq 用户轨迹,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 0 - 1
themis-mq/src/main/java/com/qmth/themis/mq/templete/impl/WebsocketUnNormalConcurrentlyImpl.java

@@ -62,7 +62,6 @@ public class WebsocketUnNormalConcurrentlyImpl implements Concurrently {
             }
         } catch (Exception e) {
             log.error("mq 延时消息监听,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 1 - 2
themis-task/src/main/java/com/qmth/themis/task/listener/QuartzOrderlyImpl.java

@@ -2,10 +2,10 @@ package com.qmth.themis.task.listener;
 
 import com.qmth.themis.business.constant.SpringContextHolder;
 import com.qmth.themis.business.constant.SystemConstant;
+import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.contanst.Constants;
-import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.mq.templete.Orderly;
 import com.qmth.themis.task.listener.service.MqTaskLogicService;
 import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext;
@@ -56,7 +56,6 @@ public class QuartzOrderlyImpl implements Orderly {
             }
         } catch (Exception e) {
             log.error("mq quartz顺序,消息消费出错", e);
-            e.printStackTrace();
             return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;//重试
         } finally {
             if (Objects.nonNull(mqDto)) {

+ 13 - 9
themis-task/src/main/java/com/qmth/themis/task/service/impl/QuartzServiceImpl.java

@@ -1,8 +1,11 @@
 package com.qmth.themis.task.service.impl;
 
+import com.qmth.themis.business.templete.TaskExportCommon;
 import com.qmth.themis.task.service.QuartzService;
 import org.quartz.*;
 import org.quartz.impl.matchers.GroupMatcher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.scheduling.quartz.QuartzJobBean;
 import org.springframework.stereotype.Service;
 
@@ -18,6 +21,7 @@ import java.util.*;
  */
 @Service("quartzService")
 public class QuartzServiceImpl implements QuartzService {
+    private final static Logger log = LoggerFactory.getLogger(QuartzServiceImpl.class);
 
     @Resource
     private Scheduler scheduler;
@@ -57,7 +61,7 @@ public class QuartzServiceImpl implements QuartzService {
             }
             scheduler.scheduleJob(jobDetail, trigger);
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -91,7 +95,7 @@ public class QuartzServiceImpl implements QuartzService {
             // 把作业和触发器注册到任务调度中
             scheduler.scheduleJob(jobDetail, trigger);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -112,7 +116,7 @@ public class QuartzServiceImpl implements QuartzService {
             // 重启触发器
             scheduler.rescheduleJob(triggerKey, trigger);
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -127,7 +131,7 @@ public class QuartzServiceImpl implements QuartzService {
         try {
             scheduler.deleteJob(new JobKey(jobName, jobGroupName));
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -143,7 +147,7 @@ public class QuartzServiceImpl implements QuartzService {
             JobKey jobKey = JobKey.jobKey(jobName, jobGroupName);
             scheduler.pauseJob(jobKey);
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -159,7 +163,7 @@ public class QuartzServiceImpl implements QuartzService {
             JobKey jobKey = JobKey.jobKey(jobName, jobGroupName);
             scheduler.resumeJob(jobKey);
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -175,7 +179,7 @@ public class QuartzServiceImpl implements QuartzService {
             JobKey jobKey = JobKey.jobKey(jobName, jobGroupName);
             scheduler.triggerJob(jobKey);
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
     }
 
@@ -209,7 +213,7 @@ public class QuartzServiceImpl implements QuartzService {
                 }
             }
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return jobList;
     }
@@ -243,7 +247,7 @@ public class QuartzServiceImpl implements QuartzService {
                 jobList.add(map);
             }
         } catch (SchedulerException e) {
-            e.printStackTrace();
+            log.error("请求出错", e);
         }
         return jobList;
     }