Browse Source

预警规则匹配逻辑——添加可复制规则逻辑

zhaoxian 4 năm trước cách đây
mục cha
commit
7d6b4cb731

+ 2 - 2
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/RuleAccountThresholdMapper.java

@@ -18,7 +18,7 @@ public interface RuleAccountThresholdMapper extends BaseMapper<RuleAccountThresh
 
     List<Long> selectGroupIdsByAccountId(Long accountId);
 
-    List<Long> selectbatchNosByGroupIdId(Long accountId, Long groupId);
+    List<String> selectbatchNosByGroupIdId(Long accountId, Long groupId);
 
-    List<RuleAccountThreshold> selectCopyThresholdByAccountId(Long accountId, Long groupId, Long batchNo);
+    List<RuleAccountThreshold> selectCopyThresholdByAccountId(Long accountId, Long groupId, String batchNo);
 }

+ 1 - 1
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/RuleAccountThresholdMapper.xml

@@ -13,7 +13,7 @@
         and  account_id = #{accountId}
         group by group_id
     </select>
-    <select id="selectbatchNosByGroupIdId" resultType="java.lang.Long">
+    <select id="selectbatchNosByGroupIdId" resultType="java.lang.String">
        SELECT batch_no FROM `ctop_rule_account_threshold`
         WHERE batch_no is not null
         and account_id = #{accountId}

+ 2 - 2
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java

@@ -393,11 +393,11 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                 }
                 for (Long groupId : groupList) {
                     JSONObject groupIdObj = new JSONObject();
-                    List<Long> batchNos = ruleAccountThresholdMapper.selectbatchNosByGroupIdId(accountId, groupId);
+                    List<String> batchNos = ruleAccountThresholdMapper.selectbatchNosByGroupIdId(accountId, groupId);
                     if (Check.isNull(batchNos)) {
                         return null;
                     }
-                    for (Long batchNo : batchNos) {
+                    for (String batchNo : batchNos) {
                         JSONObject batchNoObj = new JSONObject();
                         List<RuleAccountThreshold> thresholdList = ruleAccountThresholdMapper.selectCopyThresholdByAccountId(accountId, groupId, batchNo);
                         if (Check.isNull(thresholdList)) {