|
@@ -6,8 +6,19 @@ import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
|
|
|
import cn.com.ctop.common.module.utils.PropertiesUtils;
|
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouDirectionalPackageService;
|
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouPopulationGroupService;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.*;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.mapper.*;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaignDayBudget;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaignStatus;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupBid;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupDayBudget;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignDayBudgetMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignStatusMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCreativeMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupBidMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupDayBudgetMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
@@ -617,16 +628,19 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
|
|
|
JSONObject request = new JSONObject();
|
|
|
request.put("accountId", unitJson.getLong("advertiser_id"));
|
|
|
request.put("unitId", data.getLong("unit_id"));
|
|
|
- request.put("excludePopulation", unitJson.getJSONObject("target").getJSONArray("exclude_population"));
|
|
|
- request.put("population", unitJson.getJSONObject("target").getJSONArray("population"));
|
|
|
- request.put("paidAudience", unitJson.getJSONObject("target").getJSONArray("paid_audience"));
|
|
|
- if (!Check.isNull(unitJson.getLong("templateId"))) {
|
|
|
- request.put("templateId", unitJson.getLong("templateId"));
|
|
|
+ JSONObject target = unitJson.getJSONObject("target");
|
|
|
+ if (!Check.isNull(target)) {
|
|
|
+ request.put("excludePopulation", target.getJSONArray("exclude_population"));
|
|
|
+ request.put("population", target.getJSONArray("population"));
|
|
|
+ request.put("paidAudience", target.getJSONArray("paid_audience"));
|
|
|
+ populationGroupService.createPopulationAndGroupRel(request);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(unitJson.getLong("template_id"))) {
|
|
|
+ request.put("templateId", unitJson.getLong("template_id"));
|
|
|
directionalPackageService.createUnitAndTemplate(request);
|
|
|
}
|
|
|
- populationGroupService.createPopulationAndGroupRel(request);
|
|
|
} catch (Exception e) {
|
|
|
- log.error("添加广告组和定向模板、人群包绑定关系异常," + e);
|
|
|
+ log.error("添加广告组和定向模板、人群包绑定关系异常,", e);
|
|
|
}
|
|
|
}
|
|
|
};
|