dengsixing 7 bulan lalu
induk
melakukan
909bb8dda1

+ 1 - 0
src/main/java/com/fdkankan/contro/constant/BdProperties.java

@@ -12,6 +12,7 @@ public class BdProperties {
     private String downloadAddress;
     private String account;
     private String pass;
+    private boolean encode;
     private String dataSystemId;
     private String dataOrgCode;
     private String login;

+ 9 - 0
src/main/java/com/fdkankan/contro/schedule/ScheduleJob.java

@@ -1,17 +1,25 @@
 package com.fdkankan.contro.schedule;
 
+import com.fdkankan.contro.service.GzZcdjzxService;
 import com.fdkankan.contro.service.IScene3dNumService;
+import com.fdkankan.contro.util.BdUtil;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
+
 @Log4j2
 @Component
 public class ScheduleJob {
 
     @Autowired
     private IScene3dNumService scene3dNumService;
+    @Resource
+    private BdUtil bdUtil;
+    @Autowired
+    private GzZcdjzxService gzZcdjzxService;
 
 
     /**
@@ -27,5 +35,6 @@ public class ScheduleJob {
      */
     @Scheduled(fixedDelay = 10*60*1000, initialDelay = 1000)
     public void bd() {
+        gzZcdjzxService.bd();
     }
 }

+ 0 - 4
src/main/java/com/fdkankan/contro/service/impl/GzZcdjzxServiceImpl.java

@@ -39,10 +39,6 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
     @Resource
     private CustomHttpClient httpClient;
     @Resource
-    private LocalFileService localFileService;
-    @Resource
-    private LocalConstants localConstants;
-    @Resource
     private FYunFileConfig fYunFileConfig;
     @Autowired
     private ISceneFileBuildService sceneFileBuildService;

+ 8 - 3
src/main/java/com/fdkankan/contro/util/BdUtil.java

@@ -26,10 +26,15 @@ public class BdUtil {
     public String login(){
         Map<String, String> params = new HashMap<>();
         params.put("account", bdProperties.getAccount());
-        params.put("pass", DigestUtils.md5DigestAsHex(bdProperties.getPass().getBytes()));
+        String pass = bdProperties.getPass();
+        if(bdProperties.isEncode()){
+            pass = DigestUtils.md5DigestAsHex(bdProperties.getPass().getBytes());
+        }
+        params.put("pass", pass);
         String url = bdProperties.getAddress() + bdProperties.getLogin();
         JSONObject jsonObject = httpClient.postJson(url, params);
-        String token = jsonObject.getString("token");
+        JSONObject data = jsonObject.getJSONObject("data");
+        String token = data.getString("token");
         if(StrUtil.isEmpty(token)){
             throw new RuntimeException("登录失败");
         }
@@ -99,7 +104,7 @@ public class BdUtil {
         params.put("id,", id);
         params.put("thirdFlag", thirdFlag);
         params.put("operateResult", operateResult);
-        String url = bdProperties.getAddress() + bdProperties.getSearchDataFerryInner();
+        String url = bdProperties.getAddress() + bdProperties.getUpdateDataFerryInner();
         JSONObject upload = httpClient.postJson(url, headers, params);
     }
 

+ 8 - 3
src/main/resources/bootstrap.yml

@@ -3,9 +3,10 @@ spring:
     name: model-control
   cloud:
     nacos:
-      username: xxx
-      password: xxxx
-      server-addr: 127.0.0.1:8848
+      username: nacos
+      password: dhsu31AA4dage168.
+      server-addr: 192.168.0.125:18848
+      namespace: prod
       config:
         file-extension: yaml
         namespace: ${spring.cloud.nacos.namespace}
@@ -37,6 +38,10 @@ spring:
           - data-id: common-logback-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: common-logback-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         namespace: ${spring.cloud.nacos.namespace}