|
@@ -17,7 +17,6 @@ import org.jeecg.common.util.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -129,7 +128,6 @@ public class KuaishouCampaignCopyDataServiceImpl extends ServiceImpl<KuaishouCam
|
|
|
for (KuaiShouGroup kuaiShouGroup : kuaiShouGroups) {
|
|
|
kuaiShouGroup.setTarget(kuaiShouGroupTargetService.queryTargetInfoByunitId(copyData.getAccountId(), kuaiShouGroup.getUnitId()));
|
|
|
//根据广告组ID查询快手广告创意并入库
|
|
|
- kuaiShouGroupService.getCreativeByUnit(accessToken, copyData.getAccountId(), kuaiShouGroup.getUnitId());
|
|
|
}
|
|
|
data.put("groups", kuaiShouGroups);
|
|
|
} catch (Exception e) {
|
|
@@ -160,7 +158,7 @@ public class KuaishouCampaignCopyDataServiceImpl extends ServiceImpl<KuaishouCam
|
|
|
unitJson.put("campaign_id", copyData.getLong("newCampaignId"));
|
|
|
// 资源位置
|
|
|
JSONArray scene_id = copyData.getJSONArray("sceneId");
|
|
|
- if (Check.isNull(scene_id) || scene_id.size() == 0) {
|
|
|
+ if (!Check.isNull(scene_id)) {
|
|
|
scene_id = group.getJSONArray("sceneId");
|
|
|
}
|
|
|
unitJson.put("scene_id", scene_id);
|
|
@@ -418,17 +416,8 @@ public class KuaishouCampaignCopyDataServiceImpl extends ServiceImpl<KuaishouCam
|
|
|
|
|
|
//快手广告组名
|
|
|
String unitName = group.getString("unitName");
|
|
|
- if (unitName.contains("CopyFrom")) {
|
|
|
- String format = "-".concat(DateUtils.yyyymmddhhmmss.get().format(new Date()));
|
|
|
- if (unitName.contains("(update)")) {
|
|
|
- int lastIndx = unitName.lastIndexOf("-");
|
|
|
- group.put("unit_name", unitName.substring(0, lastIndx).concat(format).concat("(update)"));
|
|
|
- } else {
|
|
|
- unitJson.put("unit_name", unitName.concat(format).concat("(update)"));
|
|
|
- }
|
|
|
- } else {
|
|
|
- unitJson.put("unit_name", "CopyFrom-".concat(unitName));
|
|
|
- }
|
|
|
+
|
|
|
+ unitJson.put("unit_name", unitName);
|
|
|
Map<String, Object> returnUnitMap = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitJson, 1);
|
|
|
if (!Check.isNullMap(returnUnitMap)) {
|
|
|
Integer code = (Integer) returnUnitMap.get("code");
|
|
@@ -438,6 +427,7 @@ public class KuaishouCampaignCopyDataServiceImpl extends ServiceImpl<KuaishouCam
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
+ kuaiShouGroupService.getCreativeByUnit(token.getAccessToken(), token.getAccountId(), group.getLong("unitId"));
|
|
|
batchService.copyCreative(token.getAccountId(), unitId, group.getLong("unitId"), null);
|
|
|
} catch (Exception e) {
|
|
|
log.error("复制创建广告创意异常", e);
|