Forráskód Böngészése

常量变量调整

yumeng 4 éve
szülő
commit
e13f896a41

+ 4 - 1
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleAccountTemplateServiceImpl.java

@@ -37,7 +37,7 @@ public class RuleAccountTemplateServiceImpl extends ServiceImpl<RuleAccountTempl
     private IRuleAccountThresholdService ruleAccountThresholdService;
     private IRuleAccountThresholdService ruleAccountThresholdService;
 
 
     /**
     /**
-     * 推送模板到账
+     * 推送模板到账
      *
      *
      * @param accountId
      * @param accountId
      * @param templateId
      * @param templateId
@@ -95,6 +95,9 @@ public class RuleAccountTemplateServiceImpl extends ServiceImpl<RuleAccountTempl
                 threshold.setAccountId(accountId);
                 threshold.setAccountId(accountId);
                 threshold.setGroupId(groupId);
                 threshold.setGroupId(groupId);
                 threshold.setRuleId(ruleBase.getId());
                 threshold.setRuleId(ruleBase.getId());
+                if (ruleBase.getVariableType() == 0) {
+                    threshold.setThreshold(ruleBase.getThreshold());
+                }
                 if (isCopy == 1) {
                 if (isCopy == 1) {
                     threshold.setBatchNo(batchId);
                     threshold.setBatchNo(batchId);
                 }
                 }

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

@@ -1,20 +1,8 @@
 package cn.com.ctop.alarm.modules.service.impl;
 package cn.com.ctop.alarm.modules.service.impl;
 
 
 import cn.com.ctop.alarm.modules.constant.MatchLogic;
 import cn.com.ctop.alarm.modules.constant.MatchLogic;
-import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
-import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
-import cn.com.ctop.alarm.modules.entity.RuleAccountThreshold;
-import cn.com.ctop.alarm.modules.entity.RuleBase;
-import cn.com.ctop.alarm.modules.entity.RuleGroup;
-import cn.com.ctop.alarm.modules.entity.RuleIndicator;
-import cn.com.ctop.alarm.modules.entity.RuleTemplate;
-import cn.com.ctop.alarm.modules.mapper.AlarmEventSendMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleAccountTemplateMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleAccountThresholdMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleBaseMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleGroupMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleIndicatorMapper;
-import cn.com.ctop.alarm.modules.mapper.RuleTemplateMapper;
+import cn.com.ctop.alarm.modules.entity.*;
+import cn.com.ctop.alarm.modules.mapper.*;
 import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
 import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
 import cn.com.ctop.alarm.modules.service.IRuleGroupService;
 import cn.com.ctop.alarm.modules.service.IRuleGroupService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
@@ -36,12 +24,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringJoiner;
-import java.util.UUID;
+import java.util.*;
 
 
 /**
 /**
  * 规则组
  * 规则组
@@ -722,6 +705,9 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                                     continue;
                                     continue;
                                 }
                                 }
                                 RuleAccountThreshold threshold = new RuleAccountThreshold();
                                 RuleAccountThreshold threshold = new RuleAccountThreshold();
+                                if (ruleBase.getVariableType() == 0) {
+                                    threshold.setThreshold(ruleBase.getThreshold());
+                                }
                                 threshold.setAccountId(accountId);
                                 threshold.setAccountId(accountId);
                                 if (isCopy == 1) {
                                 if (isCopy == 1) {
                                     threshold.setBatchNo(batchId);
                                     threshold.setBatchNo(batchId);