|
@@ -3,6 +3,7 @@ package org.jeecg.modules.bytedance.advertise.controller;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.google.gson.JsonArray;
|
|
import com.google.gson.JsonArray;
|
|
|
|
+import io.lettuce.core.StrAlgoArgs;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -10,6 +11,8 @@ import org.apache.commons.beanutils.ConvertUtils;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.modules.bytedance.advertise.dockapi.MarketingService;
|
|
import org.jeecg.modules.bytedance.advertise.dockapi.MarketingService;
|
|
import org.jeecg.modules.bytedance.advertise.entity.AiBytedanceAdvertiserStrategy;
|
|
import org.jeecg.modules.bytedance.advertise.entity.AiBytedanceAdvertiserStrategy;
|
|
|
|
+import org.jeecg.modules.bytedance.advertise.entity.ByteDanceAdvertisePlan;
|
|
|
|
+import org.jeecg.modules.bytedance.advertise.service.IByteDanceAdvertisePlanService;
|
|
import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
|
|
import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
|
|
import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
|
|
import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
|
|
import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
|
|
import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
|
|
@@ -58,6 +61,8 @@ public class BytedanceReportController {
|
|
@Autowired
|
|
@Autowired
|
|
private ICtopOauthTokenService tokenService;
|
|
private ICtopOauthTokenService tokenService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -180,6 +185,11 @@ public class BytedanceReportController {
|
|
if (!resultUpd.isSuccess()){
|
|
if (!resultUpd.isSuccess()){
|
|
return Result.errorMsg(resultUpd.getMessage());
|
|
return Result.errorMsg(resultUpd.getMessage());
|
|
}
|
|
}
|
|
|
|
+ ByteDanceAdvertisePlan byteDanceAdvertisePlan = new ByteDanceAdvertisePlan();
|
|
|
|
+ byteDanceAdvertisePlan.setId(Long.valueOf(adId));
|
|
|
|
+ byteDanceAdvertisePlan.setAudiencePackageId(Integer.valueOf(audiencePackageId));
|
|
|
|
+ //更新 表 定向包id
|
|
|
|
+ byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
|
|
}
|
|
}
|
|
return Result.successMsg("更新计划定向包", null);
|
|
return Result.successMsg("更新计划定向包", null);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -189,8 +199,6 @@ public class BytedanceReportController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@ApiOperation(value="投放数据-更新计划状态", notes="投放数据-更新计划状态")
|
|
@ApiOperation(value="投放数据-更新计划状态", notes="投放数据-更新计划状态")
|
|
@GetMapping(value = "/updPlanStatus")
|
|
@GetMapping(value = "/updPlanStatus")
|
|
public Result updPlanStatus(@RequestParam("accountId") String accountId,
|
|
public Result updPlanStatus(@RequestParam("accountId") String accountId,
|
|
@@ -200,9 +208,19 @@ public class BytedanceReportController {
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
|
|
List<Long> list = new ArrayList<>();
|
|
List<Long> list = new ArrayList<>();
|
|
list.add(adId);
|
|
list.add(adId);
|
|
- return marketingService.updPlanStatus(token,list,optStatus);
|
|
|
|
|
|
+ //api 更新计划状态
|
|
|
|
+ Result result = marketingService.updPlanStatus(token,list,optStatus);
|
|
|
|
+ if (result.isSuccess()){
|
|
|
|
+ ByteDanceAdvertisePlan byteDanceAdvertisePlan = new ByteDanceAdvertisePlan();
|
|
|
|
+ byteDanceAdvertisePlan.setId(adId);
|
|
|
|
+ byteDanceAdvertisePlan.setOptStatus(optStatus.equalsIgnoreCase("enable") ? "AD_STATUS_ENABLE" : "AD_STATUS_DISABLE");
|
|
|
|
+ //更新 表 计划状态
|
|
|
|
+ byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
|
|
|
|
+ return Result.successMsg(result.getMessage(), null);
|
|
|
|
+ }
|
|
|
|
+ return Result.errorMsg(result.getMessage());
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("投放数据-获取花费和环比异常",e);
|
|
|
|
|
|
+ log.error("投放数据-更新计划状态异常",e);
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
return Result.error("请求失败,请联系开发人员!");
|
|
}
|
|
}
|
|
}
|
|
}
|