From 69270bd602eea005351e46089a00fe6604c21c08 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 25 六月 2024 18:42:39 +0800
Subject: [PATCH] 添加统一编码上报地址配置

---
 src/main/java/com/fzzy/api/entity/ApiConfs.java           |    4 ++
 src/main/java/com/fzzy/api/view/pr/GbUnifiedCodingPR.java |   17 +++++++-
 src/main/resources/application-pro.yml                    |   25 +++++-------
 src/main/java/com/fzzy/api/view/ApiConfs.view.xml         |   25 +++++++++---
 4 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/fzzy/api/entity/ApiConfs.java b/src/main/java/com/fzzy/api/entity/ApiConfs.java
index 139ecb1..db1f44e 100644
--- a/src/main/java/com/fzzy/api/entity/ApiConfs.java
+++ b/src/main/java/com/fzzy/api/entity/ApiConfs.java
@@ -158,6 +158,10 @@
     @Column(name = "exe_tag", length = 2)
     private String exeTag = Constant.YN_Y;
 
+    @PropertyDef(label = "缁熶竴缂栫爜鎷夊彇鍦板潃")
+    @Column(name = "GB_CODING_Url", length = 200)
+    private String gbCodingUrl;
+
     @PropertyDef(label = "缁熶竴缂栫爜涓婁紶")
     @Column(name = "GB_CODING_TAG_", length = 200)
     private String gbCodingTag;
diff --git a/src/main/java/com/fzzy/api/view/ApiConfs.view.xml b/src/main/java/com/fzzy/api/view/ApiConfs.view.xml
index d09870e..bc98d40 100644
--- a/src/main/java/com/fzzy/api/view/ApiConfs.view.xml
+++ b/src/main/java/com/fzzy/api/view/ApiConfs.view.xml
@@ -200,6 +200,10 @@
           <Property name="valueProperty">name</Property>
         </Property>
       </PropertyDef>
+      <PropertyDef name="gbCodingUrl">
+        <Property></Property>
+        <Property name="label">缁熶竴缂栫爜鍦板潃</Property>
+      </PropertyDef>
       <PropertyDef name="gbCodingTag">
         <Property></Property>
         <Property name="label">缁熶竴缂栫爜涓婁紶</Property>
@@ -439,10 +443,16 @@
                   <Property name="labelWidth">120</Property>
                   <Editor/>
                 </AutoFormElement>
-                <AutoFormElement layoutConstraint="colSpan:2">
+                <AutoFormElement>
                   <Property name="name">password</Property>
                   <Property name="property">password</Property>
                   <Property name="editorType">PasswordEditor</Property>
+                  <Property name="labelWidth">125</Property>
+                  <Editor/>
+                </AutoFormElement>
+                <AutoFormElement>
+                  <Property name="name">publicKey</Property>
+                  <Property name="property">publicKey</Property>
                   <Property name="labelWidth">125</Property>
                   <Editor/>
                 </AutoFormElement>
@@ -452,9 +462,10 @@
                   <Property name="labelWidth">125</Property>
                   <Editor/>
                 </AutoFormElement>
+
                 <AutoFormElement layoutConstraint="colSpan:2">
-                  <Property name="name">publicKey</Property>
-                  <Property name="property">publicKey</Property>
+                  <Property name="name">apiUrl</Property>
+                  <Property name="property">apiUrl</Property>
                   <Property name="labelWidth">125</Property>
                   <Editor/>
                 </AutoFormElement>
@@ -465,8 +476,8 @@
                   <Editor/>
                 </AutoFormElement>
                 <AutoFormElement layoutConstraint="colSpan:2">
-                  <Property name="name">apiUrl</Property>
-                  <Property name="property">apiUrl</Property>
+                  <Property name="name">imgUrl</Property>
+                  <Property name="property">imgUrl</Property>
                   <Property name="labelWidth">125</Property>
                   <Editor/>
                 </AutoFormElement>
@@ -477,8 +488,8 @@
                   <Editor/>
                 </AutoFormElement>
                 <AutoFormElement layoutConstraint="colSpan:2">
-                  <Property name="name">imgUrl</Property>
-                  <Property name="property">imgUrl</Property>
+                  <Property name="name">gbCodingUrl</Property>
+                  <Property name="property">gbCodingUrl</Property>
                   <Property name="labelWidth">125</Property>
                   <Editor/>
                 </AutoFormElement>
diff --git a/src/main/java/com/fzzy/api/view/pr/GbUnifiedCodingPR.java b/src/main/java/com/fzzy/api/view/pr/GbUnifiedCodingPR.java
index 4770c01..9d99da6 100644
--- a/src/main/java/com/fzzy/api/view/pr/GbUnifiedCodingPR.java
+++ b/src/main/java/com/fzzy/api/view/pr/GbUnifiedCodingPR.java
@@ -7,7 +7,9 @@
 import com.fzzy.api.dto.GbCodingData;
 import com.fzzy.api.dto.ReqGbCoding;
 import com.fzzy.api.dto.RespGbCoding;
+import com.fzzy.api.entity.ApiConfs;
 import com.fzzy.api.entity.GbUnifiedCoding;
+import com.fzzy.api.service.ApiCommonService;
 import com.fzzy.api.view.repository.GbUnifiedCodingRep;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
@@ -36,11 +38,13 @@
 @Component
 public class GbUnifiedCodingPR {
 
-    private static final String GB_CODING_URL = "http://121.36.17.6:28088/admin-api/coding/fmxx/queryDataInfo";
+    private static final String GB_CODING_URL = "http://101.36.160.117:28088/admin-api/coding/fmxx/queryDataInfo";
     @Autowired
     private GbUnifiedCodingRep codingRep;
     @Autowired
     private RestTemplate restTemplate;
+    @Autowired
+    private ApiCommonService apiCommonService;
 
     /**
      * gbUnifiedCodingPR#pageList
@@ -117,9 +121,18 @@
             return "鎵ц澶辫触锛氬崟浣嶇紪鐮佷负绌猴紝璇锋牳鏌ワ紒";
         }
 
+        String url = GB_CODING_URL;
+        List<ApiConfs> apiConfs = apiCommonService.listCacheConf();
+        if(null != apiConfs || apiConfs.size() > 0){
+            ApiConfs apiConf = apiConfs.get(0);
+            if(null != apiConf && StringUtils.isNotEmpty(apiConf.getGbCodingUrl())){
+                url = apiConf.getGbCodingUrl();
+            }
+        }
+
         //璁剧疆鍙傛暟
         ReqGbCoding reqGbCoding = new ReqGbCoding(dwdm);
-        RespGbCoding respGbCoding = restTemplate.postForObject(GB_CODING_URL, reqGbCoding, RespGbCoding.class);
+        RespGbCoding respGbCoding = restTemplate.postForObject(url, reqGbCoding, RespGbCoding.class);
         if(null == respGbCoding){
             return "鎷夊彇鏁版嵁澶辫触锛岃閲嶈瘯锛�";
         }
diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml
index eb88f33..8c771ea 100644
--- a/src/main/resources/application-pro.yml
+++ b/src/main/resources/application-pro.yml
@@ -1,4 +1,4 @@
-##########################  涓婃捣鍢夊畾 -C鐩� pro   ##########################
+##########################  骞夸笢姹曞ご娼崡   ##########################
 server:
   port: 8090
   jetty:
@@ -9,16 +9,16 @@
   datasource:
     #涓绘暟鎹簮
     primary:
-      url: jdbc:mysql://192.168.200.3:3306/igds_api?useUnicode=true&characterEncoding=utf-8&useSSL=false
+      url: jdbc:mysql://127.0.0.1:3306/igds_api?useUnicode=true&characterEncoding=utf-8&useSSL=false
       driver-class-name: com.mysql.jdbc.Driver
       username: root
-      password: Abc123..
+      password: Fzzy@#$%5432..K
     #娆℃暟鎹簮
     secondary:
-      url: jdbc:mysql://192.168.200.3:3306/igds_master?useUnicode=true&characterEncoding=utf-8&useSSL=false
+      url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8&useSSL=false
       driver-class-name: com.mysql.jdbc.Driver
       username: root
-      password: Abc123..
+      password: Fzzy@#$%5432..K
   jpa:
     #涓籮pa閰嶇疆
     primary:
@@ -39,9 +39,9 @@
   # Redis鐩稿叧閰嶇疆
   redis:
     database: 1
-    host: 192.168.200.3
+    host: 127.0.0.1
     port: 6379
-    password: Abc123..
+    password: Redispwd..
     # 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級
     pool:
       max-active: 200
@@ -51,11 +51,6 @@
       timeout: 6000
 igds:
   default:
-    companyId: 5303
-  file-path: C:/IGDS-API/FILE/
-  img-path: C:/IGDS/FILE/
-  # 鐪佸钩鍙癛SA瀵嗛挜瀵逛俊鎭�
-  #鍏挜锛歁IGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsoiS5Q5CKAT9w5EbZXCxJO/5J2iV3i2HrTW/YcGs2EGeQsQc97EWPdFE1SPXGH5p9TO8nCFRJScj4WeeKUVcuRpzR7czQQ+c6kf6cR9LLQrAiGEMQSk13j/5UsJho23IQDGKWoH18f5aPdX8tJn/o4aR6mMxUY9jdaSKEBck1TQIDAQAB
-  # 鍖虹骇骞冲彴RSA瀵嗛挜瀵逛俊鎭�
-  #鍏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