فهرست منبع

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

zhaoxian 4 سال پیش
والد
کامیت
b6c3fe548c
25فایلهای تغییر یافته به همراه847 افزوده شده و 65 حذف شده
  1. 7 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 25 6
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  3. 166 0
      module-common/src/main/java/cn/com/ctop/common/module/enums/BytedanceConvertType.java
  4. 43 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateCreativeJob.java
  5. 19 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateUnitJob.java
  6. 0 2
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAudienceReportJob.java
  7. 13 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  8. 1 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouGroupTemplateController.java
  9. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroupTemplate.java
  10. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java
  11. 3 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupTemplateMapper.xml
  12. 34 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml
  13. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupTemplateService.java
  14. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java
  15. 186 36
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java
  16. 11 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java
  17. 0 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  18. 4 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterial.java
  19. 88 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouVideoEtlInfo.java
  20. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouVideoEtlInfoMapper.java
  21. 8 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouVideoEtlInfoMapper.xml
  22. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouVideoEtlInfoService.java
  23. 186 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouVideoEtlInfoServiceImpl.java
  24. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IReportService.java
  25. 8 9
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

+ 7 - 0
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -839,6 +839,13 @@ public class DateUtils extends PropertyEditorSupport {
         System.err.println(s1);
     }
 
+    public static int getdaysOfTwoDate(String minDate, String date) {
+        Date bigDate = parseDate(date,"yyyy-MM-dd");
+        Date smallDate = parseDate(minDate,"yyyy-MM-dd");
+        int days = (int) ((bigDate.getTime() - smallDate.getTime()) / (1000*3600*24));
+        return days+1;
+    }
+
     /**
      * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd
      * HH:mm:ss“ * @param text String类型的时间值

+ 25 - 6
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -15,15 +15,18 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouCostGroupService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
 import cn.com.ctop.kuaishou.modules.report.service.IRuleKuaiShouPlanService;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatUserListService;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -248,6 +251,12 @@ public class SampleTest {
     }
 
     @Test
+    public void testData11(){
+        CtopOauthToken token =tokenService.getTokenByAccountId(1683711016125448L);
+        reportService.getAdvertiserPlanRuleData(token,new Date(),new Date(), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+    }
+
+    @Test
     public void loadKuaishouAgentData() {
         kuaishouReportDailyAgentService.loginAgent();
         try {
@@ -322,11 +331,6 @@ public class SampleTest {
 //        }
     }
 
-
-    @Autowired
-    private IKuaishouCostGroupService kuaishouCostGroupService;
-    @Autowired
-    private IAlarmEventSendService alarmEventSendService;
     @Autowired
     private IWechatCheckinDataService wechatCheckinDataService;
     @Autowired
@@ -384,6 +388,21 @@ public class SampleTest {
         CtopOauthToken token = tokenService.getTokenByAccountId(9589905L);
         ruleKuaiShouPlanService.cleanRuleDataTarget(token.getAccountId(), 1);
     }
+    @Autowired
+    private IKuaishouVideoEtlInfoService etlInfoService;
+    @Test
+    public void etlKuaishouData(){
+        String dateString = "2020-03-30";
+        Date startDate = DateUtils.parseDate(dateString,"yyyy-MM-dd");
+        for(int i=0;i<=277;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            etlInfoService.etlKuaishouVideoInfo(getDate);
+        }
+    }
 
-
+    @Test
+    public void loadBytedanceVideo(){
+        CtopOauthToken token = tokenService.getTokenByAccountId(1685024266033160L);
+        advertiserDataService.getMaterialList(token);
+    }
 }

+ 166 - 0
module-common/src/main/java/cn/com/ctop/common/module/enums/BytedanceConvertType.java

@@ -0,0 +1,166 @@
+package cn.com.ctop.common.module.enums;
+
+public enum BytedanceConvertType {
+    AD_CONVERT_TYPE_PHONE("AD_CONVERT_TYPE_PHONE", 1L, "电话拨打"),
+    AD_CONVERT_TYPE_FORM("AD_CONVERT_TYPE_FORM", 2L, "表单提交"),
+    AD_CONVERT_TYPE_MAP_SEARCH("AD_CONVERT_TYPE_MAP_SEARCH", 3L, "地图搜索"),
+    AD_CONVERT_TYPE_DOWNLOAD_FINISH("AD_CONVERT_TYPE_DOWNLOAD_FINISH", 4L, "下载完成"),
+    AD_CONVERT_TYPE_BUTTON("AD_CONVERT_TYPE_BUTTON", 5L, "按钮跳转"),
+    AD_CONVERT_TYPE_XPATH("AD_CONVERT_TYPE_XPATH", 6L, "xpath类型转换"),
+    AD_CONVERT_TYPE_VIEW("AD_CONVERT_TYPE_VIEW", 7L, "关键页面浏览"),
+    AD_CONVERT_TYPE_ACTIVE("AD_CONVERT_TYPE_ACTIVE", 8L, "激活"),
+    AD_CONVERT_TYPE_DOWNLOAD_START("AD_CONVERT_TYPE_DOWNLOAD_START", 9L, "下载按钮download_start"),
+    AD_CONVERT_TYPE_QQ("AD_CONVERT_TYPE_QQ", 10L, "qq咨询"),
+    AD_CONVERT_TYPE_LOTTERY("AD_CONVERT_TYPE_LOTTERY", 11L, "抽奖"),
+    AD_CONVERT_TYPE_VOTE("AD_CONVERT_TYPE_VOTE", 12L, "投票"),
+    AD_CONVERT_TYPE_ACTIVE_REGISTER("AD_CONVERT_TYPE_ACTIVE_REGISTER", 13L, "激活且注册"),
+    AD_CONVERT_TYPE_PAY("AD_CONVERT_TYPE_PAY", 14L, "激活且付费"),
+    AD_CONVERT_TYPE_INSTALL_FINISH("AD_CONVERT_TYPE_INSTALL_FINISH", 15L, "安装完成"),
+    AD_CONVERT_TYPE_PHONE_CONFIRM("AD_CONVERT_TYPE_PHONE_CONFIRM", 16L, "智能电话-确认拨打"),
+    AD_CONVERT_TYPE_PHONE_CONNECT("AD_CONVERT_TYPE_PHONE_CONNECT", 17L, "智能电话-确认接通"),
+    AD_CONVERT_TYPE_PHONE_EFFECTIVE("AD_CONVERT_TYPE_PHONE_EFFECTIVE", 18L, "智能电话-有效接通"),
+    AD_CONVERT_TYPE_CONSULT_EFFECTIVE("AD_CONVERT_TYPE_CONSULT_EFFECTIVE", 19L, "有效咨询"),
+    AD_CONVERT_TYPE_APP_ORDER("AD_CONVERT_TYPE_APP_ORDER", 20L, "app内下单(电商)"),
+    AD_CONVERT_TYPE_APP_UV("AD_CONVERT_TYPE_APP_UV", 21L, "app内访问"),
+    AD_CONVERT_TYPE_APP_CART("AD_CONVERT_TYPE_APP_CART", 22L, "app内添加购物车(电商)"),
+    AD_CONVERT_TYPE_APP_PAY("AD_CONVERT_TYPE_APP_PAY", 23L, "app内付费"),
+    AD_CONVERT_TYPE_SALES_LEAD("AD_CONVERT_TYPE_SALES_LEAD", 24L, "销售线索"),
+    AD_CONVERT_TYPE_GAME_ADDICTION("AD_CONVERT_TYPE_GAME_ADDICTION", 25L, "关键行为(原深度转化)"),
+    AD_CONVERT_TYPE_CUSTOMER_EFFECTIVE("AD_CONVERT_TYPE_CUSTOMER_EFFECTIVE", 26L, "有效获客"),
+    AD_CONVERT_TYPE_EFFECTIVE_COPY("AD_CONVERT_TYPE_EFFECTIVE_COPY", 27L, "关键页面到达&有效内容复制"),
+    AD_CONVERT_TYPE_COUPON("AD_CONVERT_TYPE_COUPON", 28L, "卡券领取"),
+    AD_CONVERT_TYPE_APP_DETAIL_UV("AD_CONVERT_TYPE_APP_DETAIL_UV", 29L, "app内详情页到站uv"),
+    AD_CONVERT_TYPE_RSS("AD_CONVERT_TYPE_RSS", 30L, "账号关注"),
+    AD_CONVERT_TYPE_FORM_CONNECT("AD_CONVERT_TYPE_FORM_CONNECT", 31L, "表单提交-已接通"),
+    AD_CONVERT_TYPE_FORM_ANSWER("AD_CONVERT_TYPE_FORM_ANSWER", 32L, "有效沟通"),
+    AD_CONVERT_TYPE_DIALBACK("AD_CONVERT_TYPE_DIALBACK", 33L, "提交回呼电话"),
+    AD_CONVERT_TYPE_DIALBACK_CONFIRM("AD_CONVERT_TYPE_DIALBACK_CONFIRM", 34L, "回呼电话-确认拨打"),
+    AD_CONVERT_TYPE_DIALBACK_CONNECT("AD_CONVERT_TYPE_DIALBACK_CONNECT", 35L, "回呼电话-确认接通"),
+    AD_CONVERT_TYPE_FORM_DEEP("AD_CONVERT_TYPE_FORM_DEEP", 36L, "分层表单"),
+    AD_CONVERT_TYPE_UPDATE_LEVEL("AD_CONVERT_TYPE_UPDATE_LEVEL", 37L, "激活且升级"),
+    AD_CONVERT_TYPE_CREATE_GAMEROLE("AD_CONVERT_TYPE_CREATE_GAMEROLE", 38L, "激活且创建角色"),
+    AD_CONVERT_TYPE_NEXT_DAY_OPEN("AD_CONVERT_TYPE_NEXT_DAY_OPEN", 39L, "激活且次留"),
+    AD_CONVERT_TYPE_INVALID_CLUE("AD_CONVERT_TYPE_INVALID_CLUE", 40L, "无效线索"),
+    AD_CONVERT_TYPE_INTENTION_CLUE("AD_CONVERT_TYPE_INTENTION_CLUE", 41L, "有意向客户"),
+    AD_CONVERT_TYPE_HIGH_VALUE_CLUE("AD_CONVERT_TYPE_HIGH_VALUE_CLUE", 42L, "高价值客户"),
+    AD_CONVERT_TYPE_PAID_CLUE("AD_CONVERT_TYPE_PAID_CLUE", 43L, "已成单"),
+    AD_CONVERT_TYPE_NATIVE_ACTION("AD_CONVERT_TYPE_NATIVE_ACTION", 44L, "原生互动"),
+    AD_CONVERT_TYPE_LIKE_ACTION("AD_CONVERT_TYPE_LIKE_ACTION", 45L, "视频点赞"),
+    AD_CONVERT_TYPE_FOLLOW_ACTION("AD_CONVERT_TYPE_FOLLOW_ACTION", 46L, "账户关注"),
+    AD_CONVERT_TYPE_COMMENT_ACTION("AD_CONVERT_TYPE_COMMENT_ACTION", 47L, "视频评论"),
+    AD_CONVERT_TYPE_LOCATION_ACTION("AD_CONVERT_TYPE_LOCATION_ACTION", 48L, "POI点击"),
+    AD_CONVERT_TYPE_SHOPPING_ACTION("AD_CONVERT_TYPE_SHOPPING_ACTION", 49L, "购物车点击"),
+    AD_CONVERT_TYPE_REDIRECT_TO_SHOP("AD_CONVERT_TYPE_REDIRECT_TO_SHOP", 50L, "调起店铺"),
+    AD_CONVERT_TYPE_LINK_ACTION("AD_CONVERT_TYPE_LINK_ACTION", 51L, "link点击"),
+    AD_CONVERT_TYPE_DEEP_PURCHASE("AD_CONVERT_TYPE_DEEP_PURCHASE", 52L, "多次付费"),
+    AD_CONVERT_TYPE_SUCCESSORDER_ACTION("AD_CONVERT_TYPE_SUCCESSORDER_ACTION", 53L, "小店转化"),
+    AD_CONVERT_TYPE_POI_COLLECT("AD_CONVERT_TYPE_POI_COLLECT", 60L, "poi地址点击"),
+    AD_CONVERT_TYPE_POI_ADDRESS_CLICK("AD_CONVERT_TYPE_POI_ADDRESS_CLICK", 61L, "poi收藏"),
+    AD_CONVERT_TYPE_RESERVATION("AD_CONVERT_TYPE_RESERVATION", 62L, "poi预定"),
+    AD_CONVERT_TYPE_MESSAGE_ACTION("AD_CONVERT_TYPE_MESSAGE_ACTION", 63L, "私信消息"),
+    AD_CONVERT_TYPE_SHARE_ACTION("AD_CONVERT_TYPE_SHARE_ACTION", 65L, "分享"),
+    AD_CONVERT_TYPE_CLICK_LANDING_PAGE("AD_CONVERT_TYPE_CLICK_LANDING_PAGE", 66L, "访问推广详情页"),
+    AD_CONVERT_TYPE_CLICK_SHOPWINDOW("AD_CONVERT_TYPE_CLICK_SHOPWINDOW", 67L, "访问主页商品橱窗"),
+    AD_CONVERT_TYPE_CLICK_DOWNLOAD("AD_CONVERT_TYPE_CLICK_DOWNLOAD", 68L, "访问主页下载应用"),
+    AD_CONVERT_TYPE_CLICK_CALL_DY("AD_CONVERT_TYPE_CLICK_CALL_DY", 69L, "点击主页内电话拨打"),
+    AD_CONVERT_TYPE_CLICK_WEBSITE("AD_CONVERT_TYPE_CLICK_WEBSITE", 70L, "访问主页官网"),
+    AD_CONVERT_PAGE_VIEW("AD_CONVERT_PAGE_VIEW", 93L, "访问目标页面"),
+    AD_CONVERT_TYPE_MESSAGE("AD_CONVERT_TYPE_MESSAGE", 94L, "短信"),
+    AD_CONVERT_TYPE_REDIRECT("AD_CONVERT_TYPE_REDIRECT", 95L, "页面跳转"),
+    AD_CONVERT_TYPE_SHOPPING("AD_CONVERT_TYPE_SHOPPING", 96L, "商品购买"),
+    AD_CONVERT_TYPE_CONSULT("AD_CONVERT_TYPE_CONSULT", 97L, "在线咨询"),
+    AD_CONVERT_TYPE_WECHAT("AD_CONVERT_TYPE_WECHAT", 98L, "微信"),
+    AD_CONVERT_TYPE_OTHER("AD_CONVERT_TYPE_OTHER", 99L, "其他"),
+    AD_CONVERT_TYPE_MULTIPLE("AD_CONVERT_TYPE_MULTIPLE", 100L, "多转化事件"),
+    AD_CONVERT_TYPE_POI_MULTIPLE("AD_CONVERT_TYPE_POI_MULTIPLE", 101L, "POI门店多转化目标"),
+    AD_CONVERT_TYPE_MULTI_NATIVE_ACTION("AD_CONVERT_TYPE_MULTI_NATIVE_ACTION", 102L, "互动"),
+    AD_CONVERT_TYPE_LOAN_COMPLETION("AD_CONVERT_TYPE_LOAN_COMPLETION", 103L, "互联网金融-完件"),
+    AD_CONVERT_TYPE_PRE_LOAN_CREDIT("AD_CONVERT_TYPE_PRE_LOAN_CREDIT", 104L, "互联网金融-预授信"),
+    AD_CONVERT_TYPE_LOAN_CREDIT("AD_CONVERT_TYPE_LOAN_CREDIT", 105L, "互联网金融-授信"),
+    AD_CONVERT_TYPE_IDCARD_INFORMATION("AD_CONVERT_TYPE_IDCARD_INFORMATION", 106L, "身份证信息填写完成"),
+    AD_CONVERT_TYPE_BANKCARD_INFORMATION("AD_CONVERT_TYPE_BANKCARD_INFORMATION", 107L, "银行卡信息填写完成"),
+    AD_CONVERT_TYPE_PERSONAL_INFORMATION("AD_CONVERT_TYPE_PERSONAL_INFORMATION", 108L, "补充个人信息填写完成"),
+    AD_CONVERT_TYPE_CERTIFICATION_INFORMATION("AD_CONVERT_TYPE_CERTIFICATION_INFORMATION", 109L, "用户活体认证信息上传完成"),
+    AD_CONVERT_TYPE_LT_ROI("AD_CONVERT_TYPE_LT_ROI", 110L, "广告变现ROI"),
+    AD_CONVERT_TYPE_LIVE_HOMEPAGE("AD_CONVERT_TYPE_LIVE_HOMEPAGE", 111L, "直播导流"),
+    AD_CONVERT_TYPE_REDIRECT_TO_STORE("AD_CONVERT_TYPE_REDIRECT_TO_STORE", 113L, "店铺导流"),
+    AD_CONVERT_TYPE_FEED_LIVE_HOMEPAGE("AD_CONVERT_TYPE_FEED_LIVE_HOMEPAGE", 120L, "火山feed进入直播页"),
+    AD_CONVERT_TYPE_AUTHORIZATION("AD_CONVERT_TYPE_AUTHORIZATION", 121L, "授权(电商)"),
+    AD_CONVERT_TYPE_COMMODITY_CLICK("AD_CONVERT_TYPE_COMMODITY_CLICK", 122L, "快上电商推广目的"),
+    AD_CONVERT_TYPE_CONSULT_CLUE("AD_CONVERT_TYPE_CONSULT_CLUE", 123L, "留咨咨询"),
+    AD_CONVERT_TYPE_BOOST("AD_CONVERT_TYPE_BOOST", 124L, "自然助推"),
+    AD_CONVERT_TYPE_STAY_TIME("AD_CONVERT_TYPE_STAY_TIME", 125L, "店铺停留"),
+    AD_CONVERT_TYPE_PURCHASE_OF_GOODS("AD_CONVERT_TYPE_PURCHASE_OF_GOODS", 156L, "商品签收"),
+    AD_CONVERT_TYPE_PURCHASE_ROI("AD_CONVERT_TYPE_PURCHASE_ROI", 160L, "付费ROI"),
+    AD_CONVERT_TYPE_LIVE_NATIVE_ACITON("AD_CONVERT_TYPE_LIVE_NATIVE_ACITON", 162L, "直播间原生互动"),
+    AD_CONVERT_TYPE_LIVE_FOLLOW_ACITON("AD_CONVERT_TYPE_LIVE_FOLLOW_ACITON", 163L, "直播间关注"),
+    AD_CONVERT_TYPE_LIVE_COMMENT_ACTION("AD_CONVERT_TYPE_LIVE_COMMENT_ACTION", 164L, "直播间评论"),
+    AD_CONVERT_TYPE_LIVE_GIFT_ACTION("AD_CONVERT_TYPE_LIVE_GIFT_ACTION", 165L, "直播间内打赏"),
+    AD_CONVERT_TYPE_LIVE_SLIDECART_CLICK_ACTION("AD_CONVERT_TYPE_LIVE_SLIDECART_CLICK_ACTION", 166L, "直播间查看购物车"),
+    AD_CONVERT_TYPE_LIVE_CLICK_PRODUCT_ACTION("AD_CONVERT_TYPE_LIVE_CLICK_PRODUCT_ACTION", 167L, "直播间查看商品"),
+    AD_CONVERT_TYPE_LIVE_ENTER_ACTION("AD_CONVERT_TYPE_LIVE_ENTER_ACTION", 171L, "直播间观看"),
+    AD_CONVERT_TYPE_LIVE_SUCCESSORDER_ACTION("AD_CONVERT_TYPE_LIVE_SUCCESSORDER_ACTION", 172L, "直播间成单"),
+    AD_CONVERT_TYPE_NOTIFY_DOWNLOAD("AD_CONVERT_TYPE_NOTIFY_DOWNLOAD", 173L, "预约下载"),
+    AD_CONVERT_TYPE_PREMIUM_PAYMENT("AD_CONVERT_TYPE_PREMIUM_PAYMENT", 174L, "保险支付"),
+    AD_CONVERT_TYPE_MESSAGE_CLICK("AD_CONVERT_TYPE_MESSAGE_CLICK", 177L, "私信点击"),
+    AD_CONVERT_TYPE_UG_ROI("AD_CONVERT_TYPE_UG_ROI", 178L, "内广roi"),
+    AD_CONVERT_TYPE_ENTER_HOMEPAGE("AD_CONVERT_TYPE_ENTER_HOMEPAGE", 181L, "进入个人主页"),
+    AD_CONVERT_TYPE_SHOPPING_CART("AD_CONVERT_TYPE_SHOPPING_CART", 182L, "商品购物车点击"),
+    AD_CONVERT_TYPE_WECHAT_REGISTER("AD_CONVERT_TYPE_WECHAT_REGISTER", 183L, "微信内注册"),
+    AD_CONVERT_TYPE_WECHAT_PAY("AD_CONVERT_TYPE_WECHAT_PAY", 184L, "微信内付费"),
+    AD_CONVERT_TYPE_MESSAGE_INTERACTION("AD_CONVERT_TYPE_MESSAGE_INTERACTION", 185L, "沟通互动"),
+    AD_CONVERT_TYPE_LIVE_STAY_TIME("AD_CONVERT_TYPE_LIVE_STAY_TIME", 186L, "直播间停留"),
+    AD_CONVERT_TYPE_NEW_FOLLOW_ACTION("AD_CONVERT_TYPE_NEW_FOLLOW_ACTION", 187L, "粉丝增长"),
+    AD_CONVERT_TYPE_APPLET_CLICK("AD_CONVERT_TYPE_APPLET_CLICK", 189L, "小程序互动"),
+    AD_CONVERT_TYPE_MESSAGE_SERVICE("AD_CONVERT_TYPE_MESSAGE_SERVICE", 190L, "私信服务"),
+    AD_CONVERT_TYPE_MESSAGE_CLUE("AD_CONVERT_TYPE_MESSAGE_CLUE", 192L, "私信留资"),
+    AD_CONVERT_TYPE_LIVE_FANS_ACTION("AD_CONVERT_TYPE_LIVE_FANS_ACTION", 193L, "直播间加入粉丝团"),
+    AD_CONVERT_TYPE_CLUE_CONFIRM("AD_CONVERT_TYPE_CLUE_CONFIRM", 194L, "回访_信息确认"),
+    AD_CONVERT_TYPE_CLUE_INTERFLOW("AD_CONVERT_TYPE_CLUE_INTERFLOW", 195L, "回访_加为好友"),
+    AD_CONVERT_TYPE_CLUE_HIGH_INTENTION("AD_CONVERT_TYPE_CLUE_HIGH_INTENTION", 196L, "回访_高潜成交"),
+    AD_CONVERT_TYPE_LIVE_COMPONENT_CLICK("AD_CONVERT_TYPE_LIVE_COMPONENT_CLICK", 215L, "组件点击");
+
+
+    private String code;
+    private Long num;
+    private String desc;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public Long getNum() {
+        return num;
+    }
+
+    public void setNum(Long num) {
+        this.num = num;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    BytedanceConvertType(String code, Long num, String desc) {
+        this.code = code;
+        this.num = num;
+        this.desc = desc;
+    }
+
+    public static Long getNum(String code) {
+        for (BytedanceConvertType convertType : BytedanceConvertType.values()) {
+            if (convertType.getCode().equals(code.trim())) {
+                return convertType.getNum();
+            }
+        }
+        return null;
+    }
+}

+ 43 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateCreativeJob.java

@@ -0,0 +1,43 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupTemplate;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class KuaishouCreateCreativeJob {
+
+
+    @Autowired
+    private IKuaiShouGroupTemplateService groupTemplateService;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+
+    @XxlJob("kuaihouCreateCreative")
+    public void execute() {
+        QueryWrapper<KuaiShouGroupTemplate> templateQueryWrapper = new QueryWrapper<>();
+        templateQueryWrapper.eq("task_status", 2);
+        templateQueryWrapper.eq("creative_status", 0);
+        templateQueryWrapper.orderByAsc("create_time");
+        templateQueryWrapper.last("limit 20");
+        List<KuaiShouGroupTemplate> list = groupTemplateService.list(templateQueryWrapper);
+        if (Check.isNull(list)) {
+            return;
+        }
+        for (KuaiShouGroupTemplate template : list) {
+            CtopOauthToken token = tokenService.getTokenByAccountId(template.getAccountId());
+            if (Check.isNull(token)) {
+                continue;
+            }
+            groupTemplateService.createCreative(token.getAccessToken(), template.getUnitId(), template);
+        }
+    }
+}

+ 19 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateUnitJob.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaishouCreateUnitJob {
+
+
+    @Autowired
+    private IKuaiShouGroupTemplateService groupTemplateService;
+
+    @XxlJob("kuaihouCreateUnit")
+    public void execute() {
+        groupTemplateService.createUnit();
+    }
+}

+ 0 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAudienceReportJob.java

@@ -28,8 +28,6 @@ public class KuaishouDailyAudienceReportJob {
     @Autowired
     private IKuaishouAudienceReportDailyService kuaishouAudienceReportDailyService;
     @Autowired
-    private IKuaiShouCampaignService kuaiShouCampaignService;
-    @Autowired
     private IKuaiShouGroupService kuaiShouGroupService;
 
     static ExecutorService executorService = Executors.newFixedThreadPool(6);

+ 13 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -1201,6 +1201,19 @@ public class BatchController {
         return result;
     }
 
+
+    @GetMapping(value = "/getActionBarTextByType")
+    public Result<List<KuaiShouActionBarText>> getActionBarTextByType(Integer type) {
+        Result<List<KuaiShouActionBarText>> result = new Result<>();
+        QueryWrapper<KuaiShouActionBarText> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("type", type);
+        List<KuaiShouActionBarText> list = actionBarTextService.list(queryWrapper);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
+
+
     /**
      * 创建创意
      *

+ 1 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouGroupTemplateController.java

@@ -102,14 +102,12 @@ public class KuaiShouGroupTemplateController {
      */
     @GetMapping(value = "/getApiCreateCount")
     public Result<Integer> getApiCreateCount(Long accountId) {
-
         Result<Integer> result = new Result<>();
         try {
             if (Check.isNull(accountId)) {
                 throw new Exception("accountId参数不能为空");
             }
             String date = DateUtils.getNowDate("yyyy-MM-dd");
-
             Integer count = kuaiShouGroupTemplateService.getApiCreateCount(accountId, date);
             result.setSuccess(true);
             result.setResult(count);
@@ -161,6 +159,7 @@ public class KuaiShouGroupTemplateController {
                                                               HttpServletRequest req) {
         Result<IPage<KuaiShouGroupTemplate>> result = new Result<>();
         QueryWrapper<KuaiShouGroupTemplate> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouGroupTemplate, req.getParameterMap());
+        queryWrapper.orderByDesc("create_time");
         Page<KuaiShouGroupTemplate> page = new Page<KuaiShouGroupTemplate>(pageNo, pageSize);
         IPage<KuaiShouGroupTemplate> pageList = kuaiShouGroupTemplateService.page(page, queryWrapper);
         result.setSuccess(true);

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroupTemplate.java

@@ -212,6 +212,7 @@ public class KuaiShouGroupTemplate {
     private String description;
     private Long siteId;
     private Integer createCreativeCount;
+    private Integer creativeStatus;
     private String creativeReviewDetail;
 
 

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java

@@ -29,4 +29,8 @@ public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouRe
     List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 
     void batchReplace(@Param("addList") List<KuaiShouReportDailyMaterial> addList);
+
+    KuaiShouReportDailyMaterial getEtlDataByParams(@Param("signature")String signature,@Param("date") String date);
+
+    List<KuaiShouReportDailyMaterial> getSignatureByDate(@Param("date")String date);
 }

+ 3 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupTemplateMapper.xml

@@ -4,7 +4,7 @@
 
     <select id="getMd5ByPhotoId" resultType="com.alibaba.fastjson.JSONObject">
     select
-    signature  as 'md5'
+    signature  as 'md5',
     material_type as 'materialType'
     from ctop_kuaishou_video_get
     where  photo_id = #{photoId}
@@ -18,13 +18,13 @@
       url as 'url'
       from ctop_material_cut_frame
       where video_signature = #{md5}
-      limit 15
+      limit 6
     </select>
     <select id="getApiCreateCount" resultType="java.lang.Integer">
     select count(1)
     from
     ctop_kuaishou_creative
-    where  aaccount_id = #{accountId}
+    where  account_id = #{accountId}
     and DATE_FORMAT(creative_create_time,'%Y-%m-%d') = #{date}
     </select>
 

+ 34 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -316,6 +316,39 @@
         ORDER BY
         sum(t1.charge) DESC
     </select>
+    <select id="getEtlDataByParams"
+            resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
+        select
+            channel_type,
+            signature,
+            cover_url,
+            photo_url,
+            min(stat_date)as 'stat_date',
+            sum(charge)as 'charge',
+            sum(photo_click)as 'photo_click',
+            sum(photo_show)as 'photo_show',
+            sum(aclick)as 'aclick',
+            sum(bclick)as 'bclick'
+        from ctop_kuaishou_report_daily_material
+        where
+            signature = #{signature}
+        and
+            stat_date&lt;=#{date}
+        group by signature
+    </select>
+    <select id="getSignatureByDate"
+            resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
+        select
+            distinct signature
+        from
+        ctop_kuaishou_report_daily_material
+        where
+            signature is not null
+        and
+            signature != ''
+        and
+            stat_date = #{date}
+    </select>
 
 
-</mapper>
+</mapper>

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupTemplateService.java

@@ -31,4 +31,6 @@ public interface IKuaiShouGroupTemplateService extends IService<KuaiShouGroupTem
      * @return
      */
     JSONObject getUrlByPhotoId(Long photoId);
+
+    void createCreative(String accessToken, Long unitId, KuaiShouGroupTemplate template);
 }

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java

@@ -20,4 +20,7 @@ public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouRe
 
     void getMaterialReportByAccountIdAndStatDate(Long accountId, String token, String startDate, String endDate, Integer page);
 
+    List<KuaiShouReportDailyMaterial> getSignatureByDate(String date);
+
+    KuaiShouReportDailyMaterial getEtlDataByParams(String signature, String date);
 }

+ 186 - 36
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java

@@ -5,11 +5,9 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupTemplate;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplateTarget;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupTemplateMapper;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouImageGetService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -44,10 +42,18 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
     private IKuaiShouImageGetService imageGetService;
     @Autowired
     private IKuaiShouMaterialUploadService uploadService;
+    @Autowired
+    private IKuaishouTemplateTargetService templateTargetService;
 
-    static ExecutorService executorService = Executors.newFixedThreadPool(10);
-
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
 
+    /**
+     * 提交创建任务
+     *
+     * @param requestJson
+     * @return
+     * @throws Exception
+     */
     @Override
     public JSONObject submitUnitTask(JSONObject requestJson) throws Exception {
         Long accountId = requestJson.getLong("accountId");
@@ -94,14 +100,14 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
         Long app_id = requestJson.getLong("appId");
         Integer show_mode = requestJson.getInteger("showMode");
         Integer speed = requestJson.getInteger("speed");
-        String click_track_url = requestJson.getString("click_track_url");
-        String actionbar_click_url = requestJson.getString("actionbar_click_url");
-        Integer creative_category = requestJson.getInteger("creative_category");
-        JSONArray creative_tag = requestJson.getJSONArray("creative_tag");
-        String creative_name = requestJson.getString("creative_name");
-        String action_bar_text = requestJson.getString("action_bar_text");
+        String click_track_url = requestJson.getString("clickTrackUrl");
+        String actionbar_click_url = requestJson.getString("actionbarClickUrl");
+        Integer creative_category = requestJson.getInteger("creativeCategory");
+        JSONArray creative_tag = requestJson.getJSONArray("creativeTag");
+        String creative_name = requestJson.getString("creativeName");
+        String action_bar_text = requestJson.getString("actionBarText");
         String description = requestJson.getString("description");
-        Long site_id = requestJson.getLong("site_id");
+        Long site_id = requestJson.getLong("siteId");
 
         List<KuaiShouGroupTemplate> templates = new ArrayList<>();
         for (int i = 0; i < createCount; i++) {
@@ -144,7 +150,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                 template.setSceneId(scene_id.toJSONString());
             }
             if (!Check.isNull(unit_type)) {
-                template.setUrlType(unit_type);
+                template.setUnitType(unit_type);
             }
             if (!Check.isNull(begin_time)) {
                 template.setBeginTime(begin_time);
@@ -204,6 +210,8 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                 template.setSiteId(site_id);
             }
             template.setTaskStatus(0);
+            template.setCreativeReviewDetail("创意待创建");
+            template.setCreativeStatus(0);
             templates.add(template);
         }
         boolean b = this.saveBatch(templates);
@@ -218,11 +226,15 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
         return returnJson;
     }
 
+
+    /**
+     * 创建组
+     */
     @Override
     public void createUnit() {
         QueryWrapper<KuaiShouGroupTemplate> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("task_status", 0);
-        queryWrapper.orderByDesc("create_time");
+        queryWrapper.orderByAsc("create_time");
         queryWrapper.last("limit 30");
         List<KuaiShouGroupTemplate> list = this.list(queryWrapper);
         if (Check.isNull(list)) {
@@ -243,12 +255,39 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                     updateTemplate.setTaskStatus(1);
                     updateById(updateTemplate);   // 修改状态为创建中
                     JSONObject createUnitJson = new JSONObject();
-                    createUnitJson.put("campaign_id", template.getCampaignId());
-                    createUnitJson.put("unit_name", template.getUnitName());
 
-                    if (!Check.isNull(template.getTemplateId())) {
-                        createUnitJson.put("template_id", template.getTemplateId());
+                    JSONArray sceneIdArr = JSONArray.parseArray(template.getSceneId());
+                    if (Check.isNull(sceneIdArr)) {
+                        updateTemplate.setTaskStatus(3);
+                        updateTemplate.setReviewDetail("scene_id不能为空");
+                        updateTemplate.setCreativeStatus(3);
+                        updateTemplate.setCreativeReviewDetail("组创建失败");
+                        updateById(updateTemplate);
+                        return;
+                    }
+                    createUnitJson.put("scene_id", sceneIdArr); //资源位置
+                    Integer sceneId = (Integer) sceneIdArr.get(0);
+                    if (sceneId != 5) {
+                        if (!Check.isNull(template.getTemplateId())) {
+                            createUnitJson.put("template_id", template.getTemplateId());
+                        }
+                    } else {
+                        if (!Check.isNull(template.getTemplateId())) {
+                            JSONObject unionJson = getUnionJson(template.getTemplateId());
+                            if (unionJson.getInteger("code") != 0) {
+                                updateTemplate.setTaskStatus(3);
+                                updateTemplate.setReviewDetail(unionJson.getString("message"));
+                                updateTemplate.setCreativeStatus(3);
+                                updateTemplate.setCreativeReviewDetail("组创建失败");
+                                updateById(updateTemplate);
+                                return;
+                            } else {
+                                createUnitJson.put("target", unionJson.getJSONObject("target"));
+                            }
+                        }
                     }
+                    createUnitJson.put("campaign_id", template.getCampaignId());
+                    createUnitJson.put("unit_name", template.getUnitName());
                     if (!Check.isNull(template.getBidType())) {
                         createUnitJson.put("bid_type", template.getBidType()); // 优化目标类型
                     }
@@ -256,7 +295,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                         createUnitJson.put("use_app_market", template.getUseAppMarket()); //优先从系统应用商店下载
                     }
                     if (!Check.isNull(template.getAppStore())) {
-                        createUnitJson.put("app_store", template.getAppStore()); //应用商店列表
+                        createUnitJson.put("app_store", JSONArray.parseArray(template.getAppStore())); //应用商店列表
                     }
                     if (!Check.isNull(template.getBid())) {
                         createUnitJson.put("bid", template.getBid()); //出价
@@ -273,9 +312,6 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                     if (!Check.isNull(template.getDeepConversionBid())) {
                         createUnitJson.put("deep_conversion_bid", template.getDeepConversionBid()); //深度转化目标出价
                     }
-                    if (!Check.isNull(template.getSceneId())) {
-                        createUnitJson.put("scene_id", template.getSceneId()); //资源位置
-                    }
                     if (!Check.isNull(template.getUnitType())) {
                         createUnitJson.put("unit_type", template.getUnitType()); //创意制作方式
                     }
@@ -294,8 +330,8 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                     if (!Check.isNull(template.getConvertId())) {
                         createUnitJson.put("convert_id", template.getConvertId()); //转化目标ID
                     }
-                    if (!Check.isNull(template.getUnitType())) {
-                        createUnitJson.put("url_type", template.getUnitType()); //url类型
+                    if (!Check.isNull(template.getUrlType())) {
+                        createUnitJson.put("url_type", template.getUrlType()); //url类型
                     }
                     if (!Check.isNull(template.getUrl())) {
                         createUnitJson.put("url", template.getUrl()); // 投放链接
@@ -315,7 +351,6 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                     Integer code = (Integer) groupMap.get("code");
                     if (code == 0) {
                         updateTemplate.setTaskStatus(2);
-                        updateTemplate.setCreativeReviewDetail("创意待创建");
                         Long unit = (Long) groupMap.get("unitId");
                         updateTemplate.setUnitId((unit));
                         Thread thread = new Thread() {
@@ -325,15 +360,15 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                             }
                         };
                         thread.start();
-
-
                     } else {
                         updateTemplate.setTaskStatus(3);
                         updateTemplate.setReviewDetail((String) groupMap.get("message"));
+                        updateTemplate.setCreativeStatus(3);
+                        updateTemplate.setCreativeReviewDetail("组创建失败");
                     }
                     updateById(updateTemplate);
                     try {
-                        Thread.sleep(1 * 1000);
+                        Thread.sleep(2 * 1000);
                     } catch (InterruptedException e) {
                         e.printStackTrace();
                     }
@@ -343,22 +378,139 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
 
     }
 
+
+    /**
+     * 根据模板id 获取联盟定向
+     *
+     * @return
+     */
+    private JSONObject getUnionJson(Long templateId) {
+        JSONObject returnJson = new JSONObject();
+        QueryWrapper<KuaishouTemplateTarget> targetQueryWrapper = new QueryWrapper<>();
+        targetQueryWrapper.eq("template_id", templateId);
+        targetQueryWrapper.last("limit 1");
+        KuaishouTemplateTarget templateTarget = templateTargetService.getOne(targetQueryWrapper);
+        if (Check.isNull(templateTarget)) {
+            returnJson.put("code", -1);
+            returnJson.put("message", "根据模板id未获取到模板详情");
+            return returnJson;
+        }
+        JSONObject target = new JSONObject();
+        if (!Check.isNull(templateTarget.getRegion())) {
+            target.put("region", JSONArray.parseArray(templateTarget.getRegion()));
+        }
+
+        if (!Check.isNull(templateTarget.getMax()) && !Check.isNull(templateTarget.getMin())) {
+            JSONObject ageJson = new JSONObject();
+            if (!Check.isNull(templateTarget.getMax())) {
+                ageJson.put("max", templateTarget.getMax());
+            }
+            if (!Check.isNull(templateTarget.getMin())) {
+                ageJson.put("min", templateTarget.getMin());
+            }
+            target.put("age", ageJson);
+        }
+        if (!Check.isNull(templateTarget.getAgesRange())) {
+            target.put("ages_range", JSONArray.parseArray(templateTarget.getAgesRange()));
+        }
+
+        if (!Check.isNull(templateTarget.getGender())) {
+            target.put("gender", templateTarget.getGender());
+        }
+
+        if (!Check.isNull(templateTarget.getPlatformOs())) {
+            target.put("platform_os", templateTarget.getPlatformOs());
+        }
+
+        if (!Check.isNull(templateTarget.getAndroidOsv())) {
+            target.put("android_osv", templateTarget.getAndroidOsv());
+        }
+
+        if (!Check.isNull(templateTarget.getIosOsv())) {
+            target.put("ios_osv", templateTarget.getIosOsv());
+        }
+
+        if (!Check.isNull(templateTarget.getNetwork())) {
+            target.put("network", templateTarget.getNetwork());
+        }
+
+        if (!Check.isNull(templateTarget.getDeviceBrand())) {
+            target.put("device_brand", JSONArray.parseArray(templateTarget.getDeviceBrand()));
+        }
+
+        if (!Check.isNull(templateTarget.getDevicePrice())) {
+            target.put("device_price", JSONArray.parseArray(templateTarget.getDevicePrice()));
+        }
+
+        if (!Check.isNull(templateTarget.getAppInterest())) {
+            target.put("app_interest", JSONArray.parseArray(templateTarget.getAppInterest()));
+        }
+
+        if (!Check.isNull(templateTarget.getAppIds())) {
+            target.put("app_ids", JSONArray.parseArray(templateTarget.getAppIds()));
+        }
+
+        if (!Check.isNull(templateTarget.getPopulation())) {
+            target.put("population", templateTarget.getPopulation());
+        }
+
+        if (!Check.isNull(templateTarget.getExcludePopulation())) {
+            target.put("exclude_population", templateTarget.getExcludePopulation());
+        }
+
+        if (!Check.isNull(templateTarget.getPaidAudience())) {
+            target.put("paid_audience", templateTarget.getPaidAudience());
+        }
+        returnJson.put("target", target);
+        returnJson.put("code", 0);
+        return returnJson;
+    }
+
+    /**
+     * 获取当天api创建创意数
+     *
+     * @param accountId
+     * @param date
+     * @return
+     */
     @Override
     public Integer getApiCreateCount(Long accountId, String date) {
         return groupTemplateMapper.getApiCreateCount(accountId, date);
     }
 
+    /**
+     * 根据photoId 获取视频、封面链接
+     *
+     * @param photoId
+     * @return
+     */
     @Override
     public JSONObject getUrlByPhotoId(Long photoId) {
         return groupTemplateMapper.getUrlByPhotoId(photoId);
     }
 
 
-    private void createCreative(String accessToken, Long unitId, KuaiShouGroupTemplate template) {
+    /**
+     * 创建创意
+     *
+     * @param accessToken
+     * @param unitId
+     * @param template
+     */
+    @Override
+    public void createCreative(String accessToken, Long unitId, KuaiShouGroupTemplate template) {
+        KuaiShouGroupTemplate updateTemplate = new KuaiShouGroupTemplate();
+        updateTemplate.setId(template.getId());
+        updateTemplate.setCreativeStatus(1);
+        updateTemplate.setCreativeReviewDetail("创意创建中");
+        this.updateById(updateTemplate);
         Long photoId = template.getPhotoId();
         JSONObject md5Json = groupTemplateMapper.getMd5ByPhotoId(photoId);
         if (Check.isNull(md5Json)) {
             log.error("未获取到素材详细信息,accountId:{},unitId:{}", template.getAccountId(), unitId);
+            updateTemplate.setCreativeStatus(3);
+            updateTemplate.setCreativeReviewDetail("未获取到素材信息");
+            this.updateById(updateTemplate);
             return;
         }
         String md5 = md5Json.getString("md5");
@@ -375,7 +527,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
             createJson.put("creative_category", template.getCreativeCategory());
         }
         if (!Check.isNull(template.getCreativeTag())) {
-            createJson.put("creative_tag", template.getCreativeTag());
+            createJson.put("creative_tag", JSONArray.parseArray(template.getCreativeTag()));
         }
         Integer materialType = md5Json.getInteger("materialType");
         JSONArray creatives = new JSONArray();
@@ -429,17 +581,15 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
         }
         createJson.put("creatives", creatives);
         Map<String, Object> creativeMap = iKuaishouInterfaceService.batchCreativeCreate(accessToken, template.getAccountId(), createJson, 1, template.getUserId());
-        KuaiShouGroupTemplate updateTemplate = new KuaiShouGroupTemplate();
-        updateTemplate.setId(template.getId());
         Integer code = (Integer) creativeMap.get("code");
         if (code == 0) {
+            updateTemplate.setCreativeStatus(2);
             updateTemplate.setCreativeReviewDetail("创意创建成功");
             updateTemplate.setCreateCreativeCount((Integer) creativeMap.get("count"));
         } else {
-            updateTemplate.setCreativeReviewDetail("创意创建失败:" + creativeMap.get("message"));
+            updateTemplate.setCreativeStatus(3);
+            updateTemplate.setCreativeReviewDetail((String) creativeMap.get("message"));
         }
         this.updateById(updateTemplate);
     }
-
-
 }

+ 11 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java

@@ -9,6 +9,7 @@ import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -93,4 +94,14 @@ public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShou
         dailyMaterialMapper.batchReplace(addList);
         getMaterialReportByAccountIdAndStatDate(accountId, token, startDate, endDate, page + 1);
     }
+
+    @Override
+    public List<KuaiShouReportDailyMaterial> getSignatureByDate(String date) {
+        return dailyMaterialMapper.getSignatureByDate(date);
+    }
+
+    @Override
+    public KuaiShouReportDailyMaterial getEtlDataByParams(String signature, String date) {
+        return dailyMaterialMapper.getEtlDataByParams(signature,date);
+    }
 }

+ 0 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1091,8 +1091,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
                         };
                         thread.start();
-
-
                         returnMap.put("code", 0);
                         returnMap.put("message", "success");
                         returnMap.put("unitId", unitId);

+ 4 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterial.java

@@ -99,19 +99,19 @@ public class KuaiShouReportDailyMaterial {
      */
     @Excel(name = "曝光数", width = 15)
     @ApiModelProperty(value = "曝光数")
-    private Integer photoShow;
+    private Long photoShow;
     /**
      * 素材曝光数
      */
     @Excel(name = "素材曝光数", width = 15)
     @ApiModelProperty(value = "素材曝光数")
-    private Integer aclick;
+    private Long aclick;
     /**
      * 行为数
      */
     @Excel(name = "行为数", width = 15)
     @ApiModelProperty(value = "行为数")
-    private Integer bclick;
+    private Long bclick;
     /**
      * 分享数
      */
@@ -195,7 +195,7 @@ public class KuaiShouReportDailyMaterial {
      */
     @Excel(name = "封面点击数", width = 15)
     @ApiModelProperty(value = "封面点击数")
-    private Integer photoClick;
+    private Long photoClick;
     /**
      * 封面点击率
      */

+ 88 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouVideoEtlInfo.java

@@ -0,0 +1,88 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 快手视频信息清洗表(有效,爆款)
+ * @author jeecg-boot
+ * @date   2020-12-17
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_video_etl_info")
+public class KuaishouVideoEtlInfo {
+
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**视频唯一标识*/
+	private String videoCode;
+	/**初次产生消耗时间*/
+	private String stateDate;
+	/**url*/
+	private String url;
+	/**coverUrl*/
+	private String coverUrl;
+	/**渠道类型*/
+	private String channelType;
+	/**companyName*/
+	private String companyName;
+	/**planId*/
+	private String planId;
+	/**planName*/
+	private String planName;
+	/**clipId*/
+	private String clipId;
+	/**clipName*/
+	private String clipName;
+	/**shotId*/
+	private String shotId;
+	/**shotName*/
+	private String shotName;
+	/**singleWeekCost*/
+	private BigDecimal singleWeekCost;
+	/**twoWeekCost*/
+	private BigDecimal twoWeekCost;
+	/**fourWeekCost*/
+	private BigDecimal fourWeekCost;
+	/**总消耗*/
+	private BigDecimal totalCost;
+	/**photoShow*/
+	private Long photoShow;
+	/**photoClick*/
+	private Long photoClick;
+	/**aclick*/
+	private Long aclick;
+	/**bclick*/
+	private Long bclick;
+	private String effectDate;
+	private String faddishDate;
+	private Integer effectDayNum;
+	private Integer faddishDayNum;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+
+	public KuaishouVideoEtlInfo() {
+	}
+
+	public KuaishouVideoEtlInfo(KuaiShouReportDailyMaterial nowData) {
+		this.url = nowData.getPhotoUrl();
+		this.videoCode  = nowData.getSignature();
+		this.stateDate = nowData.getStatDate();
+		this.channelType = nowData.getChannelType()+"";
+		this.coverUrl = nowData.getCoverUrl();
+		this.totalCost = nowData.getCharge();
+		this.photoClick = nowData.getPhotoClick();
+		this.photoShow =  nowData.getPhotoShow();
+		this.aclick = nowData.getAclick();
+		this.bclick = nowData.getBclick();
+
+	}
+}

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouVideoEtlInfoMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoEtlInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手视频信息清洗表(有效,爆款)
+ * @author: jeecg-boot
+ * @date:   2020-12-17
+ * @cersion: V1.0
+ */
+public interface KuaishouVideoEtlInfoMapper extends BaseMapper<KuaishouVideoEtlInfo> {
+
+    String getCompanyNameByUserId(String planId);
+}

+ 8 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouVideoEtlInfoMapper.xml

@@ -0,0 +1,8 @@
+<?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.kuaishou.modules.report.mapper.KuaishouVideoEtlInfoMapper">
+
+    <select id="getCompanyNameByUserId" resultType="java.lang.String">
+        select company_name from user_company where user_id = #{planId} limit 1
+    </select>
+</mapper>

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouVideoEtlInfoService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.report.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoEtlInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Date;
+
+/**
+ * @Description: 快手视频信息清洗表(有效,爆款)
+ * @Author: jeecg-boot
+ * @Date:   2020-12-17
+ * @Version: V1.0
+ */
+public interface IKuaishouVideoEtlInfoService extends IService<KuaishouVideoEtlInfo> {
+    void etlKuaishouVideoInfo(Date date);
+
+    KuaishouVideoEtlInfo getBySignature(String signature);
+}

+ 186 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouVideoEtlInfoServiceImpl.java

@@ -0,0 +1,186 @@
+package cn.com.ctop.kuaishou.modules.report.service.impl;
+
+import cn.com.ctop.common.module.entity.MaterialAscription;
+import cn.com.ctop.common.module.entity.MaterialInfo;
+import cn.com.ctop.common.module.service.IMaterialAscriptionService;
+import cn.com.ctop.common.module.service.IMaterialInfoService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoEtlInfo;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouVideoEtlInfoMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.opencv.core.Mat;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.logging.Logger;
+
+/**
+ * 快手视频信息清洗表(有效,爆款)
+ * @author jeecg-boot
+ * @date   2020-12-17
+ * @version V1.0
+ */
+@Slf4j
+@Service
+public class KuaishouVideoEtlInfoServiceImpl extends ServiceImpl<KuaishouVideoEtlInfoMapper, KuaishouVideoEtlInfo> implements IKuaishouVideoEtlInfoService {
+    @Autowired
+    private KuaishouVideoEtlInfoMapper kuaishouVideoEtlInfoMapper;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService dailyMaterialService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(50);
+    @Override
+    public void etlKuaishouVideoInfo(Date getDate) {
+        String date = DateUtils.formatDate(getDate);
+        //1:查询单当日视频信息
+        List<KuaiShouReportDailyMaterial> materials = dailyMaterialService.getSignatureByDate(date);
+        if(null!=materials&&!materials.isEmpty()){
+            CountDownLatch countDownLatch= new CountDownLatch(materials.size());
+            materials.forEach(material->{
+                executorService.submit(()->{
+                    try {
+                        if(null == material.getSignature()||material.getSignature().trim().equals("")){
+                            return;
+                        }
+
+                        String signature = material.getSignature();
+                        KuaishouVideoEtlInfo etlInfo = this.getBySignature(signature);
+                        KuaiShouReportDailyMaterial nowData = dailyMaterialService.getEtlDataByParams(signature,date);
+                        String minDate = nowData.getStatDate();
+                        Integer days = DateUtils.getdaysOfTwoDate(minDate,date);
+                        if(null == etlInfo){
+                            //第一次查询的数据
+                            etlInfo = new KuaishouVideoEtlInfo(nowData);
+                            BigDecimal totalCost = etlInfo.getTotalCost();
+                            JSONObject ascription =  materialAscriptionService.getDetailByCode(signature);
+                            String planId = null;
+                            if(null!=ascription){
+                                planId = ascription.getString("planId");
+                                if(null!=planId&&!planId.trim().equals("")){
+                                    etlInfo.setPlanId(planId);
+                                }
+                                String planName =  ascription.getString("planName");
+                                if(null!=planName&&!planName.trim().equals("")){
+                                    etlInfo.setPlanName(planName);
+                                }
+                                String clipId = ascription.getString("clipId");
+                                if(null!=clipId&&!clipId.trim().equals("")){
+                                    etlInfo.setClipId(clipId);
+                                }
+                                String clipName = ascription.getString("clipName");
+                                if(null!=clipName&&!clipName.trim().equals("")){
+                                    etlInfo.setClipName(clipName);
+                                }
+                                String shotId = ascription.getString("shotId");
+                                if(null!=shotId&&!shotId.trim().equals("")){
+                                    etlInfo.setShotId(shotId);
+                                }
+                                String shotName = ascription.getString("shotName");
+                                if(null!=shotName&&!shotName.trim().equals("")){
+                                    etlInfo.setShotName(shotName);
+                                }
+                            }
+                            if(null!=planId){
+                                String companyName = kuaishouVideoEtlInfoMapper.getCompanyNameByUserId(planId);
+                                if (null!=companyName&&!companyName.trim().equals("")){
+                                    etlInfo.setCompanyName(companyName);
+                                }
+                            }
+                            //计算投放总天数
+                            if(days == 7){
+                                etlInfo.setSingleWeekCost(nowData.getCharge());
+                            }
+                            if(days == 14){
+                                etlInfo.setTwoWeekCost(nowData.getCharge());
+                            }
+                            if(days == 28){
+                                etlInfo.setFourWeekCost(nowData.getCharge());
+                            }
+                            //计算是否有效,爆款
+                            if(totalCost.compareTo(new BigDecimal("5000"))>0){
+                                //此刻成为有效
+                                etlInfo.setEffectDate(date);
+                                etlInfo.setEffectDayNum(days);
+                            }
+                            if(totalCost.compareTo(new BigDecimal("100000"))>0){
+                                //此刻成为爆款
+                                etlInfo.setEffectDate(date);
+                                etlInfo.setEffectDayNum(days);
+                            }
+                            etlInfo.setCreateTime(new Date());
+                            etlInfo.setUpdateTime(new Date());
+                            this.save(etlInfo);
+                        }else{
+                            BigDecimal totalCost = etlInfo.getTotalCost();
+                            //只需要更新汇总数据
+                            etlInfo.setTotalCost(nowData.getCharge());
+                            etlInfo.setAclick(nowData.getAclick());
+                            etlInfo.setBclick(nowData.getBclick());
+                            etlInfo.setPhotoClick(nowData.getPhotoClick());
+                            etlInfo.setPhotoShow(nowData.getPhotoShow());
+                            etlInfo.setUpdateTime(new Date());
+                            //计算投放总天数
+                            if(days == 7){
+                                etlInfo.setSingleWeekCost(nowData.getCharge());
+                            }
+                            if(days == 14){
+                                etlInfo.setTwoWeekCost(nowData.getCharge());
+                            }
+                            if(days == 28){
+                                etlInfo.setFourWeekCost(nowData.getCharge());
+                            }
+                            if(null == etlInfo.getEffectDayNum()){
+                                if(totalCost.compareTo(new BigDecimal("5000"))>0){
+                                    //此刻成为有效
+                                    etlInfo.setEffectDate(date);
+                                    etlInfo.setEffectDayNum(days);
+                                }
+                            }
+                            if(null == etlInfo.getFaddishDayNum()){
+                                if(totalCost.compareTo(new BigDecimal("100000"))>0){
+                                    //此刻成为爆款
+                                    etlInfo.setEffectDate(date);
+                                    etlInfo.setEffectDayNum(days);
+                                }
+                            }
+                            this.updateById(etlInfo);
+                        }
+                    }catch (Exception e){
+
+                    }finally {
+                        countDownLatch.countDown();
+                    }
+                });
+            });
+
+            try {
+                countDownLatch.await();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            log.info("{}数据获取完成",date);
+        }
+    }
+
+    @Autowired
+    private IMaterialAscriptionService materialAscriptionService;
+    @Autowired
+    private IMaterialInfoService materialInfoService;
+    @Override
+    public KuaishouVideoEtlInfo getBySignature(String signature) {
+        QueryWrapper<KuaishouVideoEtlInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("video_code",signature).last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IReportService.java

@@ -18,6 +18,8 @@ public interface IReportService {
 
     void getAdvertiserPlanRuleData(CtopOauthToken token, Date startDate, Date endDate, String bytedanceReportTypePl);
 
+    JSONObject readAdConvert(CtopOauthToken token, Long convertId);
+
     void getAdvertiserCreativeReport(CtopOauthToken token, Date startDate, Date endDate, String bytedanceReportTypePL);
 
     void getMaterialReportByPage(CtopOauthToken token, String startDate, String endDate, Integer pageNum);

+ 8 - 9
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
 import cn.com.ctop.common.module.entity.*;
+import cn.com.ctop.common.module.enums.BytedanceConvertType;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
@@ -208,9 +209,10 @@ public class ReportServiceImpl implements IReportService {
                 Long convertId = plan.getConvertId();
                 if(null!=convertId&&convertId!=0){
                     ruleDataPlan.setConvertId(plan.getConvertId());
-                    String deepConvertTarget = readAdConvert(token,plan.getConvertId());
-                    if(null!=deepConvertTarget){
-                        ruleDataPlan.setDeepConvertTarget(deepConvertTarget);
+                    JSONObject convertTargetObject = readAdConvert(token,plan.getConvertId());
+                    if(null != convertTargetObject){
+                        ruleDataPlan.setConvertId(BytedanceConvertType.getNum(convertTargetObject.getString("convert_type")));
+                        ruleDataPlan.setDeepConvertTarget(convertTargetObject.getString("deep_external_action"));
                     }
                 }
                 RuleDataTarget target = new RuleDataTarget();
@@ -295,8 +297,8 @@ public class ReportServiceImpl implements IReportService {
         }
     }
 
-
-    public String readAdConvert(CtopOauthToken token,Long convertId) {
+    @Override
+    public JSONObject readAdConvert(CtopOauthToken token, Long convertId) {
         String url = "https://ad.oceanengine.com/open_api/2/tools/ad_convert/read/";
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
@@ -308,10 +310,7 @@ public class ReportServiceImpl implements IReportService {
             log.error("获取转化数据异常=》account:{};convertId:{};message:{}", token.getAccountId(), convertId,message);
             return  null;
         }
-        if(null!=result.getJSONObject("data")&&null!=result.getJSONObject("data").getString("deep_external_action")&&!"".equals(result.getJSONObject("data").getString("deep_external_action"))){
-            return result.getJSONObject("data").getString("deep_external_action");
-        }
-        return null;
+        return result.getJSONObject("data");
     }