Browse Source

修改获取日期

zxa 3 years ago
parent
commit
08fab651bf

+ 3 - 3
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AdUnitReportJob.java

@@ -35,7 +35,7 @@ public class AdUnitReportJob {
 
     /**
      * 获取广告组信息
-     * 前
+     * 前1
      *
      * @throws Exception
      */
@@ -53,8 +53,8 @@ public class AdUnitReportJob {
         }
 
         String endTime = DateUtils.getNowDate("yyyy-MM-dd");
-        // 前2天 时间
-        String startTime = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.getNowDate("yyyy-MM-dd"), -2);
+        // 前1天 时间
+        String startTime = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.getNowDate("yyyy-MM-dd"), -1);
         dailyExecutorService.submit(
                 new Runnable() {
                     @Override

+ 9 - 9
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/UnitReportJob.java

@@ -12,7 +12,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -67,10 +66,11 @@ public class UnitReportJob {
     @XxlJob("unitAdSceneTypeDailyReport")
     public void unitAdSceneTypeDailyReport() throws Exception {
         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
         List<JSONObject> tokens = tokenService.getByProjectId(458L);    //淘特项目
         tokens.forEach(t -> adSceneDailyExecutorService.submit(() -> {
-            unitReportDailyService.getUnitAdSceneReportDaily(t.getLong("accountId"), t.getString("accessToken"), date, date, 1);
+            unitReportDailyService.getUnitAdSceneReportDaily(t.getLong("accountId"), t.getString("accessToken"), startDate, endDate, 1);
         }));
     }
 
@@ -81,12 +81,12 @@ public class UnitReportJob {
      */
     @XxlJob("unitPlacementTypeDailyReport")
     public void unitPlacementTypeDailyReport() throws Exception {
-      String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-      String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
-      List<JSONObject> tokens = tokenService.getByProjectId(458L);    //淘特项目
-      tokens.forEach(t -> placementTypeDailyExecutorService.submit(() -> {
-        unitReportDailyService.getUnitPlacementTypeReportDaily(t.getLong("accountId"), t.getString("accessToken"), date, date, 1);
-      }));
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        List<JSONObject> tokens = tokenService.getByProjectId(458L);    //淘特项目
+        tokens.forEach(t -> placementTypeDailyExecutorService.submit(() -> {
+            unitReportDailyService.getUnitPlacementTypeReportDaily(t.getLong("accountId"), t.getString("accessToken"), date, date, 1);
+        }));
     }
 
     /**