Browse Source

规则引擎,修改bug

zhaoxian 3 years ago
parent
commit
023774ebdf

+ 4 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java

@@ -529,7 +529,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     }
                     Long newBid = 0L;
                     if ("to".equals(operationType)) {
-                        newBid = Long.valueOf(operationThreshold);
+                        newBid = new BigDecimal(operationThreshold).multiply(new BigDecimal(1000 + "")).longValue();
                     } else {
                         newBid = calculatedValue(oldBid, operationType, operationValue, operationThreshold, maxValue, minValue);
                     }
@@ -551,7 +551,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     }
                     Long newBudget = 0L;
                     if ("to".equals(operationType)) {
-                        newBudget = Long.valueOf(operationThreshold);
+                        newBudget = new BigDecimal(operationThreshold).multiply(new BigDecimal(1000 + "")).longValue();
                     } else {
                         newBudget = calculatedValue(oldBudget, operationType, operationValue, operationThreshold, maxValue, minValue);
                     }
@@ -601,7 +601,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     }
                     Long newBid = 0L;
                     if ("to".equals(operationType)) {
-                        newBid = Long.valueOf(operationThreshold);
+                        newBid = new BigDecimal(operationThreshold).multiply(new BigDecimal(1000 + "")).longValue();
                     } else {
                         newBid = calculatedValue(new BigDecimal(oldBid.toString()), operationType, operationValue, operationThreshold, maxValue, minValue);
                     }
@@ -642,7 +642,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                     }
                     Long newBudget = 0L;
                     if ("to".equals(operationType)) {
-                        newBudget = Long.valueOf(operationThreshold);
+                        newBudget = new BigDecimal(operationThreshold).multiply(new BigDecimal(1000 + "")).longValue();
                     } else {
                         newBudget = calculatedValue(new BigDecimal(oldBudget.toString()), operationType, operationValue, operationThreshold, maxValue, minValue);
                     }