Hu Jie 7 anni fa
parent
commit
0c36d9fb3e

+ 6 - 6
src/main/java/com/uas/erp/schedular/listen/ListenTask.java

@@ -64,18 +64,18 @@ public class ListenTask {
         List<Master> masters = new ArrayList<>();
         List<Master> all = new ArrayList<>();
         try {
-            String resultStr = restTemplate.getForObject(getUrl() + "/v1/master/list?cloudEnabled=true", String.class);
             String allStr = restTemplate.getForObject(getUrl() + "/v1/master/list", String.class);
-            ResultListWrap<Master> result = JSON.parseObject(resultStr, new TypeReference<ResultListWrap<Master>>(Master.class) {
-            });
             ResultListWrap<Master> allList = JSON.parseObject(allStr, new TypeReference<ResultListWrap<Master>>(Master.class) {
             });
-            if (result.isSuccess()) {
-                masters = result.getContent();
-            }
             if (allList.isSuccess()) {
                 all = allList.getContent();
             }
+            String resultStr = restTemplate.getForObject(getUrl() + "/v1/master/list?cloudEnabled=true", String.class);
+            ResultListWrap<Master> result = JSON.parseObject(resultStr, new TypeReference<ResultListWrap<Master>>(Master.class) {
+            });
+            if (result.isSuccess()) {
+                masters = result.getContent();
+            }
         } catch (Exception e) {
 
         } finally {