Bläddra i källkod

Merge remote-tracking branch 'origin/master'

yumeng 1 år sedan
förälder
incheckning
9d014d72e7
19 ändrade filer med 1519 tillägg och 654 borttagningar
  1. 4 3
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/constant/KuaishouConstant.java
  2. 50 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouEffectNativeChartreportConversionChart.java
  3. 48 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouEffectNativeChartreportFunnel.java
  4. 71 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouEffectNativeChartreportSummary.java
  5. 812 533
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouUnitReportDaily.java
  6. 11 1
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouAccountReportDailyMapper.java
  7. 9 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouVideoListMapper.java
  8. 74 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouAccountReportDailyMapper.xml
  9. 6 2
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouUnitReportDailyMapper.xml
  10. 52 1
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouVideoListMapper.xml
  11. 5 2
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IKuaishouAccountReportDailyService.java
  12. 8 1
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IKuaishouVideoListService.java
  13. 2 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/AdUnitReportServiceImpl.java
  14. 83 2
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaishouAccountReportDailyServiceImpl.java
  15. 2 0
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaishouUnitReportDailyServiceImpl.java
  16. 88 28
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaishouVideoListServiceImpl.java
  17. 104 65
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/utils/DateUtils.java
  18. 42 1
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AccountReportlJob.java
  19. 48 15
      job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/VideoListJob.java

+ 4 - 3
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/constant/KuaishouConstant.java

@@ -15,8 +15,6 @@ public class KuaishouConstant {
     public static final String VIDEO_LIST = "/rest/openapi/v1/file/ad/video/list";
 
 
-
-
     //获取广告组信息
     public static final String AD_UNIT_LIST = "/rest/openapi/v1/ad_unit/list";
 
@@ -38,8 +36,11 @@ public class KuaishouConstant {
     //快手账户操作记录
     public static final String OPERATION_RECORD_LIST = "/rest/openapi/v1/tool/operation_record/list";
 
+    //视频关联创意数查询
+    public static final String VIDEO_RELATE_CREATIVES = "/rest/openapi/v1/file/ad/video/relate/creatives";
 
-
+    //获取原生效果数据整体概览接口(数据概览、分日转化数据分布、转化漏斗)
+    public static final String EFFECT_NATIVE_CHART_REPORT = "/rest/openapi/gw/dsp/v1/effect/native/chartReport";
 
 
 }

+ 50 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouEffectNativeChartreportConversionChart.java

@@ -0,0 +1,50 @@
+package cn.com.ctop.job.kuaishou.data.entity;
+
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * 转化数分日柱状图对象 effect_native_chartreport_conversion_chart
+ */
+@Data
+public class KuaishouEffectNativeChartreportConversionChart {
+
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+
+    /**
+     * 直接转化数
+     */
+    @Excel(name = "直接转化数")
+    private Long conversionCnt;
+
+    /**
+     * 间接转化数
+     */
+    @Excel(name = "间接转化数")
+    private Long indirectConversionCnt;
+
+    /**
+     * 归因窗口
+     */
+    @Excel(name = "归因窗口")
+    private Long attributeWindow;
+
+    /**
+     * 总体值
+     */
+    @Excel(name = "总体值")
+    private BigDecimal sumValue;
+
+    /**
+     * 日期
+     */
+    private Long date;
+
+    public KuaishouEffectNativeChartreportConversionChart() {
+    }
+}

+ 48 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouEffectNativeChartreportFunnel.java

@@ -0,0 +1,48 @@
+package cn.com.ctop.job.kuaishou.data.entity;
+
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * 原生漏斗数据对象 effect_native_chartreport_funnel
+ */
+@Data
+public class KuaishouEffectNativeChartreportFunnel {
+
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数")
+    private Long adShow;
+
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数")
+    private Long actionbarClick;
+
+    /**
+     * 直接转化数
+     */
+    @Excel(name = "直接转化数")
+    private Long conversionCnt;
+
+    /**
+     * 时间窗口
+     */
+    @Excel(name = "时间窗口")
+    private BigDecimal attributeWindow;
+
+    /**
+     * 日期
+     */
+    private Long statDate;
+
+}

+ 71 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouEffectNativeChartreportSummary.java

@@ -0,0 +1,71 @@
+package cn.com.ctop.job.kuaishou.data.entity;
+
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * 原生数据概览对象 effect_native_chartreport_summary
+ */
+@Data
+public class KuaishouEffectNativeChartreportSummary {
+
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+
+    /**
+     * 类型
+     */
+    @Excel(name = "类型")
+    private String type;
+
+    /**
+     * 环比
+     */
+    @Excel(name = "环比")
+    private BigDecimal yoy;
+
+    /**
+     * 直接数据
+     */
+    @Excel(name = "直接数据")
+    private BigDecimal direct;
+
+    /**
+     * 间接数据
+     */
+    @Excel(name = "间接数据")
+    private BigDecimal indirect;
+
+    /**
+     * 日期
+     */
+    private Long statDate;
+
+    /**
+     * 原生消耗增量收益
+     */
+    @Excel(name = "原生消耗增量收益")
+    private BigDecimal nativeSoftChargeRatio;
+
+    /**
+     * 归因窗口
+     */
+    @Excel(name = "归因窗口")
+    private Long attributeWindow;
+
+    /**
+     * 原生转化增量收益
+     */
+    @Excel(name = "原生转化增量收益")
+    private BigDecimal nativeConversionRatio;
+
+    /**
+     * 总体值
+     */
+    @Excel(name = "总体值")
+    private BigDecimal sumValue;
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 812 - 533
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/entity/KuaishouUnitReportDaily.java


+ 11 - 1
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouAccountReportDailyMapper.java

@@ -1,6 +1,9 @@
 package cn.com.ctop.job.kuaishou.data.mapper;
 
 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.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -13,5 +16,12 @@ import java.util.List;
  * @version V1.0
  */
 public interface KuaishouAccountReportDailyMapper extends BaseMapper<KuaishouAccountReportDaily> {
-  void replaceBatch(@Param("addList") List<KuaishouAccountReportDaily> addList);
+
+    void replaceBatch(@Param("addList") List<KuaishouAccountReportDaily> addList);
+
+    void replaceBatchSummary(@Param("sumList") List<KuaishouEffectNativeChartreportSummary> sumList);
+
+    void replaceBatchFunnel(@Param("funList") List<KuaishouEffectNativeChartreportFunnel> funList);
+
+    void replaceBatchConversionChart(@Param("chatList") List<KuaishouEffectNativeChartreportConversionChart> chatList);
 }

+ 9 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/KuaishouVideoListMapper.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.job.kuaishou.data.mapper;
 
 import cn.com.ctop.job.kuaishou.data.entity.KuaishouVideoList;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -16,4 +17,12 @@ import java.util.List;
 public interface KuaishouVideoListMapper extends BaseMapper<KuaishouVideoList> {
 
     void replaceBatch(@Param("addList") List<KuaishouVideoList> videoGetList);
+
+    KuaishouVideoList getByPhotoId(@Param("photoId") String photoId, @Param("accountId") Long accountId);
+
+    void replaceBatchVideoRelateCreatives(@Param("list") JSONArray list);
+
+    List<Long> getAccountIds(@Param("projectId") Long projectId);
+
+    List<String> getPhototIdsByAccountId(@Param("accountId") Long accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

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

@@ -489,10 +489,84 @@
             #{add.adAppDownloadHalfImpression}
 
 
+            )
+        </foreach>
+    </insert>
 
 
+    <insert id="replaceBatchSummary">
+        replace into media_api.effect_native_chartreport_summary(
+        `account_id`,
+        `type`,
+        `yoy`,
+        `direct`,
+        `indirect`,
+        `stat_date`,
+        `native_soft_charge_ratio`,
+        `attribute_window`,
+        `native_conversion_ratio`,
+        `sum_value`
+        )
+        values
+        <foreach collection="sumList" item="sum" separator=",">
+            (
+            #{sum.accountId},
+            #{sum.type},
+            #{sum.yoy},
+            #{sum.direct},
+            #{sum.indirect},
+            #{sum.statDate},
+            #{sum.nativeSoftChargeRatio},
+            #{sum.attributeWindow},
+            #{sum.nativeConversionRatio},
+            #{sum.sumValue}
+            )
+        </foreach>
+    </insert>
+
+    <insert id="replaceBatchFunnel">
+        replace into media_api.effect_native_chartreport_funnel(
+        `account_id`,
+        `ad_show`,
+        `actionbar_click`,
+        `conversion_cnt`,
+        `attribute_window`,
+        `stat_date`
+        )
+        values
+        <foreach collection="funList" item="fun" separator=",">
+            (
+            #{fun.accountId},
+            #{fun.adShow},
+            #{fun.actionbarClick},
+            #{fun.conversionCnt},
+            #{fun.attributeWindow},
+            #{fun.statDate}
+            )
+        </foreach>
+    </insert>
 
+    <insert id="replaceBatchConversionChart">
+        replace into media_api.effect_native_chartreport_conversion_chart(
+        `account_id`,
+        `conversion_cnt`,
+        `indirect_conversion_cnt`,
+        `attribute_window`,
+        `sum_value`,
+        `date`
+        )
+        values
+        <foreach collection="chatList" item="chat" separator=",">
+            (
+            #{chat.accountId},
+            #{chat.conversionCnt},
+            #{chat.indirectConversionCnt},
+            #{chat.attributeWindow},
+            #{chat.sumValue},
+            #{chat.date}
             )
         </foreach>
     </insert>
+
+
 </mapper>

+ 6 - 2
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouUnitReportDailyMapper.xml

@@ -135,7 +135,9 @@
         `event_measurement_house`,
         `ad_photo_played_2s_ratio`,
         `event_outbound_call_ratio`,
-        `event_ad_watch_times`
+        `event_ad_watch_times`,
+        `event_order_submit`,
+        `live_event_goods_view`
         )
         values
         <foreach collection="addList" item="add" separator=",">
@@ -272,7 +274,9 @@
             #{add.eventMeasurementHouse},
             #{add.adPhotoPlayed2sRatio},
             #{add.eventOutboundCallRatio},
-            #{add.eventAdWatchTimes}
+            #{add.eventAdWatchTimes},
+            #{add.eventOrderSubmit},
+            #{add.liveEventGoodsView}
             )
         </foreach>
     </insert>

+ 52 - 1
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/KuaishouVideoListMapper.xml

@@ -38,4 +38,55 @@
         </foreach>
 
     </insert>
-</mapper>
+
+
+    <select id="getByPhotoId" resultType="cn.com.ctop.job.kuaishou.data.entity.KuaishouVideoList">
+        SELECT signature,
+               photo_name
+        from kuaishou_video_list
+        WHERE photo_id = #{photoId}
+          AND account_id = #{accountId}
+    </select>
+
+
+    <insert id="replaceBatchVideoRelateCreatives">
+        replace into kuaishou_video_create_count(
+        `account_id`,
+        `photo_id`,
+        `photo_name`,
+        `signature`,
+        `creative_count`,
+        `advanced_creative_count`
+        )
+        values
+        <foreach collection="list" item="add" separator=",">
+            (
+            #{add.account_id},
+            #{add.photo_id},
+            #{add.photo_name},
+            #{add.signature},
+            #{add.creative_count},
+            #{add.advanced_creative_count}
+            )
+        </foreach>
+    </insert>
+
+
+    <select id="getAccountIds" resultType="Long">
+        SELECT account_id
+        FROM `jeecg-boot`.ctop_user_allocation
+        WHERE project_id = #{projectId}
+    </select>
+
+    <select id="getPhototIdsByAccountId" resultType="String">
+        SELECT photo_id FROM kuaishou_video_list
+        WHERE account_id = #{accountId}
+        AND photo_name like '%真人%'
+        <if test="startTime!=null">
+            AND stat_date >=#{startTime}
+            AND stat_date &lt;=#{endTime}
+        </if>
+
+    </select>
+
+</mapper>

+ 5 - 2
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IKuaishouAccountReportDailyService.java

@@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @version V1.0
  */
 public interface IKuaishouAccountReportDailyService extends IService<KuaishouAccountReportDaily> {
-  void getAdvertiserReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page) throws Exception;
-  void sendMessage(Long accountId, String startDate, String endDate, String date_type);
+    void getAdvertiserReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page) throws Exception;
+
+    void sendMessage(Long accountId, String startDate, String endDate, String date_type);
+
+    void effectNativeChartReport(Long accountId, String token, String beginDate, String endDate);
 }

+ 8 - 1
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/IKuaishouVideoListService.java

@@ -16,5 +16,12 @@ import java.util.Map;
 public interface IKuaishouVideoListService extends IService<KuaishouVideoList> {
     void getVideoList(Long advertiserId, String accessToken, String startDate, String endDate, int page);
 
-    Map<String,String> getKuaishouVideoByAccountId(Long advertiserId, String accessToken, List<String> materialIds, int page);
+    Map<String, String> getKuaishouVideoByAccountId(Long advertiserId, String accessToken, List<String> materialIds, int page);
+
+    List<Long> getAccountIds(Long projectId);
+
+    void getVideosByAccountId(Long accountId, String startTime, String endTime);
+
+    void getVideoRelateCreatives(String accessToken, List<String> photoIds, Long accountId);
 }
+

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

@@ -250,9 +250,11 @@ public class AdUnitReportServiceImpl implements IAdUnitReportService {
                 return;
             }
             JSONArray details = data.getJSONArray("details");
+            System.out.println(details);
             if (Check.isNull(details)) {
                 log.error("代理商报表返回details节点为空");
                 return;
+
             }
             List<KuaiShouDailyAgent> agentList = new ArrayList<>();
             for (int i = 0; i < details.size(); i++) {

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

@@ -2,8 +2,12 @@ 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.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 cn.com.ctop.job.kuaishou.data.mapper.KuaishouAccountReportDailyMapper;
 import cn.com.ctop.job.kuaishou.data.service.IKuaishouAccountReportDailyService;
+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;
@@ -36,7 +40,7 @@ public class KuaishouAccountReportDailyServiceImpl extends ServiceImpl<KuaishouA
     private String postUrl;
 
     @Override
-    public void getAdvertiserReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page)throws Exception {
+    public void getAdvertiserReportDaily(Long advertiserId, String accessToken, String startDate, String endDate, int page) throws Exception {
         log.info("获取账户日报,账户id:{},开始时间:{},结束时间:{}", advertiserId, startDate, endDate);
         String url = postUrl + KuaishouConstant.ACCOUNT_REPORT;
         Map<String, String> headers = new HashMap<>();
@@ -50,7 +54,7 @@ public class KuaishouAccountReportDailyServiceImpl extends ServiceImpl<KuaishouA
         param.put("page", page);
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
-     //   System.err.println(resultJson);
+        //   System.err.println(resultJson);
         Integer code = resultJson.getInteger("code");
         String message = resultJson.getString("message");
         if (null == code || code != 0) {
@@ -85,4 +89,81 @@ public class KuaishouAccountReportDailyServiceImpl extends ServiceImpl<KuaishouA
         String result = HttpUtils.httpPostRequest(url, param, null);
         System.err.println(result);
     }
+
+    @Override
+    public void effectNativeChartReport(Long accountId, String token, String beginDate, String endDate) {
+        String url = postUrl + KuaishouConstant.EFFECT_NATIVE_CHART_REPORT;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", token);
+        Map<String, Object> param = new HashMap<>();
+        param.put("advertiser_id", accountId);
+        JSONObject search_param = new JSONObject();
+
+        search_param.put("report_start_day", DateUtils.timeToStamp(beginDate + " 00:00:00"));
+        search_param.put("report_end_day", DateUtils.timeToStamp(endDate + " 23:59:59"));
+        param.put("search_param", search_param);
+        String result = HttpUtils.httpPostRequest(url, param, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+//        System.out.println("-------------------" + param);
+//        System.out.println("");
+//        System.err.println(resultJson);
+        Integer code = resultJson.getInteger("code");
+        if (null == code || code != 0) {
+            String message = resultJson.getString("message");
+            log.error("获取快手获取原生效果数据整体概览接口(数据概览、分日转化数据分布、转化漏斗)异常:{},accountId:{}", message, accountId);
+            return;
+        }
+        JSONObject data = resultJson.getJSONObject("data");
+
+        //数据概览
+        JSONArray summary = data.getJSONArray("summary");
+        if (!Check.isNull(summary)) {
+            List<KuaishouEffectNativeChartreportSummary> sumList = new ArrayList<>();
+            for (int i = 0; i < summary.size(); i++) {
+                JSONObject sumObj = summary.getJSONObject(i);
+                KuaishouEffectNativeChartreportSummary sum = JSONObject.parseObject(sumObj.toJSONString(), KuaishouEffectNativeChartreportSummary.class);
+                sum.setStatDate(DateUtils.getDateLong(beginDate));
+                sum.setAccountId(accountId);
+
+                sumList.add(sum);
+            }
+            if (!Check.isNull(sumList)) {
+                accountReportDailyMapper.replaceBatchSummary(sumList);
+            }
+        }
+
+        //漏斗数据
+        JSONArray funnel = data.getJSONArray("funnel");
+        if (!Check.isNull(funnel)) {
+            List<KuaishouEffectNativeChartreportFunnel> funList = new ArrayList<>();
+            for (int i = 0; i < funnel.size(); i++) {
+                JSONObject funObj = funnel.getJSONObject(i);
+                KuaishouEffectNativeChartreportFunnel fun = JSONObject.parseObject(funObj.toJSONString(), KuaishouEffectNativeChartreportFunnel.class);
+                fun.setStatDate(DateUtils.getDateLong(beginDate));
+                fun.setAccountId(accountId);
+
+                funList.add(fun);
+            }
+            if (!Check.isNull(funList)) {
+                accountReportDailyMapper.replaceBatchFunnel(funList);
+            }
+        }
+
+        //转化数分日柱状图
+        JSONArray conversionChart = data.getJSONArray("conversion_chart");
+        if (!Check.isNull(conversionChart)) {
+            List<KuaishouEffectNativeChartreportConversionChart> chatList = new ArrayList<>();
+            for (int i = 0; i < conversionChart.size(); i++) {
+                JSONObject chatObj = conversionChart.getJSONObject(i);
+                KuaishouEffectNativeChartreportConversionChart chat = JSONObject.parseObject(chatObj.toJSONString(), KuaishouEffectNativeChartreportConversionChart.class);
+                chat.setDate(DateUtils.getDateLong(beginDate));
+                chat.setAccountId(accountId);
+
+                chatList.add(chat);
+            }
+            if (!Check.isNull(chatList)) {
+                accountReportDailyMapper.replaceBatchConversionChart(chatList);
+            }
+        }
+    }
 }

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

@@ -202,6 +202,8 @@ public class KuaishouUnitReportDailyServiceImpl extends ServiceImpl<KuaishouUnit
             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);
         }
         unitReportDailyMapper.replaceBatch(addList);

+ 88 - 28
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/KuaishouVideoListServiceImpl.java

@@ -5,19 +5,25 @@ import cn.com.ctop.job.kuaishou.data.entity.KuaishouVideoList;
 import cn.com.ctop.job.kuaishou.data.enums.MaterialEnum;
 import cn.com.ctop.job.kuaishou.data.mapper.KuaishouVideoListMapper;
 import cn.com.ctop.job.kuaishou.data.service.IKuaishouVideoListService;
+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.HttpUtils;
 import cn.com.ctop.job.kuaishou.utils.RedisUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -33,6 +39,8 @@ public class KuaishouVideoListServiceImpl extends ServiceImpl<KuaishouVideoListM
     @Value("${api.kuaishou.postUrl}")
     private String postUrl;
 
+    @Autowired
+    private IOauthTokenService tokenService;
     @Resource
     private KuaishouVideoListMapper videoListMapper;
 
@@ -46,7 +54,7 @@ public class KuaishouVideoListServiceImpl extends ServiceImpl<KuaishouVideoListM
 
         log.info("开始获取所有视频信息 accountID:{},page:{}", advertiserId, page);
 
-        List<Object> adAccountList = redisUtil.getList("kuaiShou:allVideo:list",null);
+        List<Object> adAccountList = redisUtil.getList("kuaiShou:allVideo:list", null);
 
         String url = postUrl + KuaishouConstant.VIDEO_LIST;
         Map<String, String> headers = new HashMap<>();
@@ -71,19 +79,19 @@ public class KuaishouVideoListServiceImpl extends ServiceImpl<KuaishouVideoListM
             log.error("获取快手视频列表数据异常:{},accountId:{}", message, advertiserId);
 
             //请求过于频繁
-            if (400001 == code){
-                log.info("定时任务-->>allVideoList<<<<----获取所有快手视频请求频繁,code:{},准备重试,accountId:{},错误消息:{}",code,advertiserId,message);
+            if (400001 == code) {
+                log.info("定时任务-->>allVideoList<<<<----获取所有快手视频请求频繁,code:{},准备重试,accountId:{},错误消息:{}", code, advertiserId, message);
                 //添加重试
-                if (Check.isNull(adAccountList)){
+                if (Check.isNull(adAccountList)) {
                     redisUtil.add("kuaiShou:allVideo:list", Arrays.asList(advertiserId), 1, TimeUnit.HOURS);
-                }else {
+                } else {
                     adAccountList.add(advertiserId);
-                    redisUtil.add("kuaiShou:allVideo:list",adAccountList, 1, TimeUnit.HOURS);
+                    redisUtil.add("kuaiShou:allVideo:list", adAccountList, 1, TimeUnit.HOURS);
                 }
-            }else {
-                if (adAccountList.contains(advertiserId)){
+            } else {
+                if (adAccountList.contains(advertiserId)) {
                     adAccountList.remove(advertiserId);
-                    redisUtil.add("kuaiShou:allVideo:list",advertiserId, 1, TimeUnit.HOURS);
+                    redisUtil.add("kuaiShou:allVideo:list", advertiserId, 1, TimeUnit.HOURS);
                 }
             }
             return;
@@ -146,22 +154,19 @@ public class KuaishouVideoListServiceImpl extends ServiceImpl<KuaishouVideoListM
     }
 
 
-
     /**
-     *
-     * @description: 根据账户获取视频素材-账户下全部视频素材
-     *
      * @param advertiserId
      * @param accessToken
      * @param page
-     * @return: java.util.Map<java.lang.String,java.lang.String>
+     * @description: 根据账户获取视频素材-账户下全部视频素材
+     * @return: java.util.Map<java.lang.String, java.lang.String>
      * @author: zianY
      * @time: 2022/2/9
      */
     @Override
-    public Map<String,String> getKuaishouVideoByAccountId(Long advertiserId, String accessToken,List<String> materialIds, int page) {
-        log.info("调用接口------getKuaishouVideoByAccountId----根据账户获取视频素材---账户--{}===第{}页===》》》",advertiserId,page);
-        Map<String,String> resultMap = new HashMap<>();
+    public Map<String, String> getKuaishouVideoByAccountId(Long advertiserId, String accessToken, List<String> materialIds, int page) {
+        log.info("调用接口------getKuaishouVideoByAccountId----根据账户获取视频素材---账户--{}===第{}页===》》》", advertiserId, page);
+        Map<String, String> resultMap = new HashMap<>();
         String url = postUrl + KuaishouConstant.VIDEO_LIST;
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", accessToken);
@@ -175,29 +180,29 @@ public class KuaishouVideoListServiceImpl extends ServiceImpl<KuaishouVideoListM
             param.put("end_date", endDate);
         }*/
 
-        if (!Check.isNull(materialIds)){
+        if (!Check.isNull(materialIds)) {
             param.put("photo_ids", materialIds);
         }
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
         if (Check.isNull(resultJson)) {
-            resultMap.put("code","0");
-            resultMap.put("message","获取快手视频素材数据为空");
+            resultMap.put("code", "0");
+            resultMap.put("message", "获取快手视频素材数据为空");
             return resultMap;
         }
         Integer code = resultJson.getInteger("code");
         String message = resultJson.getString("message");
         if (null == code || code != 0) {
             log.error("获取快手视频列表数据异常:{},accountId:{}", message, advertiserId);
-            resultMap.put("code","500");
-            resultMap.put("message","账户id:"+advertiserId+"---获取快手视频列表数据异常:"+message);
+            resultMap.put("code", "500");
+            resultMap.put("message", "账户id:" + advertiserId + "---获取快手视频列表数据异常:" + message);
             return resultMap;
         }
         JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
         if (null == details || details.size() <= 0) {
             log.info("快手视频列表信息为空=》accountId:{}", advertiserId);
-            resultMap.put("code","0");
-            resultMap.put("message","获取快手视频素材列表信息为空");
+            resultMap.put("code", "0");
+            resultMap.put("message", "获取快手视频素材列表信息为空");
             return resultMap;
         }
         Boolean toGet = true;
@@ -246,13 +251,68 @@ public class KuaishouVideoListServiceImpl extends ServiceImpl<KuaishouVideoListM
             videoListMapper.replaceBatch(videoGetList);
         }
         if (toGet) {
-            getKuaishouVideoByAccountId(advertiserId, accessToken, materialIds,page + 1);
+            getKuaishouVideoByAccountId(advertiserId, accessToken, materialIds, page + 1);
         } else {
             log.info("视频列表数据获取完成:accountId:{}", advertiserId);
         }
-        resultMap.put("code","0");
-        resultMap.put("message","success");
+        resultMap.put("code", "0");
+        resultMap.put("message", "success");
         return resultMap;
     }
 
+
+    @Override
+    public List<Long> getAccountIds(Long projectId) {
+        return videoListMapper.getAccountIds(projectId);
+    }
+
+    @Override
+    public void getVideosByAccountId(Long accountId, String startTime, String endTime) {
+        String token = tokenService.getByAccountId(accountId);
+        List<String> allPhotos = videoListMapper.getPhototIdsByAccountId(accountId, startTime, endTime);
+        if (!Check.isNull(allPhotos)) {
+            List<List<String>> photoIdList = Lists.partition(allPhotos, 20);
+            for (List<String> photoIds : photoIdList) {
+                getVideoRelateCreatives(token, photoIds, accountId);
+            }
+        }
+    }
+
+    @Override
+    public void getVideoRelateCreatives(String accessToken, List<String> photoIds, Long accountId) {
+        log.info("调用接口------getVideoRelateCreatives----视频关联创意数查询---账户:{} ", accountId);
+        String url = postUrl + KuaishouConstant.VIDEO_RELATE_CREATIVES;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", accessToken);
+        Map<String, Object> param = new HashMap<>();
+        param.put("advertiser_id", accountId);
+        param.put("photo_ids", photoIds);
+        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("调用接口---getVideoRelateCreatives----视频关联创意数查询 返回结果为空");
+            return;
+        }
+        JSONArray list = resultJson.getJSONObject("data").getJSONArray("related_creatives");
+        if (null == list || list.size() <= 0) {
+            log.info("视频关联创意数查询为空=》accountId:{}", accountId);
+            return;
+        }
+        for (int i = 0; i < list.size(); i++) {
+            JSONObject obj = list.getJSONObject(i);
+            obj.put("account_id", accountId);
+            KuaishouVideoList vo = videoListMapper.getByPhotoId(obj.getString("photo_id"), accountId);
+            if (!Check.isNull(vo)) {
+                obj.put("signature", vo.getSignature());
+                obj.put("photo_name", vo.getPhotoName());
+            }
+        }
+        if (!Check.isNull(list)) {
+            videoListMapper.replaceBatchVideoRelateCreatives(list);
+        }
+    }
+
+
 }

+ 104 - 65
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/utils/DateUtils.java

@@ -9,73 +9,112 @@ import java.util.List;
 
 public class DateUtils {
 
-  public static Integer getDateInteger(String date) {
-    if (!Check.isNull(date)) {
-      String replace = date.replace("-", "");
-      return Integer.valueOf(replace);
+    public static Integer getDateInteger(String date) {
+        if (!Check.isNull(date)) {
+            String replace = date.replace("-", "");
+            return Integer.valueOf(replace);
+        }
+        return null;
     }
-    return null;
-  }
-
-  public static String getNowDate(String format) {
-    SimpleDateFormat sdf = new SimpleDateFormat(format);
-    Date date = new Date();
-    return sdf.format(date);
-  }
-
-  public static String getAnotherDay(String format, String date, Integer num) {
-
-    SimpleDateFormat sdf = new SimpleDateFormat(format);
-    Date getDate = null;
-    try {
-      getDate = sdf.parse(date);
-    } catch (ParseException e) {
-      e.printStackTrace();
+    public static Long getDateLong(String date) {
+        if (!Check.isNull(date)) {
+            String replace = date.replace("-", "");
+            return Long.valueOf(replace);
+        }
+        return null;
     }
-    Calendar calendar = Calendar.getInstance();
-    calendar.setTime(getDate);
-    calendar.add(Calendar.DAY_OF_MONTH, num);
-    Date resultDate = calendar.getTime();
-    return sdf.format(resultDate);
-  }
-
-  /**
-   * 获取 两个日期之间的所有 日期
-   * @param startDate
-   * @param endDate
-   */
-  public static List<String> getAllDatesOfTwoTimes(String startDate, String endDate) {
-    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-    List<String> dateList = new ArrayList<String>();
-    try {
-      Date dateOne = sdf.parse(startDate);
-      Date dateTwo = sdf.parse(endDate);
-
-      Calendar calendar = Calendar.getInstance();
-      calendar.setTime(dateOne);
-
-      dateList.add(startDate);
-      while (calendar.getTime().before(dateTwo)) { //倒序时间,顺序after改before其他相应的改动。
-        calendar.add(Calendar.DAY_OF_MONTH, 1);
-        dateList.add(sdf.format(calendar.getTime()));
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
+
+    public static String getNowDate(String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        Date date = new Date();
+        return sdf.format(date);
+    }
+
+    public static String getAnotherDay(String format, String date, Integer num) {
+
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        Date getDate = null;
+        try {
+            getDate = sdf.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(getDate);
+        calendar.add(Calendar.DAY_OF_MONTH, num);
+        Date resultDate = calendar.getTime();
+        return sdf.format(resultDate);
+    }
+
+    /**
+     * 获取 两个日期之间的所有 日期
+     *
+     * @param startDate
+     * @param endDate
+     */
+    public static List<String> getAllDatesOfTwoTimes(String startDate, String endDate) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<String> dateList = new ArrayList<String>();
+        try {
+            Date dateOne = sdf.parse(startDate);
+            Date dateTwo = sdf.parse(endDate);
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(dateOne);
+
+            dateList.add(startDate);
+            while (calendar.getTime().before(dateTwo)) { //倒序时间,顺序after改before其他相应的改动。
+                calendar.add(Calendar.DAY_OF_MONTH, 1);
+                dateList.add(sdf.format(calendar.getTime()));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateList;
+    }
+
+    public static Date addDay(Date date, int day) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DAY_OF_YEAR, day);
+        return calendar.getTime();
     }
-    return dateList;
-  }
-
-  public static Date addDay(Date date, int day) {
-    Calendar calendar = Calendar.getInstance();
-    calendar.setTime(date);
-    calendar.add(Calendar.DAY_OF_YEAR, day);
-    return calendar.getTime();
-  }
-
-  public static Date getNowDate() throws ParseException {
-    SimpleDateFormat dsdf = new SimpleDateFormat("yyyy-MM-dd");
-    String nowDate = getNowDate("yyyy-MM-dd");
-    return dsdf.parse(nowDate);
-  }
 
+    public static Date getNowDate() throws ParseException {
+        SimpleDateFormat dsdf = new SimpleDateFormat("yyyy-MM-dd");
+        String nowDate = getNowDate("yyyy-MM-dd");
+        return dsdf.parse(nowDate);
+    }
+
+    /*
+     日期转换为时间戳(毫秒)
+      */
+    public static long timeToStamp(String timers) {
+        Date d = new Date();
+        long timeStemp = 0;
+        try {
+            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            d = sf.parse(timers);// 日期转换为时间戳
+        } catch (ParseException e) {
+
+            e.printStackTrace();
+        }
+        timeStemp = d.getTime();
+        return timeStemp;
+    }
+
+    /*时间戳(毫秒)转换为日期
+    format:yyyyMMdd 、 yyyy-MM-dd
+    */
+    public static String tempToDate(long millis, String format) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+        Date d1 = new Date(millis);
+        String d2 = simpleDateFormat.format(d1);
+        return d2;
+    }
+
+    public static void main(String[] args) {
+
+        System.out.println(tempToDate(1704858060000L,"yyyy-MMdd"));
+    }
 }

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

@@ -7,6 +7,7 @@ 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.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -138,7 +139,7 @@ public class AccountReportlJob {
         }
 
         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-        String  beforeYesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
+        String beforeYesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
         hourExecutorService.submit(
                 new Runnable() {
                     @Override
@@ -148,4 +149,44 @@ public class AccountReportlJob {
                     }
                 });
     }
+
+    /**
+     * 获取原生效果数据整体概览接口(数据概览、分日转化数据分布、转化漏斗)
+     * 近三天
+     */
+    @XxlJob("effectNativeChartReport")
+    public void effectNativeChartReport() throws Exception {
+        String param = XxlJobHelper.getJobParam(); // 执行参数
+        if (Check.isNull(param)) {
+            log.error("入参为空");
+            return;
+        }
+        String token = tokenService.getByAccountId(Long.valueOf(param));
+        if (Check.isNull(token)) {
+            log.error("此账户未获取到相关token,accountId:{}", param);
+            return;
+        }
+
+        //当天
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        //昨天
+        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        //前天
+        String beforeYesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
+        //大前天
+        String beforeYesterday2 = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -3);
+
+        dailyExecutorService.submit(
+                new Runnable() {
+                    @SneakyThrows
+                    @Override
+                    public void run() {
+                        Thread.sleep(500);
+                        kuaishouAccountReportDailyService.effectNativeChartReport(Long.valueOf(param), token, yesterday, yesterday);
+                        kuaishouAccountReportDailyService.effectNativeChartReport(Long.valueOf(param), token, beforeYesterday, beforeYesterday);
+                        kuaishouAccountReportDailyService.effectNativeChartReport(Long.valueOf(param), token, beforeYesterday2, beforeYesterday2);
+
+                    }
+                });
+    }
 }

+ 48 - 15
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/VideoListJob.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.job.kuaishou.handler;
 
-import cn.com.ctop.job.kuaishou.data.entity.OauthToken;
 import cn.com.ctop.job.kuaishou.data.service.IKuaishouVideoListService;
 import cn.com.ctop.job.kuaishou.data.service.IOauthTokenService;
 import cn.com.ctop.job.kuaishou.data.utils.Check;
@@ -13,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
@@ -27,6 +25,7 @@ public class VideoListJob {
     private static ExecutorService nowExecutorService = Executors.newFixedThreadPool(3);
     private static ExecutorService yesterdayExecutorService = Executors.newFixedThreadPool(3);
     private static ExecutorService allExecutorService = Executors.newFixedThreadPool(3);
+    private static ExecutorService videoRelateCreateCountExecutorService = Executors.newFixedThreadPool(8);
     @Autowired
     private IKuaishouVideoListService videoListService;
 
@@ -113,7 +112,6 @@ public class VideoListJob {
     }
 
 
-
     @Autowired
     private RedisUtil redisUtil;
 
@@ -126,18 +124,18 @@ public class VideoListJob {
     public void allVideoListSupplement() throws Exception {
         //获取视频物料信息异常的key
         Set<String> set = redisUtil.kesy("kuaiShou:allVideo:list*");
-        if (Check.isNull(set)){
-            log.info("快手视频数据暂时无遗漏---》》》日期:{}",DateUtils.getNowDate("yyyy-MM-dd"));
+        if (Check.isNull(set)) {
+            log.info("快手视频数据暂时无遗漏---》》》日期:{}", DateUtils.getNowDate("yyyy-MM-dd"));
             return;
         }
         List<String> list = new ArrayList<>(set);
         for (String key : list) {
             //添加重试
             List<Object> accountList;
-            accountList = redisUtil.getList(key,null);
+            accountList = redisUtil.getList(key, null);
             //遍历key下的所有信息
             for (Object accountId : accountList) {
-                log.info("快手视频遗漏数据补充,accountId:{}",accountId);
+                log.info("快手视频遗漏数据补充,accountId:{}", accountId);
                 String token = tokenService.getByAccountId(Long.valueOf(String.valueOf(accountId)));
                 if (Check.isNull(token)) {
                     log.error("此账户未获取到相关token,accountId:{}", accountId);
@@ -145,14 +143,14 @@ public class VideoListJob {
                 }
 
                 videoListService.getVideoList(Long.valueOf(accountId.toString()), token, null, null, 1);
-                accountList = redisUtil.getList(key,null);
+                accountList = redisUtil.getList(key, null);
 
-                if (accountList.size() == 0){
+                if (accountList.size() == 0) {
                     redisUtil.delete(key);
                 }
 
                 try {
-                    Thread.sleep(1000*2);
+                    Thread.sleep(1000 * 2);
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
@@ -163,10 +161,45 @@ public class VideoListJob {
     }
 
 
-
-
-
-
-
+    /**
+     * 支付宝-拉活-快手
+     * 支付宝-商家码
+     * 支付宝-激活
+     * 快手-瓜子二手车
+     * 瓜子-专项
+     * 百度极速版
+     * 易车
+     * 易车汽车报价
+     * 快手-京东超市-拉新
+     */
+    @XxlJob("getVideoRelateCreateCount")
+    public void getVideoRelateCreateCount() throws Exception {
+        List<Long> projectIds = new ArrayList<>();
+        projectIds.add(50L);
+        projectIds.add(67L);
+        projectIds.add(123L);
+        projectIds.add(2400915L);
+        projectIds.add(7920890L);
+        projectIds.add(12330885L);
+        projectIds.add(14310886L);
+        projectIds.add(14490902L);
+        projectIds.add(15120886L);
+        projectIds.add(15750885L);
+
+        String endTime = DateUtils.getNowDate("yyyy-MM-dd");
+        String startTime = DateUtils.getAnotherDay("yyyy-MM-dd", endTime, -31);
+
+//        String endTime = null;
+//        String startTime = null;
+
+        for (Long projectId : projectIds) {
+            List<Long> accountIds = videoListService.getAccountIds(projectId);
+            if (!Check.isNull(accountIds)) {
+                accountIds.forEach(accountId -> videoRelateCreateCountExecutorService.submit(() -> {
+                    videoListService.getVideosByAccountId(accountId, startTime, endTime);
+                }));
+            }
+        }
+    }
 
 }