|
@@ -443,10 +443,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
//倍数计算, 转化成本 高于or低于当前倍数时,预警
|
|
|
othreshold = bid.multiply(new BigDecimal(threshold)).toString();
|
|
|
}
|
|
|
- } else {
|
|
|
- othreshold = threshold;
|
|
|
- }
|
|
|
- if ("dayBudget".equals(cindicatorCode)) {
|
|
|
+ } else if ("dayBudget".equals(cindicatorCode)) {
|
|
|
if ("cost".equals(indicatorCode)) {
|
|
|
//倍数计算, 转化成本 高于or低于当前倍数时,预警
|
|
|
threshold = new BigDecimal(String.valueOf(byteDancePlan.getBudget())).multiply(new BigDecimal(threshold)).toString();
|
|
@@ -466,15 +463,12 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
//转化成本
|
|
|
if ("convertCost".equals(indicatorCode)) {
|
|
|
//倍数计算, 转化成本 高于or低于当前倍数时,预警
|
|
|
- othreshold = new BigDecimal(String.valueOf(bid)).multiply(new BigDecimal(threshold)).toString();
|
|
|
+ othreshold = new BigDecimal(String.valueOf(bid)).multiply(new BigDecimal(threshold)).divide(new BigDecimal("1000")).toString();
|
|
|
}
|
|
|
- } else {
|
|
|
- othreshold = threshold;
|
|
|
- }
|
|
|
- if ("dayBudget".equals(cindicatorCode)) {
|
|
|
+ } else if ("dayBudget".equals(cindicatorCode)) {
|
|
|
if ("charge".equals(indicatorCode)) {
|
|
|
//倍数计算, 转化成本 高于or低于当前倍数时,预警
|
|
|
- othreshold = new BigDecimal(String.valueOf(kuaiShouGroup.getDayBudget())).multiply(new BigDecimal(threshold)).toString();
|
|
|
+ othreshold = new BigDecimal(String.valueOf(kuaiShouGroup.getDayBudget())).multiply(new BigDecimal(threshold)).divide(new BigDecimal("1000")).toString();
|
|
|
}
|
|
|
} else {
|
|
|
othreshold = threshold;
|
|
@@ -615,7 +609,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if ("to".equals(operationType)) {
|
|
|
//金额直接赋值
|
|
|
if ("price".equals(operationValue)) {
|
|
|
- newBid = new BigDecimal(operationThreshold).multiply(new BigDecimal(1000 + "")).longValue();
|
|
|
+ newBid = new BigDecimal(operationThreshold).multiply(new BigDecimal("1000")).longValue();
|
|
|
} else {//百分比需计算
|
|
|
newBid = new BigDecimal(operationThreshold).multiply(oldBidDecimal).longValue();
|
|
|
}
|
|
@@ -634,7 +628,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
}
|
|
|
JSONObject jsonObject = kuaiShouUpdateService.updateUnit(token.getAccessToken(), unitJson);
|
|
|
Integer code = jsonObject.getInteger("code");
|
|
|
- BigDecimal divide = new BigDecimal(newBid + "").divide(new BigDecimal(1000 + ""));
|
|
|
+ BigDecimal divide = new BigDecimal(newBid + "").divide(new BigDecimal("1000"));
|
|
|
String message = "success";
|
|
|
if (code == 0) {
|
|
|
alreadyOperatedList.add(obj);
|
|
@@ -663,7 +657,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if ("to".equals(operationType)) {
|
|
|
//金额直接赋值
|
|
|
if ("price".equals(operationValue)) {
|
|
|
- newBudget = new BigDecimal(operationThreshold).multiply(new BigDecimal(1000 + "")).longValue();
|
|
|
+ newBudget = new BigDecimal(operationThreshold).multiply(new BigDecimal("1000")).longValue();
|
|
|
} else {//百分比需计算
|
|
|
newBudget = new BigDecimal(operationThreshold).multiply(oldBudgetDecimal).longValue();
|
|
|
}
|
|
@@ -671,7 +665,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
newBudget = calculatedValue(oldBudgetDecimal, operationType, operationValue, operationThreshold, maxValue, minValue, 2);
|
|
|
}
|
|
|
Map<String, Object> updateMap = kuaiShouUpdateService.updateUnitDayBudget(token.getAccessToken(), accountId, unitId, newBudget, "规则引擎修改预算");
|
|
|
- BigDecimal divide = new BigDecimal(newBudget + "").divide(new BigDecimal(1000 + ""));
|
|
|
+ BigDecimal divide = new BigDecimal(newBudget + "").divide(new BigDecimal("1000"));
|
|
|
String message = "success";
|
|
|
if ((Integer) updateMap.get("code") == 0) {
|
|
|
alreadyOperatedList.add(obj);
|
|
@@ -832,7 +826,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
}
|
|
|
return value.longValue();
|
|
|
} else {
|
|
|
- goal = goal.divide(new BigDecimal(1000 + ""));
|
|
|
+ goal = goal.divide(new BigDecimal("1000"));
|
|
|
//操作金额
|
|
|
if ("price".equals(operationValue)) {
|
|
|
if ("up".equals(operationType)) {
|
|
@@ -858,7 +852,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if (value.compareTo(minValue) == -1) {
|
|
|
value = minValue;
|
|
|
}
|
|
|
- return value.multiply(new BigDecimal(1000 + "")).longValue();
|
|
|
+ return value.multiply(new BigDecimal("1000")).longValue();
|
|
|
}
|
|
|
}
|
|
|
|