Commit 5bd5f3fa30978a7de6c6bfda2db46f36b90cb047

Authored by bbb
1 parent b1483ddd

数据同步优化

... ... @@ -10,7 +10,7 @@ jdy-risk.host=https://jdy.changan.com.cn/api
10 10 jdy-risk.api-key=lOnr4ms8jfc0gbCwVYS7YtbYQXjBFq979Cc06BcC866427b2a7aAd054598Bc7bB
11 11
12 12 # ---------- QX write-back target ----------
13   -jdy-risk.qx.base-url=https://hfca.uat3.qgutech.com
  13 +jdy-risk.qx.base-url=http://10.144.201.35:8081
14 14 jdy-risk.qx.username=15077901670
15 15 jdy-risk.qx.password=000000
16 16 jdy-risk.qx.corp-code=hfca
... ... @@ -914,7 +914,7 @@ jdy-form-sync.jdy.host=https://jdy.changan.com.cn/api
914 914 jdy-form-sync.jdy.api-key=lOnr4ms8jfc0gbCwVYS7YtbYQXjBFq979Cc06BcC866427b2a7aAd054598Bc7bB
915 915 jdy-form-sync.export-dir=./export
916 916
917   -jdy-form-sync.qx.base-url=https://hfca.uat3.qgutech.com
  917 +jdy-form-sync.qx.base-url=http://10.144.201.35:8081
918 918 jdy-form-sync.qx.username=15077901670
919 919 jdy-form-sync.qx.password=000000
920 920 jdy-form-sync.qx.corp-code=hfca
... ... @@ -940,7 +940,7 @@ emp-sync.kb.table=biphr_ddm_empinfo_v
940 940 emp-sync.kb.driver-class=com.kingbase8.Driver
941 941 emp-sync.kb.filter=level_2_dept = '\u5408\u80a5\u957f\u5b89\u6c7d\u8f66\u6709\u9650\u516c\u53f8' OR level_3_dept IN ('\u5408\u80a5\u7814\u7a76\u9662','\u5408\u80a5\u957f\u5b89\u91c7\u8d2d\u5904')
942 942
943   -emp-sync.qx.base-url=https://hfca.uat3.qgutech.com
  943 +emp-sync.qx.base-url=http://10.144.201.35:8081
944 944 emp-sync.qx.username=15077901670
945 945 emp-sync.qx.password=000000
946 946 emp-sync.qx.corp-code=hfca
... ...
... ... @@ -54,6 +54,75 @@
54 54 </exclusions>
55 55 </dependency>
56 56 <dependency>
  57 + <groupId>com.qgutech.qgyun.framework</groupId>
  58 + <artifactId>qgyun-core-database</artifactId>
  59 + <version>2.1.5-SNAPSHOT</version>
  60 + </dependency>
  61 + <dependency>
  62 + <groupId>com.qgutech.qgyun.framework</groupId>
  63 + <artifactId>qgyun-core-common</artifactId>
  64 + <version>2.1.5-SNAPSHOT</version>
  65 + </dependency>
  66 + <dependency>
  67 + <groupId>org.springframework.boot</groupId>
  68 + <artifactId>spring-boot-starter-web</artifactId>
  69 + </dependency>
  70 + <dependency>
  71 + <groupId>tk.mybatis</groupId>
  72 + <artifactId>mapper-spring-boot-starter</artifactId>
  73 + <version>2.1.5</version>
  74 + </dependency>
  75 + <dependency>
  76 + <groupId>org.mybatis.spring.boot</groupId>
  77 + <artifactId>mybatis-spring-boot-starter</artifactId>
  78 + <version>1.3.2</version>
  79 + </dependency>
  80 + <dependency>
  81 + <groupId>com.github.pagehelper</groupId>
  82 + <artifactId>pagehelper</artifactId>
  83 + <version>6.0.1-SNAPSHOT</version>
  84 + </dependency>
  85 + <dependency>
  86 + <groupId>io.springfox</groupId>
  87 + <artifactId>springfox-swagger2</artifactId>
  88 + <version>2.8.0</version>
  89 + </dependency>
  90 + <dependency>
  91 + <groupId>io.springfox</groupId>
  92 + <artifactId>springfox-swagger-ui</artifactId>
  93 + <version>2.8.0</version>
  94 + </dependency>
  95 + <dependency>
  96 + <groupId>org.aspectj</groupId>
  97 + <artifactId>aspectjweaver</artifactId>
  98 + <version>1.8.14</version>
  99 + </dependency>
  100 + <dependency>
  101 + <groupId>commons-lang</groupId>
  102 + <artifactId>commons-lang</artifactId>
  103 + <version>2.6</version>
  104 + </dependency>
  105 + <dependency>
  106 + <groupId>org.lionsoul</groupId>
  107 + <artifactId>ip2region</artifactId>
  108 + <version>2.6.5</version>
  109 + </dependency>
  110 + <dependency>
  111 + <groupId>joda-time</groupId>
  112 + <artifactId>joda-time</artifactId>
  113 + <version>2.9.9</version>
  114 + </dependency>
  115 + <dependency>
  116 + <groupId>org.joda</groupId>
  117 + <artifactId>joda-convert</artifactId>
  118 + <version>2.2.0</version>
  119 + </dependency>
  120 + <dependency>
  121 + <groupId>com.github.jsqlparser</groupId>
  122 + <artifactId>jsqlparser</artifactId>
  123 + <version>4.7</version>
  124 + </dependency>
  125 + <dependency>
57 126 <groupId>mysql</groupId>
58 127 <artifactId>mysql-connector-java</artifactId>
59 128 <version>8.0.24</version>
... ...
... ... @@ -393,7 +393,7 @@ public class JdyRiskProperties {
393 393
394 394 /** 启效(QX)写回目标配置。 */
395 395 public static class Qx {
396   - /** 启效环境地址,如 https://hfca.uat3.qgutech.com */
  396 + /** 启效环境地址,如 http://10.144.201.35:8081 */
397 397 private String baseUrl;
398 398 private String username;
399 399 private String password;
... ...
... ... @@ -15,7 +15,7 @@ import java.util.Map;
15 15 * jdy-sync:
16 16 * enabled: true
17 17 * qx:
18   - * base-url: https://dev3.qgutech.com
  18 + * base-url: http://10.144.201.35:8081
19 19 * username: xx
20 20 * password: xx
21 21 * corp-code: default
... ...
... ... @@ -628,7 +628,7 @@ public class JdyRiskStatisticsService {
628 628 }
629 629 result.put(s.getId(), count);
630 630 log.info("\u573a\u666f[{}] \u547d\u4e2d={} (\u53c2\u4e0e\u7edf\u8ba1{}\u6761)", new Object[]{s.getId(), count, rows.size()});
631   - boolean skipAttach = (JdyRiskStatisticsService.isReasonType(type) || JdyRiskStatisticsService.isCustomSheetType(type) || JdyRiskStatisticsService.isDbType(type)) && count == 0L;
  631 + boolean skipAttach = count == 0L;
632 632 String fileId = null;
633 633 String fileName = null;
634 634 long size = 0L;
... ... @@ -657,9 +657,15 @@ public class JdyRiskStatisticsService {
657 657 if (todayRec != null) {
658 658 todayRec.put(qx.getCountField(), (Object)count);
659 659 JdyRiskStatisticsService.setTimeFields(todayRec, qx, now);
660   - if (!skipAttach && qx.getAttachField() != null && !qx.getAttachField().isEmpty()) {
661   - todayRec.put(qx.getAttachField(), (Object)this.buildAttach(fileId, fileName, size));
662   - todayRec.put(qx.getAttachField() + "Id", (Object)fileId);
  660 + if (qx.getAttachField() != null && !qx.getAttachField().isEmpty()) {
  661 + if (skipAttach || fileId == null) {
  662 + // 更新接口对 body 中缺省的字段按“保持原值”处理,必须显式传空数组才能清空
  663 + todayRec.put(qx.getAttachField(), (Object)new JSONArray());
  664 + todayRec.put(qx.getAttachField() + "Id", (Object)new JSONArray());
  665 + } else {
  666 + todayRec.put(qx.getAttachField(), (Object)this.buildAttach(fileId, fileName, size));
  667 + todayRec.put(qx.getAttachField() + "Id", (Object)fileId);
  668 + }
663 669 }
664 670 qxApi.updateData(token, qx.getAppId(), qx.getUpdateCode(), todayRec);
665 671 log.info("\u5f53\u5929\u5df2\u5b58\u5728\u2192\u66f4\u65b0\u6210\u529f: syncCode={} id={} {}={} \u9644\u4ef6={}", new Object[]{syncCode, todayRec.getString("id"), qx.getCountField(), count, fileName});
... ...
... ... @@ -52,10 +52,10 @@ jdy-sync:
52 52 # 简道云基础地址:独立域名/独享版用 https://<域名>/api(长安: https://jdy.changan.com.cn/api);公有云用 https://api.jiandaoyun.com/api
53 53 host: https://jdy.changan.com.cn/api
54 54 qx:
55   - base-url: https://dev3.qgutech.com # 启效3.0 环境地址
  55 + base-url: http://10.144.201.35:8081 # 启效3.0 环境地址
56 56 username: 15077901670
57 57 password: "000000"
58   - corp-code: default
  58 + corp-code: hfca
59 59 apps:
60 60 - name: 合肥长安_技术处 # 简道云应用名
61 61 app-id: 65fd5c0e0d1f1a7ae4f038ec # 简道云 app_id(今日实测)
... ...
... ... @@ -52,10 +52,10 @@ jdy-sync:
52 52 # 简道云基础地址:独立域名/独享版用 https://<域名>/api(长安: https://jdy.changan.com.cn/api);公有云用 https://api.jiandaoyun.com/api
53 53 host: https://jdy.changan.com.cn/api
54 54 qx:
55   - base-url: https://dev3.qgutech.com # 启效3.0 环境地址
  55 + base-url: http://10.144.201.35:8081 # 启效3.0 环境地址
56 56 username: 15077901670
57 57 password: "000000"
58   - corp-code: default
  58 + corp-code: hfca
59 59 apps:
60 60 - name: 合肥长安_技术处 # 简道云应用名
61 61 app-id: 65fd5c0e0d1f1a7ae4f038ec # 简道云 app_id(今日实测)
... ...
... ... @@ -64,10 +64,10 @@ jdy-sync:
64 64 # 简道云基础地址:独立域名/独享版用 https://<域名>/api(长安: https://jdy.changan.com.cn/api);公有云用 https://api.jiandaoyun.com/api
65 65 host: https://jdy.changan.com.cn/api
66 66 qx:
67   - base-url: https://dev3.qgutech.com # 启效3.0 环境地址
  67 + base-url: http://10.144.201.35:8081 # 启效3.0 环境地址
68 68 username: 15077901670
69 69 password: "000000"
70   - corp-code: default
  70 + corp-code: hfca
71 71 apps:
72 72 - name: 合肥长安_技术处 # 简道云应用名
73 73 app-id: 65fd5c0e0d1f1a7ae4f038ec # 简道云 app_id(今日实测)
... ...