瀏覽代碼

加入数据对接模块

wangliang 1 周之前
父節點
當前提交
34069eb85e
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      data-docking/src/main/java/com/qmth/data/docking/util/zufe/ZufeDataDockingUtil.java

+ 11 - 5
data-docking/src/main/java/com/qmth/data/docking/util/zufe/ZufeDataDockingUtil.java

@@ -77,7 +77,9 @@ public class ZufeDataDockingUtil {
         TSToken tsTokenDb = null;
         try {
             log.info("login is come in");
-            this.commonValidate();
+            if (!this.commonValidate()) {
+                return tsTokenDb;
+            }
 
             ImmutableMap params = new ImmutableMap.Builder<String, Object>().put("key", key)
                     .put("secret", secret).build();
@@ -130,7 +132,9 @@ public class ZufeDataDockingUtil {
         StringJoiner stringJoiner = new StringJoiner("");
         try {
             log.info("course is come in");
-            this.commonValidate();
+            if (!this.commonValidate()) {
+                return;
+            }
 
             int page = SystemConstant.MIN_QUERY_SIZE, perPage = SystemConstant.MAX_QUERY_SIZE;
             Map<String, Object> params = Maps.newHashMap();
@@ -244,7 +248,9 @@ public class ZufeDataDockingUtil {
         StringJoiner stringJoiner = new StringJoiner("");
         try {
             log.info("exam is come in");
-            this.commonValidate();
+            if (!this.commonValidate()) {
+                return;
+            }
 
             int page = SystemConstant.MIN_QUERY_SIZE, perPage = SystemConstant.MAX_QUERY_SIZE;
             Map<String, Object> params = Maps.newHashMap();
@@ -349,9 +355,9 @@ public class ZufeDataDockingUtil {
     /**
      * 公共校验
      */
-    public void commonValidate() {
+    public boolean commonValidate() {
         authInfoService.appHasExpired(SCHOOL_CODE);
         BasicSchool basicSchool = commonCacheService.schoolCache(SCHOOL_CODE);
-        Objects.requireNonNull(basicSchool, "学校信息不存在");
+        return Objects.isNull(basicSchool) ? false : true;
     }
 }