wangliang пре 2 година
родитељ
комит
65c71e2e80

+ 1 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -360,9 +360,7 @@ public class SysController {
         }
         if (!code.equalsIgnoreCase(SystemConstant.ADMIN_CODE)) {
             BasicSchool basicSchool = commonCacheService.schoolCache(code);
-            if (Objects.isNull(basicSchool)) {
-                throw ExceptionResultEnum.SCHOOL_NO_DATA.exception();
-            }
+            Optional.ofNullable(basicSchool).orElseThrow(() -> ExceptionResultEnum.SCHOOL_NO_DATA.exception());
             authInfoService.appHasExpired(code);
             Map<String, String> map = new HashMap<>();
             if (Objects.nonNull(basicSchool.getLogo()) && (!basicSchool.getLogo().startsWith("http") || !basicSchool.getLogo().startsWith("https"))) {

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicSchool.java

@@ -45,12 +45,12 @@ public class BasicSchool extends BaseEntity implements Serializable {
 
     }
 
-    public BasicSchool(String code, String name, String accessKey, String accessSecret) {
+    public BasicSchool(Long id, String code, String name, String accessKey, String accessSecret) {
         this.code = code;
         this.name = name;
         this.accessKey = accessKey;
         this.accessSecret = accessSecret;
-        setId(SystemConstant.getDbUuid());
+        setId(id);
         this.enable = true;
     }
 

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

@@ -202,7 +202,7 @@ public class AuthInfoServiceImpl implements AuthInfoService {
             basicSchoolQueryWrapper.lambda().eq(BasicSchool::getCode, o.getCode());
             BasicSchool basicSchool = basicSchoolService.getOne(basicSchoolQueryWrapper);
             if (Objects.isNull(basicSchool)) {//不存在则创建学校
-                basicSchool = new BasicSchool(o.getCode(), o.getName(), o.getAccessKey(), o.getAccessSecret());
+                basicSchool = new BasicSchool(o.getId(), o.getCode(), o.getName(), o.getAccessKey(), o.getAccessSecret());
                 if (Objects.nonNull(o.getLogo()) && (!o.getLogo().startsWith("https:") || !o.getLogo().startsWith("http"))) {
                     String filePath = dictionaryConfig.fssLocalFileDomain().getConfig() + File.separator + SystemConstant.getUuid() + ".jpg";
                     File logoFile = new File(filePath);