Browse Source

待完善除上传附件其他都OK

wangliang 2 năm trước cách đây
mục cha
commit
60886e9a35
24 tập tin đã thay đổi với 372 bổ sung310 xóa
  1. 43 33
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  2. 6 12
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/SsoServiceImpl.java
  3. 6 6
      distributed-print/src/main/java/com/qmth/distributed/print/api/NotifyApiController.java
  4. 12 10
      distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java
  5. 10 9
      distributed-print/src/main/java/com/qmth/distributed/print/auth/DistributedPrintAuthenticationService.java
  6. 1 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  7. 8 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/CommonCacheService.java
  8. 30 22
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicAttachmentServiceImpl.java
  9. 14 8
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicVerifyCodeServiceImpl.java
  10. 15 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/CommonCacheServiceImpl.java
  11. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysConfigServiceImpl.java
  12. 9 8
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysUserServiceImpl.java
  13. 44 46
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java
  14. 19 28
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/TeachCloudReportTaskUtils.java
  15. 39 27
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/threadPool/MyThreadPool.java
  16. 17 26
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/CallPrintOpenApiServiceImpl.java
  17. 7 6
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/NewCallApiServiceImpl.java
  18. 30 19
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java
  19. 10 10
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/templete/strategy/CalculateTaskTemplate.java
  20. 8 5
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/OpenApiController.java
  21. 5 5
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SsoApiController.java
  22. 14 13
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysController.java
  23. 12 9
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/WudaOpenApiController.java
  24. 12 7
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/auth/TeachcloudReportAuthenticationService.java

+ 43 - 33
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -38,6 +38,7 @@ import com.qmth.teachcloud.common.mapper.BasicCourseMapper;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.util.*;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -593,32 +594,39 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         try {
             SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
             int temp = file.getOriginalFilename().lastIndexOf(".");
-            String fileName = file.getOriginalFilename().substring(0, temp);
-            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
-
-            //TODO attachment验证待完善
-//            List<String> attachmentTypeList = dictionaryConfig.sysDomain().getAttachmentType();
-//            if (Objects.nonNull(format)) {
-//                long count = attachmentTypeList.stream().filter(s -> format.equalsIgnoreCase(s)).count();
-//                if (count == 0) {
-//                    throw ExceptionResultEnum.ERROR.exception("文件格式只能为" + attachmentTypeList.toString());
-//                }
-//            }
-//            int attachmentLength = dictionaryConfig.sysDomain().getAttachmentLength().intValue();
-//            if (Objects.nonNull(fileName) && fileName.length() > attachmentLength) {
-//                throw ExceptionResultEnum.ERROR.exception("文件名长度不能超过" + attachmentLength + "个字符");
-//            }
+//            String fileName = file.getOriginalFilename().substring(0, temp);
+//            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
+            String fileName = FilenameUtils.getName(file.getOriginalFilename());
+            String format = FilenameUtils.getExtension(file.getOriginalFilename());
+
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_TYPE);
+            Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件类型"));
+            List<String> attachmentTypeList = Arrays.asList(sysConfig.getConfigValue().replaceAll("\\[", "").replaceAll("\\]", "").split(", "));
+            if (Objects.nonNull(format)) {
+                long count = attachmentTypeList.stream().filter(s -> format.equalsIgnoreCase(s)).count();
+                if (count == 0) {
+                    throw ExceptionResultEnum.ERROR.exception("文件格式只能为" + attachmentTypeList.toString());
+                }
+            }
+
+            SysConfig sysConfigLength = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_LENGTH);
+            Optional.ofNullable(sysConfigLength).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件名称长度"));
+            int attachmentLength = Integer.parseInt(sysConfigLength.getConfigValue());
+            if (Objects.nonNull(fileName) && fileName.length() > attachmentLength) {
+                throw ExceptionResultEnum.ERROR.exception("文件名长度不能超过" + attachmentLength + "个字符");
+            }
             long size = file.getSize();
             BigDecimal b = new BigDecimal(size);
             BigDecimal num = new BigDecimal(1024);
             b = b.divide(num, 2, BigDecimal.ROUND_HALF_UP).divide(num, 2, BigDecimal.ROUND_HALF_UP)
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
 
-//            TODO attachment验证待完善
-//            double attachmentSize = dictionaryConfig.sysDomain().getAttachmentSize().doubleValue();
-//            if (b.doubleValue() > attachmentSize) {
-//                throw ExceptionResultEnum.ERROR.exception("文件大小不能超过" + attachmentSize + "MB");
-//            }
+            SysConfig sysConfigSize = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_SIZE);
+            Optional.ofNullable(sysConfigSize).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件大小"));
+            double attachmentSize = Double.valueOf(sysConfigSize.getConfigValue());
+            if (b.doubleValue() > attachmentSize) {
+                throw ExceptionResultEnum.ERROR.exception("文件大小不能超过" + attachmentSize + "MB");
+            }
             log.info("fileName:{}", fileName);
             log.info("format:{}", format);
             log.info("size:{}", b);
@@ -887,21 +895,23 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         List<TBTask> tbTasks = tbTaskService.list(tbTaskQueryWrapper);
         if (Objects.nonNull(tbTasks) && tbTasks.size() > 0) {
             for (TBTask tbTask : tbTasks) {
-                //TODO 重新生成pdf次数待完善
-//                if (tbTask.getResetCount() < dictionaryConfig.sysDomain().getAutoCreatePdfResetMaxCount()) {
-                Map<String, Object> map = new HashMap<>();
+                SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.AUTO_CREATE_PDF_RESET_MAX_COUNT);
+                Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置自动重试生成pdf失败最大次数"));
+                Integer maxResetCount = Integer.parseInt(sysConfig.getConfigValue());
+                if (tbTask.getResetCount() < maxResetCount.intValue()) {
+                    Map<String, Object> map = new HashMap<>();
 //                    tbTask.setVersion(new AtomicInteger(tbTask.getVersion()).incrementAndGet());
-                if (Objects.nonNull(tbTask.getRemark())) {
-                    JSONArray jsonArray = JSONArray.parseArray(tbTask.getRemark());
-                    ArraysParams arraysParams = new ArraysParams(jsonArray.toArray(new Long[jsonArray.size()]));
-                    map.computeIfAbsent("examDetailCourseIds", v -> Arrays.asList(arraysParams.getIds()));
-                }
-                map.computeIfAbsent(SystemConstant.TASK, v -> tbTask);
-                map.computeIfAbsent(SystemConstant.USER, v -> sysUserService.getById(tbTask.getCreateId()));
+                    if (Objects.nonNull(tbTask.getRemark())) {
+                        JSONArray jsonArray = JSONArray.parseArray(tbTask.getRemark());
+                        ArraysParams arraysParams = new ArraysParams(jsonArray.toArray(new Long[jsonArray.size()]));
+                        map.computeIfAbsent("examDetailCourseIds", v -> Arrays.asList(arraysParams.getIds()));
+                    }
+                    map.computeIfAbsent(SystemConstant.TASK, v -> tbTask);
+                    map.computeIfAbsent(SystemConstant.USER, v -> sysUserService.getById(tbTask.getCreateId()));
 //                    asyncCreatePdfTempleteService.createPdf(map, null);
-                MqDto mqDto = new MqDto(MqTagEnum.PDF.getCode(), map, String.valueOf(tbTask.getId()));
-                redisUtil.sendMessage(mqDto.getTopic(), mqDto);
-//                }
+                    MqDto mqDto = new MqDto(MqTagEnum.PDF.getCode(), map, String.valueOf(tbTask.getId()));
+                    redisUtil.sendMessage(mqDto.getTopic(), mqDto);
+                }
             }
         }
     }

+ 6 - 12
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/SsoServiceImpl.java

@@ -6,7 +6,6 @@ import com.qmth.boot.tools.signature.SignatureEntity;
 import com.qmth.boot.tools.signature.SignatureType;
 import com.qmth.distributed.print.business.service.SsoService;
 import com.qmth.teachcloud.common.bean.params.OpenParams;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -40,9 +39,6 @@ public class SsoServiceImpl implements SsoService {
     @Autowired
     CloudMarkingTaskUtils stmmsUtils;
 
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
     @Resource
     CommonCacheService commonCacheService;
 
@@ -164,11 +160,9 @@ public class SsoServiceImpl implements SsoService {
         map.computeIfAbsent("time", v -> timestamp);
         map.computeIfAbsent("authorization", v -> accessToken);
 
-        //TODO 教研分析地址待完善
-//        SystemConstant.getLocalFileHost(dictionaryConfig.reportOpenDomain().getHostUrl());
-//        String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
 
         hostUrl = SystemConstant.getLocalFileHost(hostUrl);
         map.put("redirectUrl", hostUrl + SystemConstant.TEACHCLOUD_REPORT_SSO_LOGIN_API);
@@ -209,9 +203,9 @@ public class SsoServiceImpl implements SsoService {
         Optional.ofNullable(sysUserRole).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("用户没有该角色"));
 
         long timestamp = System.currentTimeMillis();
-        //TODO 题库地址待完善
-//        String questionLoginUrl = dictionaryConfig.casDomain().getQuestionHostUrl();
-        String questionLoginUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.QUESTION_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置题库地址"));
+        String questionLoginUrl = sysConfig.getConfigValue();
         if (questionLoginUrl.contains("*")) {
             questionLoginUrl = questionLoginUrl.replace("*", basicSchool.getCode());
         }

+ 6 - 6
distributed-print/src/main/java/com/qmth/distributed/print/api/NotifyApiController.java

@@ -11,12 +11,13 @@ import com.qmth.distributed.print.business.entity.GradeBatch;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.service.GradeBatchPaperService;
 import com.qmth.distributed.print.business.service.GradeBatchService;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.GradeAnalyzePaperStatusEnum;
 import com.qmth.teachcloud.common.enums.TaskResultEnum;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
+import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.*;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
@@ -51,7 +52,7 @@ public class NotifyApiController {
     private final static Logger log = LoggerFactory.getLogger(NotifyApiController.class);
 
     @Resource
-    DictionaryConfig dictionaryConfig;
+    CommonCacheService commonCacheService;
 
     @Resource
     GradeBatchService gradeBatchService;
@@ -70,11 +71,10 @@ public class NotifyApiController {
             String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
             log.info("analysis_progress decodeJson:{}", decodeJson);
 
-            //TODO 分布式印刷回调密码待完善
-//            String callbackPwd = dictionaryConfig.printOpenDomain().getCallbackPwd();
-            String callbackPwd = null;
-            Optional.ofNullable(callbackPwd).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("配置文件回调密码为空"));
+            SysConfig sysConfigCallPwd = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_OPEN_CALLBACK_PWD);
+            Optional.ofNullable(sysConfigCallPwd).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷回调密码"));
 
+            String callbackPwd = sysConfigCallPwd.getConfigValue();
             String sign = ServletUtil.getRequestAuthorization();
             Optional.ofNullable(sign).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("签名为空"));
             log.info("sign:{}", sign);

+ 12 - 10
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -179,10 +179,11 @@ public class SysController {
                     sysUserService.checkSmsCode(sysUser.getId(), sysUser.getMobileNumber(), login.getCode());
 
                     // 如果不是共用验证码再过期
-                    //TODO 万能短信验证码待完善
-//                    if (!dictionaryConfig.smsDomain().getSmsNormalCode().equals(login.getCode())) {
-                    sysUserService.expiredVerifyCode(sysUser.getId(), sysUser.getMobileNumber());
-//                    }
+                    SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SMS_NORMAL_CODE);
+                    Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置万能短信验证码"));
+                    if (!sysConfig.getConfigValue().equals(login.getCode())) {
+                        sysUserService.expiredVerifyCode(sysUser.getId(), sysUser.getMobileNumber());
+                    }
                 }
             }
         } else if (LoginTypeEnum.PHONE.name().equals(login.getType())) {
@@ -210,10 +211,11 @@ public class SysController {
             sysUserService.checkSmsCode(sysUser.getId(), sysUser.getMobileNumber(), code);
 
             // 如果不是共用验证码再过期
-            //TODO 万能短信验证码待完善
-//            if (!dictionaryConfig.smsDomain().getSmsNormalCode().equals(login.getCode())) {
-            sysUserService.expiredVerifyCode(sysUser.getId(), sysUser.getMobileNumber());
-//            }
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SMS_NORMAL_CODE);
+            Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置万能短信验证码"));
+            if (!sysConfig.getConfigValue().equals(login.getCode())) {
+                sysUserService.expiredVerifyCode(sysUser.getId(), sysUser.getMobileNumber());
+            }
         } else {
             throw ExceptionResultEnum.ERROR.exception("登录参数错误");
         }
@@ -438,8 +440,8 @@ public class SysController {
             return ResultUtil.ok(map);
         } else {
             Map<String, Object> map = new HashMap<>();
-//            TODO 超管logo待完善
-//            map.put(SystemConstant.LOGO, dictionaryConfig.sysDomain().getAdminLogoUrl());
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.ADMIN_LOGO_URL);
+            map.put(SystemConstant.LOGO, Objects.nonNull(sysConfig) ? sysConfig.getConfigValue() : null);
             map.put("name", null);
             map.put("accountSmsVerify", false);
             return ResultUtil.ok(map);

+ 10 - 9
distributed-print/src/main/java/com/qmth/distributed/print/auth/DistributedPrintAuthenticationService.java

@@ -5,8 +5,8 @@ import com.qmth.boot.core.security.model.AccessEntity;
 import com.qmth.boot.core.security.service.AuthorizationService;
 import com.qmth.boot.tools.signature.SignatureType;
 import com.qmth.teachcloud.common.bean.auth.AuthBean;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.TBSession;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -23,7 +23,9 @@ import org.springframework.stereotype.Component;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.time.Duration;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 
 @Component
@@ -36,9 +38,6 @@ public class DistributedPrintAuthenticationService implements AuthorizationServi
     @Resource
     RedisUtil redisUtil;
 
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
     @Resource
     AuthInfoService authInfoService;
 
@@ -79,11 +78,13 @@ public class DistributedPrintAuthenticationService implements AuthorizationServi
             if (auth) {
                 Long expireTime = redisUtil.getUserSessionExpire(accessEntity.getIdentity());
                 if (Objects.nonNull(expireTime) && expireTime.longValue() > -1L) {
-//                    TODO session时长待完善
-//                    if (Objects.nonNull(tbSession.getLastAccessTime()) && (System.currentTimeMillis() - tbSession.getLastAccessTime()) / 1000 > dictionaryConfig.sysDomain().getSessionActive().getSeconds()) {
-//                        log.warn("Authorization faile: session active, session active is {}", dictionaryConfig.sysDomain().getSessionActive().getSeconds());
-//                        throw ExceptionResultEnum.NOT_LOGIN.exception();
-//                    }
+                    SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SESSION_ACTIVE);
+                    Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置session会话时长"));
+                    Duration sessionActive = Duration.parse(SystemConstant.PT + sysConfig.getConfigValue());
+                    if (Objects.nonNull(tbSession.getLastAccessTime()) && (System.currentTimeMillis() - tbSession.getLastAccessTime()) / 1000 > sessionActive.getSeconds()) {
+                        log.warn("Authorization faile: session active, session active is {}", sessionActive.getSeconds());
+                        throw ExceptionResultEnum.NOT_LOGIN.exception();
+                    }
                     tbSession.setLastInfo();
                     redisUtil.setUserSession(accessEntity.getIdentity(), tbSession, expireTime);
                 }

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -151,6 +151,7 @@ public class SystemConstant {
     /**
      * 系统常量
      */
+    public static final String PT = "PT";
     public static final String CHARSET_NAME = "UTF-8";
     //    public static final String CHARSET_GB2312 = "gb2312";
     public static final String CHARSET_GBK = "gbk";

+ 8 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/CommonCacheService.java

@@ -380,6 +380,14 @@ public interface CommonCacheService {
      */
     public void removeSysConfigCache(String key);
 
+    /**
+     * 更新系统参数缓存
+     *
+     * @param key
+     * @param sysConfig
+     */
+    public void updateSysConfigCacheForDb(String key, SysConfig sysConfig);
+
     /**
      * 添加系统参数缓存
      *

+ 30 - 22
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicAttachmentServiceImpl.java

@@ -6,11 +6,13 @@ import com.qmth.boot.api.exception.ApiException;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.mapper.BasicAttachmentMapper;
 import com.qmth.teachcloud.common.service.BasicAttachmentService;
+import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.FileStoreUtil;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -29,9 +31,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.List;
-import java.util.Objects;
-import java.util.StringJoiner;
+import java.util.*;
 
 /**
  * <p>
@@ -51,6 +51,9 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
     @Autowired
     private DictionaryConfig dictionaryConfig;
 
+    @Resource
+    CommonCacheService commonCacheService;
+
     /**
      * 保存附件
      *
@@ -131,31 +134,36 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
 //            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
             String fileName = FilenameUtils.getName(file.getOriginalFilename());
             String format = FilenameUtils.getExtension(file.getOriginalFilename());
-//            List<String> attachmentTypeList = dictionaryConfig.sysDomain().getAttachmentType();
-            //TODO attachment验证待完善
-//            if (Objects.nonNull(format)) {
-//                long count = attachmentTypeList.stream().filter(s -> format.equalsIgnoreCase(s)).count();
-//                if (count == 0) {
-//                    throw ExceptionResultEnum.ERROR.exception("文件格式只能为" + attachmentTypeList.toString());
-//                }
-//            }
-//            int attachmentLength = dictionaryConfig.sysDomain().getAttachmentLength().intValue();
-//            if (Objects.nonNull(fileName) && fileName.length() > attachmentLength) {
-//                throw ExceptionResultEnum.ERROR.exception("文件名长度不能超过" + attachmentLength + "个字符");
-//            }
-            //TODO attachment验证待完善
+
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_TYPE);
+            Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件类型"));
+            List<String> attachmentTypeList = Arrays.asList(sysConfig.getConfigValue().replaceAll("\\[", "").replaceAll("\\]", "").split(", "));
+
+            if (Objects.nonNull(format)) {
+                long count = attachmentTypeList.stream().filter(s -> format.equalsIgnoreCase(s)).count();
+                if (count == 0) {
+                    throw ExceptionResultEnum.ERROR.exception("文件格式只能为" + attachmentTypeList.toString());
+                }
+            }
+
+            SysConfig sysConfigLength = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_LENGTH);
+            Optional.ofNullable(sysConfigLength).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件名称长度"));
+            int attachmentLength = Integer.parseInt(sysConfigLength.getConfigValue());
+            if (Objects.nonNull(fileName) && fileName.length() > attachmentLength) {
+                throw ExceptionResultEnum.ERROR.exception("文件名长度不能超过" + attachmentLength + "个字符");
+            }
             long size = file.getSize();
             BigDecimal b = new BigDecimal(size);
             BigDecimal num = new BigDecimal(1024);
             b = b.divide(num, 2, BigDecimal.ROUND_HALF_UP).divide(num, 2, BigDecimal.ROUND_HALF_UP)
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
 
-            //TODO attachment验证待完善
-//            double attachmentSize = dictionaryConfig.sysDomain().getAttachmentSize().doubleValue();
-//            if (b.doubleValue() > attachmentSize) {
-//                throw ExceptionResultEnum.ERROR.exception("文件大小不能超过" + attachmentSize + "MB");
-//            }
-            //TODO attachment验证待完善
+            SysConfig sysConfigSize = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_SIZE);
+            Optional.ofNullable(sysConfigSize).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件大小"));
+            double attachmentSize = Double.valueOf(sysConfigSize.getConfigValue());
+            if (b.doubleValue() > attachmentSize) {
+                throw ExceptionResultEnum.ERROR.exception("文件大小不能超过" + attachmentSize + "MB");
+            }
             log.info("fileName:{}", fileName);
             log.info("format:{}", format);
             log.info("size:{}", b);

+ 14 - 8
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicVerifyCodeServiceImpl.java

@@ -11,18 +11,22 @@ import com.aliyuncs.profile.IClientProfile;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
+import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicVerifyCode;
 import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.mapper.BasicVerifyCodeMapper;
 import com.qmth.teachcloud.common.service.BasicVerifyCodeService;
+import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.service.SysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Optional;
 
 /**
  * <p>
@@ -41,9 +45,12 @@ public class BasicVerifyCodeServiceImpl extends ServiceImpl<BasicVerifyCodeMappe
     @Autowired
     private SysConfigService sysConfigService;
 
+    @Resource
+    CommonCacheService commonCacheService;
+
     @Override
     public void sendVeirfyCode(String mobileNumber, SysUser sysUser) {
-        SysConfig sysConfig = sysConfigService.getByKey("sys.code.enable");
+        SysConfig sysConfig = sysConfigService.getByKey(SystemConstant.SYS_CODE_ENABLE);
         if (sysConfig.getConfigValue() == null) {
             throw ExceptionResultEnum.ERROR.exception("短信验证码启用开关未设置");
         }
@@ -55,9 +62,9 @@ public class BasicVerifyCodeServiceImpl extends ServiceImpl<BasicVerifyCodeMappe
         BasicVerifyCode basicVerifyCode = this.getOne(wrapper);
         if (basicVerifyCode != null) {
             Date oldCreateTime = new Date(basicVerifyCode.getCreateTime());
-            //TODO 短信验证码发送间隔待完善
-//            Integer sendInterval = dictionaryConfig.smsDomain().getCodeSendInterval();
-            Integer sendInterval = null;
+            SysConfig sysConfigSmsSendInterval = commonCacheService.addSysConfigCache(SystemConstant.CODE_SEND_INTERVAL);
+            Optional.ofNullable(sysConfigSmsSendInterval).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置短信验证码发送间隔"));
+            Integer sendInterval = Integer.parseInt(sysConfigSmsSendInterval.getConfigValue());
             if ((System.currentTimeMillis() - oldCreateTime.getTime()) < sendInterval * 1000) {
                 throw ExceptionResultEnum.ERROR.exception("发送验证码过于频繁,请" + sendInterval + "秒之后再试");
             }
@@ -99,9 +106,9 @@ public class BasicVerifyCodeServiceImpl extends ServiceImpl<BasicVerifyCodeMappe
             SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
             if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) {
                 // 请求成功
-                //TODO 短信验证码有效时间待完善
-//                Integer codeExpiredTime = dictionaryConfig.smsDomain().getCodeExpiredTime();
-                Integer codeExpiredTime = null;
+                SysConfig sysConfigSmsExpiredTime = commonCacheService.addSysConfigCache(SystemConstant.CODE_EXPIRED_TIME);
+                Optional.ofNullable(sysConfigSmsExpiredTime).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置短信验证码有效时间"));
+                Integer codeExpiredTime = Integer.parseInt(sysConfigSmsExpiredTime.getConfigValue());
                 if (basicVerifyCode == null) {
                     basicVerifyCode = new BasicVerifyCode();
                     basicVerifyCode.setUserId(sysUser.getId());
@@ -129,7 +136,6 @@ public class BasicVerifyCodeServiceImpl extends ServiceImpl<BasicVerifyCodeMappe
                 }
             }
         } catch (ClientException e) {
-            String error = e.getMessage();
             throw ExceptionResultEnum.ERROR.exception("请重新获取验证码");
         }
     }

+ 15 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/CommonCacheServiceImpl.java

@@ -9,6 +9,7 @@ import com.qmth.teachcloud.common.enums.PrivilegePropertyEnum;
 import com.qmth.teachcloud.common.service.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.cache.CacheManager;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.CachePut;
 import org.springframework.cache.annotation.Cacheable;
@@ -47,6 +48,9 @@ public class CommonCacheServiceImpl implements CommonCacheService {
     @Resource
     SysConfigService sysConfigService;
 
+    @Resource
+    CacheManager cacheManager;
+
     /**
      * 添加角色缓存
      *
@@ -598,6 +602,17 @@ public class CommonCacheServiceImpl implements CommonCacheService {
 
     }
 
+    /**
+     * 更新系统参数缓存
+     *
+     * @param key
+     * @return
+     */
+    @Override
+    public void updateSysConfigCacheForDb(String key, SysConfig sysConfig) {
+        cacheManager.getCache(SystemConstant.SYS_CONFIG_CACHE).put(key, sysConfig);
+    }
+
     /**
      * 添加系统参数缓存
      *

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysConfigServiceImpl.java

@@ -54,7 +54,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
             sysConfigList = this.list(sysConfigQueryWrapper);
             if (!CollectionUtils.isEmpty(sysConfigList)) {
                 for (SysConfig s : sysConfigList) {
-                    commonCacheService.updateSysConfigCache(s.getConfigKey());
+                    commonCacheService.updateSysConfigCacheForDb(s.getConfigKey(), s);
                 }
             }
         } catch (Exception e) {

+ 9 - 8
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysUserServiceImpl.java

@@ -258,10 +258,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             }
         }
         // 如果不是共用验证码 再过期
-        //TODO 万能短信验证码待完善
-//        if (Objects.nonNull(verifyCode) && !dictionaryConfig.smsDomain().getSmsNormalCode().equals(verifyCode)) {
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SMS_NORMAL_CODE);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置万能短信验证码"));
+        if (Objects.nonNull(verifyCode) && !sysConfig.getConfigValue().equals(verifyCode)) {
             sysUserService.expiredVerifyCode(sysUser.getId(), sysUser.getMobileNumber());
-//        }
+        }
 
         // 登录
         BasicSchool basicSchool;
@@ -313,8 +314,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             throw ExceptionResultEnum.ERROR.exception("用户学校不匹配");
         }
         // 校验验证码
-        // TODO 万能短信验证码待完善
-//        sysUserService.checkSmsCode(sysUser.getId(), sysUser.getMobileNumber(), dictionaryConfig.smsDomain().getSmsNormalCode());
+        sysUserService.checkSmsCode(sysUser.getId(), sysUser.getMobileNumber(), sysConfig.getConfigValue());
 
         return teachcloudCommonService.login(sysUser.getPassword(), sysUser, AppSourceEnum.SYSTEM);
     }
@@ -788,8 +788,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             if (Objects.isNull(code)) {
                 throw ExceptionResultEnum.ERROR.exception("验证码为空");
             }
-            //TODO 万能短信验证码待完善
-//            if (!dictionaryConfig.smsDomain().getSmsNormalCode().equals(code)) {
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SMS_NORMAL_CODE);
+            Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置万能短信验证码"));
+            if (!sysConfig.getConfigValue().equals(code)) {
                 List<VerifyCodeCheckDto> verifyCodeCheckDtoList = this.baseMapper.findVerifyCodeByUser(userId, mobileNumber);
                 if (verifyCodeCheckDtoList.size() < 1) {
                     throw ExceptionResultEnum.ERROR.exception("请确认已经发送了验证码");
@@ -802,7 +803,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 if (new Date(accessControl.getExpireTime()).before(new Date())) {
                     throw ExceptionResultEnum.ERROR.exception("短信验证码已过期");
                 }
-//            }
+            }
         }
     }
 

+ 44 - 46
teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java

@@ -10,6 +10,7 @@ import com.qmth.teachcloud.common.bean.result.PushResult;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.SyncFileTypeEnum;
@@ -25,10 +26,7 @@ import javax.annotation.Resource;
 import java.io.File;
 import java.io.FileInputStream;
 import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * 同步云阅卷接口工具类
@@ -71,9 +69,9 @@ public class CloudMarkingTaskUtils {
      * @return 考试ID
      */
     public Long syncExam(Long schoolId, String code, String name, String examTime) {
-//        TODO 云阅卷地址待完善
-//        String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String examSaveUrl = SystemConstant.CLOUD_MARK_EXAM_SAVE_API;
         validUrl(hostUrl, examSaveUrl);
         String postUrl = hostUrl.concat(examSaveUrl);
@@ -105,9 +103,9 @@ public class CloudMarkingTaskUtils {
         Boolean enable = userPushParam.getEnable();
         Long schoolId = userPushParam.getSchoolId();
 
-//        TODO 云阅卷地址待完善
-//        String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String userSaveUrl = SystemConstant.CLOUD_MARK_USER_EXTERNAL_SAVE_API;
         String postUrl = hostUrl.concat(userSaveUrl);
         // 参数
@@ -157,9 +155,9 @@ public class CloudMarkingTaskUtils {
     public boolean syncStudent(Long schoolId, String examId, String examNumber, String studentCode, String name, String college,
                                String className, String teacher, String subjectCode, String subjectName,
                                String packageCode, String paperType, String examSite, String examRoom) {
-//        TODO 云阅卷地址待完善
-//        String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String studentSaveUrl = SystemConstant.CLOUD_MARK_EXAM_STUDENT_SAVE_API;
         validUrl(hostUrl, studentSaveUrl);
         String postUrl = hostUrl.concat(studentSaveUrl);
@@ -202,9 +200,9 @@ public class CloudMarkingTaskUtils {
      * @param file        文件
      */
     public String syncFile(Long schoolId, String examId, String subjectCode, SyncFileTypeEnum type, File file) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String fileUploadUrl = SystemConstant.CLOUD_MARK_FILE_UPLOAD_API;
         validUrl(hostUrl, fileUploadUrl);
         fileUploadUrl = fileUploadUrl.replace("{type}", type.name().toLowerCase());
@@ -270,9 +268,9 @@ public class CloudMarkingTaskUtils {
      */
     public boolean syncPaperStructure(Long schoolId, String examId, String subjectCode, Boolean objective,
                                       String paperType, List<QuestionDTO> questions) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String structureUrl = SystemConstant.CLOUD_MARK_EXAM_PAPER_SAVE_API;
         validUrl(hostUrl, structureUrl);
         String postUrl = hostUrl.concat(structureUrl);
@@ -304,9 +302,9 @@ public class CloudMarkingTaskUtils {
      * @param paperType   试卷编号
      */
     public String queryPaperStructure(Long schoolId, String examId, String subjectCode, String paperType) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String queryPaperStructure = SystemConstant.CLOUD_MARK_EXAM_PAPER_QUERY_API;
         validUrl(hostUrl, queryPaperStructure);
         String postUrl = hostUrl.concat(queryPaperStructure);
@@ -332,9 +330,9 @@ public class CloudMarkingTaskUtils {
      * @param groups      试卷结构JSON
      */
     public boolean saveMarkerGroup(Long schoolId, String examId, String subjectCode, Integer trialCount, List<GroupDetailDTO> groups) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String groupSaveUrl = SystemConstant.CLOUD_MARK_EXAM_MARK_GROUP_SAVE_API;
         validUrl(hostUrl, groupSaveUrl);
         String postUrl = hostUrl.concat(groupSaveUrl);
@@ -364,9 +362,9 @@ public class CloudMarkingTaskUtils {
      * @param subjectCode 科目代码
      */
     public int countGroup(Long schoolId, String examId, String subjectCode) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String groupCountUrl = SystemConstant.CLOUD_MARK_EXAM_MARK_GROUP_COUNT_API;
         validUrl(hostUrl, groupCountUrl);
         String postUrl = hostUrl.concat(groupCountUrl);
@@ -395,9 +393,9 @@ public class CloudMarkingTaskUtils {
      * @param subjectCode 科目代码
      */
     public boolean deleteGroup(Long schoolId, String examId, String subjectCode) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String groupDeleteUrl = SystemConstant.CLOUD_MARK_EXAM_MARK_GROUP_DELETE_API;
         validUrl(hostUrl, groupDeleteUrl);
         String postUrl = hostUrl.concat(groupDeleteUrl);
@@ -425,9 +423,9 @@ public class CloudMarkingTaskUtils {
      * @param loginName   用户名
      */
     public boolean saveMarker(Long schoolId, String examId, String subjectCode, Integer groupNumber, String loginName) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String markerSaveUrl = SystemConstant.CLOUD_MARK_EXAM_MARKER_SAVE_API;
         validUrl(hostUrl, markerSaveUrl);
         String postUrl = hostUrl.concat(markerSaveUrl);
@@ -455,9 +453,9 @@ public class CloudMarkingTaskUtils {
      * @param loginName   用户名
      */
     public boolean saveMarkLeader(Long schoolId, String subjectCode, String loginName) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String markLeaderSaveUrl = SystemConstant.CLOUD_MARK_EXAM_SUBJECT_HEADER_SAVE_API;
         validUrl(hostUrl, markLeaderSaveUrl);
         String postUrl = hostUrl.concat(markLeaderSaveUrl);
@@ -508,9 +506,9 @@ public class CloudMarkingTaskUtils {
      * @param prefix   账号前缀
      */
     private Map<String, Object> openLogin(SysUser sysUser, String loginUrl, String prefix) {
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         validUrl(hostUrl, loginUrl);
         String postUrl = hostUrl.concat(loginUrl);
 
@@ -666,9 +664,9 @@ public class CloudMarkingTaskUtils {
         map.put("examId", validParam(String.valueOf(examId), null, true, "考试ID"));
         map.put("withMarkTrack", validParam(withMarkTrack, true, false, "评分标记"));
 
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String studentCountUrl = SystemConstant.CLOUD_MARK_EXAM_STUDENT_COUNT_API;
         validUrl(hostUrl, studentCountUrl);
         String postUrl = hostUrl.concat(studentCountUrl);
@@ -713,9 +711,9 @@ public class CloudMarkingTaskUtils {
         map.put("pageNumber", validParam(String.valueOf(pageNo), null, true, "页码"));
         map.put("pageSize", validParam(String.valueOf(pageSize), null, true, "数量"));
 
-        //TODO 云阅卷地址待完善
-        //String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         String studentScoreUrl = SystemConstant.CLOUD_MARK_EXAM_STUDENT_SCORE_API;
         validUrl(hostUrl, studentScoreUrl);
         String postUrl = hostUrl.concat(studentScoreUrl);

+ 19 - 28
teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/TeachCloudReportTaskUtils.java

@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.boot.tools.signature.SignatureType;
 import com.qmth.teachcloud.common.SignatureEntityTest;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.HttpUtil;
@@ -37,9 +37,6 @@ public class TeachCloudReportTaskUtils {
     @Resource
     private CommonCacheService commonCacheService;
 
-    @Resource
-    private DictionaryConfig dictionaryConfig;
-
     /**
      * 学期创建/更新接口
      *
@@ -50,10 +47,9 @@ public class TeachCloudReportTaskUtils {
      * @param enable          启用/禁用,ture:启用,false:禁用,默认启用
      */
     public Long syncSemester(Long schoolId, Long thirdSemesterId, String semesterName, Long startTime, Long endTime, Boolean enable) {
-        //TODO 教研分析地址待完善
-//        String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
@@ -100,10 +96,9 @@ public class TeachCloudReportTaskUtils {
      * @param enable     启用/禁用,ture:启用,false:禁用,默认启用
      */
     public Long syncExam(Long schoolId, Long id, String examName, Long examTime, String semesterId, Boolean enable) {
-        //TODO 教研分析地址待完善
-//      String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
@@ -147,10 +142,9 @@ public class TeachCloudReportTaskUtils {
      * @return 结果
      */
     public Boolean syncDeleteExam(Long schoolId, Long id) {
-        //TODO 教研分析地址待完善
-//        String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
@@ -193,10 +187,9 @@ public class TeachCloudReportTaskUtils {
      */
     public boolean syncCourse(Long schoolId, String examId, String courseCode, String courseName,
                               String paperType, String teachCollegeName, Boolean enable) {
-        //TODO 教研分析地址待完善
-//        String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
@@ -240,10 +233,9 @@ public class TeachCloudReportTaskUtils {
      * @param courseCodes 分析试卷的唯一标识
      */
     public boolean startCalc(Long schoolId, Long examId, List<String> courseCodes) {
-        //TODO 教研分析地址待完善
-//        String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
@@ -287,10 +279,9 @@ public class TeachCloudReportTaskUtils {
      * @return
      */
     public boolean publish(Long schoolId, Long thirdExamId, String gradeCourseCode, boolean publishStatus) {
-        //TODO 教研分析地址待完善
-//        String hostUrl = dictionaryConfig.reportOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置教研分析地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());

+ 39 - 27
teachcloud-common/src/main/java/com/qmth/teachcloud/common/threadPool/MyThreadPool.java

@@ -1,5 +1,9 @@
 package com.qmth.teachcloud.common.threadPool;//package com.qmth.themis.business.threadPool;
 
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysConfig;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.service.CommonCacheService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
@@ -7,7 +11,11 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 
+import javax.annotation.Resource;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
 
 /**
  * @Description: 线程池应用配置
@@ -22,11 +30,8 @@ public class MyThreadPool extends ThreadPoolTaskExecutor {
     private MyThreadPool threadPoolTaskExecutor = null;
     static final int cpuNum = Runtime.getRuntime().availableProcessors();
 
-//    @Value("${sys.config.threadPoolCoreSize}")
-//    Integer threadPoolCoreSize;
-//
-//    @Value("${sys.config.customThreadPoolCoreSize}")
-//    boolean customThreadPoolCoreSize;
+    @Resource
+    CommonCacheService commonCacheService;
 
     /**
      * 线程池
@@ -36,28 +41,35 @@ public class MyThreadPool extends ThreadPoolTaskExecutor {
     @Bean
     @Primary
     public Executor taskThreadPool() {
-        //TODO 自定义线程数待完善
-//        if (Objects.isNull(threadPoolTaskExecutor)) {
-//            log.info("cpuNum:{}", cpuNum);
-//            threadPoolTaskExecutor = new MyThreadPool();
-//            if (!customThreadPoolCoreSize && cpuNum > 0) {
-//                threadPoolTaskExecutor.setCorePoolSize(cpuNum);//核心线程数
-//                threadPoolTaskExecutor.setMaxPoolSize(cpuNum * 2);//最大线程数
-//            } else {
-//                threadPoolTaskExecutor.setCorePoolSize(threadPoolCoreSize);//核心线程数
-//                threadPoolTaskExecutor.setMaxPoolSize(threadPoolCoreSize * 2);//最大线程数
-//            }
-//            threadPoolTaskExecutor.setKeepAliveSeconds(SystemConstant.THREAD_POOL_KEEP_ALIVE_SECONDS);//线程空闲时间
-//            threadPoolTaskExecutor.setQueueCapacity(SystemConstant.THREAD_POOL_QUEUE_CAPACITY);//队列容量
-//            threadPoolTaskExecutor.setThreadNamePrefix(SystemConstant.THREAD_POOL_NAME);
-//            threadPoolTaskExecutor.setAllowCoreThreadTimeOut(true);//设置是否允许核心线程超时。若允许,核心线程超时后,会被销毁。默认为不允许(fasle)
-//            threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(true);//设置shutdown时是否等到所有任务完成再真正关闭
-//            threadPoolTaskExecutor.setAwaitTerminationSeconds(60);//当setWaitForTasksToCompleteOnShutdown(true)时,setAwaitTerminationSeconds 设置在 shutdown 之后最多等待多长时间后再真正关闭线程池
-//            // rejection-policy:当pool已经达到max size的时候,如何处理新任务
-//            // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
-//            threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-//            threadPoolTaskExecutor.initialize();
-//        }
+        SysConfig sysConfigCustomThreadPoolCoreSize = commonCacheService.addSysConfigCache(SystemConstant.CUSTOM_THREAD_POOL_CORE_SIZE);
+        Optional.ofNullable(sysConfigCustomThreadPoolCoreSize).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置是否自定义线程池大小"));
+        boolean customThreadPoolCoreSize = Boolean.valueOf(sysConfigCustomThreadPoolCoreSize.getConfigValue());
+
+        SysConfig sysConfigThreadPoolCoreSize = commonCacheService.addSysConfigCache(SystemConstant.THREAD_POOL_CORE_SIZE);
+        Optional.ofNullable(sysConfigThreadPoolCoreSize).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置自定义线程池大小"));
+        Integer threadPoolCoreSize = Integer.valueOf(sysConfigThreadPoolCoreSize.getConfigValue());
+
+        if (Objects.isNull(threadPoolTaskExecutor)) {
+            log.info("cpuNum:{}", cpuNum);
+            threadPoolTaskExecutor = new MyThreadPool();
+            if (!customThreadPoolCoreSize && cpuNum > 0) {
+                threadPoolTaskExecutor.setCorePoolSize(cpuNum);//核心线程数
+                threadPoolTaskExecutor.setMaxPoolSize(cpuNum * 2);//最大线程数
+            } else {
+                threadPoolTaskExecutor.setCorePoolSize(threadPoolCoreSize);//核心线程数
+                threadPoolTaskExecutor.setMaxPoolSize(threadPoolCoreSize * 2);//最大线程数
+            }
+            threadPoolTaskExecutor.setKeepAliveSeconds(SystemConstant.THREAD_POOL_KEEP_ALIVE_SECONDS);//线程空闲时间
+            threadPoolTaskExecutor.setQueueCapacity(SystemConstant.THREAD_POOL_QUEUE_CAPACITY);//队列容量
+            threadPoolTaskExecutor.setThreadNamePrefix(SystemConstant.THREAD_POOL_NAME);
+            threadPoolTaskExecutor.setAllowCoreThreadTimeOut(true);//设置是否允许核心线程超时。若允许,核心线程超时后,会被销毁。默认为不允许(fasle)
+            threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(true);//设置shutdown时是否等到所有任务完成再真正关闭
+            threadPoolTaskExecutor.setAwaitTerminationSeconds(60);//当setWaitForTasksToCompleteOnShutdown(true)时,setAwaitTerminationSeconds 设置在 shutdown 之后最多等待多长时间后再真正关闭线程池
+            // rejection-policy:当pool已经达到max size的时候,如何处理新任务
+            // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
+            threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+            threadPoolTaskExecutor.initialize();
+        }
         return threadPoolTaskExecutor;
     }
 }

+ 17 - 26
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/CallPrintOpenApiServiceImpl.java

@@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.qmth.boot.tools.signature.SignatureEntity;
 import com.qmth.boot.tools.signature.SignatureType;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.HttpUtil;
@@ -36,9 +36,6 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
     @Resource
     CommonCacheService commonCacheService;
 
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
     private final static Logger log = LoggerFactory.getLogger(CallPrintOpenApiServiceImpl.class);
 
     @Override
@@ -52,10 +49,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
 
         String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, SystemConstant.TEACHCLOUD_PRINT_OPEN_PAPER_CONFIG_API, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
 
-        //TODO 分布式印刷地址待完善
-//        String hostUrl = dictionaryConfig.printOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置知学知考host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
         }
@@ -80,10 +76,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
         long timestamp = System.currentTimeMillis();
 
         String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, SystemConstant.TEACHCLOUD_PRINT_OPEN_PAPER_DIMENSION_API, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-        //TODO 分布式印刷地址待完善
-//        String hostUrl = dictionaryConfig.printOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置知学知考host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
         }
@@ -108,10 +103,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
         long timestamp = System.currentTimeMillis();
 
         String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, SystemConstant.TEACHCLOUD_PRINT_OPEN_PAPER_STRUCTURE_API, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-        //TODO 分布式印刷地址待完善
-//        String hostUrl = dictionaryConfig.printOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置知学知考host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
         }
@@ -136,10 +130,9 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
         long timestamp = System.currentTimeMillis();
 
         String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, SystemConstant.TEACHCLOUD_PRINT_OPEN_PAPER_EVALUATION_API, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-        //TODO 分布式印刷地址待完善
-//        String hostUrl = dictionaryConfig.printOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置知学知考host"));
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
         }
@@ -164,10 +157,10 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
         printOpenParams.put("pageSize", 100);
         List<ExamStudentScore> examStudentScoreList = new ArrayList<>();
         List<ExamStudentScore> examStudentScoreCell = new ArrayList<>();
-        //TODO 分布式印刷地址待完善
-//        String hostUrl = dictionaryConfig.printOpenDomain().getHostUrl();
-        String hostUrl = null;
-        Optional.ofNullable(hostUrl).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置知学知考host"));
+
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());
         }
@@ -192,6 +185,4 @@ public class CallPrintOpenApiServiceImpl implements CallPrintOpenApiService {
         } while (examStudentScoreCell.size() > 0);
         return examStudentScoreList;
     }
-
-
 }

+ 7 - 6
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/NewCallApiServiceImpl.java

@@ -3,9 +3,10 @@ package com.qmth.teachcloud.report.business.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.qmth.boot.tools.signature.SignatureEntity;
 import com.qmth.boot.tools.signature.SignatureType;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.HttpUtil;
 import com.qmth.teachcloud.report.business.entity.TBCloudExam;
 import com.qmth.teachcloud.report.business.service.NewCallApiService;
@@ -31,10 +32,10 @@ public class NewCallApiServiceImpl implements NewCallApiService {
     private final static Logger log = LoggerFactory.getLogger(NewCallApiServiceImpl.class);
 
     @Resource
-    DictionaryConfig dictionaryConfig;
+    TBCloudExamService tbCloudExamService;
 
     @Resource
-    TBCloudExamService tbCloudExamService;
+    CommonCacheService commonCacheService;
 
     /**
      * 根据考试id或考试编码调用云阅卷学生成绩接口
@@ -45,9 +46,9 @@ public class NewCallApiServiceImpl implements NewCallApiService {
      */
     @Override
     public List<Map> callStudentScore(Long examId, String examCode) throws IOException {
-        //TODO 云阅卷地址待完善
-        //String url = dictionaryConfig.yunMarkDomain().getUrl() + dictionaryConfig.yunMarkDomain().getStudentScoreApi();
-        String url = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
+        String url = sysConfig.getConfigValue();
         Map<String, Object> params = new HashMap<>();
         if (Objects.nonNull(examId)) {
             params.put("examId", examId);

+ 30 - 19
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java

@@ -9,6 +9,7 @@ import com.qmth.teachcloud.common.cache.ThirdUserAuthCacheUtil;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.TBSession;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -28,6 +29,7 @@ import com.qmth.teachcloud.report.business.service.*;
 import com.qmth.teachcloud.report.business.utils.AnalyzeScopeUtil;
 import com.qmth.teachcloud.report.business.utils.MathUtil;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FilenameUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -723,30 +725,39 @@ public class ReportCommonServiceImpl implements ReportCommonService {
         try {
             SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
             int temp = file.getOriginalFilename().lastIndexOf(".");
-            String fileName = file.getOriginalFilename().substring(0, temp);
-            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
-//            TODO attachment验证待完善
-//            List<String> attachmentTypeList = dictionaryConfig.sysDomain().getAttachmentType();
-//            if (Objects.nonNull(format)) {
-//                long count = attachmentTypeList.stream().filter(s -> format.equalsIgnoreCase(s)).count();
-//                if (count == 0) {
-//                    throw ExceptionResultEnum.ERROR.exception("文件格式只能为" + attachmentTypeList.toString());
-//                }
-//            }
-//            TODO attachment验证待完善
-//            int attachmentLength = dictionaryConfig.sysDomain().getAttachmentLength().intValue();
-//            if (Objects.nonNull(fileName) && fileName.length() > attachmentLength) {
-//                throw ExceptionResultEnum.ERROR.exception("文件名长度不能超过" + attachmentLength + "个字符");
-//            }
+//            String fileName = file.getOriginalFilename().substring(0, temp);
+//            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
+            String fileName = FilenameUtils.getName(file.getOriginalFilename());
+            String format = FilenameUtils.getExtension(file.getOriginalFilename());
+
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_TYPE);
+            Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件类型"));
+            List<String> attachmentTypeList = Arrays.asList(sysConfig.getConfigValue().replaceAll("\\[", "").replaceAll("\\]", "").split(", "));
+            if (Objects.nonNull(format)) {
+                long count = attachmentTypeList.stream().filter(s -> format.equalsIgnoreCase(s)).count();
+                if (count == 0) {
+                    throw ExceptionResultEnum.ERROR.exception("文件格式只能为" + attachmentTypeList.toString());
+                }
+            }
+
+            SysConfig sysConfigLength = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_LENGTH);
+            Optional.ofNullable(sysConfigLength).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件名称长度"));
+            int attachmentLength = Integer.parseInt(sysConfigLength.getConfigValue());
+            if (Objects.nonNull(fileName) && fileName.length() > attachmentLength) {
+                throw ExceptionResultEnum.ERROR.exception("文件名长度不能超过" + attachmentLength + "个字符");
+            }
             long size = file.getSize();
             BigDecimal b = new BigDecimal(size);
             BigDecimal num = new BigDecimal(1024);
             b = b.divide(num, 2, BigDecimal.ROUND_HALF_UP).divide(num, 2, BigDecimal.ROUND_HALF_UP)
                     .setScale(2, BigDecimal.ROUND_HALF_UP);
-//            double attachmentSize = dictionaryConfig.sysDomain().getAttachmentSize().doubleValue();
-//            if (b.doubleValue() > attachmentSize) {
-//                throw ExceptionResultEnum.ERROR.exception("文件大小不能超过" + attachmentSize + "MB");
-//            }
+
+            SysConfig sysConfigSize = commonCacheService.addSysConfigCache(SystemConstant.ATTACHMENT_SIZE);
+            Optional.ofNullable(sysConfigSize).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置附件大小"));
+            double attachmentSize = Double.valueOf(sysConfigSize.getConfigValue());
+            if (b.doubleValue() > attachmentSize) {
+                throw ExceptionResultEnum.ERROR.exception("文件大小不能超过" + attachmentSize + "MB");
+            }
             log.info("fileName:{}", fileName);
             log.info("format:{}", format);
             log.info("size:{}", b);

+ 10 - 10
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/templete/strategy/CalculateTaskTemplate.java

@@ -7,6 +7,7 @@ import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.GradeAnalyzePaperStatusEnum;
 import com.qmth.teachcloud.common.enums.TaskResultEnum;
@@ -21,10 +22,8 @@ import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.net.URLEncoder;
+import java.util.*;
 
 /**
  * @Description: 分析数据模版
@@ -149,12 +148,13 @@ public abstract class CalculateTaskTemplate {
         jsonObject.put("result", tbSyncTask.getResult());
         jsonObject.put("time", time);
 
-        //TODO 分布式印刷回调密码待完善
-//        String sign = URLEncoder.encode(Base64Util.encode(ShaUtils.sha1(dictionaryConfig.printOpenDomain().getCallbackPwd() + jsonObject.toJSONString())), SystemConstant.CHARSET_NAME);
-        String sign = null;
-        //TODO 分布式印刷地址待完善
-//        String hostUrl = dictionaryConfig.printOpenDomain().getHostUrl();
-        String hostUrl = null;
+        SysConfig sysConfigCallPwd = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_OPEN_CALLBACK_PWD);
+        Optional.ofNullable(sysConfigCallPwd).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷回调密码"));
+        String sign = URLEncoder.encode(Base64Util.encode(ShaUtils.sha1(sysConfigCallPwd.getConfigValue() + jsonObject.toJSONString())), SystemConstant.CHARSET_NAME);
+
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_HOST_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷地址"));
+        String hostUrl = sysConfig.getConfigValue();
         BasicSchool basicSchool = commonCacheService.schoolCache(calculateParams.getSchoolId());
         if (hostUrl.contains("*")) {
             hostUrl = hostUrl.replace("*", basicSchool.getCode());

+ 8 - 5
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/OpenApiController.java

@@ -11,6 +11,7 @@ import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.BasicSemesterService;
+import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.AuthThirdUtil;
 import com.qmth.teachcloud.common.util.JacksonUtil;
 import com.qmth.teachcloud.common.util.Result;
@@ -78,6 +79,9 @@ public class OpenApiController {
     @Resource
     TBExamCourseDeleteService tbExamCourseDeleteService;
 
+    @Resource
+    CommonCacheService commonCacheService;
+
     @ApiOperation(value = "学期创建/更新接口")
     @ApiResponses({@ApiResponse(code = 200, message = "学期创建/更新接口", response = Object.class)})
     @RequestMapping(value = "/semester_edit", method = RequestMethod.POST)
@@ -169,10 +173,9 @@ public class OpenApiController {
         BasicSchool basicSchool = AuthThirdUtil.hasPermission();
         calculateParams.setSchoolId(basicSchool.getId());
 
-        //TODO 分布式印刷回调密码待完善
-//        String callbackPwd = dictionaryConfig.printOpenDomain().getCallbackPwd();
-        String callbackPwd = null;
-        Optional.ofNullable(callbackPwd).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("配置文件回调密码为空"));
+//        SysConfig sysConfigCallPwd = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_PRINT_OPEN_CALLBACK_PWD);
+//        Optional.ofNullable(sysConfigCallPwd).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置分布式印刷回调密码"));
+//        String callbackPwd = sysConfigCallPwd.getConfigValue();
 
         courseCodeSyncTaskService.start(calculateParams);
         return ResultUtil.ok(true);
@@ -188,7 +191,7 @@ public class OpenApiController {
         log.info("calculate进来了,result:{}", decodeJson);
         PublishParams publishParams = JacksonUtil.readJson(decodeJson, PublishParams.class);
         publishParams.validParams();
-        BasicSchool basicSchool = AuthThirdUtil.hasPermission();
+        AuthThirdUtil.hasPermission();
 
         Boolean publishStatus = publishParams.getPublishStatus();
         PublishStatusEnum publishStatusEnum;

+ 5 - 5
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SsoApiController.java

@@ -8,7 +8,6 @@ import com.qmth.teachcloud.common.SignatureEntityTest;
 import com.qmth.teachcloud.common.bean.dto.UserAuthenticationDto;
 import com.qmth.teachcloud.common.bean.result.LoginResult;
 import com.qmth.teachcloud.common.cache.ThirdUserAuthCacheUtil;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.AppSourceEnum;
@@ -55,7 +54,7 @@ public class SsoApiController {
     private final static Logger log = LoggerFactory.getLogger(SsoApiController.class);
 
     @Resource
-    DictionaryConfig dictionaryConfig;
+    CommonCacheService commonCacheService;
 
     @Resource
     SysUserService sysUserService;
@@ -149,9 +148,10 @@ public class SsoApiController {
 
         HttpServletResponse response = ServletUtil.getResponse();
         response.setHeader("Access-Control-Allow-Origin", "*");
-        //TODO 教研分析单点登录地址待完善
-//        String loginAuthenUrl = dictionaryConfig.sysDomain().getLoginAuthenUrl();
-        String loginAuthenUrl = null;
+
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_LOGIN_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置单点登录地址"));
+        String loginAuthenUrl = sysConfig.getConfigValue();
         if (loginAuthenUrl.contains("*")) {
             loginAuthenUrl = loginAuthenUrl.replace("*", basicSchool.getCode());
         }

+ 14 - 13
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysController.java

@@ -146,19 +146,20 @@ public class SysController {
             if (Objects.isNull(code)) {
                 throw ExceptionResultEnum.ERROR.exception("验证码为空");
             }
-            //TODO 万能短信验证码待完善
-//            if (!dictionaryConfig.smsDomain().getSmsNormalCode().equals(code)) {
-            QueryWrapper<BasicVerifyCode> codeWrapper = new QueryWrapper<>();
-            codeWrapper.lambda().eq(BasicVerifyCode::getMobileNumber, sysUser.getMobileNumber()).eq(BasicVerifyCode::getUserId, sysUser.getId());
-            BasicVerifyCode accessControl = basicVerifyCodeService.getOne(codeWrapper);
-            if (accessControl == null || (accessControl != null && !accessControl.getVerifyCode().equals(code))) {
-                throw ExceptionResultEnum.ERROR.exception("短信验证码错误,请仔细核对后再次输入");
-            }
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SMS_NORMAL_CODE);
+            Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置万能短信验证码"));
+            if (!sysConfig.getConfigValue().equals(code)) {
+                QueryWrapper<BasicVerifyCode> codeWrapper = new QueryWrapper<>();
+                codeWrapper.lambda().eq(BasicVerifyCode::getMobileNumber, sysUser.getMobileNumber()).eq(BasicVerifyCode::getUserId, sysUser.getId());
+                BasicVerifyCode accessControl = basicVerifyCodeService.getOne(codeWrapper);
+                if (accessControl == null || (accessControl != null && !accessControl.getVerifyCode().equals(code))) {
+                    throw ExceptionResultEnum.ERROR.exception("短信验证码错误,请仔细核对后再次输入");
+                }
 
-            if (new Date(accessControl.getExpireTime()).before(new Date())) {
-                throw ExceptionResultEnum.ERROR.exception("短信验证码已过期");
+                if (new Date(accessControl.getExpireTime()).before(new Date())) {
+                    throw ExceptionResultEnum.ERROR.exception("短信验证码已过期");
+                }
             }
-//            }
         }
         return ResultUtil.ok(teachcloudCommonService.login(login.getPassword(), sysUser, AppSourceEnum.SYSTEM));
     }
@@ -253,8 +254,8 @@ public class SysController {
             return ResultUtil.ok(map);
         } else {
             Map<String, String> map = new HashMap<>();
-//            TODO 超管logo待完善
-//            map.put(SystemConstant.LOGO, dictionaryConfig.sysDomain().getAdminLogoUrl());
+            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.ADMIN_LOGO_URL);
+            map.put(SystemConstant.LOGO, Objects.nonNull(sysConfig) ? sysConfig.getConfigValue() : null);
             map.put("name", null);
             return ResultUtil.ok(map);
         }

+ 12 - 9
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/WudaOpenApiController.java

@@ -12,6 +12,7 @@ import com.qmth.teachcloud.common.cache.ThirdUserAuthCacheUtil;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.AppSourceEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -45,6 +46,7 @@ import java.security.Principal;
 import java.text.MessageFormat;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 
 @Api(tags = "武大开放接口层apiController")
 @RestController
@@ -90,14 +92,14 @@ public class WudaOpenApiController {
             log.info("test-stu-cn:{}", cn);
         }
         BasicSchool basicSchool = commonCacheService.schoolCache(SystemConstant.SCHOOL_CODE);
-        //TODO 教研分析学生报告地址待完善
-        //        String testUrl = dictionaryConfig.sysDomain().getReportUrl() + basicSchool.getId() + "/" + uid + "/" + cn;
-        String testUrl = null;
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_STUDENT_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置学生报告地址"));
+
+        String testUrl = sysConfig.getConfigValue() + basicSchool.getId() + "/" + uid + "/" + cn;
         log.info("test-stu-testUrl:{}", testUrl);
         String encoderUid = EncrypAES.encrypt(uid);
         log.info("test-encoderUid:{}", encoderUid);
-        //TODO 教研分析学生报告地址待完善
-//        response.sendRedirect(dictionaryConfig.sysDomain().getReportUrl() + basicSchool.getId() + "/" + encoderUid);
+        response.sendRedirect(sysConfig.getConfigValue() + basicSchool.getId() + "/" + encoderUid);
     }
 
     @ApiOperation(value = "cas用户鉴权退出接口")
@@ -139,13 +141,14 @@ public class WudaOpenApiController {
         String testPattern = "{0}{1}{2}{3}";
         String testCode = URLEncoder.encode(MessageFormat.format(testPattern, userAuthenticationDto.getUid() + "/" + cn, SignatureEntityTest.FIELD_JOINER, SignatureEntityTest.encrypt(userAuthenticationDto.getCode())), SystemConstant.CHARSET_NAME);
         log.info("test-tea-code:{}", testCode);
-        //教研分析单点登录地址待完善
-//        log.info("test-tea-url:{}", dictionaryConfig.sysDomain().getLoginAuthenUrl() + testCode);
+        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.TEACHCLOUD_REPORT_LOGIN_URL);
+        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置单点登录地址"));
+
+        log.info("test-tea-url:{}", sysConfig.getConfigValue() + testCode);
         // 测试结束
         log.info("code:{}", code);
         response.setHeader("Access-Control-Allow-Origin", "*");
-        //教研分析单点登录地址待完善
-//        response.sendRedirect(dictionaryConfig.sysDomain().getLoginAuthenUrl() + code + "/" + AppSourceEnum.WHU_THIRD);
+        response.sendRedirect(sysConfig.getConfigValue() + code + "/" + AppSourceEnum.WHU_THIRD);
     }
 
 //    @ApiOperation(value = "cas用户鉴权测试接口")

+ 12 - 7
teachcloud-report/src/main/java/com/qmth/teachcloud/report/auth/TeachcloudReportAuthenticationService.java

@@ -7,6 +7,7 @@ import com.qmth.boot.tools.signature.SignatureType;
 import com.qmth.teachcloud.common.bean.auth.AuthBean;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysConfig;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.TBSession;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -23,7 +24,9 @@ import org.springframework.stereotype.Component;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.time.Duration;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 
 @Component
@@ -78,15 +81,17 @@ public class TeachcloudReportAuthenticationService implements AuthorizationServi
             boolean auth = authFootCommon(userId, SystemConstant.USER_OAUTH_CACHE, path, request, response);
             if (auth) {
                 Long expireTime = redisUtil.getUserSessionExpire(accessEntity.getIdentity());
-//                TODO session时长待完善
-//                if (Objects.nonNull(expireTime) && expireTime.longValue() > -1L) {
-//                    if (Objects.nonNull(tbSession.getLastAccessTime()) && (System.currentTimeMillis() - tbSession.getLastAccessTime()) / 1000 > dictionaryConfig.sysDomain().getSessionActive().getSeconds()) {
-//                        log.warn("Authorization faile: session active, session active is {}", dictionaryConfig.sysDomain().getSessionActive().getSeconds());
-//                        throw ExceptionResultEnum.NOT_LOGIN.exception();
-//                    }
+                SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SESSION_ACTIVE);
+                Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置session会话时长"));
+                Duration sessionActive = Duration.parse(SystemConstant.PT + sysConfig.getConfigValue());
+                if (Objects.nonNull(expireTime) && expireTime.longValue() > -1L) {
+                    if (Objects.nonNull(tbSession.getLastAccessTime()) && (System.currentTimeMillis() - tbSession.getLastAccessTime()) / 1000 > sessionActive.getSeconds()) {
+                        log.warn("Authorization faile: session active, session active is {}", sessionActive.getSeconds());
+                        throw ExceptionResultEnum.NOT_LOGIN.exception();
+                    }
                     tbSession.setLastInfo();
                     redisUtil.setUserSession(accessEntity.getIdentity(), tbSession, expireTime);
-//                }
+                }
             }
             return auth;
         }