ソースを参照

头条数据拉取

yumeng 1 年間 前
親
コミット
a7db16223c

+ 21 - 27
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -4,7 +4,9 @@ import cn.com.ctop.job.bytedance.data.service.IBytedancePromoterReportService;
 import cn.com.ctop.job.bytedance.data.service.IBytedanceRefreshTokenService;
 import cn.com.ctop.job.bytedance.data.service.IChannelService;
 import cn.com.ctop.job.bytedance.data.utils.Check;
+import cn.com.ctop.job.bytedance.data.utils.DateUtils;
 import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.context.XxlJobHelper;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
 
@@ -39,34 +41,26 @@ public class BytedanceController {
 
     @GetMapping("/testRefreshToken")
     public void testRefreshToken() {
-        List<JSONObject> accountList = promoterReportService.getAccountList();
-        if (!Check.isNull(accountList)) {
-            for (int i = 0; i < accountList.size(); i++) {
-                JSONObject jsonObject = accountList.get(i);
-                Long id = jsonObject.getLong("id");
-                Long advertiserId = jsonObject.getLong("advertiserId");
-                String startDate = jsonObject.getString("startDate");
-                String endDate = jsonObject.getString("endDate");
-                String dataDimension = jsonObject.getString("dataDimension");
-                String dataType = jsonObject.getString("dataType");
-                String accessToken = jsonObject.getString("accessToken");
-
-                if ("promoter".equals(dataDimension)) {
-                    if (dataType.equals("hour")) { // 广告时报
-                        promoterReportService.getBytedancePromoterHourReport(id, advertiserId, accessToken, startDate, endDate, 1);
-                    }
-
-                    if (dataType.equals("daily")) { // 广告日报
-                        promoterReportService.getBytedancePromorteDailyReport(id, advertiserId, accessToken, startDate, endDate, 1);
-                    }
-                }
-
-
-            }
-
-        } else {
-            log.info("重试列表为空");
+
+
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+       List<JSONObject> dataList =  promoterReportService.getListBydate(20250312);
+        for (int i = 0; i < dataList.size(); i++) {
+            JSONObject jsonObject = dataList.get(i);
+            Long advertiserId = jsonObject.getLong("advertiserId");
+            String accessToken = jsonObject.getString("accessToken");
+            promoterReportService.getBytedancePromoterDaily(advertiserId, accessToken, yesDate, yesDate, 1, 1);
+            promoterReportService.getBytedancePromoterHour(advertiserId, accessToken, yesDate, yesDate, 1, 1);
+
+
         }
+
+
+
+
+
+
     }
 
 

+ 103 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/entity/BytedanceErrorLog.java

@@ -0,0 +1,103 @@
+package cn.com.ctop.job.bytedance.data.entity;
+
+
+/**
+ * 头条报错误日志对象 bytedance_error_log
+ *
+ * @author ruoyi
+ * @date 2025-03-07
+ */
+public class BytedanceErrorLog {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 广告主ID
+     */
+    private Long advertiserId;
+
+    /**
+     * 开始日期
+     */
+    private String startDate;
+
+    /**
+     * 结束日期
+     */
+    private String endDate;
+
+    /**
+     * 数据纬度 promoter广告纬度
+     */
+    private String dataDimension;
+
+    /**
+     * hour:时报 daily:日报
+     */
+    private String dataType;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setAdvertiserId(Long advertiserId) {
+        this.advertiserId = advertiserId;
+    }
+
+    public Long getAdvertiserId() {
+        return advertiserId;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setDataDimension(String dataDimension) {
+        this.dataDimension = dataDimension;
+    }
+
+    public String getDataDimension() {
+        return dataDimension;
+    }
+
+    public void setDataType(String dataType) {
+        this.dataType = dataType;
+    }
+
+    public String getDataType() {
+        return dataType;
+    }
+
+    @Override
+    public String
+    toString() {
+        return "BytedanceErrorLog{" +
+                "id=" + id +
+                ", advertiserId=" + advertiserId +
+                ", startDate='" + startDate + '\'' +
+                ", endDate='" + endDate + '\'' +
+                ", dataDimension='" + dataDimension + '\'' +
+                ", dataType='" + dataType + '\'' +
+                '}';
+    }
+}

+ 5 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/BytedancePromoterReportMapper.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.job.bytedance.data.mapper;
 
 
+import cn.com.ctop.job.bytedance.data.entity.BytedanceErrorLog;
 import cn.com.ctop.job.bytedance.data.entity.BytedancePromoterReportDaily;
 import cn.com.ctop.job.bytedance.data.entity.BytedancePromoterReportHour;
 import com.alibaba.fastjson.JSONObject;
@@ -18,4 +19,8 @@ public interface BytedancePromoterReportMapper {
     void replacePromoterReportDailies(@Param("list") List<BytedancePromoterReportDaily> promoterReportDailies);
 
     List<JSONObject> getChannelInfoList();
+
+    void replaceErrorInfo(BytedanceErrorLog errorInfo);
+
+    List<JSONObject> getListBydate(@Param("date") Integer date);
 }

+ 28 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/BytedancePromoterReportMapper.xml

@@ -18,6 +18,15 @@
                 secret_key         as 'secretKey'
         from deepthink.channel_account_info
     </select>
+    <select id="getListBydate" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.Integer">
+        SELECT t1.advertiser_id AS 'advertiserId', t3.access_token AS 'accessToken'
+        FROM (SELECT advertiser_id
+              FROM media_api.bytedance_promoter_report_hour
+              WHERE stat_time_day = date_format(CURDATE() - INTERVAL 1 DAY, '%Y%m%d')
+              GROUP BY advertiser_id) t1
+                 LEFT JOIN deepthink.bytedance_advertiser_list t2 ON t1.advertiser_id = t2.advertiser_id
+                 LEFT JOIN deepthink.bytedance_auth_list t3 ON t2.admin_advertiser_id = t3.admin_advertiser_id
+    </select>
 
     <insert id="replacePromoterReportHour">
         replace into bytedance_promoter_report_hour (
@@ -142,4 +151,23 @@
             )
         </foreach>
     </insert>
+    <insert id="replaceErrorInfo" parameterType="cn.com.ctop.job.bytedance.data.entity.BytedanceErrorLog">
+        replace into bytedance_error_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="advertiserId != null">advertiser_id,</if>
+            <if test="startDate != null">start_date,</if>
+            <if test="endDate != null">end_date,</if>
+            <if test="dataDimension != null">data_dimension,</if>
+            <if test="dataType != null">data_type,</if>
+
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="advertiserId != null">#{advertiserId},</if>
+            <if test="startDate != null">#{startDate},</if>
+            <if test="endDate != null">#{endDate},</if>
+            <if test="dataDimension != null">#{dataDimension},</if>
+            <if test="dataType != null">#{dataType},</if>
+
+        </trim>
+    </insert>
 </mapper>

+ 8 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/IBytedancePromoterReportService.java

@@ -8,9 +8,15 @@ import java.util.List;
 public interface IBytedancePromoterReportService {
     List<JSONObject> getAccountList();
 
-    void getBytedancePromoterHourReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page);
+    void getBytedanceRetryPromoterHourReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page);
 
-    void getBytedancePromorteDailyReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page);
+    void getBytedancePromoterRetryDailyReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page);
 
     List<JSONObject> getChannelInfoList();
+
+    void getBytedancePromoterHour(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog);
+
+    void getBytedancePromoterDaily(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog);
+
+    List<JSONObject> getListBydate(Integer date);
 }

+ 201 - 4
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedancePromoterReportServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.job.bytedance.data.service.impl;
 
+import cn.com.ctop.job.bytedance.data.entity.BytedanceErrorLog;
 import cn.com.ctop.job.bytedance.data.entity.BytedancePromoterReportDaily;
 import cn.com.ctop.job.bytedance.data.entity.BytedancePromoterReportHour;
 import cn.com.ctop.job.bytedance.data.mapper.BytedancePromoterReportMapper;
@@ -23,13 +24,14 @@ import java.util.Map;
 public class BytedancePromoterReportServiceImpl implements IBytedancePromoterReportService {
     @Autowired
     private BytedancePromoterReportMapper promoterReportMapper;
+
     @Override
     public List<JSONObject> getAccountList() {
         return promoterReportMapper.getAccountList();
     }
 
     @Override
-    public void getBytedancePromoterHourReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page) {
+    public void getBytedanceRetryPromoterHourReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page) {
         try {
             String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/get/";
             Map<String, Object> paramsMap = new HashMap<>();
@@ -95,7 +97,7 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
                 } catch (InterruptedException e) {
                     throw new RuntimeException(e);
                 }
-                getBytedancePromoterHourReport(errorId,advertiserId, accessToken, startDate, endDate, page + 1);
+                getBytedanceRetryPromoterHourReport(errorId, advertiserId, accessToken, startDate, endDate, page + 1);
             } else {
                 log.info("账户ID:{},日期:{},广告时报(最细粒度)数据请求成功", advertiserId, startDate);
                 promoterReportMapper.deleteInfoByErrorId(errorId);
@@ -107,7 +109,7 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
     }
 
     @Override
-    public void getBytedancePromorteDailyReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page) {
+    public void getBytedancePromoterRetryDailyReport(Long errorId, Long advertiserId, String accessToken, String startDate, String endDate, Integer page) {
         try {
             String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/get/";
             Map<String, Object> paramsMap = new HashMap<>();
@@ -172,7 +174,7 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
                 } catch (InterruptedException e) {
                     throw new RuntimeException(e);
                 }
-                getBytedancePromorteDailyReport(errorId,advertiserId, accessToken, startDate, endDate, page + 1);
+                getBytedancePromoterRetryDailyReport(errorId, advertiserId, accessToken, startDate, endDate, page + 1);
             } else {
                 log.info("账户ID:{},日期:{},广告日报(最细粒度)数据请求成功", advertiserId, startDate);
                 promoterReportMapper.deleteInfoByErrorId(errorId);
@@ -188,4 +190,199 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
     public List<JSONObject> getChannelInfoList() {
         return promoterReportMapper.getChannelInfoList();
     }
+
+    @Override
+    public void getBytedancePromoterHour(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog) {
+        try {
+            String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/get/";
+            Map<String, Object> paramsMap = new HashMap<>();
+            paramsMap.put("advertiser_id", advertiserId);
+            paramsMap.put("start_time", startDate);
+            paramsMap.put("end_time", endDate);
+            paramsMap.put("data_topic", "BASIC_DATA");
+            paramsMap.put("metrics", FieldsConfig.getpromoterMetrics());
+            paramsMap.put("dimensions", FieldsConfig.getpromoterHoutDimensions());
+            paramsMap.put("order_by", new JSONArray());
+            paramsMap.put("filters", new JSONArray());
+            paramsMap.put("page", page);
+            paramsMap.put("page_size", 100);
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Access-Token", accessToken);
+            headers.put("Content-Type", "application/json;charset=UTF-8");
+            String s = HttpUtils.httpGet(url, paramsMap, headers);
+            JSONObject result = JSONObject.parseObject(s);
+            if (Check.isNull(result)) {
+                log.info("账户id:{},日期:{},广告时报(最细粒度)请求结果返回为空", advertiserId, startDate);
+                if (isLog == 1) {
+                    BytedanceErrorLog errorInfo = new BytedanceErrorLog();
+                    errorInfo.setAdvertiserId(advertiserId);
+                    errorInfo.setStartDate(startDate);
+                    errorInfo.setEndDate(endDate);
+                    errorInfo.setDataDimension("promoter");
+                    errorInfo.setDataType("hour");
+                    promoterReportMapper.replaceErrorInfo(errorInfo);
+                }
+                return;
+            }
+            List<BytedancePromoterReportHour> hours = new ArrayList<>();
+            Integer code = result.getInteger("code");
+            if (code == 0) {
+                JSONObject data = result.getJSONObject("data");
+                if (!Check.isNull(data)) {
+                    JSONArray rows = data.getJSONArray("rows");
+                    if (!Check.isNull(rows)) {
+                        for (int i = 0; i < rows.size(); i++) {
+                            JSONObject rowJson = rows.getJSONObject(i);
+                            JSONObject metricsJson = rowJson.getJSONObject("metrics");
+                            JSONObject dimensionsJson = rowJson.getJSONObject("dimensions");
+                            Long cdpProjectId = dimensionsJson.getLong("cdp_project_id");
+                            String cdpProjectName = dimensionsJson.getString("cdp_project_name");
+                            Long cdpPromotionId = dimensionsJson.getLong("cdp_promotion_id");
+                            String cdpPromotionName = dimensionsJson.getString("cdp_promotion_name");
+                            Integer statTimeDay = Integer.valueOf(dimensionsJson.getString("stat_time_day").replace("-", ""));
+                            Integer hour = Integer.valueOf(dimensionsJson.getString("stat_time_hour").substring(11, 13));
+                            BytedancePromoterReportHour bytedancePromoterReportHour = JSONObject.parseObject(metricsJson.toJSONString(), BytedancePromoterReportHour.class);
+                            bytedancePromoterReportHour.setAdvertiserId(advertiserId);
+                            bytedancePromoterReportHour.setCdpProjectId(cdpProjectId);
+                            bytedancePromoterReportHour.setCdpProjectName(cdpProjectName);
+                            bytedancePromoterReportHour.setCdpPromotionId(cdpPromotionId);
+                            bytedancePromoterReportHour.setCdpPromotionName(cdpPromotionName);
+                            bytedancePromoterReportHour.setStatTimeDay(statTimeDay);
+                            bytedancePromoterReportHour.setHour(hour);
+                            hours.add(bytedancePromoterReportHour);
+                        }
+                    }
+                }
+            } else {
+                log.info("账户id:{},日期:{}广告时报(最细粒度)请求结果失败,返回数据:{}", advertiserId, startDate, result);
+                if (isLog == 1) {
+                    BytedanceErrorLog errorInfo = new BytedanceErrorLog();
+                    errorInfo.setAdvertiserId(advertiserId);
+                    errorInfo.setStartDate(startDate);
+                    errorInfo.setEndDate(endDate);
+                    errorInfo.setDataDimension("promoter");
+                    errorInfo.setDataType("hour");
+                    promoterReportMapper.replaceErrorInfo(errorInfo);
+                }
+                return;
+
+            }
+            if (!Check.isNull(hours)) {
+                promoterReportMapper.replacePromoterReportHour(hours);
+            }
+            if (hours.size() >= 100) {
+                try {
+                    Thread.sleep(500L);
+                } catch (InterruptedException e) {
+                    throw new RuntimeException(e);
+                }
+                getBytedancePromoterHour(advertiserId, accessToken, startDate, endDate, page + 1, 1);
+            } else {
+                log.info("账户ID:{},日期:{},广告时报(最细粒度)数据请求成功", advertiserId, startDate);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void getBytedancePromoterDaily(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Integer isLog) {
+        try {
+            String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/get/";
+            Map<String, Object> paramsMap = new HashMap<>();
+            paramsMap.put("advertiser_id", advertiserId);
+            paramsMap.put("start_time", startDate);
+            paramsMap.put("end_time", endDate);
+            paramsMap.put("data_topic", "BASIC_DATA");
+            paramsMap.put("metrics", FieldsConfig.getpromoterMetrics());
+            paramsMap.put("dimensions", FieldsConfig.getpromoterDailyDimensions());
+            paramsMap.put("order_by", new JSONArray());
+            paramsMap.put("filters", new JSONArray());
+            paramsMap.put("page", page);
+            paramsMap.put("page_size", 100);
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Access-Token", accessToken);
+            headers.put("Content-Type", "application/json");
+            String s = HttpUtils.httpGet(url, paramsMap, headers);
+            JSONObject result = JSONObject.parseObject(s);
+            if (Check.isNull(result)) {
+                log.info("账户id:{},广告日报(最细粒度)请求结果返回为空", advertiserId);
+                if (isLog == 1) {
+                    BytedanceErrorLog errorInfo = new BytedanceErrorLog();
+                    errorInfo.setAdvertiserId(advertiserId);
+                    errorInfo.setStartDate(startDate);
+                    errorInfo.setEndDate(endDate);
+                    errorInfo.setDataDimension("promoter");
+                    errorInfo.setDataType("daily");
+                    promoterReportMapper.replaceErrorInfo(errorInfo);
+                }
+                return;
+            }
+            List<BytedancePromoterReportDaily> promoterReportDailies = new ArrayList<>();
+            Integer code = result.getInteger("code");
+            if (code == 0) {
+                JSONObject data = result.getJSONObject("data");
+                if (!Check.isNull(data)) {
+                    JSONArray rows = data.getJSONArray("rows");
+                    if (!Check.isNull(rows)) {
+                        for (int i = 0; i < rows.size(); i++) {
+                            JSONObject rowJson = rows.getJSONObject(i);
+                            JSONObject metricsJson = rowJson.getJSONObject("metrics");
+                            JSONObject dimensionsJson = rowJson.getJSONObject("dimensions");
+                            Long cdpProjectId = dimensionsJson.getLong("cdp_project_id");
+                            String cdpProjectName = dimensionsJson.getString("cdp_project_name");
+                            Long cdpPromotionId = dimensionsJson.getLong("cdp_promotion_id");
+                            String cdpPromotionName = dimensionsJson.getString("cdp_promotion_name");
+                            Integer statTimeDay = Integer.valueOf(dimensionsJson.getString("stat_time_day").replace("-", ""));
+                            BytedancePromoterReportDaily promoterReportDaily = JSONObject.parseObject(metricsJson.toJSONString(), BytedancePromoterReportDaily.class);
+                            promoterReportDaily.setAdvertiserId(advertiserId);
+                            promoterReportDaily.setCdpProjectId(cdpProjectId);
+                            promoterReportDaily.setCdpProjectName(cdpProjectName);
+                            promoterReportDaily.setCdpPromotionId(cdpPromotionId);
+                            promoterReportDaily.setCdpPromotionName(cdpPromotionName);
+                            promoterReportDaily.setStatTimeDay(statTimeDay);
+                            promoterReportDailies.add(promoterReportDaily);
+                        }
+                    }
+                }
+            } else {
+                log.info("账户id:{},日期:{}广告日报(最细粒度)请求结果失败,返回数据:{}", advertiserId, startDate, result);
+                if (isLog == 1) {
+                    BytedanceErrorLog errorInfo = new BytedanceErrorLog();
+                    errorInfo.setAdvertiserId(advertiserId);
+                    errorInfo.setStartDate(startDate);
+                    errorInfo.setEndDate(endDate);
+                    errorInfo.setDataDimension("promoter");
+                    errorInfo.setDataType("daily");
+                    promoterReportMapper.replaceErrorInfo(errorInfo);
+                }
+                return;
+            }
+            if (!Check.isNull(promoterReportDailies)) {
+                promoterReportMapper.replacePromoterReportDailies(promoterReportDailies);
+                log.info("账户ID:{},广告日报(最细粒度)数据请求成功", advertiserId);
+            }
+            if (promoterReportDailies.size() >= 100) {
+                try {
+                    Thread.sleep(500L);
+                } catch (InterruptedException e) {
+                    throw new RuntimeException(e);
+                }
+                getBytedancePromoterDaily(advertiserId, accessToken, startDate, endDate, page + 1, 1);
+            } else {
+                log.info("账户ID:{},日期:{},广告日报(最细粒度)数据请求成功", advertiserId, startDate);
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        }
+
+
+    }
+
+    @Override
+    public List<JSONObject> getListBydate(Integer date) {
+        return promoterReportMapper.getListBydate(date);
+    }
 }

+ 61 - 8
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedancePromoterReportJob.java

@@ -4,7 +4,9 @@ package cn.com.ctop.job.bytedance.handler;
 import cn.com.ctop.job.bytedance.data.service.IBytedancePromoterReportService;
 import cn.com.ctop.job.bytedance.data.service.IChannelService;
 import cn.com.ctop.job.bytedance.data.utils.Check;
+import cn.com.ctop.job.bytedance.data.utils.DateUtils;
 import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,8 +29,12 @@ public class BytedancePromoterReportJob {
     private IBytedancePromoterReportService promoterReportService;
     @Autowired
     private IChannelService channelService;
+
     private static ExecutorService dailyExecutorService = Executors.newFixedThreadPool(2);
-    private static ExecutorService hourrExecutorService = Executors.newFixedThreadPool(2);
+    private static ExecutorService hourExecutorService = Executors.newFixedThreadPool(2);
+
+    private static ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(2);
+    private static ExecutorService hourRetrExecutorService = Executors.newFixedThreadPool(2);
 
     @XxlJob("promoterReport")
     public void promoterReport() throws Exception {
@@ -46,21 +52,21 @@ public class BytedancePromoterReportJob {
 
                 if ("promoter".equals(dataDimension)) {
                     if (dataType.equals("hour")) { // 广告时报
-                        hourrExecutorService.submit(new Runnable() {
+                        hourRetrExecutorService.submit(new Runnable() {
                             @Override
                             public void run() {
                                 if (!Check.isNull(accessToken)) {
-                                    promoterReportService.getBytedancePromoterHourReport(id, advertiserId, accessToken, startDate, endDate, 1);
+                                    promoterReportService.getBytedanceRetryPromoterHourReport(id, advertiserId, accessToken, startDate, endDate, 1);
                                 }
                             }
                         });
                     }
                     if (dataType.equals("daily")) { // 广告日报
-                        dailyExecutorService.submit(new Runnable() {
+                        dailyRetrExecutorService.submit(new Runnable() {
                             @Override
                             public void run() {
                                 if (!Check.isNull(accessToken)) {
-                                    promoterReportService.getBytedancePromorteDailyReport(id, advertiserId, accessToken, startDate, endDate, 1);
+                                    promoterReportService.getBytedancePromoterRetryDailyReport(id, advertiserId, accessToken, startDate, endDate, 1);
 
                                 }
                             }
@@ -77,20 +83,67 @@ public class BytedancePromoterReportJob {
 
     }
 
-
+    /**
+     * 番茄数据拉取
+     *
+     * @throws Exception
+     */
     @XxlJob("getPromoterList")
     public void getPromoterList() throws Exception {
-        List<JSONObject>  channelList = promoterReportService.getChannelInfoList();
+        List<JSONObject> channelList = promoterReportService.getChannelInfoList();
         for (int i = 0; i < channelList.size(); i++) {
             JSONObject jsonObject = channelList.get(i);
             String channelAccountId = jsonObject.getString("channelAccountId");
             String secretKey = jsonObject.getString("secretKey");
-            channelService.getPromotionIdList(channelAccountId,secretKey,0);
+            channelService.getPromotionIdList(channelAccountId, secretKey, 0);
+        }
+    }
+
+
+    @XxlJob("yesHourPromoterReport")
+    public void yesHourPromoterReport() throws Exception {
+        String param = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(param)) {
+            log.error("入参为空");
+            return;
         }
 
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String[] s = param.split("_");
+        Long advertiserId = Long.valueOf(s[0]);
+        String accessToken = s[1];
+
+        hourExecutorService
+                .submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        promoterReportService.getBytedancePromoterHour(advertiserId, accessToken, yesDate, yesDate, 1, 1);
+                    }
+                });
+    }
+
 
+    @XxlJob("yesReportPromoterReport")
+    public void yesReportPromoterReport() throws Exception {
+        String param = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(param)) {
+            log.error("入参为空");
+            return;
+        }
 
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String[] s = param.split("_");
+        Long advertiserId = Long.valueOf(s[0]);
+        String accessToken = s[1];
 
+        dailyExecutorService.submit(new Runnable() {
+            @Override
+            public void run() {
+                promoterReportService.getBytedancePromoterDaily(advertiserId, accessToken, yesDate, yesDate, 1, 1);
+            }
+        });
     }