|
@@ -2,12 +2,9 @@ package org.jeecg.modules.bytedance.advertise.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.google.gson.JsonArray;
|
|
|
-import io.lettuce.core.StrAlgoArgs;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.beanutils.ConvertUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.modules.bytedance.advertise.dockapi.MarketingService;
|
|
|
import org.jeecg.modules.bytedance.advertise.entity.AiBytedanceAdvertiserStrategy;
|
|
@@ -16,7 +13,6 @@ import org.jeecg.modules.bytedance.advertise.service.IByteDanceAdvertisePlanServ
|
|
|
import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
|
|
|
import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
|
|
|
import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
|
|
|
-import org.jeecg.modules.bytedance.common.service.IMaterialInfoService;
|
|
|
import org.jeecg.modules.bytedance.common.utils.Check;
|
|
|
import org.jeecg.modules.bytedance.report.service.IBytedanceAdvertiserHourlyReportService;
|
|
|
import org.jeecg.modules.bytedance.report.service.IBytedancePlanHourlyReportService;
|
|
@@ -28,9 +24,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 投放数据
|
|
@@ -169,7 +167,8 @@ public class BytedanceReportController {
|
|
|
@GetMapping(value = "/updateADCpaBid")
|
|
|
public Result updateADCpaBid(@RequestParam("accountId") String accountId,
|
|
|
@RequestParam("adId") String adId,
|
|
|
- @RequestParam("cpaBid") BigDecimal cpaBid) {
|
|
|
+ @RequestParam("cpaBid") BigDecimal cpaBid,
|
|
|
+ @RequestParam("adScheduleTime") String adScheduleTime) {
|
|
|
try {
|
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
|
|
|
PlanSearchVo planSearchVo = new PlanSearchVo();
|
|
@@ -185,10 +184,13 @@ public class BytedanceReportController {
|
|
|
List<Map<String,Object>> dataList = JSONArray.parseObject(array.toJSONString(),List.class);
|
|
|
|
|
|
for (Map<String, Object> map : dataList) {
|
|
|
- String modifyTime = map.get("modify_time").toString();
|
|
|
+ //不需要传modifytime字段
|
|
|
+ //String modifyTime = map.get("modify_time").toString();
|
|
|
+ String modifyTime = null;
|
|
|
AiBytedanceAdvertiserStrategy strategy = new AiBytedanceAdvertiserStrategy();
|
|
|
strategy.setAccountId(Long.valueOf(accountId));
|
|
|
strategy.setAdCpaBid(cpaBid);
|
|
|
+ strategy.setAdScheduleTime(adScheduleTime);
|
|
|
//3 修改广告计划 中的 cpaBid
|
|
|
Result resultUpd = marketingService.updateAdvertiserPlan(token,adId,modifyTime,strategy);
|
|
|
if (!resultUpd.isSuccess()){
|
|
@@ -197,6 +199,7 @@ public class BytedanceReportController {
|
|
|
ByteDanceAdvertisePlan byteDanceAdvertisePlan = new ByteDanceAdvertisePlan();
|
|
|
byteDanceAdvertisePlan.setId(Long.valueOf(adId));
|
|
|
byteDanceAdvertisePlan.setCpaBid(cpaBid);
|
|
|
+ byteDanceAdvertisePlan.setScheduleTime(adScheduleTime);
|
|
|
//更新 表 bid || 定向包id || 状态
|
|
|
byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
|
|
|
}
|