|
@@ -68,6 +68,8 @@ public class AdPlanConfServiceImpl extends ServiceImpl<AdPlanConfMapper, AdPlanC
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TencentAccountService tencentAccountService;
|
|
private TencentAccountService tencentAccountService;
|
|
|
|
|
|
|
|
|
|
+ private static final Long MAIN_ORG_ACCOUNT_ID = 41644744L;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Long createAdPlanConf(AdPlanConf adPlanConf) {
|
|
public Long createAdPlanConf(AdPlanConf adPlanConf) {
|
|
@@ -200,7 +202,7 @@ public class AdPlanConfServiceImpl extends ServiceImpl<AdPlanConfMapper, AdPlanC
|
|
|
|
|
|
|
|
if (plan.getAdgroupId() > 0 || plan.getStatus() == AdPlanStatus.SUCCESS) {
|
|
if (plan.getAdgroupId() > 0 || plan.getStatus() == AdPlanStatus.SUCCESS) {
|
|
|
// 创建动态创意
|
|
// 创建动态创意
|
|
|
- createDynamicCreatives(plan, jobNumber, 33453856L);
|
|
|
|
|
|
|
+ createDynamicCreatives(plan, jobNumber, MAIN_ORG_ACCOUNT_ID);
|
|
|
plan.setFailReason("");
|
|
plan.setFailReason("");
|
|
|
plan.setStatus(AdPlanStatus.SUCCESS);
|
|
plan.setStatus(AdPlanStatus.SUCCESS);
|
|
|
plan.setSuccessTime(LocalDateTime.now());
|
|
plan.setSuccessTime(LocalDateTime.now());
|
|
@@ -216,21 +218,10 @@ public class AdPlanConfServiceImpl extends ServiceImpl<AdPlanConfMapper, AdPlanC
|
|
|
// 根据 adType 构建请求
|
|
// 根据 adType 构建请求
|
|
|
AdgroupsAddRequest request = buildAdgroupRequest(plan);
|
|
AdgroupsAddRequest request = buildAdgroupRequest(plan);
|
|
|
|
|
|
|
|
- // 获取授权账号的 orgAccountId
|
|
|
|
|
- // TencentAccount account = tencentAccountService.getOne(
|
|
|
|
|
- // new LambdaQueryWrapper<TencentAccount>()
|
|
|
|
|
- // .eq(TencentAccount::getAccountId, plan.getAccountId())
|
|
|
|
|
- // .eq(TencentAccount::getDeleted, 0)
|
|
|
|
|
- // );
|
|
|
|
|
-
|
|
|
|
|
- // if (account == null) {
|
|
|
|
|
- // throw new RuntimeException("未找到账户信息,accountId=" + plan.getAccountId());
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
// 创建广告组
|
|
// 创建广告组
|
|
|
- log.info("调用腾讯API创建广告组,accountId={}, orgAccountId={}", plan.getAccountId(), 33453856L);
|
|
|
|
|
|
|
+ log.info("调用腾讯API创建广告组,accountId={}, orgAccountId={}", plan.getAccountId(), MAIN_ORG_ACCOUNT_ID);
|
|
|
AdgroupsAddResponseData response = tencentAdsAdgroupService.createAdgroup(
|
|
AdgroupsAddResponseData response = tencentAdsAdgroupService.createAdgroup(
|
|
|
- jobNumber, 33453856L, request
|
|
|
|
|
|
|
+ jobNumber, MAIN_ORG_ACCOUNT_ID, request
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// 更新 adgroupId
|
|
// 更新 adgroupId
|
|
@@ -245,7 +236,7 @@ public class AdPlanConfServiceImpl extends ServiceImpl<AdPlanConfMapper, AdPlanC
|
|
|
|
|
|
|
|
// 创建动态创意
|
|
// 创建动态创意
|
|
|
if (plan.getAdgroupId() > 0) {
|
|
if (plan.getAdgroupId() > 0) {
|
|
|
- createDynamicCreatives(plan, jobNumber, 33453856L);
|
|
|
|
|
|
|
+ createDynamicCreatives(plan, jobNumber, MAIN_ORG_ACCOUNT_ID);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
log.info("广告计划处理成功,planId={}, adgroupId={}", plan.getId(), plan.getAdgroupId());
|
|
log.info("广告计划处理成功,planId={}, adgroupId={}", plan.getId(), plan.getAdgroupId());
|