Преглед изворни кода

获取罗盘绑定广告主

zhaoxian пре 9 месеци
родитељ
комит
ff52e45ef4
16 измењених фајлова са 1242 додато и 93 уклоњено
  1. 15 15
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/controller/KuaishouController.java
  2. 25 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/CompassBindAdvertisers.java
  3. 20 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/CompassBindAdvertisersMapper.java
  4. 0 3
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouAccountReportDailyMapper.java
  5. 2 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/OauthTokenMapper.java
  6. 574 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/CompassBindAdvertisersMapper.xml
  7. 0 16
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouAccountReportDailyMapper.xml
  8. 18 21
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/OauthTokenMapper.xml
  9. 14 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/CompassBindAdvertisersService.java
  10. 0 1
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IKuaishouAccountReportDailyService.java
  11. 2 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IOauthTokenService.java
  12. 414 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/CompassBindAdvertisersServiceImpl.java
  13. 0 22
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaishouAccountReportDailyServiceImpl.java
  14. 5 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/OauthTokenServiceImpl.java
  15. 0 15
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AccountReportlJob.java
  16. 153 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CompassBindAdvertisersJob.java

+ 15 - 15
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/controller/KuaishouController.java

@@ -1,6 +1,8 @@
 package cn.com.ctop.job.kuaishou.controller;
 
+import cn.com.ctop.job.kuaishou.data.entity.CompassBindAdvertisers;
 import cn.com.ctop.job.kuaishou.data.mapper.KuaishouAccountReportHourlyMapper;
+import cn.com.ctop.job.kuaishou.data.service.CompassBindAdvertisersService;
 import cn.com.ctop.job.kuaishou.data.service.IAccountWarningService;
 import cn.com.ctop.job.kuaishou.data.service.IAdUnitReportService;
 import cn.com.ctop.job.kuaishou.data.service.IKuaishouAccountReportDailyService;
@@ -255,18 +257,18 @@ public class KuaishouController {
         List<Long> accountIds = tokenService.getAllAccountIds();
 
 //        for (String date : dates) {
-            for (Long accountId : accountIds) {
-                String token = tokenService.getByAccountId(accountId);
-                hourlyExecutorService.submit(
-                        new Runnable() {
-                            @SneakyThrows
-                            @Override
-                            public void run() {
-                                Thread.sleep(500);
-                                kuaishouAccountReportHourlyService
-                                        .getAdvertiserReportHour(accountId, token, "2024-07-11", "2024-07-11", 1);
-                            }
-                        });
+        for (Long accountId : accountIds) {
+            String token = tokenService.getByAccountId(accountId);
+            hourlyExecutorService.submit(
+                    new Runnable() {
+                        @SneakyThrows
+                        @Override
+                        public void run() {
+                            Thread.sleep(500);
+                            kuaishouAccountReportHourlyService
+                                    .getAdvertiserReportHour(accountId, token, "2024-07-11", "2024-07-11", 1);
+                        }
+                    });
 //            }
         }
     }
@@ -298,7 +300,7 @@ public class KuaishouController {
     }
 
     @Autowired
-    private IAccountWarningService accountWarningService;
+    private CompassBindAdvertisersService compassBindAdvertisersService;
 
     @GetMapping(value = "testD")
     public void testD(Long accountId) throws Exception {
@@ -310,6 +312,4 @@ public class KuaishouController {
     }
 
 
-
-
 }

+ 25 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/CompassBindAdvertisers.java

@@ -0,0 +1,25 @@
+package cn.com.ctop.job.kuaishou.data.entity;
+
+import lombok.Data;
+
+/**
+ * 罗盘绑定广告主
+ * compass_bind_advertisers
+ */
+@Data
+public class CompassBindAdvertisers {
+
+    /**
+     * 广告主ID
+     */
+    private Long advertiserId;
+
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String corporationName;
+}

+ 20 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/CompassBindAdvertisersMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.job.kuaishou.data.mapper;
+
+import cn.com.ctop.job.kuaishou.data.entity.CompassBindAdvertisers;
+import cn.com.ctop.job.kuaishou.data.entity.KuaishouCampaignReportDaily;
+import cn.com.ctop.job.kuaishou.data.entity.KuaishouUnitReportDaily;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface CompassBindAdvertisersMapper extends BaseMapper<CompassBindAdvertisers> {
+
+    void replaceBatchAdvertisers(@Param("details") JSONArray lists);
+
+    void replaceBatchCampaignReportDaily(@Param("addList") List<KuaishouCampaignReportDaily> addList);
+
+    void replaceBatchUnitReportDaily(@Param("addList") List<KuaishouUnitReportDaily> addList);
+
+}

+ 0 - 3
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouAccountReportDailyMapper.java

@@ -4,8 +4,6 @@ import cn.com.ctop.job.kuaishou.data.entity.KuaishouAccountReportDaily;
 import cn.com.ctop.job.kuaishou.data.entity.KuaishouEffectNativeChartreportConversionChart;
 import cn.com.ctop.job.kuaishou.data.entity.KuaishouEffectNativeChartreportFunnel;
 import cn.com.ctop.job.kuaishou.data.entity.KuaishouEffectNativeChartreportSummary;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -27,5 +25,4 @@ public interface KuaishouAccountReportDailyMapper extends BaseMapper<KuaishouAcc
 
     void replaceBatchConversionChart(@Param("chatList") List<KuaishouEffectNativeChartreportConversionChart> chatList);
 
-    void replaceBatchAdvertisers(@Param("details") JSONArray lists);
 }

+ 2 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/OauthTokenMapper.java

@@ -28,4 +28,6 @@ public interface OauthTokenMapper extends BaseMapper<OauthToken> {
     List<JSONObject> getAgentTokens();
 
     String getOuthTokenAccountId(@Param("accountId") Long accountId);
+
+    String getAgentTokenByAgentId(@Param("agentId") Long agentId);
 }

+ 574 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/CompassBindAdvertisersMapper.xml

@@ -0,0 +1,574 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.data.mapper.CompassBindAdvertisersMapper">
+
+    <insert id="replaceBatchAdvertisers">
+        replace into `media_api`.compass_bind_advertisers(
+        advertiser_id,
+        advertiser_name,
+        corporation_name
+        )
+        values
+        <foreach collection="details" item="data" separator=",">
+            (
+            #{data.advertiser_id},
+            #{data.advertiser_name},
+            #{data.corporation_name}
+            )
+        </foreach>
+    </insert>
+
+
+    <insert id="replaceBatchCampaignReportDaily">
+        replace into `media_api`.compass_bind_kuaishou_campaign_report_daily(
+        `advertiser_id`,
+        `stat_date`,
+        `campaign_id`,
+        `campaign_name`,
+        `charge`,
+        `show`,
+        `photo_click`,
+        `aclick`,
+        `bclick`,
+        `photo_click_ratio`,
+        `play_3s_ratio`,
+        `action_ratio`,
+        `impression_1k_cost`,
+        `photo_click_cost`,
+        `action_cost`,
+        `share`,
+        `comment`,
+        `like`,
+        `follow`,
+        `cancel_follow`,
+        `report`,
+        `block`,
+        `negative`,
+        `submit`,
+        `download_started`,
+        `download_completed`,
+        `activation`,
+        `event_pay_first_day`,
+        `event_pay_purchase_amount_first_day`,
+        `event_pay_first_day_roi`,
+        `event_pay`,
+        `event_pay_purchase_amount`,
+        `event_pay_roi`,
+        `event_register`,
+        `event_register_cost`,
+        `event_register_ratio`,
+        `event_jin_jian_app`,
+        `event_jin_jian_app_cost`,
+        `event_credit_grant_app`,
+        `event_credit_grant_app_cost`,
+        `event_credit_grant_app_ratio`,
+        `event_order_paid`,
+        `event_order_paid_purchase_amount`,
+        `event_order_paid_cost`,
+        `event_next_day_stay`,
+        `event_next_day_stay_cost`,
+        `event_next_day_stay_ratio`,
+        `form_count`,
+        `form_cost`,
+        `form_action_ratio`,
+        `event_jin_jian_landing_page`,
+        `event_jin_jian_landing_page_cost`,
+        `event_credit_grant_landing_page`,
+        `event_credit_grant_landing_page_cost`,
+        `event_credit_grant_landing_page_ratio`,
+        `event_valid_clues`,
+        `event_valid_clues_cost`,
+        `event_add_wechat`,
+        `event_add_wechat_cost`,
+        `event_add_wechat_ratio`,
+        `event_get_through`,
+        `event_get_through_cost`,
+        `event_get_through_ratio`,
+        `event_app_invoked`,
+        `event_app_invoked_cost`,
+        `event_app_invoked_ratio`,
+        `event_credit_grant_landing_ratio`,
+        `play_5s_ratio`,
+        `play_end_ratio`,
+        `event_new_user_pay`,
+        `event_new_user_pay_cost`,
+        `event_new_user_pay_ratio`,
+        `click_1k_cost`,
+        `ad_product_cnt`,
+        `event_goods_view`,
+        `merchant_reco_fans`,
+        `event_order_amount_roi`,
+        `event_goods_view_cost`,
+        `merchant_reco_fans_cost`,
+        `event_button_click`,
+        `event_button_click_cost`,
+        `event_button_click_ratio`,
+        `event_order_paid_roi`,
+        `event_new_user_jinjian_app`,
+        `event_new_user_jinjian_app_cost`,
+        `event_new_user_jinjian_app_roi`,
+        `event_new_user_credit_grant_app`,
+        `event_new_user_credit_grant_app_cost`,
+        `event_new_user_credit_grant_app_roi`,
+        `event_new_user_jinjian_page`,
+        `event_new_user_jinjian_page_cost`,
+        `event_new_user_jinjian_page_roi`,
+        `event_new_user_credit_grant_page`,
+        `event_new_user_credit_grant_page_cost`,
+        `event_new_user_credit_grant_page_roi`,
+        `event_appoint_form`,
+        `event_appoint_form_cost`,
+        `event_appoint_form_ratio`,
+        `event_appoint_jump_click`,
+        `event_appoint_jump_click_cost`,
+        `event_appoint_jump_click_ratio`,
+        `union_event_pay_purchase_amount_7d`,
+        `union_event_pay_purchase_amount_7d_roi`,
+        `placement_type`,
+        `ad_scene`,
+        `event_order_successed`,
+        `ad_photo_played_10s_ratio`,
+        `key_action_cost`,
+        `event_add_shopping_cart_cost`,
+        `event_ad_watch_times_ratio`,
+        `event_outbound_call_cost`,
+        `event_outbound_call`,
+        `action_new_ratio`,
+        `event_watch_app_ad`,
+        `event_multi_conversion_cost`,
+        `event_phone_card_activate`,
+        `ad_photo_played_75percent_ratio`,
+        `key_action_ratio`,
+        `event_ad_watch_times_cost`,
+        `event_add_shopping_cart`,
+        `key_action`,
+        `event_multi_conversion`,
+        `event_wechat_connected`,
+        `event_dsp_gift_form`,
+        `event_intention_confirmed`,
+        `event_phone_get_through`,
+        `event_multi_conversion_ratio`,
+        `event_measurement_house`,
+        `ad_photo_played_2s_ratio`,
+        `event_outbound_call_ratio`,
+        `event_ad_watch_times`
+        )
+        values
+        <foreach collection="addList" item="add" separator=",">
+            (
+            #{add.advertiserId},
+            #{add.statDate},
+            #{add.campaignId},
+            #{add.campaignName},
+            #{add.charge},
+            #{add.show},
+            #{add.photoClick},
+            #{add.aclick},
+            #{add.bclick},
+            #{add.photoClickRatio},
+            #{add.play3sRatio},
+            #{add.actionRatio},
+            #{add.impression1kCost},
+            #{add.photoClickCost},
+            #{add.actionCost},
+            #{add.share},
+            #{add.comment},
+            #{add.like},
+            #{add.follow},
+            #{add.cancelFollow},
+            #{add.report},
+            #{add.block},
+            #{add.negative},
+            #{add.submit},
+            #{add.downloadStarted},
+            #{add.downloadCompleted},
+            #{add.activation},
+            #{add.eventPayFirstDay},
+            #{add.eventPayPurchaseAmountFirstDay},
+            #{add.eventPayFirstDayRoi},
+            #{add.eventPay},
+            #{add.eventPayPurchaseAmount},
+            #{add.eventPayRoi},
+            #{add.eventRegister},
+            #{add.eventRegisterCost},
+            #{add.eventRegisterRatio},
+            #{add.eventJinJianApp},
+            #{add.eventJinJianAppCost},
+            #{add.eventCreditGrantApp},
+            #{add.eventCreditGrantAppCost},
+            #{add.eventCreditGrantAppRatio},
+            #{add.eventOrderPaid},
+            #{add.eventOrderPaidPurchaseAmount},
+            #{add.eventOrderPaidCost},
+            #{add.eventNextDayStay},
+            #{add.eventNextDayStayCost},
+            #{add.eventNextDayStayRatio},
+            #{add.formCount},
+            #{add.formCost},
+            #{add.formActionRatio},
+            #{add.eventJinJianLandingPage},
+            #{add.eventJinJianLandingPageCost},
+            #{add.eventCreditGrantLandingPage},
+            #{add.eventCreditGrantLandingPageCost},
+            #{add.eventCreditGrantLandingPageRatio},
+            #{add.eventValidClues},
+            #{add.eventValidCluesCost},
+            #{add.eventAddWechat},
+            #{add.eventAddWechatCost},
+            #{add.eventAddWechatRatio},
+            #{add.eventGetThrough},
+            #{add.eventGetThroughCost},
+            #{add.eventGetThroughRatio},
+            #{add.eventAppInvoked},
+            #{add.eventAppInvokedCost},
+            #{add.eventAppInvokedRatio},
+            #{add.eventCreditGrantLandingRatio},
+            #{add.play5sRatio},
+            #{add.playEndRatio},
+            #{add.eventNewUserPay},
+            #{add.eventNewUserPayCost},
+            #{add.eventNewUserPayRatio},
+            #{add.click1kCost},
+            #{add.adProductCnt},
+            #{add.eventGoodsView},
+            #{add.merchantRecoFans},
+            #{add.eventOrderAmountRoi},
+            #{add.eventGoodsViewCost},
+            #{add.merchantRecoFansCost},
+            #{add.eventButtonClick},
+            #{add.eventButtonClickCost},
+            #{add.eventButtonClickRatio},
+            #{add.eventOrderPaidRoi},
+            #{add.eventNewUserJinjianApp},
+            #{add.eventNewUserJinjianAppCost},
+            #{add.eventNewUserJinjianAppRoi},
+            #{add.eventNewUserCreditGrantApp},
+            #{add.eventNewUserCreditGrantAppCost},
+            #{add.eventNewUserCreditGrantAppRoi},
+            #{add.eventNewUserJinjianPage},
+            #{add.eventNewUserJinjianPageCost},
+            #{add.eventNewUserJinjianPageRoi},
+            #{add.eventNewUserCreditGrantPage},
+            #{add.eventNewUserCreditGrantPageCost},
+            #{add.eventNewUserCreditGrantPageRoi},
+            #{add.eventAppointForm},
+            #{add.eventAppointFormCost},
+            #{add.eventAppointFormRatio},
+            #{add.eventAppointJumpClick},
+            #{add.eventAppointJumpClickCost},
+            #{add.eventAppointJumpClickRatio},
+            #{add.unionEventPayPurchaseAmount7d},
+            #{add.unionEventPayPurchaseAmount7dRoi},
+            #{add.placementType},
+            #{add.adScene},
+            #{add.eventOrderSuccessed},
+            #{add.adPhotoPlayed10sRatio},
+            #{add.keyActionCost},
+            #{add.eventAddShoppingCartCost},
+            #{add.eventAdWatchTimesRatio},
+            #{add.eventOutboundCallCost},
+            #{add.eventOutboundCall},
+            #{add.actionNewRatio},
+            #{add.eventWatchAppAd},
+            #{add.eventMultiConversionCost},
+            #{add.eventPhoneCardActivate},
+            #{add.adPhotoPlayed75percentRatio},
+            #{add.keyActionRatio},
+            #{add.eventAdWatchTimesCost},
+            #{add.eventAddShoppingCart},
+            #{add.keyAction},
+            #{add.eventMultiConversion},
+            #{add.eventWechatConnected},
+            #{add.eventDspGiftForm},
+            #{add.eventIntentionConfirmed},
+            #{add.eventPhoneGetThrough},
+            #{add.eventMultiConversionRatio},
+            #{add.eventMeasurementHouse},
+            #{add.adPhotoPlayed2sRatio},
+            #{add.eventOutboundCallRatio},
+            #{add.eventAdWatchTimes}
+            )
+        </foreach>
+    </insert>
+
+
+    <insert id="replaceBatchUnitReportDaily">
+        replace into compass_bind_kuaishou_unit_report_daily(
+        `advertiser_id`,
+        `stat_date`,
+        `campaign_id`,
+        `campaign_name`,
+        `unit_id`,
+        `unit_name`,
+        `charge`,
+        `show`,
+        `photo_click`,
+        `aclick`,
+        `bclick`,
+        `photo_click_ratio`,
+        `play_3s_ratio`,
+        `action_ratio`,
+        `impression_1k_cost`,
+        `photo_click_cost`,
+        `action_cost`,
+        `share`,
+        `comment`,
+        `like`,
+        `follow`,
+        `cancel_follow`,
+        `report`,
+        `block`,
+        `negative`,
+        `submit`,
+        `download_started`,
+        `download_completed`,
+        `activation`,
+        `event_pay_first_day`,
+        `event_pay_purchase_amount_first_day`,
+        `event_pay_first_day_roi`,
+        `event_pay`,
+        `event_pay_purchase_amount`,
+        `event_pay_roi`,
+        `event_register`,
+        `event_register_cost`,
+        `event_register_ratio`,
+        `event_jin_jian_app`,
+        `event_jin_jian_app_cost`,
+        `event_credit_grant_app`,
+        `event_credit_grant_app_cost`,
+        `event_credit_grant_app_ratio`,
+        `event_order_paid`,
+        `event_order_paid_purchase_amount`,
+        `event_order_paid_cost`,
+        `event_next_day_stay`,
+        `event_next_day_stay_cost`,
+        `event_next_day_stay_ratio`,
+        `form_count`,
+        `form_cost`,
+        `form_action_ratio`,
+        `event_jin_jian_landing_page`,
+        `event_jin_jian_landing_page_cost`,
+        `event_credit_grant_landing_page`,
+        `event_credit_grant_landing_page_cost`,
+        `event_credit_grant_landing_page_ratio`,
+        `event_valid_clues`,
+        `event_valid_clues_cost`,
+        `event_add_wechat`,
+        `event_add_wechat_cost`,
+        `event_add_wechat_ratio`,
+        `event_get_through`,
+        `event_get_through_cost`,
+        `event_get_through_ratio`,
+        `event_app_invoked`,
+        `event_app_invoked_cost`,
+        `event_app_invoked_ratio`,
+        `event_credit_grant_landing_ratio`,
+        `play_5s_ratio`,
+        `play_end_ratio`,
+        `event_new_user_pay`,
+        `event_new_user_pay_cost`,
+        `event_new_user_pay_ratio`,
+        `click_1k_cost`,
+        `ad_product_cnt`,
+        `event_goods_view`,
+        `merchant_reco_fans`,
+        `event_order_amount_roi`,
+        `event_goods_view_cost`,
+        `merchant_reco_fans_cost`,
+        `event_button_click`,
+        `event_button_click_cost`,
+        `event_button_click_ratio`,
+        `event_order_paid_roi`,
+        `event_new_user_jinjian_app`,
+        `event_new_user_jinjian_app_cost`,
+        `event_new_user_jinjian_app_roi`,
+        `event_new_user_credit_grant_app`,
+        `event_new_user_credit_grant_app_cost`,
+        `event_new_user_credit_grant_app_roi`,
+        `event_new_user_jinjian_page`,
+        `event_new_user_jinjian_page_cost`,
+        `event_new_user_jinjian_page_roi`,
+        `event_new_user_credit_grant_page`,
+        `event_new_user_credit_grant_page_cost`,
+        `event_new_user_credit_grant_page_roi`,
+        `event_appoint_form`,
+        `event_appoint_form_cost`,
+        `event_appoint_form_ratio`,
+        `event_appoint_jump_click`,
+        `event_appoint_jump_click_cost`,
+        `event_appoint_jump_click_ratio`,
+        `union_event_pay_purchase_amount_7d`,
+        `union_event_pay_purchase_amount_7d_roi`,
+        `placement_type`,
+        `ad_scene`,
+        `event_order_successed`,
+        `ad_photo_played_10s_ratio`,
+        `key_action_cost`,
+        `event_add_shopping_cart_cost`,
+        `event_ad_watch_times_ratio`,
+        `event_outbound_call_cost`,
+        `event_outbound_call`,
+        `action_new_ratio`,
+        `event_watch_app_ad`,
+        `event_multi_conversion_cost`,
+        `event_phone_card_activate`,
+        `ad_photo_played_75percent_ratio`,
+        `key_action_ratio`,
+        `event_ad_watch_times_cost`,
+        `event_add_shopping_cart`,
+        `key_action`,
+        `event_multi_conversion`,
+        `event_wechat_connected`,
+        `event_dsp_gift_form`,
+        `event_intention_confirmed`,
+        `event_phone_get_through`,
+        `event_multi_conversion_ratio`,
+        `event_measurement_house`,
+        `ad_photo_played_2s_ratio`,
+        `event_outbound_call_ratio`,
+        `event_ad_watch_times`,
+        `event_order_submit`,
+        `live_event_goods_view`
+        )
+        values
+        <foreach collection="addList" item="add" separator=",">
+            (
+            #{add.advertiserId},
+            #{add.statDate},
+            #{add.campaignId},
+            #{add.campaignName},
+            #{add.unitId},
+            #{add.unitName},
+            #{add.charge},
+            #{add.show},
+            #{add.photoClick},
+            #{add.aclick},
+            #{add.bclick},
+            #{add.photoClickRatio},
+            #{add.play3sRatio},
+            #{add.actionRatio},
+            #{add.impression1kCost},
+            #{add.photoClickCost},
+            #{add.actionCost},
+            #{add.share},
+            #{add.comment},
+            #{add.like},
+            #{add.follow},
+            #{add.cancelFollow},
+            #{add.report},
+            #{add.block},
+            #{add.negative},
+            #{add.submit},
+            #{add.downloadStarted},
+            #{add.downloadCompleted},
+            #{add.activation},
+            #{add.eventPayFirstDay},
+            #{add.eventPayPurchaseAmountFirstDay},
+            #{add.eventPayFirstDayRoi},
+            #{add.eventPay},
+            #{add.eventPayPurchaseAmount},
+            #{add.eventPayRoi},
+            #{add.eventRegister},
+            #{add.eventRegisterCost},
+            #{add.eventRegisterRatio},
+            #{add.eventJinJianApp},
+            #{add.eventJinJianAppCost},
+            #{add.eventCreditGrantApp},
+            #{add.eventCreditGrantAppCost},
+            #{add.eventCreditGrantAppRatio},
+            #{add.eventOrderPaid},
+            #{add.eventOrderPaidPurchaseAmount},
+            #{add.eventOrderPaidCost},
+            #{add.eventNextDayStay},
+            #{add.eventNextDayStayCost},
+            #{add.eventNextDayStayRatio},
+            #{add.formCount},
+            #{add.formCost},
+            #{add.formActionRatio},
+            #{add.eventJinJianLandingPage},
+            #{add.eventJinJianLandingPageCost},
+            #{add.eventCreditGrantLandingPage},
+            #{add.eventCreditGrantLandingPageCost},
+            #{add.eventCreditGrantLandingPageRatio},
+            #{add.eventValidClues},
+            #{add.eventValidCluesCost},
+            #{add.eventAddWechat},
+            #{add.eventAddWechatCost},
+            #{add.eventAddWechatRatio},
+            #{add.eventGetThrough},
+            #{add.eventGetThroughCost},
+            #{add.eventGetThroughRatio},
+            #{add.eventAppInvoked},
+            #{add.eventAppInvokedCost},
+            #{add.eventAppInvokedRatio},
+            #{add.eventCreditGrantLandingRatio},
+            #{add.play5sRatio},
+            #{add.playEndRatio},
+            #{add.eventNewUserPay},
+            #{add.eventNewUserPayCost},
+            #{add.eventNewUserPayRatio},
+            #{add.click1kCost},
+            #{add.adProductCnt},
+            #{add.eventGoodsView},
+            #{add.merchantRecoFans},
+            #{add.eventOrderAmountRoi},
+            #{add.eventGoodsViewCost},
+            #{add.merchantRecoFansCost},
+            #{add.eventButtonClick},
+            #{add.eventButtonClickCost},
+            #{add.eventButtonClickRatio},
+            #{add.eventOrderPaidRoi},
+            #{add.eventNewUserJinjianApp},
+            #{add.eventNewUserJinjianAppCost},
+            #{add.eventNewUserJinjianAppRoi},
+            #{add.eventNewUserCreditGrantApp},
+            #{add.eventNewUserCreditGrantAppCost},
+            #{add.eventNewUserCreditGrantAppRoi},
+            #{add.eventNewUserJinjianPage},
+            #{add.eventNewUserJinjianPageCost},
+            #{add.eventNewUserJinjianPageRoi},
+            #{add.eventNewUserCreditGrantPage},
+            #{add.eventNewUserCreditGrantPageCost},
+            #{add.eventNewUserCreditGrantPageRoi},
+            #{add.eventAppointForm},
+            #{add.eventAppointFormCost},
+            #{add.eventAppointFormRatio},
+            #{add.eventAppointJumpClick},
+            #{add.eventAppointJumpClickCost},
+            #{add.eventAppointJumpClickRatio},
+            #{add.unionEventPayPurchaseAmount7d},
+            #{add.unionEventPayPurchaseAmount7dRoi},
+            #{add.placementType},
+            #{add.adScene},
+            #{add.eventOrderSuccessed},
+            #{add.adPhotoPlayed10sRatio},
+            #{add.keyActionCost},
+            #{add.eventAddShoppingCartCost},
+            #{add.eventAdWatchTimesRatio},
+            #{add.eventOutboundCallCost},
+            #{add.eventOutboundCall},
+            #{add.actionNewRatio},
+            #{add.eventWatchAppAd},
+            #{add.eventMultiConversionCost},
+            #{add.eventPhoneCardActivate},
+            #{add.adPhotoPlayed75percentRatio},
+            #{add.keyActionRatio},
+            #{add.eventAdWatchTimesCost},
+            #{add.eventAddShoppingCart},
+            #{add.keyAction},
+            #{add.eventMultiConversion},
+            #{add.eventWechatConnected},
+            #{add.eventDspGiftForm},
+            #{add.eventIntentionConfirmed},
+            #{add.eventPhoneGetThrough},
+            #{add.eventMultiConversionRatio},
+            #{add.eventMeasurementHouse},
+            #{add.adPhotoPlayed2sRatio},
+            #{add.eventOutboundCallRatio},
+            #{add.eventAdWatchTimes},
+            #{add.eventOrderSubmit},
+            #{add.liveEventGoodsView}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 0 - 16
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouAccountReportDailyMapper.xml

@@ -574,20 +574,4 @@
     </insert>
 
 
-    <insert id="replaceBatchAdvertisers">
-        replace into `jeecg-boot`.compass_bind_advertisers(
-        advertiser_id,
-        advertiser_name,
-        corporation_name
-        )
-        values
-        <foreach collection="details" item="data" separator=",">
-            (
-            #{data.advertiser_id},
-            #{data.advertiser_name},
-            #{data.corporation_name}
-            )
-        </foreach>
-    </insert>
-
 </mapper>

+ 18 - 21
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/OauthTokenMapper.xml

@@ -19,8 +19,13 @@
     <select id="getOuthTokenAccountId" resultType="java.lang.String">
         SELECT access_token
         FROM `jeecg-boot`.ctop_oauth_token
-        WHERE account_id = #{accountId}
-        limit 1
+        WHERE account_id = #{accountId} limit 1
+    </select>
+
+    <select id="getAgentTokenByAgentId" resultType="java.lang.String">
+        SELECT access_token
+        FROM `jeecg-boot`.ctop_oauth_agent_token
+        WHERE agent_id = #{agentId} limit 1
     </select>
 
 
@@ -43,25 +48,17 @@
     </select>
 
     <select id="selectKuaiShouToken" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT
-            t1.id as 'id',
-            t1.media_id as 'mediaId',
-            t1.advertiser_id as 'advertiser_id',
-            t1.account_id as 'accountId',
-            (CasE WHEN t3.access_token IS NOT NULL THEN t3.access_token ELSE t1.access_token END ) as 'accessToken',
-            (CasE WHEN t3.refresh_token IS NOT NULL THEN t3.refresh_token ELSE t1.refresh_token END ) as 'refreshToken',
-            t1.agent_type as 'agentType',
-            t1.app_id as 'appId',
-            t1.access_token_expires_in as 'accessTokenExpiresIn',
-            t1.refresh_token_expires_in as 'refreshTokenExpiresIn',
-            t1.create_time as 'createTime',
-            t1.update_time as 'updateTime'
-        FROM
-            `jeecg-boot`.ctop_oauth_token t1
-                LEFT JOIN  `jeecg-boot`.ctop_user_allocation t2 ON t1.account_id = t2.account_id
-                LEFT JOIN  `jeecg-boot`.ctop_oauth_agent_token t3 ON t1.app_id = t3.app_id
-        WHERE
-            t2.account_status = 0
+        SELECT t1.id as 'id', t1.media_id as 'mediaId', t1.advertiser_id as 'advertiser_id', t1.account_id as 'accountId', (CasE
+                                                                                                                                WHEN t3.access_token IS NOT NULL
+                                                                                                                                    THEN t3.access_token
+                                                                                                                                ELSE t1.access_token END) as 'accessToken', (CasE
+                                                                                                                                                                                 WHEN t3.refresh_token IS NOT NULL
+                                                                                                                                                                                     THEN t3.refresh_token
+                                                                                                                                                                                 ELSE t1.refresh_token END) as 'refreshToken', t1.agent_type as 'agentType', t1.app_id as 'appId', t1.access_token_expires_in as 'accessTokenExpiresIn', t1.refresh_token_expires_in as 'refreshTokenExpiresIn', t1.create_time as 'createTime', t1.update_time as 'updateTime'
+        FROM `jeecg-boot`.ctop_oauth_token t1
+                 LEFT JOIN `jeecg-boot`.ctop_user_allocation t2 ON t1.account_id = t2.account_id
+                 LEFT JOIN `jeecg-boot`.ctop_oauth_agent_token t3 ON t1.app_id = t3.app_id
+        WHERE t2.account_status = 0
           AND t1.media_id = 2;
     </select>
 

+ 14 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/CompassBindAdvertisersService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.job.kuaishou.data.service;
+
+import cn.com.ctop.job.kuaishou.data.entity.CompassBindAdvertisers;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface CompassBindAdvertisersService extends IService<CompassBindAdvertisers> {
+
+    public void openapiGwUcV1Advertisers(Long advertiserId, String token);
+
+    public void getCompassAdvertisersCampaignReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page);
+
+    public void getCompassAdvertisersUnitReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page);
+
+}

+ 0 - 1
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IKuaishouAccountReportDailyService.java

@@ -21,5 +21,4 @@ public interface IKuaishouAccountReportDailyService extends IService<KuaishouAcc
 
     void liveUserReport(Long accountId, String token, String beginDate, String endDate);
 
-    void openapiGwUcV1Advertisers(Long advertiserId, String token);
 }

+ 2 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IOauthTokenService.java

@@ -25,4 +25,6 @@ public interface IOauthTokenService extends IService<OauthToken> {
     List<JSONObject> getAgentTokens();
 
     String getOuthTokenAccountId(Long accountId);
+
+    String getAgentTokenByAgentId(Long agentId);
 }

+ 414 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/CompassBindAdvertisersServiceImpl.java

@@ -0,0 +1,414 @@
+package cn.com.ctop.job.kuaishou.data.service.impl;
+
+import cn.com.ctop.job.kuaishou.data.constant.KuaishouConstant;
+import cn.com.ctop.job.kuaishou.data.entity.CompassBindAdvertisers;
+import cn.com.ctop.job.kuaishou.data.entity.KuaishouCampaignReportDaily;
+import cn.com.ctop.job.kuaishou.data.entity.KuaishouUnitReportDaily;
+import cn.com.ctop.job.kuaishou.data.mapper.CompassBindAdvertisersMapper;
+import cn.com.ctop.job.kuaishou.data.service.CompassBindAdvertisersService;
+import cn.com.ctop.job.kuaishou.data.utils.Check;
+import cn.com.ctop.job.kuaishou.data.utils.DateUtils;
+import cn.com.ctop.job.kuaishou.data.utils.HttpUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class CompassBindAdvertisersServiceImpl extends ServiceImpl<CompassBindAdvertisersMapper, CompassBindAdvertisers> implements CompassBindAdvertisersService {
+
+    @Value("${api.kuaishou.postUrl}")
+    private String postUrl;
+
+
+    @Override
+    public void openapiGwUcV1Advertisers(Long advertiserId, String token) {
+        String url = postUrl + KuaishouConstant.GW_UC_V1_ADVERTISERS;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", token);
+        Map<String, Object> param = new HashMap<>();
+        param.put("advertiser_id", advertiserId);
+        String result = HttpUtils.httpPostRequest(url, param, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        Integer code = resultJson.getInteger("code");
+        if (null == code || code != 0) {
+            String message = resultJson.getString("message");
+            log.error("获取[罗盘广告主]列异常:{},advertiserId:{}", message, advertiserId);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (!Check.isNull(details)) {
+            baseMapper.replaceBatchAdvertisers(details);
+        }
+        log.info("[罗盘广告主]执行完成");
+    }
+
+
+    @Override
+    public void getCompassAdvertisersCampaignReportDaily(Long advertiserId, String accessToken,
+                                                         String startDate, String endDate, int page) {
+        String url = postUrl + KuaishouConstant.CAMPAIGN_REPORT;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", accessToken);
+        Map<String, Object> param = new HashMap<>();
+        param.put("start_date", startDate);
+        param.put("end_date", endDate);
+        param.put("advertiser_id", advertiserId);
+        param.put("temporal_granularity", "DAILY");
+        Integer page_size = 2000;
+        param.put("page_size", page_size);
+        param.put("page", page);
+        String result = HttpUtils.httpPostRequest(url, param, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取快手[罗盘广告主]计划日报表异常:{},accountId:{}", message, advertiserId);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            log.error("快手[罗盘广告主]计划日报返回详情为空,accountId:{}", advertiserId);
+            return;
+        }
+        Boolean toGet = true;
+        if (details.size() < page_size) {
+            toGet = false;
+        }
+        List<KuaishouCampaignReportDaily> addList = new ArrayList<>();
+        for (int i = 0; i < details.size(); i++) {
+            JSONObject returnJson = details.getJSONObject(i);
+            KuaishouCampaignReportDaily reportDaily = new KuaishouCampaignReportDaily();
+            reportDaily.setAdvertiserId(advertiserId);
+            reportDaily.setStatDate(DateUtils.getDateInteger(returnJson.getString("stat_date")));
+            reportDaily.setCampaignId(returnJson.getLong("campaign_id"));
+            reportDaily.setCampaignName(returnJson.getString("campaign_name"));
+            reportDaily.setCharge(returnJson.getBigDecimal("charge"));
+            reportDaily.setShow(returnJson.getLong("show"));
+            reportDaily.setPhotoClick(returnJson.getLong("photo_click"));
+            reportDaily.setAclick(returnJson.getLong("aclick"));
+            reportDaily.setBclick(returnJson.getLong("bclick"));
+            reportDaily.setPhotoClickRatio(returnJson.getBigDecimal("photo_click_ratio"));
+            reportDaily.setPlay3sRatio(returnJson.getBigDecimal("play_3s_ratio"));
+            reportDaily.setActionRatio(returnJson.getBigDecimal("action_ratio"));
+            reportDaily.setImpression1kCost(returnJson.getBigDecimal("impression_1k_cost"));
+            reportDaily.setPhotoClickCost(returnJson.getBigDecimal("photo_click_cost"));
+            reportDaily.setActionCost(returnJson.getBigDecimal("action_cost"));
+            reportDaily.setShare(returnJson.getLong("share"));
+            reportDaily.setComment(returnJson.getLong("comment"));
+            reportDaily.setLike(returnJson.getLong("like"));
+            reportDaily.setFollow(returnJson.getLong("follow"));
+            reportDaily.setCancelFollow(returnJson.getLong("cancel_follow"));
+            reportDaily.setReport(returnJson.getLong("report"));
+            reportDaily.setBlock(returnJson.getLong("block"));
+            reportDaily.setNegative(returnJson.getLong("negative"));
+            reportDaily.setSubmit(returnJson.getLong("submit"));
+            reportDaily.setDownloadStarted(returnJson.getLong("download_started"));
+            reportDaily.setDownloadCompleted(returnJson.getLong("download_completed"));
+            reportDaily.setActivation(returnJson.getLong("activation"));
+            reportDaily.setEventPayFirstDay(returnJson.getLong("event_pay_first_day"));
+            reportDaily.setEventPayPurchaseAmountFirstDay(returnJson.getBigDecimal("event_pay_purchase_amount_first_day"));
+            reportDaily.setEventPayFirstDayRoi(returnJson.getBigDecimal("event_pay_first_day_roi"));
+            reportDaily.setEventPay(returnJson.getLong("event_pay"));
+            reportDaily.setEventPayPurchaseAmount(returnJson.getBigDecimal("event_pay_purchase_amount"));
+            reportDaily.setEventPayRoi(returnJson.getBigDecimal("event_pay_roi"));
+            reportDaily.setEventRegister(returnJson.getLong("event_register"));
+            reportDaily.setEventRegisterCost(returnJson.getBigDecimal("event_register_cost"));
+            reportDaily.setEventRegisterRatio(returnJson.getBigDecimal("event_register_ratio"));
+            reportDaily.setEventJinJianApp(returnJson.getLong("event_jin_jian_app"));
+            reportDaily.setEventJinJianAppCost(returnJson.getBigDecimal("event_jin_jian_app_cost"));
+            reportDaily.setEventCreditGrantApp(returnJson.getLong("event_credit_grant_app"));
+            reportDaily.setEventCreditGrantAppCost(returnJson.getBigDecimal("event_credit_grant_app_cost"));
+            reportDaily.setEventCreditGrantAppRatio(returnJson.getBigDecimal("event_credit_grant_app_ratio"));
+            reportDaily.setEventOrderPaid(returnJson.getLong("event_order_paid"));
+            reportDaily.setEventOrderPaidPurchaseAmount(returnJson.getBigDecimal("event_order_paid_purchase_amount"));
+            reportDaily.setEventOrderPaidCost(returnJson.getBigDecimal("event_order_paid_cost"));
+            reportDaily.setEventNextDayStay(returnJson.getLong("event_next_day_stay"));
+            reportDaily.setEventNextDayStayCost(returnJson.getBigDecimal("event_next_day_stay_cost"));
+            reportDaily.setEventNextDayStayRatio(returnJson.getBigDecimal("event_next_day_stay_ratio"));
+            reportDaily.setFormCount(returnJson.getLong("form_count"));
+            reportDaily.setFormCost(returnJson.getBigDecimal("form_cost"));
+            reportDaily.setFormActionRatio(returnJson.getBigDecimal("form_action_ratio"));
+            reportDaily.setEventJinJianLandingPage(returnJson.getLong("event_jin_jian_landing_page"));
+            reportDaily.setEventJinJianLandingPageCost(returnJson.getBigDecimal("event_jin_jian_landing_page_cost"));
+            reportDaily.setEventCreditGrantLandingPage(returnJson.getLong("event_credit_grant_landing_page"));
+            reportDaily.setEventCreditGrantLandingPageCost(returnJson.getBigDecimal("event_credit_grant_landing_page_cost"));
+            reportDaily.setEventCreditGrantLandingPageRatio(returnJson.getBigDecimal("event_credit_grant_landing_page_ratio"));
+            reportDaily.setEventValidClues(returnJson.getLong("event_valid_clues"));
+            reportDaily.setEventValidCluesCost(returnJson.getBigDecimal("event_valid_clues_cost"));
+            reportDaily.setEventAddWechat(returnJson.getLong("event_add_wechat"));
+            reportDaily.setEventAddWechatCost(returnJson.getBigDecimal("event_add_wechat_cost"));
+            reportDaily.setEventAddWechatRatio(returnJson.getBigDecimal("event_add_wechat_ratio"));
+            reportDaily.setEventGetThrough(returnJson.getLong("event_get_through"));
+            reportDaily.setEventGetThroughCost(returnJson.getBigDecimal("event_get_through_cost"));
+            reportDaily.setEventGetThroughRatio(returnJson.getBigDecimal("event_get_through_ratio"));
+            reportDaily.setEventAppInvoked(returnJson.getLong("event_app_invoked"));
+            reportDaily.setEventAppInvokedCost(returnJson.getBigDecimal("event_app_invoked_cost"));
+            reportDaily.setEventAppInvokedRatio(returnJson.getBigDecimal("event_app_invoked_ratio"));
+            reportDaily.setEventCreditGrantLandingRatio(returnJson.getBigDecimal("event_credit_grant_landing_ratio"));
+            reportDaily.setPlay5sRatio(returnJson.getBigDecimal("play_5s_ratio"));
+            reportDaily.setPlayEndRatio(returnJson.getBigDecimal("play_end_ratio"));
+            reportDaily.setEventNewUserPay(returnJson.getBigDecimal("event_new_user_pay"));
+            reportDaily.setEventNewUserPayCost(returnJson.getBigDecimal("event_new_user_pay_cost"));
+            reportDaily.setEventNewUserPayRatio(returnJson.getBigDecimal("event_new_user_pay_ratio"));
+            reportDaily.setClick1kCost(returnJson.getBigDecimal("click_1k_cost"));
+            reportDaily.setAdProductCnt(returnJson.getLong("ad_product_cnt"));
+            reportDaily.setEventGoodsView(returnJson.getLong("event_goods_view"));
+            reportDaily.setMerchantRecoFans(returnJson.getLong("merchant_reco_fans"));
+            reportDaily.setEventGoodsViewCost(returnJson.getBigDecimal("event_goods_view_cost"));
+            reportDaily.setMerchantRecoFansCost(returnJson.getBigDecimal("merchant_reco_fans_cost"));
+            reportDaily.setEventOrderAmountRoi(returnJson.getBigDecimal("event_order_amount_roi"));
+            reportDaily.setEventButtonClick(returnJson.getLong("event_button_click"));
+            reportDaily.setEventButtonClickCost(returnJson.getBigDecimal("event_button_click_cost"));
+            reportDaily.setEventButtonClickRatio(returnJson.getBigDecimal("event_button_click_ratio"));
+            reportDaily.setEventOrderPaidRoi(returnJson.getBigDecimal("event_order_paid_roi"));
+            reportDaily.setEventNewUserJinjianApp(returnJson.getLong("event_new_user_jinjian_app"));
+            reportDaily.setEventNewUserJinjianAppCost(returnJson.getBigDecimal("event_new_user_jinjian_app_cost"));
+            reportDaily.setEventNewUserJinjianAppRoi(returnJson.getBigDecimal("event_new_user_jinjian_app_roi"));
+            reportDaily.setEventNewUserCreditGrantApp(returnJson.getLong("event_new_user_credit_grant_app"));
+            reportDaily.setEventNewUserCreditGrantAppCost(returnJson.getBigDecimal("event_new_user_credit_grant_app_cost"));
+            reportDaily.setEventNewUserCreditGrantAppRoi(returnJson.getBigDecimal("event_new_user_credit_grant_app_roi"));
+            reportDaily.setEventNewUserJinjianPage(returnJson.getLong("event_new_user_jinjian_page"));
+            reportDaily.setEventNewUserJinjianPageCost(returnJson.getBigDecimal("event_new_user_jinjian_page_cost"));
+            reportDaily.setEventNewUserJinjianPageRoi(returnJson.getBigDecimal("event_new_user_jinjian_page_roi"));
+            reportDaily.setEventNewUserCreditGrantPage(returnJson.getLong("event_new_user_credit_grant_page"));
+            reportDaily.setEventNewUserCreditGrantPageCost(returnJson.getBigDecimal("event_new_user_credit_grant_page_cost"));
+            reportDaily.setEventNewUserCreditGrantPageRoi(returnJson.getBigDecimal("event_new_user_credit_grant_page_roi"));
+            reportDaily.setEventAppointForm(returnJson.getLong("event_appoint_form"));
+            reportDaily.setEventAppointFormCost(returnJson.getBigDecimal("event_appoint_form_cost"));
+            reportDaily.setEventAppointFormRatio(returnJson.getBigDecimal("event_appoint_form_ratio"));
+            reportDaily.setEventAppointJumpClick(returnJson.getLong("event_appoint_jump_click"));
+            reportDaily.setEventAppointJumpClickCost(returnJson.getBigDecimal("event_appoint_jump_click_cost"));
+            reportDaily.setEventAppointJumpClickRatio(returnJson.getBigDecimal("event_appoint_jump_click_ratio"));
+            reportDaily.setUnionEventPayPurchaseAmount7d(returnJson.getLong("union_event_pay_purchase_amount_7d"));
+            reportDaily.setUnionEventPayPurchaseAmount7dRoi(returnJson.getBigDecimal("union_event_pay_purchase_amount_7d_roi"));
+            reportDaily.setPlacementType(returnJson.getString("placement_type"));
+            reportDaily.setAdScene(returnJson.getString("ad_scene"));
+            reportDaily.setEventOrderSuccessed(returnJson.getLong("event_order_successed"));
+            reportDaily.setAdPhotoPlayed10sRatio(returnJson.getBigDecimal("ad_photo_played_10s_ratio"));
+            reportDaily.setKeyActionCost(returnJson.getBigDecimal("key_action_cost"));
+            reportDaily.setEventAddShoppingCartCost(returnJson.getBigDecimal("event_add_shopping_cart_cost"));
+            reportDaily.setEventAdWatchTimesRatio(returnJson.getBigDecimal("event_ad_watch_times_ratio"));
+            reportDaily.setEventOutboundCallCost(returnJson.getBigDecimal("event_outbound_call_cost"));
+            reportDaily.setEventOutboundCall(returnJson.getLong("event_outbound_call"));
+            reportDaily.setActionNewRatio(returnJson.getBigDecimal("action_new_ratio"));
+            reportDaily.setEventWatchAppAd(returnJson.getLong("event_watch_app_ad"));
+            reportDaily.setEventMultiConversionCost(returnJson.getBigDecimal("event_multi_conversion_cost"));
+            reportDaily.setEventPhoneCardActivate(returnJson.getLong("event_phone_card_activate"));
+            reportDaily.setAdPhotoPlayed75percentRatio(returnJson.getBigDecimal("ad_photo_played_75percent_ratio"));
+            //   reportDaily.setKeyActionRatio(returnJson.getBigDecimal("key_action_ratio"));
+            reportDaily.setEventAdWatchTimesCost(returnJson.getBigDecimal("event_ad_watch_times_cost"));
+            reportDaily.setEventAddShoppingCart(returnJson.getLong("event_add_shopping_cart"));
+            reportDaily.setKeyAction(returnJson.getLong("key_action"));
+            reportDaily.setEventMultiConversion(returnJson.getLong("event_multi_conversion"));
+            reportDaily.setEventWechatConnected(returnJson.getLong("event_wechat_connected"));
+            reportDaily.setEventDspGiftForm(returnJson.getLong("event_dsp_gift_form"));
+            reportDaily.setEventIntentionConfirmed(returnJson.getLong("event_intention_confirmed"));
+            reportDaily.setEventPhoneGetThrough(returnJson.getLong("event_phone_get_through"));
+            reportDaily.setEventMultiConversionRatio(returnJson.getBigDecimal("event_multi_conversion_ratio"));
+            reportDaily.setEventMeasurementHouse(returnJson.getBigDecimal("event_measurement_house"));
+            reportDaily.setAdPhotoPlayed2sRatio(returnJson.getBigDecimal("ad_photo_played_2s_ratio"));
+            reportDaily.setEventOutboundCallRatio(returnJson.getBigDecimal("event_outbound_call_ratio"));
+            reportDaily.setEventAdWatchTimes(returnJson.getLong("event_ad_watch_times"));
+            addList.add(reportDaily);
+        }
+        if (!Check.isNull(addList)) {
+            baseMapper.replaceBatchCampaignReportDaily(addList);
+        }
+        if (toGet) {
+            getCompassAdvertisersCampaignReportDaily(advertiserId, accessToken, startDate, endDate, page + 1);
+        } else {
+            log.info("[罗盘广告主]计划日报数据获取完成:accountId:{}", advertiserId);
+        }
+    }
+
+
+    @Override
+    public void getCompassAdvertisersUnitReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page) {
+        String url = postUrl + KuaishouConstant.UNIT_REPORT;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", accessToken);
+        Map<String, Object> param = new HashMap<>();
+        param.put("start_date", startDate);
+        param.put("end_date", endDate);
+        param.put("advertiser_id", advertiserId);
+        param.put("temporal_granularity", "DAILY");
+        Integer page_size = 2000;
+        param.put("page_size", page_size);
+        param.put("page", page);
+        String result = HttpUtils.httpPostRequest(url, param, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取快手[罗盘广告主]广告组日报表异常:{},accountId:{}", message, advertiserId);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            log.error("[罗盘广告主]快手组日报返回详情为空,accountId:{}", advertiserId);
+            return;
+        }
+        Boolean toGet = true;
+        if (details.size() < page_size) {
+            toGet = false;
+        }
+        List<KuaishouUnitReportDaily> addList = new ArrayList<>();
+        for (int i = 0; i < details.size(); i++) {
+            JSONObject returnJson = details.getJSONObject(i);
+            KuaishouUnitReportDaily reportDaily = new KuaishouUnitReportDaily();
+            reportDaily.setAdvertiserId(advertiserId);
+            reportDaily.setStatDate(DateUtils.getDateInteger(returnJson.getString("stat_date")));
+            reportDaily.setCampaignId(returnJson.getLong("campaign_id"));
+            reportDaily.setCampaignName(returnJson.getString("campaign_name"));
+            reportDaily.setUnitId(returnJson.getLong("unit_id"));
+            reportDaily.setUnitName(returnJson.getString("unit_name"));
+            reportDaily.setCharge(returnJson.getBigDecimal("charge"));
+            reportDaily.setShow(returnJson.getLong("show"));
+            reportDaily.setPhotoClick(returnJson.getLong("photo_click"));
+            reportDaily.setAclick(returnJson.getLong("aclick"));
+            reportDaily.setBclick(returnJson.getLong("bclick"));
+            reportDaily.setPhotoClickRatio(returnJson.getBigDecimal("photo_click_ratio"));
+            reportDaily.setPlay3sRatio(returnJson.getBigDecimal("play_3s_ratio"));
+            reportDaily.setActionRatio(returnJson.getBigDecimal("action_ratio"));
+            reportDaily.setImpression1kCost(returnJson.getBigDecimal("impression_1k_cost"));
+            reportDaily.setPhotoClickCost(returnJson.getBigDecimal("photo_click_cost"));
+            reportDaily.setActionCost(returnJson.getBigDecimal("action_cost"));
+            reportDaily.setShare(returnJson.getLong("share"));
+            reportDaily.setComment(returnJson.getLong("comment"));
+            reportDaily.setLike(returnJson.getLong("like"));
+            reportDaily.setFollow(returnJson.getLong("follow"));
+            reportDaily.setCancelFollow(returnJson.getLong("cancel_follow"));
+            reportDaily.setReport(returnJson.getLong("report"));
+            reportDaily.setBlock(returnJson.getLong("block"));
+            reportDaily.setNegative(returnJson.getLong("negative"));
+            reportDaily.setSubmit(returnJson.getLong("submit"));
+            reportDaily.setDownloadStarted(returnJson.getLong("download_started"));
+            reportDaily.setDownloadCompleted(returnJson.getLong("download_completed"));
+            reportDaily.setActivation(returnJson.getLong("activation"));
+            reportDaily.setEventPayFirstDay(returnJson.getLong("event_pay_first_day"));
+            reportDaily.setEventPayPurchaseAmountFirstDay(returnJson.getBigDecimal("event_pay_purchase_amount_first_day"));
+            reportDaily.setEventPayFirstDayRoi(returnJson.getBigDecimal("event_pay_first_day_roi"));
+            reportDaily.setEventPay(returnJson.getLong("event_pay"));
+            reportDaily.setEventPayPurchaseAmount(returnJson.getBigDecimal("event_pay_purchase_amount"));
+            reportDaily.setEventPayRoi(returnJson.getBigDecimal("event_pay_roi"));
+            reportDaily.setEventRegister(returnJson.getLong("event_register"));
+            reportDaily.setEventRegisterCost(returnJson.getBigDecimal("event_register_cost"));
+            reportDaily.setEventRegisterRatio(returnJson.getBigDecimal("event_register_ratio"));
+            reportDaily.setEventJinJianApp(returnJson.getLong("event_jin_jian_app"));
+            reportDaily.setEventJinJianAppCost(returnJson.getBigDecimal("event_jin_jian_app_cost"));
+            reportDaily.setEventCreditGrantApp(returnJson.getLong("event_credit_grant_app"));
+            reportDaily.setEventCreditGrantAppCost(returnJson.getBigDecimal("event_credit_grant_app_cost"));
+            reportDaily.setEventCreditGrantAppRatio(returnJson.getBigDecimal("event_credit_grant_app_ratio"));
+            reportDaily.setEventOrderPaid(returnJson.getLong("event_order_paid"));
+            reportDaily.setEventOrderPaidPurchaseAmount(returnJson.getBigDecimal("event_order_paid_purchase_amount"));
+            reportDaily.setEventOrderPaidCost(returnJson.getBigDecimal("event_order_paid_cost"));
+            reportDaily.setEventNextDayStay(returnJson.getLong("event_next_day_stay"));
+            reportDaily.setEventNextDayStayCost(returnJson.getBigDecimal("event_next_day_stay_cost"));
+            reportDaily.setEventNextDayStayRatio(returnJson.getBigDecimal("event_next_day_stay_ratio"));
+            reportDaily.setFormCount(returnJson.getLong("form_count"));
+            reportDaily.setFormCost(returnJson.getBigDecimal("form_cost"));
+            reportDaily.setFormActionRatio(returnJson.getBigDecimal("form_action_ratio"));
+            reportDaily.setEventJinJianLandingPage(returnJson.getLong("event_jin_jian_landing_page"));
+            reportDaily.setEventJinJianLandingPageCost(returnJson.getBigDecimal("event_jin_jian_landing_page_cost"));
+            reportDaily.setEventCreditGrantLandingPage(returnJson.getLong("event_credit_grant_landing_page"));
+            reportDaily.setEventCreditGrantLandingPageCost(returnJson.getBigDecimal("event_credit_grant_landing_page_cost"));
+            reportDaily.setEventCreditGrantLandingPageRatio(returnJson.getBigDecimal("event_credit_grant_landing_page_ratio"));
+            reportDaily.setEventValidClues(returnJson.getLong("event_valid_clues"));
+            reportDaily.setEventValidCluesCost(returnJson.getBigDecimal("event_valid_clues_cost"));
+            reportDaily.setEventAddWechat(returnJson.getLong("event_add_wechat"));
+            reportDaily.setEventAddWechatCost(returnJson.getBigDecimal("event_add_wechat_cost"));
+            reportDaily.setEventAddWechatRatio(returnJson.getBigDecimal("event_add_wechat_ratio"));
+            reportDaily.setEventGetThrough(returnJson.getLong("event_get_through"));
+            reportDaily.setEventGetThroughCost(returnJson.getBigDecimal("event_get_through_cost"));
+            reportDaily.setEventGetThroughRatio(returnJson.getBigDecimal("event_get_through_ratio"));
+            reportDaily.setEventAppInvoked(returnJson.getLong("event_app_invoked"));
+            reportDaily.setEventAppInvokedCost(returnJson.getBigDecimal("event_app_invoked_cost"));
+            reportDaily.setEventAppInvokedRatio(returnJson.getBigDecimal("event_app_invoked_ratio"));
+            reportDaily.setEventCreditGrantLandingRatio(returnJson.getBigDecimal("event_credit_grant_landing_ratio"));
+            reportDaily.setPlay5sRatio(returnJson.getBigDecimal("play_5s_ratio"));
+            reportDaily.setPlayEndRatio(returnJson.getBigDecimal("play_end_ratio"));
+            reportDaily.setEventNewUserPay(returnJson.getBigDecimal("event_new_user_pay"));
+            reportDaily.setEventNewUserPayCost(returnJson.getBigDecimal("event_new_user_pay_cost"));
+            reportDaily.setEventNewUserPayRatio(returnJson.getBigDecimal("event_new_user_pay_ratio"));
+            reportDaily.setClick1kCost(returnJson.getBigDecimal("click_1k_cost"));
+            reportDaily.setAdProductCnt(returnJson.getLong("ad_product_cnt"));
+            reportDaily.setEventGoodsView(returnJson.getLong("event_goods_view"));
+            reportDaily.setMerchantRecoFans(returnJson.getLong("merchant_reco_fans"));
+            reportDaily.setEventGoodsViewCost(returnJson.getBigDecimal("event_goods_view_cost"));
+            reportDaily.setMerchantRecoFansCost(returnJson.getBigDecimal("merchant_reco_fans_cost"));
+            reportDaily.setEventOrderAmountRoi(returnJson.getBigDecimal("event_order_amount_roi"));
+            reportDaily.setEventButtonClick(returnJson.getLong("event_button_click"));
+            reportDaily.setEventButtonClickCost(returnJson.getBigDecimal("event_button_click_cost"));
+            reportDaily.setEventButtonClickRatio(returnJson.getBigDecimal("event_button_click_ratio"));
+            reportDaily.setEventOrderPaidRoi(returnJson.getBigDecimal("event_order_paid_roi"));
+            reportDaily.setEventNewUserJinjianApp(returnJson.getLong("event_new_user_jinjian_app"));
+            reportDaily.setEventNewUserJinjianAppCost(returnJson.getBigDecimal("event_new_user_jinjian_app_cost"));
+            reportDaily.setEventNewUserJinjianAppRoi(returnJson.getBigDecimal("event_new_user_jinjian_app_roi"));
+            reportDaily.setEventNewUserCreditGrantApp(returnJson.getLong("event_new_user_credit_grant_app"));
+            reportDaily.setEventNewUserCreditGrantAppCost(returnJson.getBigDecimal("event_new_user_credit_grant_app_cost"));
+            reportDaily.setEventNewUserCreditGrantAppRoi(returnJson.getBigDecimal("event_new_user_credit_grant_app_roi"));
+            reportDaily.setEventNewUserJinjianPage(returnJson.getLong("event_new_user_jinjian_page"));
+            reportDaily.setEventNewUserJinjianPageCost(returnJson.getBigDecimal("event_new_user_jinjian_page_cost"));
+            reportDaily.setEventNewUserJinjianPageRoi(returnJson.getBigDecimal("event_new_user_jinjian_page_roi"));
+            reportDaily.setEventNewUserCreditGrantPage(returnJson.getLong("event_new_user_credit_grant_page"));
+            reportDaily.setEventNewUserCreditGrantPageCost(returnJson.getBigDecimal("event_new_user_credit_grant_page_cost"));
+            reportDaily.setEventNewUserCreditGrantPageRoi(returnJson.getBigDecimal("event_new_user_credit_grant_page_roi"));
+            reportDaily.setEventAppointForm(returnJson.getLong("event_appoint_form"));
+            reportDaily.setEventAppointFormCost(returnJson.getBigDecimal("event_appoint_form_cost"));
+            reportDaily.setEventAppointFormRatio(returnJson.getBigDecimal("event_appoint_form_ratio"));
+            reportDaily.setEventAppointJumpClick(returnJson.getLong("event_appoint_jump_click"));
+            reportDaily.setEventAppointJumpClickCost(returnJson.getBigDecimal("event_appoint_jump_click_cost"));
+            reportDaily.setEventAppointJumpClickRatio(returnJson.getBigDecimal("event_appoint_jump_click_ratio"));
+            reportDaily.setUnionEventPayPurchaseAmount7d(returnJson.getLong("union_event_pay_purchase_amount_7d"));
+            reportDaily.setUnionEventPayPurchaseAmount7dRoi(returnJson.getBigDecimal("union_event_pay_purchase_amount_7d_roi"));
+            reportDaily.setPlacementType(returnJson.getString("placement_type"));
+            reportDaily.setAdScene(returnJson.getString("ad_scene"));
+            reportDaily.setEventOrderSuccessed(returnJson.getLong("event_order_successed"));
+            reportDaily.setAdPhotoPlayed10sRatio(returnJson.getBigDecimal("ad_photo_played_10s_ratio"));
+            reportDaily.setKeyActionCost(returnJson.getBigDecimal("key_action_cost"));
+            reportDaily.setEventAddShoppingCartCost(returnJson.getBigDecimal("event_add_shopping_cart_cost"));
+            reportDaily.setEventAdWatchTimesRatio(returnJson.getBigDecimal("event_ad_watch_times_ratio"));
+            reportDaily.setEventOutboundCallCost(returnJson.getBigDecimal("event_outbound_call_cost"));
+            reportDaily.setEventOutboundCall(returnJson.getLong("event_outbound_call"));
+            reportDaily.setActionNewRatio(returnJson.getBigDecimal("action_new_ratio"));
+            reportDaily.setEventWatchAppAd(returnJson.getLong("event_watch_app_ad"));
+            reportDaily.setEventMultiConversionCost(returnJson.getBigDecimal("event_multi_conversion_cost"));
+            reportDaily.setEventPhoneCardActivate(returnJson.getLong("event_phone_card_activate"));
+            reportDaily.setAdPhotoPlayed75percentRatio(returnJson.getBigDecimal("ad_photo_played_75percent_ratio"));
+            //   reportDaily.setKeyActionRatio(returnJson.getBigDecimal("key_action_ratio"));
+            reportDaily.setEventAdWatchTimesCost(returnJson.getBigDecimal("event_ad_watch_times_cost"));
+            reportDaily.setEventAddShoppingCart(returnJson.getLong("event_add_shopping_cart"));
+            reportDaily.setKeyAction(returnJson.getLong("key_action"));
+            reportDaily.setEventMultiConversion(returnJson.getLong("event_multi_conversion"));
+            reportDaily.setEventWechatConnected(returnJson.getLong("event_wechat_connected"));
+            reportDaily.setEventDspGiftForm(returnJson.getLong("event_dsp_gift_form"));
+            reportDaily.setEventIntentionConfirmed(returnJson.getLong("event_intention_confirmed"));
+            reportDaily.setEventPhoneGetThrough(returnJson.getLong("event_phone_get_through"));
+            reportDaily.setEventMultiConversionRatio(returnJson.getBigDecimal("event_multi_conversion_ratio"));
+            reportDaily.setEventMeasurementHouse(returnJson.getBigDecimal("event_measurement_house"));
+            reportDaily.setAdPhotoPlayed2sRatio(returnJson.getBigDecimal("ad_photo_played_2s_ratio"));
+            reportDaily.setEventOutboundCallRatio(returnJson.getBigDecimal("event_outbound_call_ratio"));
+            reportDaily.setEventAdWatchTimes(returnJson.getLong("event_ad_watch_times"));
+            reportDaily.setEventOrderSubmit(returnJson.getLong("event_order_submit"));
+            reportDaily.setLiveEventGoodsView(returnJson.getLong("live_event_goods_view"));
+            addList.add(reportDaily);
+        }
+        if (!Check.isNull(addList)) {
+            baseMapper.replaceBatchUnitReportDaily(addList);
+        }
+        if (toGet) {
+            getCompassAdvertisersUnitReportDaily(advertiserId, accessToken, startDate, endDate, page + 1);
+        } else {
+            log.info("罗盘广告主-组日报数据获取完成:accountId:{}", advertiserId);
+        }
+    }
+}

+ 0 - 22
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaishouAccountReportDailyServiceImpl.java

@@ -248,27 +248,5 @@ public class KuaishouAccountReportDailyServiceImpl extends ServiceImpl<KuaishouA
             System.err.println("-------------------直播间整理数据\n" + details);
 
         }
-
-    }
-
-    @Override
-    public void openapiGwUcV1Advertisers(Long advertiserId, String token) {
-        String url = postUrl + KuaishouConstant.GW_UC_V1_ADVERTISERS;
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Access-Token", token);
-        Map<String, Object> param = new HashMap<>();
-        param.put("advertiser_id", advertiserId);
-        String result = HttpUtils.httpPostRequest(url, param, headers);
-        JSONObject resultJson = JSONObject.parseObject(result);
-        Integer code = resultJson.getInteger("code");
-        if (null == code || code != 0) {
-            String message = resultJson.getString("message");
-            log.error("获取罗盘绑定广告主列异常:{},advertiserId:{}", message, advertiserId);
-            return;
-        }
-        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
-        if (!Check.isNull(details)) {
-            accountReportDailyMapper.replaceBatchAdvertisers(details);
-        }
     }
 }

+ 5 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/OauthTokenServiceImpl.java

@@ -50,4 +50,9 @@ public class OauthTokenServiceImpl extends ServiceImpl<OauthTokenMapper, OauthTo
   public String getOuthTokenAccountId(Long accountId) {
     return tokenMapper.getOuthTokenAccountId(accountId);
   }
+
+  @Override
+  public String getAgentTokenByAgentId(Long agentId) {
+    return tokenMapper.getAgentTokenByAgentId(agentId);
+  }
 }

+ 0 - 15
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AccountReportlJob.java

@@ -189,19 +189,4 @@ public class AccountReportlJob {
                     }
                 });
     }
-
-    /**
-     * 获取罗盘绑定广告主列
-     * 当前快手ID,账户ID 固定写死
-     */
-
-    @XxlJob("openapiGwUcV1Advertisers")
-    public void openapiGwUcV1Advertisers() throws Exception {
-        //罗盘账户的「快手 id」,只能传递授权时使用的快手 id
-        Long advertiserId = 4361966075L;
-        String token = tokenService.getOuthTokenAccountId(39526067L);
-        kuaishouAccountReportDailyService.openapiGwUcV1Advertisers(advertiserId, token);
-        log.info("------【获取罗盘绑定广告主列】执行完成");
-
-    }
 }

+ 153 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CompassBindAdvertisersJob.java

@@ -0,0 +1,153 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.data.service.CompassBindAdvertisersService;
+import cn.com.ctop.job.kuaishou.data.service.IOauthTokenService;
+import cn.com.ctop.job.kuaishou.data.utils.Check;
+import cn.com.ctop.job.kuaishou.data.utils.DateUtils;
+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;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@Component
+public class CompassBindAdvertisersJob {
+    @Autowired
+    private IOauthTokenService tokenService;
+    @Autowired
+    private CompassBindAdvertisersService compassBindAdvertisersService;
+
+    private static ExecutorService campaignExecutorService = Executors.newFixedThreadPool(3);
+    private static ExecutorService unitExecutorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 获取罗盘绑定广告主列
+     * 当前快手ID,账户ID 固定写死
+     */
+
+    @XxlJob("compassAdvertisers")
+    public void compassAdvertisers() throws Exception {
+        //罗盘账户的「快手 id」,只能传递授权时使用的快手 id
+        Long advertiserId = 4361966075L;
+        String token = tokenService.getOuthTokenAccountId(39526067L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId, token);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+    }
+
+    /**
+     * 获取罗盘绑定广告主今日计划日报表
+     */
+    @XxlJob("compassAdNowDayCampaignDailyReport")
+    public void compassAdNowDayCampaignDailyReport() throws Exception {
+        String accountId = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(accountId)) {
+            log.error("入参为空");
+            return;
+        }
+        //723 骄阳token
+        String token = tokenService.getAgentTokenByAgentId(723L);
+        if (Check.isNull(token)) {
+            log.error("token 为空 !!!");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        campaignExecutorService.submit(
+                new Runnable() {
+                    @Override
+                    public void run() {
+                        compassBindAdvertisersService.getCompassAdvertisersCampaignReportDaily(
+                                Long.valueOf(accountId), token, nowDate, nowDate, 1);
+                    }
+                });
+    }
+
+    /**
+     * 获取罗盘绑定广告主昨日日计划日报表
+     */
+    @XxlJob("compassAdYesterdayCampaignDailyReport")
+    public void compassAdYesterdayCampaignDailyReport() throws Exception {
+        String accountId = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(accountId)) {
+            log.error("入参为空");
+            return;
+        }
+        //723 骄阳token
+        String token = tokenService.getAgentTokenByAgentId(723L);
+        if (Check.isNull(token)) {
+            log.error("token 为空 !!!");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        campaignExecutorService.submit(
+                new Runnable() {
+                    @Override
+                    public void run() {
+                        compassBindAdvertisersService.getCompassAdvertisersCampaignReportDaily(
+                                Long.valueOf(accountId), token, yesterday, yesterday, 1);
+                    }
+                });
+    }
+
+    /**
+     * 获取罗盘绑定广告主今日广告组日报表
+     */
+    @XxlJob("compassAdNowDayUnitDailyReport")
+    public void compassAdNowDayUnitDailyReport() throws Exception {
+        String accountId = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(accountId)) {
+            log.error("入参为空");
+            return;
+        }
+
+        //723 骄阳token
+        String token = tokenService.getAgentTokenByAgentId(723L);
+        if (Check.isNull(token)) {
+            log.error("token 为空 !!!");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        campaignExecutorService.submit(
+                new Runnable() {
+                    @Override
+                    public void run() {
+                        compassBindAdvertisersService.getCompassAdvertisersUnitReportDaily(
+                                Long.valueOf(accountId), token, nowDate, nowDate, 1);
+                    }
+                });
+    }
+
+    /**
+     * 获取罗盘绑定广告主昨日广告组日报表
+     */
+    @XxlJob("compassAdYesterdayUnitDailyReport")
+    public void compassAdYesterdayUnitDailyReport() throws Exception {
+        String accountId = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(accountId)) {
+            log.error("入参为空");
+            return;
+        }
+        //723 骄阳token
+        String token = tokenService.getAgentTokenByAgentId(723L);
+        if (Check.isNull(token)) {
+            log.error("token 为空 !!!");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        campaignExecutorService.submit(
+                new Runnable() {
+                    @Override
+                    public void run() {
+                        compassBindAdvertisersService.getCompassAdvertisersUnitReportDaily(
+                                Long.valueOf(accountId), token, yesterday, yesterday, 1);
+                    }
+                });
+    }
+
+}