Selaa lähdekoodia

Merge branch 'dev_v3.1.0' into release_v3.1.0
merge

wangliang 3 vuotta sitten
vanhempi
commit
a6bd0bd447
36 muutettua tiedostoa jossa 189 lisäystä ja 519 poistoa
  1. 0 99
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/TSAuthDto.java
  2. 8 13
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncReportServiceImpl.java
  3. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java
  4. 1 1
      distributed-print-business/src/main/resources/mapper/TSyncExamStudentScoreMapper.xml
  5. 2 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/NotifyApiController.java
  6. 6 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java
  7. 0 188
      distributed-print/src/main/java/com/qmth/distributed/print/api/TSAuthController.java
  8. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/auth/DistributedPrintAuthenticationService.java
  9. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/start/StartRunning.java
  10. 2 2
      distributed-print/src/main/resources/application-36dev.properties
  11. 6 6
      distributed-print/src/main/resources/application-dev.properties
  12. 2 2
      distributed-print/src/main/resources/application-release.properties
  13. 2 2
      distributed-print/src/main/resources/application-test.properties
  14. 75 0
      teachcloud-common-api/src/main/java/com/qmth/teachcloud/common/api/api/TSAuthController.java
  15. 4 4
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/cache/ThirdUserAuthCacheUtil.java
  16. 2 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  17. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/TSAuth.java
  18. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/AuthEnum.java
  19. 2 3
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/TSAuthMapper.java
  20. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/AuthInfoService.java
  21. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/TSAuthService.java
  22. 6 6
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/AuthInfoServiceImpl.java
  23. 4 4
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TSAuthServiceImpl.java
  24. 1 1
      teachcloud-common/src/main/resources/mapper/TSAuthMapper.xml
  25. 2 2
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeDataCheckServiceImpl.java
  26. 5 5
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeDataGetAndEditServiceImpl.java
  27. 8 22
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/OpenApiController.java
  28. 1 2
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SsoApiController.java
  29. 6 0
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysController.java
  30. 0 142
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/TestCallPrintOpenApiController.java
  31. 7 1
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/auth/TeachcloudReportAuthenticationService.java
  32. 6 2
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/start/StartRunning.java
  33. 4 0
      teachcloud-report/src/main/resources/application-36dev.properties
  34. 7 2
      teachcloud-report/src/main/resources/application-dev.properties
  35. 4 0
      teachcloud-report/src/main/resources/application-release.properties
  36. 4 0
      teachcloud-report/src/main/resources/application-test.properties

+ 0 - 99
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/TSAuthDto.java

@@ -1,99 +0,0 @@
-package com.qmth.distributed.print.business.bean.dto;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.AuthEnum;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-
-/**
- * @Description: 授权配置 dto
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2022/4/26
- */
-public class TSAuthDto implements Serializable {
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty(value = "主键")
-    @TableId(value = "id")
-    private Long id;
-
-    @ApiModelProperty(value = "学校id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long schoolId;
-
-    @ApiModelProperty(value = "accessKey")
-    private String accessKey;
-
-    @ApiModelProperty(value = "accessSecret")
-    private String accessSecret;
-
-    @ApiModelProperty(value = "离线授权证书")
-    private String description;
-
-    @ApiModelProperty(value = "授权类型")
-    private AuthEnum type;
-
-    @ApiModelProperty(value = "过期时间")
-    private Long expireTime;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getSchoolId() {
-        return schoolId;
-    }
-
-    public void setSchoolId(Long schoolId) {
-        this.schoolId = schoolId;
-    }
-
-    public String getAccessKey() {
-        return accessKey;
-    }
-
-    public void setAccessKey(String accessKey) {
-        this.accessKey = accessKey;
-    }
-
-    public String getAccessSecret() {
-        return accessSecret;
-    }
-
-    public void setAccessSecret(String accessSecret) {
-        this.accessSecret = accessSecret;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public AuthEnum getType() {
-        return type;
-    }
-
-    public void setType(AuthEnum type) {
-        this.type = type;
-    }
-
-    public Long getExpireTime() {
-        return expireTime;
-    }
-
-    public void setExpireTime(Long expireTime) {
-        this.expireTime = expireTime;
-    }
-}

+ 8 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncReportServiceImpl.java

@@ -96,7 +96,7 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
                 boolean syncCourse = teachCloudReportTaskUtils.syncCourse(schoolId, String.valueOf(thirdExamId), courseCode, gradeBatchPaper.getPaperName(), gradeBatchPaper.getPaperType(), gradeBatchPaper.getTeachCollegeName(), gradeBatchPaper.getEnable());
                 if (syncCourse) {
                     // 删除enable=false的课程
-                    if(!gradeBatchPaper.getEnable()) {
+                    if (!gradeBatchPaper.getEnable()) {
                         gradeBatchPaperService.removeById(gradeBatchPaper.getId());
                     }
 
@@ -144,11 +144,6 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
             status = TaskStatusEnum.RUNNING;
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), null, status, null, null);
 
-            // 清空错误日志文件
-            UpdateWrapper<GradeBatch> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(GradeBatch::getReportFilePath, null).eq(GradeBatch::getId, gradeBatch.getId());
-            gradeBatchService.update(updateWrapper);
-
             QueryWrapper<GradeBatchPaper> queryWrapper = new QueryWrapper<>();
             queryWrapper.lambda().eq(GradeBatchPaper::getBatchId, gradeBatch.getId());
             List<GradeBatchPaper> gradeBatchPaperList = gradeBatchPaperService.list(queryWrapper);
@@ -159,6 +154,12 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
             List<String> courseCodes = gradeBatchPaperList.stream().map(m -> m.getPaperNumber() + m.getPaperType()).collect(Collectors.toList());
             Collections.sort(courseCodes);
             source = Base64Util.encode(ShaUtils.sha1(gradeBatch.getThirdExamId() + courseCodes.toString()));
+            UpdateWrapper<GradeBatch> gradeBatchUpdateWrapper = new UpdateWrapper<>();
+            if (source != null) {
+                gradeBatchUpdateWrapper.lambda().set(GradeBatch::getSource, source);
+            }
+            gradeBatchUpdateWrapper.lambda().set(GradeBatch::getReportFilePath, null).eq(GradeBatch::getId, gradeBatch.getId());
+            gradeBatchService.update(gradeBatchUpdateWrapper);
             teachCloudReportTaskUtils.startCalc(schoolId, gradeBatch.getThirdExamId(), courseCodes);
             // 任务结果
             result = TaskResultEnum.SUCCESS;
@@ -172,12 +173,6 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
             // 同步结束
             status = TaskStatusEnum.FINISH;
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), null, status, result, errorMessage);
-
-            if (source != null) {
-                UpdateWrapper<GradeBatch> updateWrapper = new UpdateWrapper<>();
-                updateWrapper.lambda().set(GradeBatch::getSource, source).eq(GradeBatch::getId, gradeBatch.getId());
-                gradeBatchService.update(updateWrapper);
-            }
         }
     }
 
@@ -206,7 +201,7 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
             status = TaskStatusEnum.FINISH;
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), null, status, result, errorMessage);
 
-            if(!gradeBatchPaper.getPublishStatus()) {
+            if (!gradeBatchPaper.getPublishStatus()) {
                 UpdateWrapper<GradeBatchPaper> updateWrapper = new UpdateWrapper<>();
                 updateWrapper.lambda().set(GradeBatchPaper::getPublishStatus, publish).eq(GradeBatchPaper::getId, gradeBatchPaper.getId());
                 gradeBatchPaperService.update(updateWrapper);

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java

@@ -336,6 +336,9 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
                 .eq(ExamTaskDetail::getExamTaskId, examTaskId)).getCardId();
         String jpgAttachmentInfo = examCardDetailService.getOne(new QueryWrapper<ExamCardDetail>().lambda()
                 .eq(ExamCardDetail::getCardId, cardId)).getJpgAttachmentInfo();
+        if(StringUtils.isBlank(jpgAttachmentInfo)){
+            return new ArrayList<>();
+        }
 
         List<ConvertJpgStorage> convertJpgStorageList = JSONObject.parseArray(jpgAttachmentInfo, ConvertJpgStorage.class);
 

+ 1 - 1
distributed-print-business/src/main/resources/mapper/TSyncExamStudentScoreMapper.xml

@@ -38,7 +38,7 @@
                 union all select id,teach_clazz_name clazz_name from teach_clazz where school_id = #{schoolId} ) bc on
             bc.id = tsess.clazz_id
         join exam_student es on
-            es.school_id = tsess.school_id and es.student_code = tsess.student_code
+            es.school_id = tsess.school_id and es.ticket_number = tsess.exam_number and es.student_code = tsess.student_code
         left join basic_major bm on
             bm.id = tsess.major_id
         left join sys_org so on

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

@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.util.*;
@@ -107,7 +108,7 @@ public class NotifyApiController {
                     gradeBatch.setStatus(GradeAnalyzePaperStatusEnum.FINISH_CALCULATE);
                 }
                 if (Objects.nonNull(calculateNotifyResult.getProgress())) {
-                    gradeBatch.setProgress(calculateNotifyResult.getProgress());
+                    gradeBatch.setProgress(calculateNotifyResult.getProgress().multiply(SystemConstant.PERCENT).setScale(2, BigDecimal.ROUND_HALF_UP));
                 }
                 gradeBatch.setNotifyTime(System.currentTimeMillis());
                 if (Objects.nonNull(calculateNotifyResult.getResult())) {

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

@@ -135,6 +135,9 @@ public class SysController {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
+        if (Objects.nonNull(login.getSchoolCode()) && login.getSchoolCode().contains("#")) {
+            login.setSchoolCode(login.getSchoolCode().substring(0, login.getSchoolCode().indexOf("#")));
+        }
 
         BasicSchool basicSchool = null;
         if (!login.getSchoolCode().equalsIgnoreCase(SystemConstant.ADMIN_CODE)) {
@@ -364,6 +367,9 @@ public class SysController {
     @ApiResponses({@ApiResponse(code = 200, message = "学校信息", response = EditResult.class)})
     @Aac(auth = BOOL.FALSE)
     public Result queryBySchoolCode(@ApiParam(value = "机构code", required = true) @RequestParam String code) {
+        if (Objects.nonNull(code) && code.contains("#")) {
+            code = code.substring(0, code.indexOf("#"));
+        }
         if (!code.equalsIgnoreCase(SystemConstant.ADMIN_CODE)) {
             BasicSchool basicSchool = commonCacheService.schoolCache(code);
             if (Objects.isNull(basicSchool)) {

+ 0 - 188
distributed-print/src/main/java/com/qmth/distributed/print/api/TSAuthController.java

@@ -1,188 +0,0 @@
-package com.qmth.distributed.print.api;
-
-import cn.hutool.http.HttpStatus;
-import com.alibaba.fastjson.JSONObject;
-import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.boot.api.exception.ApiException;
-import com.qmth.boot.core.solar.crypto.AppLicenseUtil;
-import com.qmth.boot.tools.signature.SignatureEntity;
-import com.qmth.boot.tools.signature.SignatureType;
-import com.qmth.distributed.print.business.service.AuthInfoService;
-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.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.service.CommonCacheService;
-import com.qmth.teachcloud.common.util.*;
-import io.swagger.annotations.*;
-import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * <p>
- * 激活授权配置表 前端控制器
- * </p>
- *
- * @author wangliang
- * @since 2022-04-26
- */
-@Api(tags = "授权配置Controller")
-@RestController
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.auth}")
-@Validated
-public class TSAuthController {
-    private final static Logger log = LoggerFactory.getLogger(TSAuthController.class);
-
-    @Resource
-    AuthInfoService authInfoService;
-
-    @Resource
-    CommonCacheService commonCacheService;
-
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
-    @ApiOperation(value = "导出硬件信息")
-    @ApiResponses({@ApiResponse(code = 200, message = "导出硬件信息", response = Object.class)})
-    @RequestMapping(value = "/export/device/info", method = RequestMethod.POST)
-    public void info() {
-        try {
-            HttpServletResponse response = ServletUtil.getResponse();
-            response.setHeader("Content-Disposition", "attachment; filename=" + SystemConstant.urlEncode("device.info"));
-            IOUtils.copy(new ByteArrayInputStream(AppLicenseUtil.buildDeviceInfo().value()), response.getOutputStream());
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-        }
-    }
-
-    @ApiOperation(value = "离线激活")
-    @ApiResponses({@ApiResponse(code = 200, message = "授权配置信息", response = Boolean.class)})
-    @RequestMapping(value = "/offline/activation", method = RequestMethod.POST)
-    public Result offlineActivation(@ApiParam(value = "上传文件", required = true) @RequestParam(required = true) MultipartFile file) throws Exception {
-        try {
-            authInfoService.updateLicense(file.getBytes());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return ResultUtil.ok(true);
-    }
-
-    @ApiOperation(value = "查询激活信息")
-    @ApiResponses({@ApiResponse(code = 200, message = "授权配置信息", response = Long.class)})
-    @RequestMapping(value = "/select", method = RequestMethod.POST)
-    public Result select() {
-        return ResultUtil.ok(authInfoService.selectAuthInfo());
-    }
-
-    @ApiOperation(value = "测试推送信息给教研分析")
-    @ApiResponses({@ApiResponse(code = 200, message = "测试推送信息给教研分析", response = Objects.class)})
-    @RequestMapping(value = "/test/push", method = RequestMethod.POST)
-    public void testPush() throws IOException {
-        Long schoolId = SystemConstant.getHeadOrUserSchoolId();
-        BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
-        Long timestamp = System.currentTimeMillis();
-//        /**
-//         * 测试推送学期
-//         */
-//        BasicSemesterParams basicSemesterParams = new BasicSemesterParams("测试学期1", System.currentTimeMillis(), System.currentTimeMillis() + 1L);
-//        String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getSemesterApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-//        String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getSemesterApi(), JacksonUtil.parseJson(basicSemesterParams), accessToken, timestamp);
-//        if (Objects.nonNull(result)) {
-//            log.info("result:{}", JacksonUtil.parseJson(result));
-//        }
-
-//        /**
-//         * 测试推送考试
-//         */
-//        Map<String, Object> map = new HashMap<>();
-//        map.computeIfAbsent("examName", v -> "测试考试1");
-//        map.computeIfAbsent("examTime", v -> timestamp);
-//        map.computeIfAbsent("semesterId", v -> 262908000564412416L);
-//        String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getExamApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-//        String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getExamApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
-//        if (Objects.nonNull(result)) {
-//            log.info("result:{}", JacksonUtil.parseJson(result));
-//        }
-
-//        /**
-//         * 测试推送分析课程(试卷)
-//         */
-//        Map<String, Object> map = new HashMap<>();
-//        map.computeIfAbsent("examId", v -> 262946761763454976L);
-//        map.computeIfAbsent("courseCode", v -> 2022052700001L + "A");//试卷编号+卷型
-//        map.computeIfAbsent("courseName", v -> "测试课程1");
-//        map.computeIfAbsent("paperType", v -> "A");
-//        map.computeIfAbsent("teachCollegeName", v -> "测试机构1");//机构名称
-//        String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCourseEditApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-//        String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCourseEditApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
-//        if (Objects.nonNull(result)) {
-//            log.info("result:{}", JacksonUtil.parseJson(result));
-//        }
-
-//        /**
-//         * 测试单点登录
-//         */
-//        Map<String, Object> map = new HashMap<>();
-//        map.computeIfAbsent("loginName", v -> "admin");
-//        map.computeIfAbsent("role", v -> RoleTypeEnum.OFFICE_TEACHER);
-//        map.computeIfAbsent("orgName", v -> "本科生院");
-//        map.computeIfAbsent("realName", v -> "admin");
-//        map.computeIfAbsent("mobileNumber", v -> "18008659001");
-//        map.computeIfAbsent("returnUrl", v -> "https://www.baidu.com");
-//        String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getSsoLoginApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-//        String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getSsoLoginApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
-//        if (Objects.nonNull(result)) {
-//            log.info("result:{}", JacksonUtil.parseJson(result));
-//        }
-
-        /**
-         * 测试生成课程(试卷)分析报告接口
-         */
-        try {
-            Map<String, Object> map = new HashMap<>();
-            map.computeIfAbsent("examId", v -> 262946761763454976L);
-            map.computeIfAbsent("courseCode", v -> Arrays.asList(2022052700001L + "A",
-                    2022052700001L + "B",
-                    2022052700001L + "C",
-                    2022052700001L + "D",
-                    2022052700001L + "E",
-                    2022052700001L + "F",
-                    2022052700001L + "G"));//试卷编号+卷型
-            String source = Base64Util.encode(ShaUtils.sha1(map.get("examId") + map.get("courseCode").toString()));
-            log.info("source:{}", source);
-            String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCalculateApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-            String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCalculateApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
-            if (Objects.nonNull(result)) {
-                log.info("result:{}", JacksonUtil.parseJson(result));
-                JSONObject jsonObject = JSONObject.parseObject(result);
-                if (Objects.nonNull(jsonObject.get("code")) && jsonObject.getIntValue("code") != HttpStatus.HTTP_OK) {
-                    throw ExceptionResultEnum.ERROR.exception(jsonObject.getString("error"));
-                }
-            }
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            //TODO 生成txt文件
-            if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-    }
-}

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

@@ -4,7 +4,6 @@ import com.qmth.boot.core.enums.Platform;
 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.distributed.print.business.service.AuthInfoService;
 import com.qmth.teachcloud.common.bean.auth.AuthBean;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -13,6 +12,7 @@ import com.qmth.teachcloud.common.entity.TBSession;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.PrivilegePropertyEnum;
 import com.qmth.teachcloud.common.enums.RoleTypeEnum;
+import com.qmth.teachcloud.common.service.AuthInfoService;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.RedisUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/start/StartRunning.java

@@ -1,7 +1,7 @@
 package com.qmth.distributed.print.start;
 
-import com.qmth.distributed.print.business.service.AuthInfoService;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.service.AuthInfoService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.CommandLineRunner;

+ 2 - 2
distributed-print/src/main/resources/application-36dev.properties

@@ -66,8 +66,8 @@ sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,
 sys.config.attachmentLength=100
 sys.config.attachmentSize=200
 sys.config.serverUpload=
-sys.config.fileHost=192.168.10.36:7001
-sys.config.serverHost=192.168.10.36:7001
+sys.config.fileHost=http://127.0.0.1
+sys.config.serverHost=http://127.0.0.1
 #sys.config.accessKey=0bce69d94a7b4aef8bc0badf150351a9
 #sys.config.accessSecret=LdUwb5X4etmjW7fDn0KAdoXG0Yt7AkDu
 sys.config.accessKey=274f823e5f59410f8b3bb6edcd8e2b6e

+ 6 - 6
distributed-print/src/main/resources/application-dev.properties

@@ -68,8 +68,8 @@ sys.config.attachmentSize=200
 sys.config.serverUpload=
 #sys.config.fileHost=localhost:7001
 #sys.config.serverHost=localhost:7001
-sys.config.fileHost=http://*.teachcloud-print-wl-test.cn
-sys.config.serverHost=http://*.teachcloud-print-wl-test.cn
+sys.config.fileHost=http://127.0.0.1
+sys.config.serverHost=http://127.0.0.1
 #sys.config.accessKey=0bce69d94a7b4aef8bc0badf150351a9
 #sys.config.accessSecret=LdUwb5X4etmjW7fDn0KAdoXG0Yt7AkDu
 sys.config.accessKey=274f823e5f59410f8b3bb6edcd8e2b6e
@@ -160,9 +160,9 @@ sync.config.groupCountUrl=/api/exam/mark_group/count
 sync.config.groupDeleteUrl=/api/exam/mark_group/delete
 sync.config.markerSaveUrl=/api/exam/marker/save
 
-#com.qmth.solar.access-key=274f823e5f59410f8b3bb6edcd8e2b6e
-#com.qmth.solar.access-secret=y7AO6W0TOdTF8HpWBwGHbp3wfIHsmUKr
-com.qmth.solar.license=/Volumes/extend/\u542F\u660E/\u5206\u5E03\u5F0F\u5370\u5237/\u5206\u5E03\u5F0F\u5370\u5237&\u6559\u7814\u5206\u6790v3.1.0/tc-dev-wl.lic
+com.qmth.solar.access-key=274f823e5f59410f8b3bb6edcd8e2b6e
+com.qmth.solar.access-secret=y7AO6W0TOdTF8HpWBwGHbp3wfIHsmUKr
+#com.qmth.solar.license=/Volumes/extend/\u542F\u660E/\u5206\u5E03\u5F0F\u5370\u5237/\u5206\u5E03\u5F0F\u5370\u5237&\u6559\u7814\u5206\u6790v3.1.0/tc-dev-wl.lic
 
 sms.config.smsNormalCode=qmth
 sms.config.codeExpiredTime=2
@@ -199,7 +199,7 @@ sms.config.aliyunSMSAuditRejectCode=SMS_237206063
 sms.config.aliyunSMSUploadStructureCode=SMS_237201068
 sms.config.aliyunSMSAuditCopyUserCode=SMS_237206065
 
-report.open.hostUrl=http://192.168.10.86:7004
+report.open.hostUrl=http://127.0.0.1:7004
 report.open.semesterApi=/api/report/open/semester_edit
 report.open.examApi=/api/report/open/exam_edit
 report.open.courseEditApi=/api/report/open/course_edit

+ 2 - 2
distributed-print/src/main/resources/application-release.properties

@@ -71,8 +71,8 @@ sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,
 sys.config.attachmentLength=100
 sys.config.attachmentSize=200
 sys.config.serverUpload=
-sys.config.fileHost=localhost:7811
-sys.config.serverHost=localhost:7811
+sys.config.fileHost=http://127.0.0.1
+sys.config.serverHost=http://127.0.0.1
 #sys.config.accessKey=0bce69d94a7b4aef8bc0badf150351a9
 #sys.config.accessSecret=LdUwb5X4etmjW7fDn0KAdoXG0Yt7AkDu
 sys.config.accessKey=df8baa73072c4725a07fe4d119cceb24

+ 2 - 2
distributed-print/src/main/resources/application-test.properties

@@ -66,8 +66,8 @@ sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,
 sys.config.attachmentLength=100
 sys.config.attachmentSize=200
 sys.config.serverUpload=
-sys.config.fileHost=localhost:7771
-sys.config.serverHost=localhost:7771
+sys.config.fileHost=http://127.0.0.1
+sys.config.serverHost=http://127.0.0.1
 #sys.config.accessKey=0bce69d94a7b4aef8bc0badf150351a9
 #sys.config.accessSecret=LdUwb5X4etmjW7fDn0KAdoXG0Yt7AkDu
 sys.config.accessKey=918d0878ee7944beb448980b011ff804

+ 75 - 0
teachcloud-common-api/src/main/java/com/qmth/teachcloud/common/api/api/TSAuthController.java

@@ -0,0 +1,75 @@
+package com.qmth.teachcloud.common.api.api;
+
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.boot.core.solar.crypto.AppLicenseUtil;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.service.AuthInfoService;
+import com.qmth.teachcloud.common.util.Result;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.common.util.ServletUtil;
+import io.swagger.annotations.*;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+/**
+ * <p>
+ * 激活授权配置表 前端控制器
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-04-26
+ */
+@Api(tags = "授权配置Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.auth}")
+@Validated
+public class TSAuthController {
+    private final static Logger log = LoggerFactory.getLogger(TSAuthController.class);
+
+    @Resource
+    AuthInfoService authInfoService;
+
+    @ApiOperation(value = "导出硬件信息")
+    @ApiResponses({@ApiResponse(code = 200, message = "导出硬件信息", response = Object.class)})
+    @RequestMapping(value = "/export/device/info", method = RequestMethod.POST)
+    public void info() {
+        try {
+            HttpServletResponse response = ServletUtil.getResponse();
+            response.setHeader("Content-Disposition", "attachment; filename=" + SystemConstant.urlEncode("device.info"));
+            IOUtils.copy(new ByteArrayInputStream(AppLicenseUtil.buildDeviceInfo().value()), response.getOutputStream());
+        } catch (Exception e) {
+            log.error(SystemConstant.LOG_ERROR, e);
+        }
+    }
+
+    @ApiOperation(value = "离线激活")
+    @ApiResponses({@ApiResponse(code = 200, message = "授权配置信息", response = Boolean.class)})
+    @RequestMapping(value = "/offline/activation", method = RequestMethod.POST)
+    public Result offlineActivation(@ApiParam(value = "上传文件", required = true) @RequestParam(required = true) MultipartFile file) throws Exception {
+        try {
+            authInfoService.updateLicense(file.getBytes());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return ResultUtil.ok(true);
+    }
+
+    @ApiOperation(value = "查询激活信息")
+    @ApiResponses({@ApiResponse(code = 200, message = "授权配置信息", response = Long.class)})
+    @RequestMapping(value = "/select", method = RequestMethod.POST)
+    public Result select() {
+        return ResultUtil.ok(authInfoService.selectAuthInfo());
+    }
+}

+ 4 - 4
teachcloud-common/src/main/java/com/qmth/teachcloud/common/cache/ThirdUserAuthCacheUtil.java

@@ -31,16 +31,16 @@ public class ThirdUserAuthCacheUtil {
     }
 
     public static void setAuthReturnUrl(String key, String url) {
-        redisUtil.set(RedisKeyHelper.thirdUserAuthReturnUrl(key), url, SystemConstant.REDIS_DEFAULT_EXPIRE_TIME, TimeUnit.SECONDS);
+        redisUtil.set(RedisKeyHelper.thirdUserAuthReturnUrl(key), url, SystemConstant.REDIS_DEFAULT_EXPIRE_TIME + 180L, TimeUnit.SECONDS);
     }
 
     public static String getAuthReturnUrl(String key) {
         return (String) redisUtil.get(RedisKeyHelper.thirdUserAuthReturnUrl(key));
     }
 
-    public static void deleteAuthReturnUrl(String key) {
-        redisUtil.delete(RedisKeyHelper.thirdUserAuthReturnUrl(key));
-    }
+//    public static void deleteAuthReturnUrl(String key) {
+//        redisUtil.delete(RedisKeyHelper.thirdUserAuthReturnUrl(key));
+//    }
 
     public static void deleteCache(Long userId) {
         CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);

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

@@ -15,6 +15,7 @@ import org.springframework.cglib.beans.BeanMap;
 
 import java.io.*;
 import java.lang.reflect.Field;
+import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.nio.charset.Charset;
 import java.util.*;
@@ -90,6 +91,7 @@ public class SystemConstant {
     public static final int FINAL_SCALE = 1;
     public static final int CALCULATE_SCALE = 4;
     public static final int OPER_SCALE = 8;
+    public static final BigDecimal PERCENT = new BigDecimal(100);
     public static final String HYPHEN = "-";
     public static final String DEFAULT_SIGN = "#";
     public static final String PARENT_ORG = "武汉大学教务处";

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TSAuth.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/TSAuth.java

@@ -1,10 +1,10 @@
-package com.qmth.distributed.print.business.entity;
+package com.qmth.teachcloud.common.entity;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.AuthEnum;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.enums.AuthEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/AuthEnum.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/AuthEnum.java

@@ -1,4 +1,4 @@
-package com.qmth.distributed.print.business.enums;
+package com.qmth.teachcloud.common.enums;
 
 import java.util.Objects;
 

+ 2 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TSAuthMapper.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/TSAuthMapper.java

@@ -1,8 +1,7 @@
-package com.qmth.distributed.print.business.mapper;
+package com.qmth.teachcloud.common.mapper;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.distributed.print.business.entity.TSAuth;
 import com.qmth.teachcloud.common.base.CustomBaseMapper;
+import com.qmth.teachcloud.common.entity.TSAuth;
 
 /**
  * <p>

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/AuthInfoService.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/AuthInfoService.java

@@ -1,7 +1,7 @@
-package com.qmth.distributed.print.business.service;
+package com.qmth.teachcloud.common.service;
 
 import com.qmth.boot.core.solar.model.AppInfo;
-import com.qmth.distributed.print.business.enums.AuthEnum;
+import com.qmth.teachcloud.common.enums.AuthEnum;
 
 /**
  * @Description: 授权信息service

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TSAuthService.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/TSAuthService.java

@@ -1,7 +1,7 @@
-package com.qmth.distributed.print.business.service;
+package com.qmth.teachcloud.common.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.entity.TSAuth;
+import com.qmth.teachcloud.common.entity.TSAuth;
 
 /**
  * <p>

+ 6 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/AuthInfoServiceImpl.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/AuthInfoServiceImpl.java

@@ -1,24 +1,24 @@
-package com.qmth.distributed.print.business.service.impl;
+package com.qmth.teachcloud.common.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.boot.core.solar.config.SolarProperties;
 import com.qmth.boot.core.solar.model.AppInfo;
 import com.qmth.boot.core.solar.model.OrgInfo;
 import com.qmth.boot.core.solar.service.SolarService;
-import com.qmth.distributed.print.business.entity.TSAuth;
-import com.qmth.distributed.print.business.enums.AuthEnum;
-import com.qmth.distributed.print.business.mapper.TSAuthMapper;
-import com.qmth.distributed.print.business.service.AuthInfoService;
-import com.qmth.distributed.print.business.service.TSAuthService;
 import com.qmth.teachcloud.common.bean.dto.AuthOrgInfoDto;
 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.TSAuth;
+import com.qmth.teachcloud.common.enums.AuthEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.mapper.BasicSchoolMapper;
+import com.qmth.teachcloud.common.mapper.TSAuthMapper;
+import com.qmth.teachcloud.common.service.AuthInfoService;
 import com.qmth.teachcloud.common.service.BasicSchoolService;
 import com.qmth.teachcloud.common.service.CommonCacheService;
+import com.qmth.teachcloud.common.service.TSAuthService;
 import com.qmth.teachcloud.common.util.FileStoreUtil;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.slf4j.Logger;

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TSAuthServiceImpl.java → teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TSAuthServiceImpl.java

@@ -1,9 +1,9 @@
-package com.qmth.distributed.print.business.service.impl;
+package com.qmth.teachcloud.common.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.entity.TSAuth;
-import com.qmth.distributed.print.business.mapper.TSAuthMapper;
-import com.qmth.distributed.print.business.service.TSAuthService;
+import com.qmth.teachcloud.common.entity.TSAuth;
+import com.qmth.teachcloud.common.mapper.TSAuthMapper;
+import com.qmth.teachcloud.common.service.TSAuthService;
 import org.springframework.stereotype.Service;
 
 /**

+ 1 - 1
distributed-print-business/src/main/resources/mapper/TSAuthMapper.xml → teachcloud-common/src/main/resources/mapper/TSAuthMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qmth.distributed.print.business.mapper.TSAuthMapper">
+<mapper namespace="com.qmth.teachcloud.common.mapper.TSAuthMapper">
 
 </mapper>

+ 2 - 2
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeDataCheckServiceImpl.java

@@ -18,9 +18,9 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
- * @Description:
+ * @Description: 教研分析数据校验服务实现类
  * @Author: CaoZixuan
- * @Date:
+ * @Date: 2022-06-09
  */
 @Service
 public class AnalyzeDataCheckServiceImpl implements AnalyzeDataCheckService {

+ 5 - 5
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeDataGetAndEditServiceImpl.java

@@ -82,7 +82,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
     public boolean tbPaperDispose(Long examId, String courseCode, Long schoolId) throws IOException {
         boolean repeat = false;
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
-            throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
+            return false;
         }
         String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
         PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(schoolId, examId, courseCode);
@@ -149,7 +149,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
     public boolean tbPaperDimensionDispose(Long examId, String courseCode, Long schoolId) throws IOException {
         boolean repeat = false;
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
-            throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
+            return false;
         }
         List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(schoolId, examId, courseCode);
 
@@ -205,7 +205,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
     public boolean tbPaperStructDispose(Long examId, String courseCode, Long schoolId) throws IOException {
         boolean repeat = false;
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
-            throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
+            return false;
         }
         List<TBPaper> tbPaperList = tbPaperService.list(new QueryWrapper<TBPaper>().lambda().eq(TBPaper::getExamId, examId).eq(TBPaper::getCourseCode, courseCode));
         if (tbPaperList.size() != 1) {
@@ -297,7 +297,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
     public boolean tbPaperModuleDispose(Long examId, String courseCode, Long schoolId) throws IOException {
         boolean repeat = false;
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
-            throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
+            return false;
         }
         String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
         List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(schoolId, examId, courseCode);
@@ -399,7 +399,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
     public boolean tbExamStudentScoreDatasourceDispose(Long examId, String courseCode, Long schoolId) throws IOException {
         boolean repeat = false;
         if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
-            throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
+            return false;
         }
         String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
         List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(schoolId, examId, courseCode);

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

@@ -28,12 +28,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.net.URLDecoder;
-import java.util.List;
 import java.util.Optional;
 
 /**
@@ -84,7 +86,7 @@ public class OpenApiController {
         Optional.ofNullable(basicSemesterParams).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("转换后的数据为空"));
         basicSemesterParams.validParams();
         BasicSchool basicSchool = AuthThirdUtil.hasPermission();
-        return ResultUtil.ok(basicSemesterService.saveBasicSemesterCommon(basicSemesterParams, basicSchool.getId(), null,true));
+        return ResultUtil.ok(basicSemesterService.saveBasicSemesterCommon(basicSemesterParams, basicSchool.getId(), null, true));
     }
 
     @ApiOperation(value = "考试创建/更新接口")
@@ -154,28 +156,12 @@ public class OpenApiController {
 
         Boolean publishStatus = publishParams.getPublishStatus();
         PublishStatusEnum publishStatusEnum;
-        if (publishStatus){
+        if (publishStatus) {
             publishStatusEnum = PublishStatusEnum.PUBLISH;
-        }else {
+        } else {
             publishStatusEnum = PublishStatusEnum.UN_PUBLISH;
         }
-        analyzeForReportService.publishReport(publishParams.getExamId(),publishParams.getCourseCode(),publishStatusEnum);
-        return ResultUtil.ok(true);
-    }
-
-
-    @ApiOperation(value = "生成课程(试卷)分析报告接口测试")
-    @ApiResponses({@ApiResponse(code = 200, message = "生成课程(试卷)分析报告接口", response = Object.class)})
-    @RequestMapping(value = "/calculate_test", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result calculateTest(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
-                            @ApiParam(value = "科目编号", required = true) @RequestParam List<String> courseCode,
-                            @ApiParam(value = "学校id", required = true) @RequestParam Long schoolId) throws IOException {
-        CalculateParams calculateParams = new CalculateParams();
-        calculateParams.setSchoolId(schoolId);
-        calculateParams.setCourseCode(courseCode);
-        calculateParams.setExamId(examId);
-        courseCodeSyncTaskService.start(calculateParams);
+        analyzeForReportService.publishReport(publishParams.getExamId(), publishParams.getCourseCode(), publishStatusEnum);
         return ResultUtil.ok(true);
     }
 }

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

@@ -145,8 +145,6 @@ public class SsoApiController {
         ThirdUserAuthCacheUtil.setAuthCode(userAuthenticationDto);
         String pattern = "{0}{1}{2}";
         String code = URLEncoder.encode(MessageFormat.format(pattern, userAuthenticationDto.getUid(), SignatureEntityTest.FIELD_JOINER, SignatureEntityTest.encrypt(userAuthenticationDto.getCode())), SystemConstant.CHARSET_NAME);
-
-        ThirdUserAuthCacheUtil.deleteCache(sysUser.getId());
         ThirdUserAuthCacheUtil.setAuthReturnUrl(String.valueOf(sysUser.getId()), returnUrl);
 
         HttpServletResponse response = ServletUtil.getResponse();
@@ -182,6 +180,7 @@ public class SsoApiController {
         LoginResult loginResult = teachcloudCommonService.login(sysUser.getPassword(), sysUser, appSource);
         loginResult.setReturnUrl(ThirdUserAuthCacheUtil.getAuthReturnUrl(String.valueOf(sysUser.getId())));
         ThirdUserAuthCacheUtil.deleteAuthCode(values[0]);
+        ThirdUserAuthCacheUtil.deleteCache(sysUser.getId());
         return ResultUtil.ok(loginResult);
     }
 

+ 6 - 0
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysController.java

@@ -93,6 +93,9 @@ public class SysController {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
+        if (Objects.nonNull(login.getSchoolCode()) && login.getSchoolCode().contains("#")) {
+            login.setSchoolCode(login.getSchoolCode().substring(0, login.getSchoolCode().indexOf("#")));
+        }
 
         BasicSchool basicSchool = null;
         if (!Objects.equals(login.getSchoolCode().toUpperCase(), RoleTypeEnum.ADMIN.name())) {
@@ -218,6 +221,9 @@ public class SysController {
     @ApiResponses({@ApiResponse(code = 200, message = "学校信息", response = EditResult.class)})
     @Aac(auth = BOOL.FALSE)
     public Result queryBySchoolCode(@ApiParam(value = "机构code", required = true) @RequestParam String code) {
+        if (Objects.nonNull(code) && code.contains("#")) {
+            code = code.substring(0, code.indexOf("#"));
+        }
         if (!Objects.equals(code.toUpperCase(), RoleTypeEnum.ADMIN.name())) {
             BasicSchool basicSchool = commonCacheService.schoolCache(code);
             if (Objects.isNull(basicSchool)) {

+ 0 - 142
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/TestCallPrintOpenApiController.java

@@ -1,142 +0,0 @@
-package com.qmth.teachcloud.report.api;
-
-import com.alibaba.fastjson.JSON;
-import com.qmth.boot.api.annotation.Aac;
-import com.qmth.boot.api.annotation.BOOL;
-import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.teachcloud.common.util.Result;
-import com.qmth.teachcloud.common.util.ResultUtil;
-import com.qmth.teachcloud.report.business.bean.dto.printOpen.*;
-import com.qmth.teachcloud.report.business.bean.params.CalculateParams;
-import com.qmth.teachcloud.report.business.service.AnalyzeDataCalculateService;
-import com.qmth.teachcloud.report.business.service.AnalyzeDataCheckService;
-import com.qmth.teachcloud.report.business.service.AnalyzeDataGetAndEditService;
-import com.qmth.teachcloud.report.business.service.CallPrintOpenApiService;
-import io.swagger.annotations.*;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-/**
- * @Description: 需要删除的controllor
- * @Author: CaoZixuan
- * @Date:
- */
-@Api(tags = "测试请求分布式印刷开放接口Controller")
-@RestController
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/test/call")
-@Validated
-@Deprecated
-public class TestCallPrintOpenApiController {
-    @Resource
-    CallPrintOpenApiService callPrintOpenApiService;
-    @Resource
-    AnalyzeDataCalculateService analyzeDataCalculateService;
-    @Resource
-    AnalyzeDataCheckService analyzeDataCheckService;
-    @Resource
-    AnalyzeDataGetAndEditService analyzeDataGetAndEditService;
-
-    @ApiOperation(value = "试卷配置")
-    @ApiResponses({@ApiResponse(code = 200, message = "试卷配置", response = Object.class)})
-    @RequestMapping(value = "/paper_config", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result paperConfig(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
-                              @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(2L,thirdExamId, courseCode);
-        System.out.println(JSON.toJSONString(paperConfig));
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "维度配置")
-    @ApiResponses({@ApiResponse(code = 200, message = "试卷配置", response = Object.class)})
-    @RequestMapping(value = "/paper_dimension", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result paperDimension(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
-                                 @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(2L,thirdExamId, courseCode);
-        System.out.println(JSON.toJSONString(paperDimensionList));
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "蓝图配置")
-    @ApiResponses({@ApiResponse(code = 200, message = "试卷配置", response = Object.class)})
-    @RequestMapping(value = "/paper_struct", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result paperStruct(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
-                              @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(2L,thirdExamId, courseCode);
-        System.out.println(JSON.toJSONString(paperStructureList));
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "模块配置")
-    @ApiResponses({@ApiResponse(code = 200, message = "试卷配置", response = Object.class)})
-    @RequestMapping(value = "/paper_module", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result paperModule(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
-                              @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(2L,thirdExamId, courseCode);
-        System.out.println(JSON.toJSONString(paperEvaluationList));
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "考生成绩")
-    @ApiResponses({@ApiResponse(code = 200, message = "考生成绩", response = Object.class)})
-    @RequestMapping(value = "/exam_student_score", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result examStudentScore(@ApiParam(value = "考试id", required = true) @RequestParam Long thirdExamId,
-                                   @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode) throws IOException {
-        List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(2L,thirdExamId, courseCode);
-        System.out.println(JSON.toJSONString(examStudentScoreList));
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "获取和新增数据")
-    @ApiResponses({@ApiResponse(code = 200, message = "获取和新增数据", response = Object.class)})
-    @RequestMapping(value = "/insert_analyze_data", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result insertAnalyzeData(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
-                                    @ApiParam(value = "科目编号", required = true) @RequestParam String courseCode,
-                                    @ApiParam(value = "学校id", required = true) @RequestParam Long schoolId) throws IOException {
-        analyzeDataGetAndEditService.dataGetAndEdit(examId, courseCode, schoolId);
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "数据检验和分析触发器")
-    @ApiResponses({@ApiResponse(code = 200, message = "数据检验和分析触发器", response = Object.class)})
-    @RequestMapping(value = "/check_and_trigger", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result checkAndTrigger(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
-                                  @ApiParam(value = "科目编号", required = true) @RequestParam List<String> courseCode,
-                                  @ApiParam(value = "学校id", required = true) @RequestParam Long schoolId) throws IOException {
-        CalculateParams calculateParams = new CalculateParams();
-        calculateParams.setSchoolId(schoolId);
-        calculateParams.setCourseCode(courseCode);
-        calculateParams.setExamId(examId);
-        analyzeDataCheckService.analyzeDataCheck(calculateParams);
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "数据计算")
-    @ApiResponses({@ApiResponse(code = 200, message = "数据计算", response = Object.class)})
-    @RequestMapping(value = "/calculate", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    public Result calculate(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
-                            @ApiParam(value = "科目编号", required = true) @RequestParam List<String> courseCode,
-                            @ApiParam(value = "学校id", required = true) @RequestParam Long schoolId) throws IOException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException {
-        CalculateParams calculateParams = new CalculateParams();
-        calculateParams.setSchoolId(schoolId);
-        calculateParams.setCourseCode(courseCode);
-        calculateParams.setExamId(examId);
-        analyzeDataCalculateService.dataCalculateStart(calculateParams);
-        return ResultUtil.ok();
-    }
-}

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

@@ -12,6 +12,7 @@ import com.qmth.teachcloud.common.entity.TBSession;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.PrivilegePropertyEnum;
 import com.qmth.teachcloud.common.enums.RoleTypeEnum;
+import com.qmth.teachcloud.common.service.AuthInfoService;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.RedisUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -22,7 +23,6 @@ import org.springframework.stereotype.Component;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.List;
 import java.util.Objects;
 import java.util.Set;
 
@@ -39,6 +39,9 @@ public class TeachcloudReportAuthenticationService implements AuthorizationServi
     @Resource
     DictionaryConfig dictionaryConfig;
 
+    @Resource
+    AuthInfoService authInfoService;
+
     @Override
     public AccessEntity findByIdentity(String identity, SignatureType signatureType, String path) {
         return new TeachcloudReportSession(identity, SignatureType.TOKEN);
@@ -117,6 +120,9 @@ public class TeachcloudReportAuthenticationService implements AuthorizationServi
         if (count > 0) {
             return true;
         }
+        if (Objects.nonNull(authBean.getSchool())) {
+            authInfoService.appHasExpired(authBean.getSchool().getCode());
+        }
         //系统公用接口不拦截
         Set<String> sysUrls = commonCacheService.privilegeUrlCache(PrivilegePropertyEnum.SYS);
         int sysCount = Objects.nonNull(sysUrls) ? (int) sysUrls.stream().filter(s -> s.equalsIgnoreCase(path)).count() : 0;

+ 6 - 2
teachcloud-report/src/main/java/com/qmth/teachcloud/report/start/StartRunning.java

@@ -1,7 +1,7 @@
 package com.qmth.teachcloud.report.start;
 
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.service.OrgCenterDataDisposeService;
+import com.qmth.teachcloud.common.service.AuthInfoService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.CommandLineRunner;
@@ -20,14 +20,18 @@ import javax.annotation.Resource;
 public class StartRunning implements CommandLineRunner {
     private final static Logger log = LoggerFactory.getLogger(StartRunning.class);
 
+//    @Resource
+//    private OrgCenterDataDisposeService orgCenterDataDisposeService;
+
     @Resource
-    private OrgCenterDataDisposeService orgCenterDataDisposeService;
+    AuthInfoService authInfoService;
 
     @Override
     public void run(String... args) throws Exception {
         log.info("服务器启动时执行 start");
         SystemConstant.initTempFiles();
 //        orgCenterDataDisposeService.updateSchoolInfo();
+        authInfoService.appInfoInit();
         log.info("服务器启动时执行 end");
     }
 }

+ 4 - 0
teachcloud-report/src/main/resources/application-36dev.properties

@@ -142,6 +142,10 @@ print.open.paperStructure=/api/admin/print/open/paper_structure
 print.open.paperEvaluation=/api/admin/print/open/paper_evaluation
 print.open.examStudentScore=/api/admin/print/open/exam_student_score
 
+com.qmth.solar.access-key=0bf05ef4857b4fb58b6cd480b7f0dcd0
+com.qmth.solar.access-secret=28yvjWPtLqIQPgxS2UWZPAF8McwMteaZ
+#com.qmth.solar.license=/Volumes/extend/\u542F\u660E/\u5206\u5E03\u5F0F\u5370\u5237/\u5206\u5E03\u5F0F\u5370\u5237&\u6559\u7814\u5206\u6790v3.1.0/jy-dev-wangliang.lic
+
 #============================================================================
 # \u914D\u7F6EJobStore
 #============================================================================

+ 7 - 2
teachcloud-report/src/main/resources/application-dev.properties

@@ -56,7 +56,7 @@ sys.config.customThreadPoolCoreSize=true
 sys.config.analyzeThreadPoolCoreSize=false
 sys.config.sessionActive=1h
 sys.config.reportUrl=http://localhost:9099/#/student-report/
-sys.config.loginAuthenUrl=http://192.168.10.86:8057/#/login-authen/
+sys.config.loginAuthenUrl=http://127.0.0.1:8057/#/login-authen/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 
 org.center.url=https://solar.qmth.com.cn
@@ -94,6 +94,7 @@ prefix.url.datasource=report/datasource
 prefix.url.analyze=report/analyze
 prefix.url.open=report/open
 prefix.url.sso=report/sso
+prefix.url.auth=admin/auth
 
 #\u65E5\u5FD7\u914D\u7F6E
 com.qmth.logging.root-level=info
@@ -133,7 +134,7 @@ sms.config.aliyunSMSAuditOverdueCode=SMS_217416271
 yun.mark.url=http://192.168.10.224:80
 yun.mark.studentScoreApi=/api/exam/student/score
 
-print.open.hostUrl=http://192.168.10.86:7001
+print.open.hostUrl=http://127.0.0.1:7001
 print.open.callbackUrlApi=/api/admin/print/notify/analysis/progress
 print.open.callbackPwd=123456
 print.open.paperConfig=/api/admin/print/open/paper_config
@@ -142,6 +143,10 @@ print.open.paperStructure=/api/admin/print/open/paper_structure
 print.open.paperEvaluation=/api/admin/print/open/paper_evaluation
 print.open.examStudentScore=/api/admin/print/open/exam_student_score
 
+com.qmth.solar.access-key=0bf05ef4857b4fb58b6cd480b7f0dcd0
+com.qmth.solar.access-secret=28yvjWPtLqIQPgxS2UWZPAF8McwMteaZ
+#com.qmth.solar.license=/Volumes/extend/\u542F\u660E/\u5206\u5E03\u5F0F\u5370\u5237/\u5206\u5E03\u5F0F\u5370\u5237&\u6559\u7814\u5206\u6790v3.1.0/jy-dev-wangliang.lic
+
 #============================================================================
 # \u914D\u7F6EJobStore
 #============================================================================

+ 4 - 0
teachcloud-report/src/main/resources/application-release.properties

@@ -142,6 +142,10 @@ print.open.paperStructure=/api/admin/print/open/paper_structure
 print.open.paperEvaluation=/api/admin/print/open/paper_evaluation
 print.open.examStudentScore=/api/admin/print/open/exam_student_score
 
+com.qmth.solar.access-key=0bf05ef4857b4fb58b6cd480b7f0dcd0
+com.qmth.solar.access-secret=28yvjWPtLqIQPgxS2UWZPAF8McwMteaZ
+#com.qmth.solar.license=/Volumes/extend/\u542F\u660E/\u5206\u5E03\u5F0F\u5370\u5237/\u5206\u5E03\u5F0F\u5370\u5237&\u6559\u7814\u5206\u6790v3.1.0/jy-dev-wangliang.lic
+
 #============================================================================
 # \u914D\u7F6EJobStore
 #============================================================================

+ 4 - 0
teachcloud-report/src/main/resources/application-test.properties

@@ -142,6 +142,10 @@ print.open.paperStructure=/api/admin/print/open/paper_structure
 print.open.paperEvaluation=/api/admin/print/open/paper_evaluation
 print.open.examStudentScore=/api/admin/print/open/exam_student_score
 
+com.qmth.solar.access-key=0bf05ef4857b4fb58b6cd480b7f0dcd0
+com.qmth.solar.access-secret=28yvjWPtLqIQPgxS2UWZPAF8McwMteaZ
+#com.qmth.solar.license=/Volumes/extend/\u542F\u660E/\u5206\u5E03\u5F0F\u5370\u5237/\u5206\u5E03\u5F0F\u5370\u5237&\u6559\u7814\u5206\u6790v3.1.0/jy-dev-wangliang.lic
+
 #============================================================================
 # \u914D\u7F6EJobStore
 #============================================================================