|
@@ -25,19 +25,12 @@ import org.jeecg.modules.bytedance.common.entity.UserAllocation;
|
|
|
import org.jeecg.modules.bytedance.common.service.*;
|
|
|
import org.jeecg.modules.bytedance.common.utils.Check;
|
|
|
import org.jeecg.modules.bytedance.common.utils.StringUtils;
|
|
|
-import org.simpleframework.xml.strategy.Strategy;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.*;
|
|
|
import javax.transaction.Transactional;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.spi.LocaleServiceProvider;
|
|
|
-import java.util.stream.Collectors;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 头条智能投放账户配置信息表
|
|
@@ -762,14 +755,14 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
@Transactional
|
|
|
public Result updStaById(String id,String state,String accountId) {
|
|
|
//开启
|
|
|
- if (StringUtils.equals(state,"0")){
|
|
|
+ if (org.apache.commons.lang3.StringUtils.equals(state,"0")){
|
|
|
//修改状态为开启
|
|
|
aiBytedanceAdvertiserStrategyMapper.updStaById(id,state);
|
|
|
//关闭 账户下 其他数据信息(不包含本条id信息) 状态为 关闭
|
|
|
aiBytedanceAdvertiserStrategyMapper.updStaByAccountId(accountId,"1",id);
|
|
|
}
|
|
|
//关闭
|
|
|
- if (StringUtils.equals(state,"1")){
|
|
|
+ if (org.apache.commons.lang3.StringUtils.equals(state,"1")){
|
|
|
//查询是否有 状态为 开启 其他数据信息(不包含本id数据信息)
|
|
|
QueryWrapper<AiBytedanceAdvertiserStrategy> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("account_id", accountId);
|
|
@@ -805,44 +798,13 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
return Result.errorMsg("出价不能为空,请重新输入。");
|
|
|
}
|
|
|
aiBytedanceAdvertiserStrategyMapper.updCpaById(updAdStaOrCpaOrBudget.getId(),updAdStaOrCpaOrBudget.getBId());
|
|
|
- /*
|
|
|
- mapPrice.put("ad_id",updAdStaOrCpaOrBudget.getAdId());
|
|
|
- mapPrice.put("bid",updAdStaOrCpaOrBudget.getBId());
|
|
|
- priceList.add(mapPrice);
|
|
|
-*/
|
|
|
-
|
|
|
- // api 更新计划出价
|
|
|
- updResult = Marketing.updatePlanBid(token,updAdStaOrCpaOrBudget.getAccountId(),priceList);
|
|
|
- // api 更新计划出价 TODO
|
|
|
- /* updResult = marketing.updatePlanBid(token,updAdStaOrCpaOrBudget.getAccountId(),priceList);
|
|
|
- if (!"200".equals(updResult.getCode())){
|
|
|
- return Result.error(updResult.getMessage());
|
|
|
- }*/
|
|
|
- // 修改 出价
|
|
|
- /* priceList.forEach(map-> {
|
|
|
- aiBytedanceAdvertiserStrategyMapper.updCpaById(updAdStaOrCpaOrBudget.getId(),updAdStaOrCpaOrBudget.getBId());
|
|
|
- });*/
|
|
|
}
|
|
|
//2-修改预算
|
|
|
if (BytedanceConstant.UPDTYPE_BUDGET.equals(updAdStaOrCpaOrBudget.getType())) {
|
|
|
- if (Check.isNull(updAdStaOrCpaOrBudget.getBudget())){
|
|
|
+ if (Check.isNull(updAdStaOrCpaOrBudget.getBudget())) {
|
|
|
return Result.errorMsg("预算不能为空,请重新输入。");
|
|
|
}
|
|
|
- aiBytedanceAdvertiserStrategyMapper.updBudgetById(updAdStaOrCpaOrBudget.getId(),updAdStaOrCpaOrBudget.getBudget());
|
|
|
- /* mapPrice.put("ad_id",updAdStaOrCpaOrBudget.getAdId());
|
|
|
- mapPrice.put("budget",updAdStaOrCpaOrBudget.getBudget());
|
|
|
- priceList.add(mapPrice);*/
|
|
|
- // api 修改计划 预算
|
|
|
- /* updResult = marketing.updatePlanBudget(token,updAdStaOrCpaOrBudget.getAccountId(),priceList);
|
|
|
- updResult = Marketing.updatePlanBudget(token,updAdStaOrCpaOrBudget.getAccountId(),priceList);
|
|
|
- if (!"200".equals(updResult.getCode())){
|
|
|
- return Result.error(updResult.getMessage());
|
|
|
- }*/
|
|
|
- priceList.forEach(map-> {
|
|
|
- // 修改 预算 TODO
|
|
|
- /*priceList.forEach(map-> {
|
|
|
- aiBytedanceAdvertiserStrategyMapper.updBudgetById(updAdStaOrCpaOrBudget.getId(),updAdStaOrCpaOrBudget.getBudget());
|
|
|
- });*/
|
|
|
+ aiBytedanceAdvertiserStrategyMapper.updBudgetById(updAdStaOrCpaOrBudget.getId(), updAdStaOrCpaOrBudget.getBudget());
|
|
|
}
|
|
|
return Result.successMsg("修改"+(BytedanceConstant.UPDTYPE_BID.equals(updAdStaOrCpaOrBudget.getType()) ? "出价" : "预算")+"成功。", updResult.getResult());
|
|
|
}
|
|
@@ -1049,7 +1011,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
aiBytedanceAdvertiserStrategy.setCreativeInventoryType(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getCreativeInventoryTypes(), ","));
|
|
|
//创意标签
|
|
|
aiBytedanceAdvertiserStrategy.setCreativeAdKeywords(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getAdKeywords(), ","));
|
|
|
- aiBytedanceAdvertiserStrategy.setCreativeAdKeywords(StringUtils.join(aiBytedanceAdvertiserStrategy.getAdKeywords(), ","));
|
|
|
+ aiBytedanceAdvertiserStrategy.setCreativeAdKeywords(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getAdKeywords(), ","));
|
|
|
//状态(0开 1关)
|
|
|
aiBytedanceAdvertiserStrategy.setStatus(0);
|
|
|
|
|
@@ -1104,6 +1066,4 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
this.createCreative(strategy, 4, remindCnt);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|