|
@@ -527,7 +527,12 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if (("up".equals(operationType) && oldBid.compareTo(new BigDecimal(maxValue)) == 0) || ("down".equals(operationType) && oldBid.compareTo(new BigDecimal(minValue)) == 0)) {
|
|
|
continue;
|
|
|
}
|
|
|
- Long newBid = calculatedValue(oldBid, operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ Long newBid = 0L;
|
|
|
+ if ("to".equals(operationType)) {
|
|
|
+ newBid = Long.valueOf(operationThreshold);
|
|
|
+ } else {
|
|
|
+ newBid = calculatedValue(oldBid, operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ }
|
|
|
//TODO
|
|
|
String code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), new BigDecimal(newBid.toString()), null, null);
|
|
|
String message = "success";
|
|
@@ -544,7 +549,12 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if (("up".equals(operationType) && oldBudget.compareTo(new BigDecimal(maxValue)) == 0) || ("down".equals(operationType) && oldBudget.compareTo(new BigDecimal(minValue)) == 0)) {
|
|
|
continue;
|
|
|
}
|
|
|
- Long newBudget = calculatedValue(oldBudget, operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ Long newBudget = 0L;
|
|
|
+ if ("to".equals(operationType)) {
|
|
|
+ newBudget = Long.valueOf(operationThreshold);
|
|
|
+ } else {
|
|
|
+ newBudget = calculatedValue(oldBudget, operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ }
|
|
|
//TODO
|
|
|
String code = externalLinkService.editBytedancePlanCpaBidOrBudget(accountId, planId.toString(), null, null, newBudget);
|
|
|
String message = "success";
|
|
@@ -589,7 +599,12 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if (("up".equals(operationType) && oldBid - Long.valueOf(maxValue) == 0) || ("down".equals(operationType) && oldBid - Long.valueOf(minValue) == 0)) {
|
|
|
continue;
|
|
|
}
|
|
|
- Long newBid = calculatedValue(new BigDecimal(oldBid.toString()), operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ Long newBid = 0L;
|
|
|
+ if ("to".equals(operationType)) {
|
|
|
+ newBid = Long.valueOf(operationThreshold);
|
|
|
+ } else {
|
|
|
+ newBid = calculatedValue(new BigDecimal(oldBid.toString()), operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ }
|
|
|
JSONObject unitJson = new JSONObject();
|
|
|
unitJson.put("advertiser_id", accountId);
|
|
|
unitJson.put("unit_id", unitId);
|
|
@@ -625,7 +640,12 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if (("up".equals(operationType) && oldBudget - Long.valueOf(maxValue) == 0) || ("down".equals(operationType) && oldBudget - Long.valueOf(minValue) == 0)) {
|
|
|
continue;
|
|
|
}
|
|
|
- Long newBudget = calculatedValue(new BigDecimal(oldBudget.toString()), operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ Long newBudget = 0L;
|
|
|
+ if ("to".equals(operationType)) {
|
|
|
+ newBudget = Long.valueOf(operationThreshold);
|
|
|
+ } else {
|
|
|
+ newBudget = calculatedValue(new BigDecimal(oldBudget.toString()), operationType, operationValue, operationThreshold, maxValue, minValue);
|
|
|
+ }
|
|
|
Map<String, Object> updateMap = kuaiShouUpdateService.updateUnitDayBudget(token.getAccessToken(), accountId, unitId, newBudget, "规则引擎修改预算");
|
|
|
String message = "success";
|
|
|
if ((Integer) updateMap.get("code") == 0) {
|