Jelajahi Sumber

同步eta指标

kobe6258 3 bulan lalu
induk
melakukan
426d386808
42 mengubah file dengan 1266 tambahan dan 40 penghapusan
  1. 265 0
      .idea/easyCodeTableSetting.xml
  2. 10 1
      qhtx-eta-integrator/qhtx-integrator-common/src/main/java/com/qhtx/eta/common/constant/ETAConstants.java
  3. 2 2
      qhtx-eta-integrator/qhtx-integrator-common/src/main/java/com/qhtx/eta/common/eunms/ErrorEnum.java
  4. 32 0
      qhtx-eta-integrator/qhtx-integrator-common/src/main/java/com/qhtx/eta/common/utils/MapUtils.java
  5. 0 1
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/aspect/DomainTransDataSourceAspect.java
  6. 11 5
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/config/RedissonConfig.java
  7. 5 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/config/ThreadPoolConfig.java
  8. 6 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/convert/EtaApiQuotaInfoConverter.java
  9. 15 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/convert/LinkDataDTOConverter.java
  10. 39 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/convert/TDampDwLinkInfoConverter.java
  11. 25 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/DWIndexWithLinkCodeDTO.java
  12. 36 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/LinkDataDTO.java
  13. 14 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/LinkFieldDTO.java
  14. 35 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/LinkInfoDTO.java
  15. 1 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/QuotaInfoDTO.java
  16. 57 10
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/job/ETASyncJob.java
  17. 3 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/ETAClassifyService.java
  18. 2 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/ETAQuotaService.java
  19. 1 1
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/DWIndexFrameServiceImpl.java
  20. 6 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/ETAClassifyServiceImpl.java
  21. 64 14
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/ETAQuotaServiceImpl.java
  22. 89 0
      qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/TDampLinkService.java
  23. 83 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/entity/dw/TDampDwLinkData.java
  24. 87 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/entity/dw/TDampDwLinkInfo.java
  25. 26 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/enums/DimTranFieldType.java
  26. 2 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/ETAClassifyIndexFrameMappingDao.java
  27. 5 2
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/EtaApiQuotaInfoDao.java
  28. 35 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/TDampDwLinkDataDao.java
  29. 23 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/TDampDwLinkInfoDao.java
  30. 1 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/EtaApiClassifyService.java
  31. 5 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/EtaApiQuotaInfoService.java
  32. 26 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/TDampDwLinkDataService.java
  33. 22 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/TDampDwLinkInfoService.java
  34. 5 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/EtaApiClassifyServiceImpl.java
  35. 15 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/EtaApiQuotaInfoServiceImpl.java
  36. 40 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/TDampDwLinkDataServiceImpl.java
  37. 35 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/TDampDwLinkInfoServiceImpl.java
  38. 6 1
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/ETAClassifyIndexFrameMappingDao.xml
  39. 25 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/EtaApiQuotaInfoDao.xml
  40. 64 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/TDampDwLinkDataDao.xml
  41. 38 0
      qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/TDampDwLinkInfoDao.xml
  42. 5 3
      qhtx-eta-integrator/qhtx-integrator-starter/src/main/java/com/qhtx/eta/init/ETAEnvironmentInit.java

+ 265 - 0
.idea/easyCodeTableSetting.xml

@@ -3,6 +3,271 @@
   <component name="EasyCodeTableSetting">
     <option name="tableInfoMap">
       <map>
+        <entry key="DW.T_DAMP_DW_LINK_DATA">
+          <value>
+            <TableInfoDTO>
+              <option name="comment" value="DW层对接码详情表" />
+              <option name="fullColumn">
+                <list>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="主键" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="id" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码管理表主键" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkId" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码code" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkCode" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码名称" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkName" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码所属字段名称,以,隔开&#13;&#10;" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkFiledName" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码所属字段id,以,隔开" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkFiledIds" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码有效数据总数" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="totalNum" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码新增总数" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="increaseNum" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="最小时间" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="minTime" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="最大时间" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="maxTime" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="是否显示,1,显示,0隐藏" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="isShow" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="创建时间" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="createTime" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="更新时间" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="updateTime" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="元素值" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="elementVal" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="元素名" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="elementName" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="分区" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="partitionId" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                </list>
+              </option>
+              <option name="name" value="TDampDwLinkData" />
+              <option name="preName" value="" />
+              <option name="saveModelName" value="qhtx-integrator-infra" />
+              <option name="savePackageName" value="com.qhtx.eta.infra" />
+              <option name="savePath" value="./qhtx-eta-integrator/qhtx-integrator-infra/src/main/java" />
+              <option name="templateGroupName" value="Default" />
+            </TableInfoDTO>
+          </value>
+        </entry>
+        <entry key="DW.T_DAMP_DW_LINK_INFO">
+          <value>
+            <TableInfoDTO>
+              <option name="comment" value="对接码管理表" />
+              <option name="fullColumn">
+                <list>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="主键" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="id" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码类型,1,单表,2双表" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkType" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码前缀" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkPrefix" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="信息表id" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="infoTableId" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="信息表名" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="infoTableName" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="数据表id,type=2时必填" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="dataTableId" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="数据表名,type=2时必填" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="dataTableName" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="是否生成对接码1,生成,0,不生成" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="isGenerate" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="度量字段来源,1信息表,2数据表,type=1默认为1" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="measureFieldSource" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="对接码字段集合,json格式保存" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="linkFileds" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="初始化版本号,用作乐观锁" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="initVersion" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="是否启用,1:是,0:否" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="isEnable" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="创建时间" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="createTime" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="创建人id" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="createUserId" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="创建人名称" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="createUserName" />
+                    <option name="type" value="java.lang.String" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="分区" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="partitionId" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                  <ColumnInfoDTO>
+                    <option name="comment" value="1 oracle 2 hbase -1 未知" />
+                    <option name="custom" value="false" />
+                    <option name="ext" value="{}" />
+                    <option name="name" value="sourceType" />
+                    <option name="type" value="java.lang.Integer" />
+                  </ColumnInfoDTO>
+                </list>
+              </option>
+              <option name="name" value="TDampDwLinkInfo" />
+              <option name="preName" value="" />
+              <option name="saveModelName" value="qhtx-integrator-infra" />
+              <option name="savePackageName" value="com.qhtx.eta.infra" />
+              <option name="savePath" value="./qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper" />
+              <option name="templateGroupName" value="Default" />
+            </TableInfoDTO>
+          </value>
+        </entry>
         <entry key="DW.T_ETA_INDEX_PUSH_TASK">
           <value>
             <TableInfoDTO>

+ 10 - 1
qhtx-eta-integrator/qhtx-integrator-common/src/main/java/com/qhtx/eta/common/constant/ETAConstants.java

@@ -37,7 +37,7 @@ public class ETAConstants {
 
     public static final String ODS_DATA_TABLE_NAME = "T_ETA_API_QUOTA_DATA";
 
-    public static final String DW_INDEX_FRAME_PARENT_NAME = "弘则研究";
+    public static final String DW_INDEX_FRAME_PARENT_NAME = "ETA投研平台";
 
     //海通DW
     public static final String REDIS_INDEX_FRAME_TABLE_CODE_KEY = "t_damp_dm_index_frame_table_code_incr";
@@ -48,4 +48,13 @@ public class ETAConstants {
 
     public static final int ETA_PUSH_DATA_LIMIT = 1000;
     public static final int ETA_PUSH_DATA_CHUNK = 100;
+
+
+    public static final String ETA_LINK_PREFIX = "ETA";
+    public static final int INDEX_SYNC_LIMIT = 1000;
+
+    public static final int INDEX_SYNC_CHUNK = 100;
+
+
+    public static final String COLON = ":";
 }

+ 2 - 2
qhtx-eta-integrator/qhtx-integrator-common/src/main/java/com/qhtx/eta/common/eunms/ErrorEnum.java

@@ -36,8 +36,8 @@ public enum ErrorEnum {
     PARAM_TYPE_ERROR("20009", "参数类型错误"),
 
 
-    DW_INDEX_TABLE_CODE_GET_ERROR("20010", "获取指标框架table_code失败"),
-    DW_HZ_ROOT_PATH_NOT_EXIST("20011", "弘则研究指标根目录不存在"),
+    DW_INDEX_TABLE_CODE_GET_ERROR("20010", "获取指标框架[table_code]失败"),
+    DW_HZ_ROOT_PATH_NOT_EXIST("20011", "ETA投研平台指标根目录不存在"),
     DW_INDEX_NOT_FOUND("20012", "DW指标信息不存在"),
     INDEX_AllREADY_ADD("20013", "指标已添加,请勿重复添加"),
     INDEX_UPDATE_ERROR("20013", "更新指标出错,指标异常"),

+ 32 - 0
qhtx-eta-integrator/qhtx-integrator-common/src/main/java/com/qhtx/eta/common/utils/MapUtils.java

@@ -0,0 +1,32 @@
+package com.qhtx.eta.common.utils;
+
+public class MapUtils {
+
+    /**
+     * 将大写下划线格式的字符串转换为驼峰格式。
+     *
+     * @param underscoreStr 大写下划线格式的字符串
+     * @return 驼峰格式的字符串
+     */
+    public static String underscoreToCamelCase(String underscoreStr, boolean IgnoreUpperCase) {
+        if (underscoreStr == null || underscoreStr.isEmpty()) {
+            return underscoreStr;
+        }
+        StringBuilder camelCaseStr = new StringBuilder();
+        boolean nextUpperCase = false; // 标记是否需要将下一个字符转换为大写
+
+        for (char ch : underscoreStr.toCharArray()) {
+            if (ch == '_') {
+                nextUpperCase = true; // 遇到下划线,标记下一个字符需要转大写
+            } else {
+                if (nextUpperCase) {
+                    camelCaseStr.append(Character.toUpperCase(ch)); // 转换为大写并添加到结果中
+                    nextUpperCase = false; // 重置标记
+                } else {
+                    camelCaseStr.append(IgnoreUpperCase ? Character.toLowerCase(ch) : ch); // 第一个字符小写,其余保持原样
+                }
+            }
+        }
+        return camelCaseStr.toString();
+    }
+}

+ 0 - 1
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/aspect/DomainTransDataSourceAspect.java

@@ -4,7 +4,6 @@ import com.qhtx.eta.common.eunms.DataSourceType;
 import com.qhtx.eta.common.eunms.ErrorEnum;
 import com.qhtx.eta.common.exception.ETAException;
 import com.qhtx.eta.domain.annotation.DomainTransDataSource;
-import com.qhtx.eta.infra.annotation.UseDataSource;
 import com.qhtx.eta.infra.datasource.DataSourceContextHolder;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;

+ 11 - 5
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/config/RedissonConfig.java

@@ -12,19 +12,25 @@ import org.springframework.context.annotation.Configuration;
 @Configuration
 public class RedissonConfig {
 
-    @Value("${redisson.address}")
-    private String address;
+    @Value("${spring.redis.host}")
+    private String host;
 
-    @Value("${redisson.password}")
+    @Value("${spring.redis.password}")
     private String password;
 
+    @Value("${spring.redis.port}")
+    private String port;
+
+    @Value("${spring.redis.database}")
+    private int database;
+
     @Bean
     public RedissonClient redissonClient() {
         Config config = new Config();
         if (StringUtils.isNotBlank(password)) {
-            config.useSingleServer().setAddress(address).setPassword(password);
+            config.useSingleServer().setAddress("redis://" + host + ":" + port).setPassword(password).setDatabase(database);
         } else {
-            config.useSingleServer().setAddress(address);
+            config.useSingleServer().setAddress("redis://" + host + ":" + port).setDatabase(database);
         }
         return Redisson.create(config);
     }

+ 5 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/config/ThreadPoolConfig.java

@@ -21,6 +21,11 @@ public class ThreadPoolConfig {
         return new ThreadPoolExecutor(10, 20, 5, TimeUnit.SECONDS, new LinkedBlockingDeque<>(40), new ETAThreadFactory(ETAConstants.THREAD_POOL_ETA_INFO), new ThreadPoolExecutor.CallerRunsPolicy());
     }
 
+    @Bean(name = "IndexSyncThreadPool")
+    public ThreadPoolExecutor indexSyncThreadPool() {
+        return new ThreadPoolExecutor(10, 20, 5, TimeUnit.SECONDS, new LinkedBlockingDeque<>(40), new ETAThreadFactory(ETAConstants.THREAD_POOL_ETA_INFO), new ThreadPoolExecutor.CallerRunsPolicy());
+    }
+
     @Bean(name = "ETADataThreadPool")
     public ThreadPoolExecutor etaDataThreadPool() {
         return new ThreadPoolExecutor(10, 20, 5, TimeUnit.SECONDS, new LinkedBlockingDeque<>(40), new ETAThreadFactory(ETAConstants.THREAD_POOL_ETA_DATA), new ThreadPoolExecutor.CallerRunsPolicy());

+ 6 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/convert/EtaApiQuotaInfoConverter.java

@@ -1,20 +1,26 @@
 package com.qhtx.eta.domain.convert;
 
+import com.qhtx.eta.domain.entity.LinkInfoDTO;
 import com.qhtx.eta.domain.entity.QuotaInfoDTO;
+import com.qhtx.eta.domain.service.impl.TDampLinkService;
 import com.qhtx.eta.infra.entity.ods.EtaApiQuotaInfo;
 import org.mapstruct.AfterMapping;
 import org.mapstruct.Mapper;
 import org.mapstruct.MappingTarget;
+import org.mapstruct.Named;
 import org.mapstruct.factory.Mappers;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 @Mapper
 public interface EtaApiQuotaInfoConverter {
+    
     EtaApiQuotaInfoConverter INSTANCE = Mappers.getMapper(EtaApiQuotaInfoConverter.class);
 
     List<EtaApiQuotaInfo> convertEntityToBoList(List<QuotaInfoDTO> quotaInfoList);
 
+    List<QuotaInfoDTO> convertEntityToDTOList(List<EtaApiQuotaInfo> quotaInfoList);
 
     EtaApiQuotaInfo convertEntityToBo(QuotaInfoDTO quotaInfoDTO);
 

+ 15 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/convert/LinkDataDTOConverter.java

@@ -0,0 +1,15 @@
+package com.qhtx.eta.domain.convert;
+
+import com.qhtx.eta.domain.entity.LinkDataDTO;
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkData;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+@Mapper
+public interface LinkDataDTOConverter {
+    LinkDataDTOConverter INSTANCE = Mappers.getMapper(LinkDataDTOConverter.class);
+
+    List<LinkDataDTO> convertEntityToDTOList(List<TDampDwLinkData> linkData);
+}

+ 39 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/convert/TDampDwLinkInfoConverter.java

@@ -0,0 +1,39 @@
+package com.qhtx.eta.domain.convert;
+
+import com.alibaba.fastjson.JSON;
+import com.qhtx.eta.domain.entity.LinkFieldDTO;
+import com.qhtx.eta.domain.entity.LinkInfoDTO;
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkInfo;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.Named;
+import org.mapstruct.factory.Mappers;
+
+import java.util.Collections;
+import java.util.List;
+
+@Mapper
+public interface TDampDwLinkInfoConverter {
+    TDampDwLinkInfoConverter INSTANCE = Mappers.getMapper(TDampDwLinkInfoConverter.class);
+    @Mapping(source = "linkFileds", target = "linkFields", qualifiedByName = "strToList")
+    LinkInfoDTO convertToDTO(TDampDwLinkInfo tdampDwLinkInfo);
+
+    @Named("strToList")
+    default List<LinkFieldDTO> strToList(String fieldsStr) {
+        // 验证输入是否为空或仅包含空白字符
+        if (fieldsStr == null || fieldsStr.trim().isEmpty()) {
+            return Collections.emptyList();
+        }
+        // 清理字符串,移除可能的前后空格
+        String trimmedFieldsStr = fieldsStr.trim();
+        // 验证输入字符串是否为有效的JSON数组格式
+        try {
+            return JSON.parseArray(trimmedFieldsStr, LinkFieldDTO.class);
+        } catch (Exception e) {
+            // 处理解析错误
+            System.err.println("Invalid input: " + trimmedFieldsStr);
+            return Collections.emptyList();
+        }
+    }
+
+}

+ 25 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/DWIndexWithLinkCodeDTO.java

@@ -0,0 +1,25 @@
+package com.qhtx.eta.domain.entity;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class DWIndexWithLinkCodeDTO {
+    private String indexId;
+    private String indexCode;
+    private Integer status = 1;
+    private Integer maintainType = 4;
+    private Integer isForeign = 1;
+    private Integer isDelete = 0;
+    private Integer isEnable = 1;
+    private String frameId;
+    private String dataTableName = "t_damp_dw_index_data";
+    private String units;
+    private String cnRemarks;
+    private Integer createUserId = 0;
+    private String createUserName = "SYS_INIT";
+    private String linkCode;
+    private String linkId;
+}

+ 36 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/LinkDataDTO.java

@@ -0,0 +1,36 @@
+package com.qhtx.eta.domain.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class LinkDataDTO {
+
+    /**
+     * 对接码管理表主键
+     */
+    private String linkId;
+    /**
+     * 对接码code
+     */
+    private String linkCode;
+    /**
+     * 对接码名称
+     */
+    private String linkName;
+    /**
+     * 对接码所属字段名称,以,隔开
+     */
+    private String linkFiledName;
+    
+    /**
+     * 元素值
+     */
+    private String elementVal;
+    /**
+     * 元素名
+     */
+    private String elementName;
+
+}

+ 14 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/LinkFieldDTO.java

@@ -0,0 +1,14 @@
+package com.qhtx.eta.domain.entity;
+
+import lombok.Data;
+
+@Data
+public class LinkFieldDTO {
+    private String id;
+    private String linkId;
+    private String tableId;
+    private String sort;
+    private String filedId;
+    private String filedName;
+    private int filedType;
+}

+ 35 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/LinkInfoDTO.java

@@ -0,0 +1,35 @@
+package com.qhtx.eta.domain.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class LinkInfoDTO {
+
+    /**
+     * 对接码前缀
+     */
+    private String linkPrefix;
+    /**
+     * 信息表id
+     */
+    private String infoTableId;
+    /**
+     * 信息表名
+     */
+    private String infoTableName;
+    /**
+     * 数据表id,type=2时必填
+     */
+    private String dataTableId;
+    /**
+     * 数据表名,type=2时必填
+     */
+    private String dataTableName;
+    /**
+     * 对接码字段集合,json格式保存
+     */
+    private List<LinkFieldDTO> linkFields;
+
+}

+ 1 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/entity/QuotaInfoDTO.java

@@ -42,6 +42,7 @@ public class QuotaInfoDTO implements Serializable {
     private String edbSourceName;
 
     private Integer noUpdate;
+    private String elementVal;
 
 }
 

+ 57 - 10
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/job/ETASyncJob.java

@@ -22,10 +22,12 @@ import com.qhtx.eta.domain.service.ETAQuotaService;
 import com.qhtx.eta.domain.api.ApiServiceHolder;
 import com.qhtx.eta.domain.api.http.request.ETADataHttpRequest;
 import com.qhtx.eta.common.constant.ETAConstants;
+import com.qhtx.eta.domain.service.impl.TDampLinkService;
 import com.qhtx.eta.domain.task.FixedDelayTaskRegistrar;
 import com.qhtx.eta.domain.task.SchedulingRunnable;
 import com.qhtx.eta.infra.annotation.UseDataSource;
 import com.qhtx.eta.infra.entity.dw.TEtaIndexPushTask;
+import com.qhtx.eta.infra.entity.ods.EtaApiQuotaInfo;
 import com.qhtx.eta.infra.enums.Frequency;
 import lombok.extern.slf4j.Slf4j;
 import org.redisson.api.RLock;
@@ -71,7 +73,8 @@ public class ETASyncJob implements CommandLineRunner {
     @Resource
     private ScheduleTaskConfig scheduleTaskConfig;
 
-
+    @Resource
+    private TDampLinkService TDampLinkService;
     @Resource
     private DWIndexFrameService dwIndexFrameService;
 
@@ -91,6 +94,7 @@ public class ETASyncJob implements CommandLineRunner {
         return taskMappingMap.get(configId);
     }
 
+
     /**
      * 同步指标数据到自有数据源
      */
@@ -217,16 +221,60 @@ public class ETASyncJob implements CommandLineRunner {
             log.info("================================ 开始同步接口指标分类列表 ================================ ");
             log.info("================================ 接口指标分类列表数量:{}条================================ ", classifyList.size());
             try {
-                etaClassifyService.syncClassify(classifyList);
-                // 获取信号量
-                List<ClassifyMappingDTO> processingList = etaClassifyService.getProcessingList();
-                if (!CollectionUtils.isEmpty(processingList)) {
-                    log.info("processingList size:{}", processingList.size());
-                    dwIndexFrameService.processing(ClassifyMappingDTOConverter.INSTANCE.convertDTOToDWIndexFrameList(processingList));
+//                etaClassifyService.syncClassify(classifyList);
+//                List<ClassifyMappingDTO> processingList = etaClassifyService.getProcessingList();
+//                if (!CollectionUtils.isEmpty(processingList)) {
+//                    log.info("processingList size:{}", processingList.size());
+//                    dwIndexFrameService.processing(ClassifyMappingDTOConverter.INSTANCE.convertDTOToDWIndexFrameList(processingList));
+//                }
+                //对接码指标数据
+                CompletableFuture<List<QuotaInfoDTO>> QuotaInfoFutures = CompletableFuture.supplyAsync(() -> etaQuotaService.getQuotaList());
+                //对接码数据
+                CompletableFuture<List<LinkDataDTO>> linkDataFutures = CompletableFuture.supplyAsync(() -> TDampLinkService.getLinkDataList());
+                //获取分类目录
+                CompletableFuture<List<ClassifyMappingDTO>> classifyFutures = CompletableFuture.supplyAsync(() -> etaClassifyService.getDealedList());
+                CompletableFuture<Void> future = CompletableFuture.allOf(QuotaInfoFutures, linkDataFutures, classifyFutures);
+                try {
+                    future.get();
+                    List<QuotaInfoDTO> etaApiQuotaInfoList = QuotaInfoFutures.get();
+                    List<LinkDataDTO> linkDataList = linkDataFutures.get();
+                    List<ClassifyMappingDTO> classiyfList = classifyFutures.get();
+                    if (CollectionUtils.isEmpty(classifyList)) {
+                        log.info("指标目录未同步,停止同步指标信息");
+                        return;
+                    } else {
+                        //装配指标信息数据结构
+                        List<DWIndexWithLinkCodeDTO> dwIndexWithLinkCodeList = new ArrayList<>(linkDataList.size());
+                        //哈希map组装数据
+                        Map<String, QuotaInfoDTO> dimensionDataMap = new HashMap<>();
+                        for (QuotaInfoDTO quotaInfoDTO : etaApiQuotaInfoList) {
+                            String elementVal = quotaInfoDTO.getElementVal();
+                            QuotaInfoDTO dimensionData = quotaInfoDTO;
+                            dimensionDataMap.put(elementVal, dimensionData);
+                        }
+
+                        // 创建哈希表存储 frameId 和 classify
+                        Map<Integer, ClassifyMappingDTO> classifyMap = new HashMap<>();
+                        for (ClassifyMappingDTO classifyMappingDTO : classiyfList) {
+                            int classifyId = classifyMappingDTO.getClassifyId();
+                            ClassifyMappingDTO classify = classifyMappingDTO;
+                            classifyMap.put(classifyId, classify);
+                        }
+                        for (LinkDataDTO linkDataDTO : linkDataList) {
+                            DWIndexWithLinkCodeDTO dwIndexWithLinkCodeDTO = new DWIndexWithLinkCodeDTO();
+                            dwIndexWithLinkCodeDTO.setLinkCode(linkDataDTO.getLinkCode());
+                            dwIndexWithLinkCodeDTO.setLinkId(linkDataDTO.getLinkId());
+                            QuotaInfoDTO dimensionData = dimensionDataMap.get(linkDataDTO.getElementVal());
+                            ClassifyMappingDTO classify = classifyMap.get(dimensionData.getClassifyId());
+                            dwIndexWithLinkCodeDTO.setFrameId(classify.getIndexFrameId());
+                            dwIndexWithLinkCodeList.add(dwIndexWithLinkCodeDTO);
+                        }
+                    }
+                    System.out.println("etaApiQuotaInfoList size:" + etaApiQuotaInfoList.size());
+                } catch (Exception e) {
+                    log.error("同步指标数据数据失败", e);
                 }
-                //开始获取新增和需要更新的框架数据
             } catch (Exception e) {
-                e.printStackTrace();
                 log.warn("同步eta指标分类失败:{}", e.getMessage());
             }
             log.info("================================ 同步接口指标分类列表完成 ================================ ");
@@ -235,7 +283,6 @@ public class ETASyncJob implements CommandLineRunner {
         }
     }
 
-
     /**
      * 同步指标数据
      */

+ 3 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/ETAClassifyService.java

@@ -1,10 +1,13 @@
 package com.qhtx.eta.domain.service;
 
 import com.qhtx.eta.domain.entity.ClassifyMappingDTO;
+import com.qhtx.eta.domain.entity.LinkDataDTO;
 
 import java.util.List;
 
 public interface ETAClassifyService {
     void syncClassify(List<ClassifyMappingDTO> classifyList);
     List<ClassifyMappingDTO> getProcessingList();
+
+    List<ClassifyMappingDTO> getDealedList();
 }

+ 2 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/ETAQuotaService.java

@@ -15,5 +15,7 @@ public interface ETAQuotaService {
 
     List<QuotaDataUpdateBO> getQuotaInfoListForUpdate(QuotaInfoDTO quotaInfoDTO);
 
+    List<QuotaInfoDTO> getQuotaList();
+
     void LinkedCodeMessage(long minOperationTime);
 }

+ 1 - 1
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/DWIndexFrameServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils;
 import com.qhtx.eta.common.constant.ETAConstants;
 import com.qhtx.eta.common.eunms.ErrorEnum;
 import com.qhtx.eta.common.exception.ETAException;
+import com.qhtx.eta.domain.annotation.DomainTransDataSource;
 import com.qhtx.eta.domain.convert.DWIndexDTOConverter;
 import com.qhtx.eta.domain.convert.DWIndexDataDTOConverter;
 import com.qhtx.eta.domain.convert.DWIndexFrameDTOConverter;
@@ -108,7 +109,6 @@ public class DWIndexFrameServiceImpl implements DWIndexFrameService {
                 log.info("未找到对应eta分类,{}:{}", dto.getCnName(), dto.getClassifyId());
                 continue;
             }
-
             //无法代理方法直接使用手动方法设置数据源
             DataSourceContextHolder.setDataSourceType(DataSourceType.DW);
             transactionTemplate.execute(new TransactionCallbackWithoutResult() {

+ 6 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/ETAClassifyServiceImpl.java

@@ -3,6 +3,7 @@ package com.qhtx.eta.domain.service.impl;
 import com.qhtx.eta.domain.convert.ClassifyMappingDTOConverter;
 import com.qhtx.eta.domain.convert.ETAClassifyIndexFrameMappingConverter;
 import com.qhtx.eta.domain.entity.ClassifyMappingDTO;
+import com.qhtx.eta.domain.entity.LinkDataDTO;
 import com.qhtx.eta.domain.service.ETAClassifyService;
 import com.qhtx.eta.infra.entity.dw.ETAClassifyIndexFrameMapping;
 import com.qhtx.eta.infra.service.EtaApiClassifyService;
@@ -28,6 +29,11 @@ public class ETAClassifyServiceImpl implements ETAClassifyService {
         List<ETAClassifyIndexFrameMapping> mappingList = etaApiClassifyService.getProcessingList();
         return ClassifyMappingDTOConverter.INSTANCE.convertEntityToDTOList(mappingList);
     }
+
+    @Override
+    public List<ClassifyMappingDTO> getDealedList() {
+        return ClassifyMappingDTOConverter.INSTANCE.convertEntityToDTOList(etaApiClassifyService.getDealedList());
+    }
 }
 
 

+ 64 - 14
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/ETAQuotaServiceImpl.java

@@ -1,8 +1,10 @@
 package com.qhtx.eta.domain.service.impl;
 
 import com.google.common.collect.Lists;
+import com.qhtx.eta.common.utils.MapUtils;
 import com.qhtx.eta.domain.convert.EtaApiQuotaDataConverter;
 import com.qhtx.eta.domain.convert.EtaApiQuotaInfoConverter;
+import com.qhtx.eta.domain.entity.LinkFieldDTO;
 import com.qhtx.eta.domain.entity.QuotaDataDTO;
 import com.qhtx.eta.domain.entity.QuotaDataUpdateBO;
 import com.qhtx.eta.domain.entity.QuotaInfoDTO;
@@ -13,14 +15,17 @@ import com.qhtx.eta.common.constant.ETAConstants;
 import com.qhtx.eta.common.exception.ETAException;
 import com.qhtx.eta.infra.entity.ods.EtaApiQuotaData;
 import com.qhtx.eta.infra.entity.ods.EtaApiQuotaInfo;
+import com.qhtx.eta.infra.enums.DimTranFieldType;
 import com.qhtx.eta.infra.service.EtaApiQuotaDataService;
 import com.qhtx.eta.infra.service.EtaApiQuotaInfoService;
 import com.qhtx.eta.infra.service.OdsDimService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
+import java.lang.reflect.Field;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.ZoneId;
@@ -35,11 +40,15 @@ public class ETAQuotaServiceImpl implements ETAQuotaService {
     @Resource
     private EtaApiQuotaInfoService etaApiQuotaInfoService;
 
+    @Resource
+    private TDampLinkService tDampLinkService;
     @Resource
     private EtaApiQuotaDataService etaApiQuotaDataService;
     @Resource(name = "ETAInfoThreadPool")
     private ThreadPoolExecutor etaInfoThreadPool;
 
+    @Resource(name = "IndexSyncThreadPool")
+    private ThreadPoolExecutor indexSyncThreadPool;
     @Resource
     private OdsDimService odsDimService;
     @Resource
@@ -101,6 +110,61 @@ public class ETAQuotaServiceImpl implements ETAQuotaService {
         return allResults.stream().flatMap(List::stream).collect(Collectors.toList());
     }
 
+    @Override
+    public List<QuotaInfoDTO> getQuotaList() {
+        long total = etaApiQuotaInfoService.countQuota();
+        LinkFieldDTO dimensionField = tDampLinkService.getLinkField(DimTranFieldType.INDEX_NAME.getValue());
+        LinkFieldDTO metricField = tDampLinkService.getLinkField(DimTranFieldType.METRIC.getValue());
+        String enName = StringUtils.substring(dimensionField.getFiledName(), dimensionField.getFiledName().indexOf("(") + 1, dimensionField.getFiledName().indexOf(")"));
+        String cnMetric = StringUtils.substring(metricField.getFiledName(), 0, metricField.getFiledName().indexOf("("));
+        if (total > ETAConstants.INDEX_SYNC_LIMIT) {
+            List<CompletableFuture<List<QuotaInfoDTO>>> futures = new ArrayList<>();
+            long chunk = (total + ETAConstants.INDEX_SYNC_LIMIT - 1) / ETAConstants.INDEX_SYNC_LIMIT;
+            for (int i = 0; i < chunk; i++) {
+                int current = i;
+                CompletableFuture<List<QuotaInfoDTO>> future = CompletableFuture.supplyAsync(() -> {
+                    try {
+                        int offset = current * ETAConstants.INDEX_SYNC_LIMIT;
+                        List<QuotaInfoDTO> list = EtaApiQuotaInfoConverter.INSTANCE.convertEntityToDTOList(etaApiQuotaInfoService.queryQuotaListPage(offset, ETAConstants.INDEX_SYNC_LIMIT));
+                        list.forEach(quotaInfoDTO -> {
+                            String FiledName = MapUtils.underscoreToCamelCase(enName, true);
+                            try {
+                                Field field = QuotaInfoDTO.class.getDeclaredField(FiledName);
+                                field.setAccessible(true);
+                                String value = String.valueOf(field.get(quotaInfoDTO));
+                                String elementVal = StringUtils.join(value, ETAConstants.COLON, cnMetric);
+                                quotaInfoDTO.setElementVal(elementVal);
+                            } catch (Exception e) {
+                                log.error("获取指标度量字段失败", e);
+                            }
+                        });
+                        return list;
+                    } catch (Exception e) {
+                        log.error("获取指标列表失败", e);
+                        return Collections.emptyList();
+                    }
+                }, indexSyncThreadPool);
+                futures.add(future);
+            }
+            return futures.stream().map(CompletableFuture::join).flatMap(List::stream).collect(Collectors.toList());
+        } else {
+            List<QuotaInfoDTO> list = EtaApiQuotaInfoConverter.INSTANCE.convertEntityToDTOList(etaApiQuotaInfoService.getAllQuotaList());
+            list.forEach(quotaInfoDTO -> {
+                String FiledName = MapUtils.underscoreToCamelCase(enName, true);
+                try {
+                    Field field = QuotaInfoDTO.class.getDeclaredField(FiledName);
+                    field.setAccessible(true);
+                    String value = String.valueOf(field.get(quotaInfoDTO));
+                    String elementVal = StringUtils.join(value, ETAConstants.COLON, cnMetric);
+                    quotaInfoDTO.setElementVal(elementVal);
+                } catch (Exception e) {
+                    log.error("获取指标度量字段失败", e);
+                }
+            });
+            return list;
+        }
+    }
+
     @Override
     public void LinkedCodeMessage(long minOperationTime) {
 
@@ -109,20 +173,6 @@ public class ETAQuotaServiceImpl implements ETAQuotaService {
 
     private List<QuotaDataUpdateBO> dataUpdate(List<EtaApiQuotaInfo> quotaInfoList, List<EtaApiQuotaData> dataList) {
         return quotaInfoList.stream().map(info -> {
-            //    修改为代码遍历
-//            QuotaDataUpdateBO quotaDataUpdateBO = new QuotaDataUpdateBO();
-//            EtaApiQuotaData etaApiQuotaData = etaApiQuotaDataService.getLatestDataByUniqueCode(info.getUniqueCode());
-//            quotaDataUpdateBO.setUniqueCode(info.getUniqueCode());
-//            if (etaApiQuotaData == null) {
-//                quotaDataUpdateBO.setStatus(ETADataStatus.NEW);
-//                return quotaDataUpdateBO;
-//            }
-//            quotaDataUpdateBO.setCurrentDate(new SimpleDateFormat(ETAConstants.DATE_PATTERN).format(etaApiQuotaData.getDataTime()));
-//            if (compareDate(etaApiQuotaData.getDataTime(), info.getEndDate())) {
-//                quotaDataUpdateBO.setStatus(ETADataStatus.UPDATE);
-//                return quotaDataUpdateBO;
-//            }
-//            quotaDataUpdateBO.setStatus(ETADataStatus.LATEST);
             QuotaDataUpdateBO quotaDataUpdateBO = new QuotaDataUpdateBO();
             quotaDataUpdateBO.setUniqueCode(info.getUniqueCode());
             quotaDataUpdateBO.setFrequency(info.getFrequency());

+ 89 - 0
qhtx-eta-integrator/qhtx-integrator-domain/src/main/java/com/qhtx/eta/domain/service/impl/TDampLinkService.java

@@ -0,0 +1,89 @@
+package com.qhtx.eta.domain.service.impl;
+
+import com.qhtx.eta.common.constant.ETAConstants;
+import com.qhtx.eta.common.utils.MapUtils;
+import com.qhtx.eta.domain.convert.EtaApiQuotaInfoConverter;
+import com.qhtx.eta.domain.convert.LinkDataDTOConverter;
+import com.qhtx.eta.domain.convert.TDampDwLinkInfoConverter;
+import com.qhtx.eta.domain.entity.LinkDataDTO;
+import com.qhtx.eta.domain.entity.LinkFieldDTO;
+import com.qhtx.eta.domain.entity.LinkInfoDTO;
+import com.qhtx.eta.domain.entity.QuotaInfoDTO;
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkInfo;
+import com.qhtx.eta.infra.service.TDampDwLinkDataService;
+import com.qhtx.eta.infra.service.TDampDwLinkInfoService;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+@Data
+public class TDampLinkService {
+
+    @Resource
+    private TDampDwLinkInfoService tdampDwLinkInfoService;
+
+    @Resource
+    private TDampDwLinkDataService tdampDwLinkDataService;
+    // ETA 维表和对接码的映射关系
+    private static Map<Integer, LinkFieldDTO> linkFieldMap = new ConcurrentHashMap<>();
+
+
+    @Resource(name = "IndexSyncThreadPool")
+    private ThreadPoolExecutor indexSyncThreadPool;
+
+    /**
+     * 初始化ETA 维表和对接码的映射关系
+     */
+    public void initLinkInfo() {
+        TDampDwLinkInfo linkInfo = tdampDwLinkInfoService.queryByLinkPrefix(ETAConstants.ETA_LINK_PREFIX);
+        if (linkInfo == null) {
+            log.warn("未配置ETA对接信息");
+            return;
+        }
+        LinkInfoDTO linkInfoDTO = TDampDwLinkInfoConverter.INSTANCE.convertToDTO(linkInfo);
+        for (LinkFieldDTO field : linkInfoDTO.getLinkFields()) {
+            linkFieldMap.put(field.getFiledType(), field);
+        }
+    }
+
+    public List<LinkDataDTO> getLinkDataList() {
+        long total = tdampDwLinkDataService.count();
+        if (total > ETAConstants.INDEX_SYNC_LIMIT) {
+            List<CompletableFuture<List<LinkDataDTO>>> futures = new ArrayList<>();
+            long chunk = (total + ETAConstants.INDEX_SYNC_LIMIT - 1) / ETAConstants.INDEX_SYNC_LIMIT;
+            for (int i = 0; i < chunk; i++) {
+                int current = i;
+                CompletableFuture<List<LinkDataDTO>> future = CompletableFuture.supplyAsync(() -> {
+                    try {
+                        int offset = current * ETAConstants.INDEX_SYNC_LIMIT;
+                        return LinkDataDTOConverter.INSTANCE.convertEntityToDTOList(tdampDwLinkDataService.queryByLimit(offset, ETAConstants.INDEX_SYNC_LIMIT));
+                    } catch (Exception e) {
+                        log.error("获取对接码数据列表失败", e);
+                        return Collections.emptyList();
+                    }
+                }, indexSyncThreadPool);
+                futures.add(future);
+            }
+            return futures.stream().map(CompletableFuture::join).flatMap(List::stream).collect(Collectors.toList());
+        } else {
+            return LinkDataDTOConverter.INSTANCE.convertEntityToDTOList(tdampDwLinkDataService.queryAll());
+        }
+    }
+    public LinkFieldDTO getLinkField(int filedType) {
+        return linkFieldMap.get(filedType);
+    }
+}

+ 83 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/entity/dw/TDampDwLinkData.java

@@ -0,0 +1,83 @@
+package com.qhtx.eta.infra.entity.dw;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * DW层对接码详情表(TDampDwLinkData)实体类
+ *
+ * @author makejava
+ * @since 2024-10-15 15:53:29
+ */
+@Data
+public class TDampDwLinkData implements Serializable {
+    private static final long serialVersionUID = 443727606323720385L;
+    /**
+     * 主键
+     */
+    private String id;
+    /**
+     * 对接码管理表主键
+     */
+    private String linkId;
+    /**
+     * 对接码code
+     */
+    private String linkCode;
+    /**
+     * 对接码名称
+     */
+    private String linkName;
+    /**
+     * 对接码所属字段名称,以,隔开
+     */
+    private String linkFiledName;
+    /**
+     * 对接码所属字段id,以,隔开
+     */
+    private String linkFiledIds;
+    /**
+     * 对接码有效数据总数
+     */
+    private Integer totalNum;
+    /**
+     * 对接码新增总数
+     */
+    private Integer increaseNum;
+    /**
+     * 最小时间
+     */
+    private String minTime;
+    /**
+     * 最大时间
+     */
+    private String maxTime;
+    /**
+     * 是否显示,1,显示,0隐藏
+     */
+    private Integer isShow;
+    /**
+     * 创建时间
+     */
+    private String createTime;
+    /**
+     * 更新时间
+     */
+    private String updateTime;
+    /**
+     * 元素值
+     */
+    private String elementVal;
+    /**
+     * 元素名
+     */
+    private String elementName;
+    /**
+     * 分区
+     */
+    private Integer partitionId;
+
+
+}
+

+ 87 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/entity/dw/TDampDwLinkInfo.java

@@ -0,0 +1,87 @@
+package com.qhtx.eta.infra.entity.dw;
+
+import lombok.Data;
+import lombok.Getter;
+
+import java.io.Serializable;
+
+/**
+ * 对接码管理表(TDampDwLinkInfo)实体类
+ *
+ * @author makejava
+ * @since 2024-10-15 10:20:52
+ */
+@Data
+public class TDampDwLinkInfo implements Serializable {
+    private static final long serialVersionUID = 165966114614203272L;
+    /**
+     * 主键
+     */
+    private String id;
+    /**
+     * 对接码类型,1,单表,2双表
+     */
+    private Integer linkType;
+    /**
+     * 对接码前缀
+     */
+    private String linkPrefix;
+    /**
+     * 信息表id
+     */
+    private String infoTableId;
+    /**
+     * 信息表名
+     */
+    private String infoTableName;
+    /**
+     * 数据表id,type=2时必填
+     */
+    private String dataTableId;
+    /**
+     * 数据表名,type=2时必填
+     */
+    private String dataTableName;
+    /**
+     * 是否生成对接码1,生成,0,不生成
+     */
+    private Integer isGenerate;
+    /**
+     * 度量字段来源,1信息表,2数据表,type=1默认为1
+     */
+    private Integer measureFieldSource;
+    /**
+     * 对接码字段集合,json格式保存
+     */
+    private String linkFileds;
+    /**
+     * 初始化版本号,用作乐观锁
+     */
+    private String initVersion;
+    /**
+     * 是否启用,1:是,0:否
+     */
+    private Integer isEnable;
+    /**
+     * 创建时间
+     */
+    private String createTime;
+    /**
+     * 创建人id
+     */
+    private String createUserId;
+    /**
+     * 创建人名称
+     */
+    private String createUserName;
+    /**
+     * 分区
+     */
+    private Integer partitionId;
+    /**
+     * 1 oracle 2 hbase -1 未知
+     */
+    private Integer sourceType;
+
+}
+

+ 26 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/enums/DimTranFieldType.java

@@ -0,0 +1,26 @@
+package com.qhtx.eta.infra.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum DimTranFieldType {
+
+    TABLE_RELATION(1, "双表关联字段"),
+
+    DIMENSION(2, "维度字段"),
+
+    METRIC(3, "度量字段"),
+    DATE(4, "日期字段"),
+    MCODE(5, "对接码字段"),
+    INDEX_NAME(6, "指标名称字段"),
+    ;
+
+
+    private int value;
+    private String desc;
+
+    private DimTranFieldType(int value, String desc) {
+        this.desc = desc;
+        this.value = value;
+    }
+}

+ 2 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/ETAClassifyIndexFrameMappingDao.java

@@ -15,4 +15,6 @@ public interface ETAClassifyIndexFrameMappingDao {
 
 
     void update(@Param("entity") ETAClassifyIndexFrameMapping etaClassifyIndexFrameMapping);
+
+    List<ETAClassifyIndexFrameMapping> getDealedList();
 }

+ 5 - 2
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/EtaApiQuotaInfoDao.java

@@ -24,10 +24,9 @@ public interface EtaApiQuotaInfoDao {
     /**
      * 统计总行数
      *
-     * @param etaApiQuotaInfo 查询条件
      * @return 总行数
      */
-    long count(EtaApiQuotaInfo etaApiQuotaInfo);
+    long count();
 
     /**
      * 新增数据
@@ -72,5 +71,9 @@ public interface EtaApiQuotaInfoDao {
 
 
     List<EtaApiQuotaInfo> queryQuotaList(EtaApiQuotaInfo etaApiQuotaInfo);
+
+    List<EtaApiQuotaInfo> queryQuotaListPage(@Param("offset") int offset, @Param("limit") int limit);
+
+    List<EtaApiQuotaInfo> getAllQuotaList();
 }
 

+ 35 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/TDampDwLinkDataDao.java

@@ -0,0 +1,35 @@
+package com.qhtx.eta.infra.mapper;
+
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * DW层对接码详情表(TDampDwLinkData)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-10-15 15:53:28
+ */
+public interface TDampDwLinkDataDao {
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param offset offset
+     * @param limit  limit
+     * @return 对象列表
+     */
+    List<TDampDwLinkData> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
+
+    /**
+     * 统计总行数
+     *
+     * @return 总行数
+     */
+    long count();
+
+    List<TDampDwLinkData> queryAll();
+}
+

+ 23 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/TDampDwLinkInfoDao.java

@@ -0,0 +1,23 @@
+package com.qhtx.eta.infra.mapper;
+
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkInfo;
+
+/**
+ * 对接码管理表(TDampDwLinkInfo)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-10-15 10:20:47
+ */
+public interface TDampDwLinkInfoDao {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param prefix 主键
+     * @return 实例对象
+     */
+    TDampDwLinkInfo queryByLinkPrefix(String prefix);
+
+
+}
+

+ 1 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/EtaApiClassifyService.java

@@ -13,4 +13,5 @@ public interface EtaApiClassifyService {
 
     void update(ETAClassifyIndexFrameMapping etaClassifyIndexFrameMapping);
 
+    List<ETAClassifyIndexFrameMapping> getDealedList();
 }

+ 5 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/EtaApiQuotaInfoService.java

@@ -21,6 +21,7 @@ public interface EtaApiQuotaInfoService {
      */
     EtaApiQuotaInfo queryById(Integer quoteId);
 
+    long countQuota();
 
     /**
      * 新增数据
@@ -50,4 +51,8 @@ public interface EtaApiQuotaInfoService {
 
 
     List<EtaApiQuotaInfo> queryQuotaList(EtaApiQuotaInfo etaApiQuotaInfo);
+
+    List<EtaApiQuotaInfo> queryQuotaListPage(int offset, int limit);
+
+    List<EtaApiQuotaInfo> getAllQuotaList();
 }

+ 26 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/TDampDwLinkDataService.java

@@ -0,0 +1,26 @@
+package com.qhtx.eta.infra.service;
+
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkData;
+
+import java.util.List;
+
+/**
+ * DW层对接码详情表(TDampDwLinkData)表服务接口
+ *
+ * @author makejava
+ * @since 2024-10-15 15:53:30
+ */
+public interface TDampDwLinkDataService {
+
+    /**
+     * 分页查询
+     *
+     * @param offset 偏移量
+     * @param limit  限制
+     * @return 查询结果
+     */
+    List<TDampDwLinkData> queryByLimit(int offset, int limit);
+
+    List<TDampDwLinkData> queryAll();
+    long count();
+}

+ 22 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/TDampDwLinkInfoService.java

@@ -0,0 +1,22 @@
+package com.qhtx.eta.infra.service;
+
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkInfo;
+
+/**
+ * 对接码管理表(TDampDwLinkInfo)表服务接口
+ *
+ * @author makejava
+ * @since 2024-10-15 10:20:54
+ */
+public interface TDampDwLinkInfoService {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param prefix 前綴
+     * @return 实例对象
+     */
+    TDampDwLinkInfo queryByLinkPrefix(String prefix);
+
+
+}

+ 5 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/EtaApiClassifyServiceImpl.java

@@ -40,4 +40,9 @@ public class EtaApiClassifyServiceImpl implements EtaApiClassifyService {
     public void update(ETAClassifyIndexFrameMapping etaClassifyIndexFrameMapping) {
         etaClassifyIndexFrameMappingDao.update(etaClassifyIndexFrameMapping);
     }
+
+    @Override
+    public List<ETAClassifyIndexFrameMapping> getDealedList() {
+        return etaClassifyIndexFrameMappingDao.getDealedList();
+    }
 }

+ 15 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/EtaApiQuotaInfoServiceImpl.java

@@ -44,6 +44,11 @@ public class EtaApiQuotaInfoServiceImpl implements EtaApiQuotaInfoService {
         return this.etaApiQuotaInfoDao.queryById(quoteId);
     }
 
+    @Override
+    public long countQuota() {
+        return etaApiQuotaInfoDao.count();
+    }
+
 
     /**
      * 新增数据
@@ -101,4 +106,14 @@ public class EtaApiQuotaInfoServiceImpl implements EtaApiQuotaInfoService {
     public List<EtaApiQuotaInfo> queryQuotaList(EtaApiQuotaInfo etaApiQuotaInfo) {
         return etaApiQuotaInfoDao.queryQuotaList(etaApiQuotaInfo);
     }
+
+    @Override
+    public List<EtaApiQuotaInfo> queryQuotaListPage(int offset, int limit) {
+        return etaApiQuotaInfoDao.queryQuotaListPage(offset, limit);
+    }
+
+    @Override
+    public List<EtaApiQuotaInfo> getAllQuotaList() {
+        return etaApiQuotaInfoDao.getAllQuotaList();
+    }
 }

+ 40 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/TDampDwLinkDataServiceImpl.java

@@ -0,0 +1,40 @@
+package com.qhtx.eta.infra.service.impl;
+
+import com.qhtx.eta.common.eunms.DataSourceType;
+import com.qhtx.eta.infra.annotation.UseDataSource;
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkData;
+import com.qhtx.eta.infra.mapper.TDampDwLinkDataDao;
+import com.qhtx.eta.infra.service.TDampDwLinkDataService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * DW层对接码详情表(TDampDwLinkData)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-10-15 15:53:30
+ */
+@Service("tDampDwLinkDataService")
+@UseDataSource(dataSourceType = DataSourceType.DW)
+public class TDampDwLinkDataServiceImpl implements TDampDwLinkDataService {
+    @Resource
+    private TDampDwLinkDataDao tDampDwLinkDataDao;
+
+
+    @Override
+    public List<TDampDwLinkData> queryByLimit(int offset, int limit) {
+        return tDampDwLinkDataDao.queryAllByLimit(offset, limit);
+    }
+
+    @Override
+    public List<TDampDwLinkData> queryAll() {
+        return tDampDwLinkDataDao.queryAll();
+    }
+
+    @Override
+    public long count() {
+        return tDampDwLinkDataDao.count();
+    }
+}

+ 35 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/TDampDwLinkInfoServiceImpl.java

@@ -0,0 +1,35 @@
+package com.qhtx.eta.infra.service.impl;
+
+import com.qhtx.eta.common.eunms.DataSourceType;
+import com.qhtx.eta.infra.annotation.UseDataSource;
+import com.qhtx.eta.infra.entity.dw.TDampDwLinkInfo;
+import com.qhtx.eta.infra.mapper.TDampDwLinkInfoDao;
+import com.qhtx.eta.infra.service.TDampDwLinkInfoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * 对接码管理表(TDampDwLinkInfo)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-10-15 10:20:59
+ */
+@Service("tDampDwLinkInfoService")
+@UseDataSource(dataSourceType = DataSourceType.DW)
+public class TDampDwLinkInfoServiceImpl implements TDampDwLinkInfoService {
+    @Resource
+    private TDampDwLinkInfoDao tDampDwLinkInfoDao;
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param prefix 主键
+     * @return 实例对象
+     */
+    @Override
+    public TDampDwLinkInfo queryByLinkPrefix(String prefix) {
+        return this.tDampDwLinkInfoDao.queryByLinkPrefix(prefix);
+    }
+
+}

+ 6 - 1
qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/ETAClassifyIndexFrameMappingDao.xml

@@ -47,7 +47,12 @@
         order by id
     </select>
 
-
+    <select id="getDealedList" resultMap="EtaClassifyIndexFrameMappingMap">
+        select *
+        from T_ETA_CLASSIFY_INDEX_MAPPING
+        where index_frame_id is not null
+        order by id
+    </select>
     <select id="getByClassifyId"  resultMap="EtaClassifyIndexFrameMappingMap">
         select * from  T_ETA_CLASSIFY_INDEX_MAPPING where classify_id=#{id}
     </select>

+ 25 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/EtaApiQuotaInfoDao.xml

@@ -69,5 +69,30 @@
         </where>
         order by quota_id asc
     </select>
+    <select id="getAllQuotaList" resultMap="EtaApiQuotaInfoMap">
+        select  EDB_INFO_ID, EDB_CODE, UNIQUE_CODE, EDB_NAME, CLASSIFY_ID, EDB_SOURCE_NAME from T_ETA_API_QUOTA_INFO
+        <where>
+           IS_DELETE = 0
+        </where>
+    </select>
+
+    <select id="count" resultType="Long">
+        select count(*) from T_ETA_API_QUOTA_INFO
+        <where>
+            IS_DELETE = 0
+        </where>
+    </select>
+    <select id="queryQuotaListPage" resultMap="EtaApiQuotaInfoMap">
+        select *
+        from (select *
+              from (select rownum NO, EDB_INFO_ID, EDB_CODE, UNIQUE_CODE, EDB_NAME, CLASSIFY_ID, EDB_SOURCE_NAME
+                    from T_ETA_API_QUOTA_INFO
+                    where is_delete = 0
+                    ORDER BY NO ASC)
+              where NO <![CDATA[>]]> #{offset})
+        where ROWNUM
+         <![CDATA[<=]]> #{limit}
+    </select>
+
 </mapper>
 

+ 64 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/TDampDwLinkDataDao.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qhtx.eta.infra.mapper.TDampDwLinkDataDao">
+
+    <resultMap type="com.qhtx.eta.infra.entity.dw.TDampDwLinkData" id="TDampDwLinkDataMap">
+        <result property="id" column="ID" jdbcType="VARCHAR"/>
+        <result property="linkId" column="LINK_ID" jdbcType="VARCHAR"/>
+        <result property="linkCode" column="LINK_CODE" jdbcType="VARCHAR"/>
+        <result property="linkName" column="LINK_NAME" jdbcType="VARCHAR"/>
+        <result property="linkFiledName" column="LINK_FILED_NAME" jdbcType="VARCHAR"/>
+        <result property="linkFiledIds" column="LINK_FILED_IDS" jdbcType="VARCHAR"/>
+        <result property="totalNum" column="TOTAL_NUM" jdbcType="INTEGER"/>
+        <result property="increaseNum" column="INCREASE_NUM" jdbcType="INTEGER"/>
+        <result property="minTime" column="MIN_TIME" jdbcType="VARCHAR"/>
+        <result property="maxTime" column="MAX_TIME" jdbcType="VARCHAR"/>
+        <result property="isShow" column="IS_SHOW" jdbcType="INTEGER"/>
+        <result property="createTime" column="CREATE_TIME" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="UPDATE_TIME" jdbcType="VARCHAR"/>
+        <result property="elementVal" column="ELEMENT_VAL" jdbcType="VARCHAR"/>
+        <result property="elementName" column="ELEMENT_NAME" jdbcType="VARCHAR"/>
+        <result property="partitionId" column="PARTITION_ID" jdbcType="INTEGER"/>
+    </resultMap>
+
+
+    <!--查询指定行数据-->
+    <select id="queryAllByLimit" resultMap="TDampDwLinkDataMap">
+
+        select *
+        from (select *
+              from (select rownum NO,
+                           LINK_ID,
+                           LINK_CODE,
+                           LINK_NAME,
+                           LINK_FILED_NAME,
+                           LINK_FILED_IDS,
+                           ELEMENT_VAL,
+                           ELEMENT_NAME
+                    from T_DAMP_DW_LINK_DATA
+                    ORDER BY NO ASC)
+              where NO <![CDATA[>]]> #{offset})
+        where ROWNUM
+         <![CDATA[<=]]> #{limit}
+    </select>
+
+    <!--统计总行数-->
+    <select id="count" resultType="Long">
+        select count(1)
+        from T_DAMP_DW_LINK_DATA
+    </select>
+
+
+    <select id="queryAll"  resultMap="TDampDwLinkDataMap">
+        select  LINK_ID,
+                LINK_CODE,
+                LINK_NAME,
+                LINK_FILED_NAME,
+                LINK_FILED_IDS,
+                ELEMENT_VAL,
+                ELEMENT_NAME
+        from T_DAMP_DW_LINK_DATA
+    </select>
+
+</mapper>
+

+ 38 - 0
qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/TDampDwLinkInfoDao.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qhtx.eta.infra.mapper.TDampDwLinkInfoDao">
+
+    <resultMap type="com.qhtx.eta.infra.entity.dw.TDampDwLinkInfo" id="TDampDwLinkInfoMap">
+        <result property="id" column="ID" jdbcType="VARCHAR"/>
+        <result property="linkType" column="LINK_TYPE" jdbcType="INTEGER"/>
+        <result property="linkPrefix" column="LINK_PREFIX" jdbcType="VARCHAR"/>
+        <result property="infoTableId" column="INFO_TABLE_ID" jdbcType="VARCHAR"/>
+        <result property="infoTableName" column="INFO_TABLE_NAME" jdbcType="VARCHAR"/>
+        <result property="dataTableId" column="DATA_TABLE_ID" jdbcType="VARCHAR"/>
+        <result property="dataTableName" column="DATA_TABLE_NAME" jdbcType="VARCHAR"/>
+        <result property="isGenerate" column="IS_GENERATE" jdbcType="INTEGER"/>
+        <result property="measureFieldSource" column="MEASURE_FIELD_SOURCE" jdbcType="INTEGER"/>
+        <result property="linkFileds" column="LINK_FILEDS" jdbcType="VARCHAR"/>
+        <result property="initVersion" column="INIT_VERSION" jdbcType="VARCHAR"/>
+        <result property="isEnable" column="IS_ENABLE" jdbcType="INTEGER"/>
+        <result property="createTime" column="CREATE_TIME" jdbcType="VARCHAR"/>
+        <result property="createUserId" column="CREATE_USER_ID" jdbcType="VARCHAR"/>
+        <result property="createUserName" column="CREATE_USER_NAME" jdbcType="VARCHAR"/>
+        <result property="partitionId" column="PARTITION_ID" jdbcType="INTEGER"/>
+        <result property="sourceType" column="SOURCE_TYPE" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!--查询单个-->
+    <select id="queryByLinkPrefix" resultMap="TDampDwLinkInfoMap">
+        select LINK_PREFIX,
+               INFO_TABLE_ID,
+               INFO_TABLE_NAME,
+               DATA_TABLE_ID,
+               DATA_TABLE_NAME,
+               LINK_FILEDS
+        from T_DAMP_DW_LINK_INFO
+        where LINK_PREFIX = #{prefix}
+    </select>
+
+</mapper>
+

+ 5 - 3
qhtx-eta-integrator/qhtx-integrator-starter/src/main/java/com/qhtx/eta/init/ETAEnvironmentInit.java

@@ -3,6 +3,7 @@ package com.qhtx.eta.init;
 import com.qhtx.eta.domain.api.ApiServiceHolder;
 import com.qhtx.eta.domain.api.http.ETAHttpClient;
 import com.qhtx.eta.domain.enums.ETAInterfaceEnum;
+import com.qhtx.eta.domain.service.impl.TDampLinkService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
@@ -15,12 +16,12 @@ import javax.annotation.Resource;
 @Component
 @Slf4j
 public class ETAEnvironmentInit implements CommandLineRunner {
-
     @Resource
     private ApiServiceHolder apiServiceHolder;
     @Resource
     private ETAHttpClient httpClientHandler;
-
+    @Resource
+    private TDampLinkService TDampLinkService;
 
     @Override
     public void run(String... args) {
@@ -35,8 +36,9 @@ public class ETAEnvironmentInit implements CommandLineRunner {
                 apiServiceHolder.register(etaInterfaceEnum);
             }
         }
-        // ETAHttpClient etaHttpClient = ETARetryProxyFactory.createProxy(httpClientHandler, ETAHttpClient.class);
         apiServiceHolder.registerClient(httpClientHandler);
+        //加载eta指标参数必须字段
+        TDampLinkService.initLinkInfo();
         log.info("============================ 初始化系统API结束 ============================");
     }
 }