|
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -79,7 +80,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
IAiBytedanceAutocreateLogService iBytedanceAutocreateLogService;
|
|
|
|
|
|
@Override
|
|
|
- public Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) {
|
|
|
+ public Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) throws ParseException {
|
|
|
UserAllocation userAllocation = userAllocationService.getByAccountId(strategy.getAccountId());
|
|
|
if(null == userAllocation||userAllocation.getAccountStatus()!=0){
|
|
|
log.info("此账户不存在或者已经被关闭=>accountId:{}", token.getAccountId());
|
|
@@ -90,14 +91,14 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
//查询相应的素材信息
|
|
|
Long timeStart = BytedanceCreativeMatTypeEnum.getStartTimeByType(createType.toString());
|
|
|
Long timeEnd = BytedanceCreativeMatTypeEnum.getEndTimeByType(createType.toString());
|
|
|
- Long now = System.currentTimeMillis();
|
|
|
String startTime = DateUtils.formatDate()+" 00:00:00";
|
|
|
String endTime = DateUtils.formatDate()+" 23:59:59";
|
|
|
+ Long endTimestamp = DateUtils.parseDate(endTime,"yyyy-MM-dd hh:mm:ss").getTime();
|
|
|
if(timeStart != 0){
|
|
|
- startTime = DateUtils.formatDateTime(now + timeStart * 60 * 1000L);
|
|
|
+ startTime = DateUtils.formatDateTime(endTimestamp + timeStart * 60 * 1000L);
|
|
|
}
|
|
|
if(timeEnd != 0){
|
|
|
- endTime = DateUtils.formatDateTime(now + timeEnd * 60 * 1000L);
|
|
|
+ endTime = DateUtils.formatDateTime(endTimestamp + timeEnd * 60 * 1000L);
|
|
|
}
|
|
|
List<ByteDanceVideoInfo> videoInfos = getvideoOrImageInfoByCreateType(userAllocation.getProjectId(),strategy,startTime,endTime,createType,videoCnt);
|
|
|
if(null == videoInfos||videoInfos.isEmpty()){
|