소스 검색

获取全量广告组数据

yumeng 5 년 전
부모
커밋
4365a37296

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportLoadJob.java

@@ -39,13 +39,13 @@ public class KuaishouDailyReportLoadJob implements Job {
 
         tokens.forEach(token -> {
             //1: 获取广告主信息数据
-            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
+            kuaishouInterfaceService.getAdvertiserReportDaily(token, null, null);
             //2:获取广告计划信息数据
-            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
+            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, null, null);
             //3:获取广告组信息数据
-            kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
+            kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, null, null);
             //4: 获取广告创意信息数据
-            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate);
+   //         kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate);
 //            kuaishouInterfaceService.loadAdvertiserCreativeReportDailyStatistic(token, getDate);
         });
     }

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

@@ -263,8 +263,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
         Map<String, Object> param = new HashMap<>();
-        param.put("start_date", DateUtils.formatDate(startDate));
-        param.put("end_date", DateUtils.formatDate(endDate));
+        if (!Check.isNull(startDate)) {
+            param.put("start_date", DateUtils.formatDate(startDate));
+        }
+
+        if (!Check.isNull(endDate)) {
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
+
+
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "DAILY");
         param.put("page_size", 500);
@@ -350,8 +357,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
         Map<String, Object> param = new HashMap<>();
-        param.put("start_date", DateUtils.formatDate(startDate));
-        param.put("end_date", DateUtils.formatDate(endDate));
+
+        if (!Check.isNull(startDate)) {
+            param.put("start_date", DateUtils.formatDate(startDate));
+        }
+        if (Check.isNull(endDate)) {
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
+
+
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "DAILY");
         param.put("page_size", 500);
@@ -523,8 +537,14 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
         Map<String, Object> param = new HashMap<>();
-        param.put("start_date", DateUtils.formatDate(startDate));
-        param.put("end_date", DateUtils.formatDate(endDate));
+        if (!Check.isNull(startDate)) {
+            param.put("start_date", DateUtils.formatDate(startDate));
+        }
+
+        if (!Check.isNull(endDate)) {
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
+
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "DAILY");
         param.put("page_size", 500);