Explorar el Código

优化快手广告组拉取

huangpingkang hace 1 año
padre
commit
f2a99ffb3b

+ 1 - 1
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/controller/KuaiShouController.java

@@ -106,7 +106,7 @@ public class KuaiShouController {
                 public void run() {
                 public void run() {
                     Long advertiserId = jsonObject.getLong("advertiser_id");
                     Long advertiserId = jsonObject.getLong("advertiser_id");
                     String accessToken = jsonObject.getString("access_token");
                     String accessToken = jsonObject.getString("access_token");
-                    groupReportService.queryGroupList(accessToken, advertiserId, startDate, endDate, 1, 1, null, 2);
+                    groupReportService.queryGroupList(accessToken, advertiserId, null, null, 1, 1, null, 2);
                 }
                 }
             });
             });
         }
         }

+ 2 - 2
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaiShouGroupReportServiceImpl.java

@@ -188,7 +188,7 @@ public class KuaiShouGroupReportServiceImpl implements IKuaiShouGroupReportServi
         String result = HttpUtils.httpPostRequest(url, param, headers);
         String result = HttpUtils.httpPostRequest(url, param, headers);
         if (Check.isNull(result)) {
         if (Check.isNull(result)) {
             log.error("获取快手广告组异常,返回为空, accountId:{}", advertiserId);
             log.error("获取快手广告组异常,返回为空, accountId:{}", advertiserId);
-            errorLogService.addError(advertiserId, startDate, endDate, "group_list", "daily", "返回为空", 2);
+            errorLogService.addError(advertiserId, !Check.isNull(startDate) ? startDate : "-", !Check.isNull(endDate) ? endDate : "-", "group_list", "daily", "返回为空", 2);
             return;
             return;
         }
         }
         JSONObject resultJson = JSONObject.parseObject(result);
         JSONObject resultJson = JSONObject.parseObject(result);
@@ -196,7 +196,7 @@ public class KuaiShouGroupReportServiceImpl implements IKuaiShouGroupReportServi
         String message = resultJson.getString("message");
         String message = resultJson.getString("message");
         if (null == code || code != 0) {
         if (null == code || code != 0) {
             log.error("获取快手广告组异常:{},accountId:{}", message, advertiserId);
             log.error("获取快手广告组异常:{},accountId:{}", message, advertiserId);
-            errorLogService.addError(advertiserId, startDate, endDate, "group_list", "daily", message, 2);
+            errorLogService.addError(advertiserId, !Check.isNull(startDate) ? startDate : "-", !Check.isNull(endDate) ? endDate : "-", "group_list", "daily", message, 2);
             return;
             return;
         }
         }
         JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
         JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");

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

@@ -106,7 +106,7 @@ public class KuaiShouGroupReportJob {
         yesGroupexecutorService.submit(new Runnable() {
         yesGroupexecutorService.submit(new Runnable() {
             @Override
             @Override
             public void run() {
             public void run() {
-                groupReportService.queryGroupList(accessToken, advertiserId, yesDate, nowDate, 1, 1, null, 2);
+                groupReportService.queryGroupList(accessToken, advertiserId, null, null, 1, 1, null, 2);
             }
             }
         });
         });
     }
     }

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

@@ -119,7 +119,7 @@ public class KuaiShouRetryReportJob {
                         @Override
                         @Override
                         public void run() {
                         public void run() {
                             if (!Check.isNull(accessToken)) {
                             if (!Check.isNull(accessToken)) {
-                                groupReportService.queryGroupList(accessToken, advertiserId, startDate, endDate, 1, null, id, isSend);
+                                groupReportService.queryGroupList(accessToken, advertiserId, null, null, 1, null, id, isSend);
                             }
                             }
                         }
                         }
                     });
                     });