|
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -88,12 +89,17 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
ruleDataAccountQueryWrapper.eq("account_id",pojo.getAccountId());
|
|
ruleDataAccountQueryWrapper.eq("account_id",pojo.getAccountId());
|
|
//获取消耗 余额
|
|
//获取消耗 余额
|
|
RuleDataAccount ruleDataAccountVo = ruleDataAccountService.getOne(ruleDataAccountQueryWrapper);
|
|
RuleDataAccount ruleDataAccountVo = ruleDataAccountService.getOne(ruleDataAccountQueryWrapper);
|
|
- if(null!=ruleDataAccountVo){
|
|
|
|
|
|
+ if (!Check.isNull(ruleDataAccountVo)){
|
|
//消耗
|
|
//消耗
|
|
pojo.setCost(ruleDataAccountVo.getCost());
|
|
pojo.setCost(ruleDataAccountVo.getCost());
|
|
//余额
|
|
//余额
|
|
pojo.setValidBalance(ruleDataAccountVo.getValidBalance());
|
|
pojo.setValidBalance(ruleDataAccountVo.getValidBalance());
|
|
|
|
+ }else {
|
|
|
|
+ pojo.setCost(new BigDecimal(0));
|
|
|
|
+ pojo.setValidBalance(new BigDecimal(0));
|
|
}
|
|
}
|
|
|
|
+ //拼接 目标转化出价
|
|
|
|
+ pojo.setAdCpaBidStr("FIX".equalsIgnoreCase(pojo.getAdBidCreateType()) ? pojo.getAdCpaBid().toString() : (pojo.getAdMinBid() + "~" + pojo.getAdMaxBid()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -159,7 +165,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
aiBytedanceAdvertiserStrategyService.removeById(id);
|
|
aiBytedanceAdvertiserStrategyService.removeById(id);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("删除失败",e.getMessage());
|
|
|
|
|
|
+ log.error("删除失败",e);
|
|
return Result.error("删除失败!");
|
|
return Result.error("删除失败!");
|
|
}
|
|
}
|
|
return Result.successMsg("删除成功!",null);
|
|
return Result.successMsg("删除成功!",null);
|
|
@@ -226,7 +232,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.updStaById(id,state,accountId);
|
|
return aiBytedanceAdvertiserStrategyService.updStaById(id,state,accountId);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("修改状态(0开-1关)失败",e.getMessage());
|
|
|
|
|
|
+ log.error("修改状态(0开-1关)失败",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -238,7 +244,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.updStaOrCpaOrBudgetById(updAdStaOrCpaOrBudget);
|
|
return aiBytedanceAdvertiserStrategyService.updStaOrCpaOrBudgetById(updAdStaOrCpaOrBudget);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("修改出价-预算失败",e.getMessage());
|
|
|
|
|
|
+ log.error("修改出价-预算失败",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -250,7 +256,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getIndustryList(accountId,type);
|
|
return aiBytedanceAdvertiserStrategyService.getIndustryList(accountId,type);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("创建失败",e.getMessage());
|
|
|
|
|
|
+ log.error("创建失败",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -265,7 +271,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getCampaignGroup(accountId,adGroupSearchVoList,pageNo,pageSize);
|
|
return aiBytedanceAdvertiserStrategyService.getCampaignGroup(accountId,adGroupSearchVoList,pageNo,pageSize);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("获取广告组异常。",e.getMessage());
|
|
|
|
|
|
+ log.error("获取广告组异常。",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -279,7 +285,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getCampaignPlan(accountId,planSearchVoList,pageNo,pageSize);
|
|
return aiBytedanceAdvertiserStrategyService.getCampaignPlan(accountId,planSearchVoList,pageNo,pageSize);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("获取广告计划异常。",e.getMessage());
|
|
|
|
|
|
+ log.error("获取广告计划异常。",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -290,7 +296,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.creativeReadInfo(accountId,adId);
|
|
return aiBytedanceAdvertiserStrategyService.creativeReadInfo(accountId,adId);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("获取广告组异常。",e.getMessage());
|
|
|
|
|
|
+ log.error("获取广告组异常。",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -303,7 +309,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getToolConvert(adConvertQueryVo);
|
|
return aiBytedanceAdvertiserStrategyService.getToolConvert(adConvertQueryVo);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("查询广告计划可用转化目标异常",e.getMessage());
|
|
|
|
|
|
+ log.error("查询广告计划可用转化目标异常",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -364,7 +370,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
}
|
|
}
|
|
return Result.successMsg("根据下载链接获取应用包名成功", map);
|
|
return Result.successMsg("根据下载链接获取应用包名成功", map);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("根据下载链接获取应用包名异常",e.getMessage());
|
|
|
|
|
|
+ log.error("根据下载链接获取应用包名异常",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -378,7 +384,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getAdActionText(accountId,landingType,advancedCreativeType);
|
|
return aiBytedanceAdvertiserStrategyService.getAdActionText(accountId,landingType,advancedCreativeType);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("获取行动号召异常",e.getMessage());
|
|
|
|
|
|
+ log.error("获取行动号召异常",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -394,7 +400,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getAdAudiencePackage(accountId,landingType,deliveryRange);
|
|
return aiBytedanceAdvertiserStrategyService.getAdAudiencePackage(accountId,landingType,deliveryRange);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("获取行动号召异常",e.getMessage());
|
|
|
|
|
|
+ log.error("获取行动号召异常",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -406,7 +412,7 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
try {
|
|
try {
|
|
return aiBytedanceAdvertiserStrategyService.getDMPCustomAudience(accountId);
|
|
return aiBytedanceAdvertiserStrategyService.getDMPCustomAudience(accountId);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("获取人群包列表异常",e.getMessage());
|
|
|
|
|
|
+ log.error("获取人群包列表异常",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|