Sfoglia il codice sorgente

创意日报调整

yumeng 4 anni fa
parent
commit
31801dc73d

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java

@@ -61,7 +61,7 @@ public class KuaishouDailyCreativeReportLoadJob implements Job {
                                     @Override
                                     public void run() {
                                         try {
-                                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaignIds);
+                                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaignIds, null);
                                         } catch (Exception e) {
                                             log.info("获取创意日报失败,accountId:{}", token.getAccountId());
                                         }

+ 1 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyCreativeReportLoadJob.java

@@ -52,7 +52,7 @@ public class KuaishouDailyCreativeReportLoadJob {
             }
             List<JSONArray> campaigns = campaignService.getJsonArrByAccount(token.getAccountId(), 50);
             if (null != campaigns && !campaigns.isEmpty()) {
-                campaigns.forEach(campaign -> executorService.submit(() -> kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaign)));
+                campaigns.forEach(campaign -> executorService.submit(() -> kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaign, null)));
             }
         });
         return ReturnT.SUCCESS;

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java

@@ -340,7 +340,7 @@ public interface IKuaishouInterfaceService {
      * @param endDate
      * @param campaignIds
      */
-    void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds);
+    void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds, JSONArray creativeIds);
 
     /**
      * 获取广告主时报

+ 7 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -657,11 +657,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     @Override
-    public void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds) {
-        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, 1);
+    public void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds, JSONArray creativeIds) {
+        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, creativeIds, 1);
     }
 
-    private void getAdvertiserCreativeReportDailyByPage(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds, int page) {
+    private void getAdvertiserCreativeReportDailyByPage(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds, JSONArray creativeIds, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
         headers.put("Content-Type", "application/json");
@@ -677,7 +677,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             param.put("campaign_ids", campaignIds);
 
         }
+        if (!Check.isNull(creativeIds) && creativeIds.size() > 0) {
+            param.put("creative_ids", creativeIds);
 
+        }
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "DAILY");
         param.put("page_size", 1000);
@@ -714,7 +717,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             dailyCreativeStatisticService.saveOrUpdate(statistic);
             dailyCreativeService.saveOrUpdate(creative);
         }
-        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, page + 1);
+        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, creativeIds, page + 1);
     }
 
     private KuaishouReportDailyCreativeStatistic setDailyStatistic(KuaishouReportDailyCreative creative, CtopOauthToken token) {