|
@@ -875,6 +875,26 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IKuaiShouUpdateService updateService;
|
|
private IKuaiShouUpdateService updateService;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void ProgramCreative(AiKuaishouAdvertiserStrategy strategy, Integer createType, Long videoCnt) {
|
|
|
|
|
+ Long programUnitCnt = strategy.getProgramUnitCnt();
|
|
|
|
|
+ if (Check.isNull(programUnitCnt)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ String date = DateUtils.formatDate(new Date());
|
|
|
|
|
+ //查询当前账户创建自定义类型组数量
|
|
|
|
|
+ Integer unitCreateCnt = queryUnitCnt(strategy.getAccountId() + date + "_old_program_cnt");
|
|
|
|
|
+ Long unitNum = 0L;
|
|
|
|
|
+ if (!Check.isNull(unitCreateCnt)) {
|
|
|
|
|
+ unitNum = programUnitCnt - unitCreateCnt;
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("{}截止目前创建程序化组总数:{}", strategy.getAccountId(), unitCreateCnt);
|
|
|
|
|
+ if (unitNum >= 1) {
|
|
|
|
|
+ this.autoCreateProgramCreative(strategy, createType, videoCnt);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void createProgramCreative(CtopOauthToken token, JSONObject creativeParams, AiKuaishouAdvertiserStrategy strategy) {
|
|
private void createProgramCreative(CtopOauthToken token, JSONObject creativeParams, AiKuaishouAdvertiserStrategy strategy) {
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("Content-Type", "application/json");
|
|
headers.put("Content-Type", "application/json");
|