瀏覽代碼

支持redisson的集群部署

kobe6258 2 周之前
父節點
當前提交
6ee5586d2a

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

@@ -66,9 +66,9 @@ public class TDampLinkService {
             linkFieldMap.put(field.getFiledType(), field);
         }
         //设置已经同步的指标
-        List<TDampDwIndexLink> indexLinks = tDampDwIndexLinkService.queryAll();
+        List<TDampDwIndexLink> indexLinks = tDampDwIndexLinkService.queryAll(linkInfo.getLinkPrefix());
         indexLinks.forEach(indexLink -> {
-            int uniqueId = Integer.parseInt(indexLink.getLinkCode().substring(indexLink.getLinkCode().indexOf("ETA") + 3));
+            int uniqueId = Integer.parseInt(indexLink.getLinkCode().substring(indexLink.getLinkCode().indexOf(linkInfo.getLinkPrefix()) + 3));
             redisUtils.setBit(redisUtils.indexSyncKey(), uniqueId, true);
             log.info("对接码:{}对应指标数据已同步,不在进行同步处理,指标编码{}", indexLink.getLinkCode(), indexLink.getIndexCode());
         });

+ 1 - 1
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/mapper/TDampDwIndexLinkDao.java

@@ -29,6 +29,6 @@ public interface TDampDwIndexLinkDao {
     int insert(@Param("entity") TDampDwIndexLink tDampDwIndexLink);
 
 
-    List<TDampDwIndexLink> queryAll();
+    List<TDampDwIndexLink> queryAll(@Param("prefix") String prefix);
 }
 

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

@@ -21,5 +21,5 @@ public interface TDampDwIndexLinkService {
     TDampDwIndexLink insert(TDampDwIndexLink tDampDwIndexLink);
 
 
-    List<TDampDwIndexLink> queryAll();
+    List<TDampDwIndexLink> queryAll(String perfix);
 }

+ 2 - 2
qhtx-eta-integrator/qhtx-integrator-infra/src/main/java/com/qhtx/eta/infra/service/impl/TDampDwIndexLinkServiceImpl.java

@@ -35,8 +35,8 @@ public class TDampDwIndexLinkServiceImpl implements TDampDwIndexLinkService {
     }
 
     @Override
-    public List<TDampDwIndexLink> queryAll() {
-        return tDampDwIndexLinkDao.queryAll();
+    public List<TDampDwIndexLink> queryAll(String prefix) {
+        return tDampDwIndexLinkDao.queryAll(prefix);
     }
 
 }

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

@@ -23,8 +23,7 @@
             #{item.classifyName,jdbcType=VARCHAR} AS CLASSIFY_NAME,
             #{item.parentId,jdbcType=VARCHAR} AS PARENT_ID,
             #{item.sort,jdbcType=INTEGER} AS SORT,
-            #{item.frameLevel,jdbcType=VARCHAR} AS FRAME_LEVEL,
-            #{item.createTime,jdbcType=TIMESTAMP} AS CREATE_TIME
+            #{item.frameLevel,jdbcType=VARCHAR} AS FRAME_LEVEL
             FROM dual
         </foreach>
         ) s ON (t.CLASSIFY_ID = s.CLASSIFY_ID)
@@ -32,13 +31,12 @@
         UPDATE SET
         t.classify_name = s.classify_name,
         t.parent_id = s.parent_id,
-        t.sort=s.sort,
-        t.update_time=SYSDATE
+        t.sort=s.sort
         WHEN NOT MATCHED THEN
         INSERT
-        (CLASSIFY_ID,INDEX_FRAME_ID,CLASSIFY_NAME,PARENT_ID,SORT,FRAME_LEVEL,UNIQUE_CODE,CREATE_TIME)
+        (CLASSIFY_ID,INDEX_FRAME_ID,CLASSIFY_NAME,PARENT_ID,SORT,FRAME_LEVEL,UNIQUE_CODE)
         VALUES
-        (s.CLASSIFY_ID,s.INDEX_FRAME_ID,s.CLASSIFY_NAME,s.PARENT_ID,s.SORT,s.FRAME_LEVEL,s.UNIQUE_CODE,s.CREATE_TIME)
+        (s.CLASSIFY_ID,s.INDEX_FRAME_ID,s.CLASSIFY_NAME,s.PARENT_ID,s.SORT,s.FRAME_LEVEL,s.UNIQUE_CODE)
     </update>
 
     <select id="getClassifyMappingList" resultMap="EtaClassifyIndexFrameMappingMap">

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

@@ -44,7 +44,7 @@
     </insert>
 <select id="queryAll" resultMap="TDampDwIndexLinkMap">
     select INDEX_CODE, LINK_CODE
-    from T_DAMP_DW_INDEX_LINK
+    from T_DAMP_DW_INDEX_LINK where  LINK_CODE LIKE  #{prefix} || '%'
 </select>
 </mapper>
 

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

@@ -46,7 +46,7 @@
     <!--统计总行数-->
     <select id="count" resultType="Long">
         select count(1)
-        from T_DAMP_DW_LINK_DATA
+        from T_DAMP_DW_LINK_DATA where LINK_CODE like 'ETA%'
     </select>
 
 
@@ -59,7 +59,7 @@
                LINK_FILED_IDS,
                ELEMENT_VAL,
                ELEMENT_NAME
-        from T_DAMP_DW_LINK_DATA
+        from T_DAMP_DW_LINK_DATA  where LINK_CODE like 'ETA%'
     </select>
 
 </mapper>