Browse Source

Merge remote-tracking branch 'origin/test' into test

syh 5 years ago
parent
commit
fefbdffb56
15 changed files with 248 additions and 157 deletions
  1. 115 47
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  2. 43 76
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialTopMapper.xml
  3. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/MaterialTopVO.java
  4. 6 6
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  5. 6 6
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  6. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialCutFrameTask.java
  7. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  8. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  9. 12 12
      module-common/src/main/java/cn/com/ctop/common/module/utils/CosUtil.java
  10. 1 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  11. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertiserDataService.java
  12. 49 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  13. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/ByteDanceVideoReportDaily.java
  14. 1 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceVideoReportDailyMapper.xml
  15. 2 2
      pom.xml

+ 115 - 47
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -298,64 +298,132 @@ public class CallbackController {
                 return returnMap;
                 return returnMap;
 
 
             }
             }
-
             data.remove("advertiser_ids");
             data.remove("advertiser_ids");
             StringBuilder text = new StringBuilder();
             StringBuilder text = new StringBuilder();
             for (int i = 0; i < advertiser_ids.size(); i++) {
             for (int i = 0; i < advertiser_ids.size(); i++) {
                 Long advertiser_id = advertiser_ids.getLong(i);
                 Long advertiser_id = advertiser_ids.getLong(i);
-                data.put("advertiser_id", advertiser_id);
-                CtopOauthToken token = new CtopOauthToken(advertiserId, data);
-                ctopOauthTokenService.saveOrUpdate(token);
-                //获取广告主信息
-                Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(token.getAccountId() + "");
-                Boolean getSuccess = (Boolean) advertiserDataMap.get("success");
-                if (null == getSuccess || !getSuccess) {
-                    log.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
-                    continue;
-                }
+                JSONObject adJson = advertiserDataService.getAdvertiserList(data.getString("access_token"), advertiser_id);
+                Integer returnCode = adJson.getInteger("code");
+                if (returnCode == 0) {
+                    JSONArray dataArr = adJson.getJSONArray("data");
+                    if (!Check.isNull(dataArr)) {
+                        for (int j = 0; j < dataArr.size(); j++) {
+                            JSONObject dataJson = dataArr.getJSONObject(j);
+                            Long advertiser_id1 = dataJson.getLong("advertiser_id");
+                            data.put("advertiser_id", advertiser_id1);
+                            CtopOauthToken token = new CtopOauthToken(advertiserId, data);
+                            ctopOauthTokenService.saveOrUpdate(token);
+                            //获取广告主信息
+                            Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(token.getAccountId() + "");
+                            Boolean getSuccess = (Boolean) advertiserDataMap.get("success");
+                            if (null == getSuccess || !getSuccess) {
+                                log.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
+                                text.append("账户id:" + advertiser_id + "暂未获取数据权限,请检查账户")
+                                        .append("<br/>");
+                                continue;
+                            }
 
 
-                Long accountId = token.getAccountId();
-                QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
-                userAllocationQueryWrapper.eq("account_id", accountId);
-                userAllocationQueryWrapper.eq("media_id", 1);
-                userAllocationQueryWrapper.orderByDesc("create_time");
-                userAllocationQueryWrapper.last("limit 1");
-                UserAllocation checkUserAllocation = allocationMapper.selectOne(userAllocationQueryWrapper);
-                if (!Check.isNull(checkUserAllocation)) {
-                    text.append("accountId:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定失败,失败原因:已被" + checkUserAllocation.getUserName() + "绑定。")
-                            .append("<br/>");
-                    continue;
-                }
-                text.append("accountId:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定成功。").append("<br/>");
-                String systemType = json.getString("systemType");
-                UserAllocation userAllocation = new UserAllocation();
-                userAllocation.setUserId(userId);
-                userAllocation.setUserName(userName);
-                userAllocation.setAccountId(token.getAccountId());
-                userAllocation.setAdvertiserName(advertiserName);
-                userAllocation.setMediaId(mediaId);
-                userAllocation.setProjectId(projectId);
-                userAllocation.setProjectName(projectName);
-                userAllocation.setSystemType(systemType);
-                userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                userAllocation.setAdvertiserId(advertiserId);
-                userAllocation.setWarningProportion(warningProportion);
-                userAllocation.setWarningAmount(warningAmount);
-                userAllocation.setCreateTime(new Date());
-                userAllocation.setUpdateTime(new Date());
-                int j = allocationMapper.insert(userAllocation);
-                if (j > 0) {
-                    log.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
+                            Long accountId = token.getAccountId();
+                            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
+                            userAllocationQueryWrapper.eq("account_id", accountId);
+                            userAllocationQueryWrapper.eq("media_id", 1);
+                            userAllocationQueryWrapper.orderByDesc("create_time");
+                            userAllocationQueryWrapper.last("limit 1");
+                            UserAllocation checkUserAllocation = allocationMapper.selectOne(userAllocationQueryWrapper);
+                            if (!Check.isNull(checkUserAllocation)) {
+                                text.append("账户id:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定失败,失败原因:已被" + checkUserAllocation.getUserName() + "绑定。")
+                                        .append("<br/>");
+                                continue;
+                            }
+                            text.append("accountId:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定成功。").append("<br/>");
+                            String systemType = json.getString("systemType");
+                            UserAllocation userAllocation = new UserAllocation();
+                            userAllocation.setUserId(userId);
+                            userAllocation.setUserName(userName);
+                            userAllocation.setAccountId(token.getAccountId());
+                            userAllocation.setAdvertiserName(advertiserName);
+                            userAllocation.setMediaId(mediaId);
+                            userAllocation.setProjectId(projectId);
+                            userAllocation.setProjectName(projectName);
+                            userAllocation.setSystemType(systemType);
+                            userAllocation.setAuthName((String) advertiserDataMap.get("name"));
+                            userAllocation.setAdvertiserId(advertiserId);
+                            userAllocation.setWarningProportion(warningProportion);
+                            userAllocation.setWarningAmount(warningAmount);
+                            userAllocation.setCreateTime(new Date());
+                            userAllocation.setUpdateTime(new Date());
+                            int g = allocationMapper.insert(userAllocation);
+                            if (g > 0) {
+                                log.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
+                            }
+                            //账号绑定
+                            bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
+                            new Thread(() -> reportService.loadBytedanceHistoryData(token)).start();
+                        }
+
+                    }
+
+                } else {
+                    data.put("advertiser_id", advertiser_id);
+                    CtopOauthToken token = new CtopOauthToken(advertiserId, data);
+                    ctopOauthTokenService.saveOrUpdate(token);
+                    //获取广告主信息
+                    Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(token.getAccountId() + "");
+                    Boolean getSuccess = (Boolean) advertiserDataMap.get("success");
+                    if (null == getSuccess || !getSuccess) {
+                        log.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
+                        text.append("accountId:" + advertiser_id + "暂未获取数据权限,请检查账户")
+                                .append("<br/>");
+                        continue;
+                    }
+
+                    Long accountId = token.getAccountId();
+                    QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
+                    userAllocationQueryWrapper.eq("account_id", accountId);
+                    userAllocationQueryWrapper.eq("media_id", 1);
+                    userAllocationQueryWrapper.orderByDesc("create_time");
+                    userAllocationQueryWrapper.last("limit 1");
+                    UserAllocation checkUserAllocation = allocationMapper.selectOne(userAllocationQueryWrapper);
+                    if (!Check.isNull(checkUserAllocation)) {
+                        text.append("账户id:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定失败,失败原因:已被" + checkUserAllocation.getUserName() + "绑定。")
+                                .append("<br/>");
+                        continue;
+                    }
+                    text.append("账户id:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定成功。").append("<br/>");
+                    String systemType = json.getString("systemType");
+                    UserAllocation userAllocation = new UserAllocation();
+                    userAllocation.setUserId(userId);
+                    userAllocation.setUserName(userName);
+                    userAllocation.setAccountId(token.getAccountId());
+                    userAllocation.setAdvertiserName(advertiserName);
+                    userAllocation.setMediaId(mediaId);
+                    userAllocation.setProjectId(projectId);
+                    userAllocation.setProjectName(projectName);
+                    userAllocation.setSystemType(systemType);
+                    userAllocation.setAuthName((String) advertiserDataMap.get("name"));
+                    userAllocation.setAdvertiserId(advertiserId);
+                    userAllocation.setWarningProportion(warningProportion);
+                    userAllocation.setWarningAmount(warningAmount);
+                    userAllocation.setCreateTime(new Date());
+                    userAllocation.setUpdateTime(new Date());
+                    int g = allocationMapper.insert(userAllocation);
+                    if (g > 0) {
+                        log.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
+                    }
+                    //账号绑定
+                    bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
+                    new Thread(() -> reportService.loadBytedanceHistoryData(token)).start();
                 }
                 }
-                //账号绑定
-                bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
-                new Thread(() -> reportService.loadBytedanceHistoryData(token)).start();
+
+
             }
             }
 
 
+
             returnMap.put("code", 0);
             returnMap.put("code", 0);
             returnMap.put("desc", text.toString());
             returnMap.put("desc", text.toString());
 
 
-        } catch (Exception e) {
+        } catch (
+                Exception e) {
             e.printStackTrace();
             e.printStackTrace();
             returnMap.put("code", -1);
             returnMap.put("code", -1);
             returnMap.put("desc", "回调token异常");
             returnMap.put("desc", "回调token异常");

+ 43 - 76
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialTopMapper.xml

@@ -4,6 +4,7 @@
     <select id="selectMapsPage" resultType="org.jeecg.modules.ctop.vo.MaterialTopVO">
     <select id="selectMapsPage" resultType="org.jeecg.modules.ctop.vo.MaterialTopVO">
        SELECT
        SELECT
           url,
           url,
+          cover_url,
           name,
           name,
           stat_date ,
           stat_date ,
           sum(cost) as cost,
           sum(cost) as cost,
@@ -28,6 +29,7 @@
         INSERT INTO ctop_material_report_total_result (
         INSERT INTO ctop_material_report_total_result (
             CODE,
             CODE,
             url,
             url,
+            cover_url,
             NAME,
             NAME,
             stat_date,
             stat_date,
             cost,
             cost,
@@ -44,58 +46,36 @@
             media_type
             media_type
         ) SELECT
         ) SELECT
               t2.signature,
               t2.signature,
-              CASE
-                  WHEN (
-                      SELECT
-                          info.url
-                      FROM
-                          ctop_material_info info
-                      WHERE
-                          info. CODE = t2.signature
-                      ORDER BY
-                          create_time DESC
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
-                          SELECT
+              IFNULL((SELECT
                               info.url
                               info.url
                           FROM
                           FROM
                               ctop_material_info info
                               ctop_material_info info
                           WHERE
                           WHERE
-                              info. CODE = t2.signature
+                              info.CODE = t2.signature
                           ORDER BY
                           ORDER BY
                               create_time DESC
                               create_time DESC
-                          LIMIT 1
-                      )
-                  END AS url,
-              CASE
-                  WHEN (
-                      SELECT
-                          info.material_name
-                      FROM
-                          ctop_material_info info
-                      WHERE
-                          info. CODE = t2.signature
-                      ORDER BY
-                          create_time DESC
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
+                          LIMIT 1),'') AS url,
+              			IFNULL((SELECT
+                              info.cover_url
+                          FROM
+                              ctop_material_info info
+                          WHERE
+                              info.CODE = t2.signature
+                          ORDER BY
+                              create_time DESC
+                          LIMIT 1),'') AS cover_url,
+                      IFNULL((
                           SELECT
                           SELECT
                               info.material_name
                               info.material_name
                           FROM
                           FROM
                               ctop_material_info info
                               ctop_material_info info
                           WHERE
                           WHERE
-                              info. CODE = t2.signature
+                              info.CODE = t2.signature
                           ORDER BY
                           ORDER BY
                               create_time DESC
                               create_time DESC
                           LIMIT 1
                           LIMIT 1
-                      )
-                  END AS NAME,
+                      ),'')
+                   AS NAME,
               t1.stat_datetime AS statDate,
               t1.stat_datetime AS statDate,
               sum(t1.cost) AS cost,
               sum(t1.cost) AS cost,
               sum(t1.click) click,
               sum(t1.click) click,
@@ -127,6 +107,7 @@
         INSERT INTO ctop_material_report_total_result (
         INSERT INTO ctop_material_report_total_result (
             CODE,
             CODE,
             url,
             url,
+            cover_url,
             NAME,
             NAME,
             stat_date,
             stat_date,
             cost,
             cost,
@@ -138,50 +119,36 @@
             media_type
             media_type
         ) SELECT
         ) SELECT
               t1.signature AS 'code',
               t1.signature AS 'code',
-              CASE
-                  WHEN (
-                      SELECT
-                          url
-                      FROM
-                          ctop_material_info
-                      WHERE
-                          `code` = t1.signature
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
-                          SELECT
-                              url
+              IFNULL((SELECT
+                              info.url
                           FROM
                           FROM
-                              ctop_material_info
+                              ctop_material_info info
                           WHERE
                           WHERE
-                              `code` = t1.signature
-                          LIMIT 1
-                      )
-                  END AS 'url',
-              CASE
-                  WHEN (
-                      SELECT
-                          material_name
-                      FROM
-                          ctop_material_info
-                      WHERE
-                          `code` = t1.signature
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
+                              info.CODE = t2.signature
+                          ORDER BY
+                              create_time DESC
+                          LIMIT 1),'') AS url,
+              			IFNULL((SELECT
+                              info.cover_url
+                          FROM
+                              ctop_material_info info
+                          WHERE
+                              info.CODE = t2.signature
+                          ORDER BY
+                              create_time DESC
+                          LIMIT 1),'') AS cover_url,
+                      IFNULL((
                           SELECT
                           SELECT
-                              material_name
+                              info.material_name
                           FROM
                           FROM
-                              ctop_material_info
+                              ctop_material_info info
                           WHERE
                           WHERE
-                              `code` = t1.signature
+                              info.CODE = t2.signature
+                          ORDER BY
+                              create_time DESC
                           LIMIT 1
                           LIMIT 1
-                      )
-                  END AS 'name',
+                      ),'')
+                   AS NAME,
               t1.stat_date AS 'stat_date',
               t1.stat_date AS 'stat_date',
               sum(t1.charge) AS 'cost',
               sum(t1.charge) AS 'cost',
               sum(t1.photo_click) AS 'click',
               sum(t1.photo_click) AS 'click',

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/MaterialTopVO.java

@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 @Data
 @Data
 public class MaterialTopVO {
 public class MaterialTopVO {
     private String url;
     private String url;
+    private String coverUrl;
     private String name ;
     private String name ;
     private String statDate;
     private String statDate;
     private BigDecimal cost;
     private BigDecimal cost;

+ 6 - 6
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -58,9 +58,9 @@ spring:
   autoconfigure:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
   datasource:
-    url: jdbc:mysql://172.30.0.4:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-    username: hcst
-    password: test@20190531
+    url: jdbc:mysql://172.30.0.9:6033/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    username: sync
+    password: sync@2020
     driver-class-name: com.mysql.jdbc.Driver
     driver-class-name: com.mysql.jdbc.Driver
     druid:
     druid:
       stat-view-servlet:
       stat-view-servlet:
@@ -97,9 +97,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
       datasource:
         master:
         master:
-          url: jdbc:mysql://172.30.0.4:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: hcst
-          password: test@20190531
+          url: jdbc:mysql://172.30.0.9:6033/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: sync
+          password: sync@2020
           driver-class-name: com.mysql.jdbc.Driver
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           # 多数据源配置
           #multi-datasource1:
           #multi-datasource1:

+ 6 - 6
jeecg-boot-module-system/src/main/resources/application-prod2.yml

@@ -58,9 +58,9 @@ spring:
   autoconfigure:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
   datasource:
-    url: jdbc:mysql://172.30.0.4:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-    username: hcst
-    password: test@20190531
+    url: jdbc:mysql://172.30.0.9:6033/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    username: sync
+    password: sync@2020
     driver-class-name: com.mysql.jdbc.Driver
     driver-class-name: com.mysql.jdbc.Driver
     druid:
     druid:
       stat-view-servlet:
       stat-view-servlet:
@@ -97,9 +97,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
       datasource:
         master:
         master:
-          url: jdbc:mysql://172.30.0.4:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: hcst
-          password: test@20190531
+          url: jdbc:mysql://172.30.0.9:6033/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: sync
+          password: sync@2020
           driver-class-name: com.mysql.jdbc.Driver
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           # 多数据源配置
           #multi-datasource1:
           #multi-datasource1:

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialCutFrameTask.java

@@ -60,4 +60,6 @@ public class MaterialCutFrameTask {
      */
      */
     @ApiModelProperty(value = "updateTime")
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
     private Date updateTime;
+
+    private Integer cloud_type;
 }
 }

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -48,6 +48,10 @@ public class MaterialInfo {
     @Excel(name = "url", width = 15)
     @Excel(name = "url", width = 15)
     @ApiModelProperty(value = "url")
     @ApiModelProperty(value = "url")
     private String url;
     private String url;
+    /**
+     * 封面url
+     */
+    private String coverUrl;
 
 
     /**
     /**
      * 水印素材链接
      * 水印素材链接

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -251,6 +251,7 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
             MaterialCutFrameTask cutFrameTask = new MaterialCutFrameTask();
             MaterialCutFrameTask cutFrameTask = new MaterialCutFrameTask();
             cutFrameTask.setJobStatus(0);
             cutFrameTask.setJobStatus(0);
             cutFrameTask.setJobId(jobId);
             cutFrameTask.setJobId(jobId);
+            cutFrameTask.setCloud_type(2);
             cutFrameTask.setVideoSignature(materialId);
             cutFrameTask.setVideoSignature(materialId);
             cutFrameTaskService.save(cutFrameTask);
             cutFrameTaskService.save(cutFrameTask);
         } catch (Exception e) {
         } catch (Exception e) {

+ 12 - 12
module-common/src/main/java/cn/com/ctop/common/module/utils/CosUtil.java

@@ -17,13 +17,13 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
 
 
-//@Slf4j
+@Slf4j
 public class CosUtil {
 public class CosUtil {
     public static final String secretId = "AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets";
     public static final String secretId = "AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets";
     public static final String secretKey = "tXzuwMfplTTK3c9GFUyETilasvQfePu9";
     public static final String secretKey = "tXzuwMfplTTK3c9GFUyETilasvQfePu9";
     public static final String region = "ap-chongqing";
     public static final String region = "ap-chongqing";
-    public static final String bucket = "part-1301855440";
-    public static final String host = "https://media-1301855440.cos.ap-chongqing.myqcloud.com";
+    public static final String bucket = "media-1301855440";
+    public static final String host = "https://" + bucket +".cos.ap-chongqing.myqcloud.com";
 
 
 
 
     //创建采样视频截图模板
     //创建采样视频截图模板
@@ -46,9 +46,9 @@ public class CosUtil {
 
 
             CreateSampleSnapshotTemplateResponse resp = client.CreateSampleSnapshotTemplate(req);
             CreateSampleSnapshotTemplateResponse resp = client.CreateSampleSnapshotTemplate(req);
 
 
-            System.out.println(CreateSampleSnapshotTemplateRequest.toJsonString(resp));
+            log.info(CreateSampleSnapshotTemplateRequest.toJsonString(resp));
         } catch (TencentCloudSDKException e) {
         } catch (TencentCloudSDKException e) {
-            System.out.println(e.toString());
+            log.error(e.toString());
         }
         }
     }
     }
 
 
@@ -73,9 +73,9 @@ public class CosUtil {
 
 
                 DescribeSampleSnapshotTemplatesResponse resp = client.DescribeSampleSnapshotTemplates(req);
                 DescribeSampleSnapshotTemplatesResponse resp = client.DescribeSampleSnapshotTemplates(req);
 
 
-                System.out.println(DescribeSampleSnapshotTemplatesRequest.toJsonString(resp));
+                log.info(DescribeSampleSnapshotTemplatesRequest.toJsonString(resp));
             } catch (TencentCloudSDKException e) {
             } catch (TencentCloudSDKException e) {
-                System.out.println(e.toString());
+                log.error(e.toString());
             }
             }
     }
     }
 
 
@@ -97,10 +97,10 @@ public class CosUtil {
 
 
                 DescribeTaskDetailResponse resp = client.DescribeTaskDetail(req);
                 DescribeTaskDetailResponse resp = client.DescribeTaskDetail(req);
 
 
-                System.out.println(DescribeTaskDetailRequest.toJsonString(resp));
+                log.info(DescribeTaskDetailRequest.toJsonString(resp));
                 return DescribeTaskDetailRequest.toJsonString(resp);
                 return DescribeTaskDetailRequest.toJsonString(resp);
             } catch (TencentCloudSDKException e) {
             } catch (TencentCloudSDKException e) {
-                System.out.println(e.toString());
+                log.error(e.toString());
                 return null;
                 return null;
             }
             }
     }
     }
@@ -119,16 +119,16 @@ public class CosUtil {
 
 
             MpsClient client = new MpsClient(cred, region, clientProfile);
             MpsClient client = new MpsClient(cred, region, clientProfile);
 
 
-            String params = "{\"InputInfo\":{\"Type\":\"COS\",\"CosInputInfo\":{\"Bucket\":\"" + bucket + "\",\"Region\":\"" + region + "\",\"Object\":\"" + videoPath + "\"}},\"MediaProcessTask\":{\"SampleSnapshotTaskSet\":[{\"Definition\":42095,\"OutputStorage\":{\"Type\":\"COS\",\"CosOutputStorage\":{\"Bucket\":\"part-1301855440\",\"Region\":\"" + region + "\"}},\"OutputObjectPath\":\"" + snapshotPath + "\"}]}}";
+            String params = "{\"InputInfo\":{\"Type\":\"COS\",\"CosInputInfo\":{\"Bucket\":\"" + bucket + "\",\"Region\":\"" + region + "\",\"Object\":\"" + videoPath + "\"}},\"MediaProcessTask\":{\"SampleSnapshotTaskSet\":[{\"Definition\":42095,\"OutputStorage\":{\"Type\":\"COS\",\"CosOutputStorage\":{\"Bucket\":\""+ bucket +"\",\"Region\":\"" + region + "\"}},\"OutputObjectPath\":\"" + snapshotPath + "\"}]}}";
 
 
             ProcessMediaRequest req = ProcessMediaRequest.fromJsonString(params, ProcessMediaRequest.class);
             ProcessMediaRequest req = ProcessMediaRequest.fromJsonString(params, ProcessMediaRequest.class);
 
 
             ProcessMediaResponse resp = client.ProcessMedia(req);
             ProcessMediaResponse resp = client.ProcessMedia(req);
 
 
-            System.out.println(ProcessMediaRequest.toJsonString(resp));
+            log.info(ProcessMediaRequest.toJsonString(resp));
             return ProcessMediaRequest.toJsonString(resp);
             return ProcessMediaRequest.toJsonString(resp);
         } catch (TencentCloudSDKException e) {
         } catch (TencentCloudSDKException e) {
-            System.out.println(e.toString());
+            log.error(e.toString());
             return null;
             return null;
         }
         }
     }
     }

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

@@ -952,14 +952,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     returnMap.put("campaignId", campaignId);
                     returnMap.put("campaignId", campaignId);
                     returnMap.put("success", true);
                     returnMap.put("success", true);
                     // 创建成功 拉取广告组信息
                     // 创建成功 拉取广告组信息
-                    Thread thread = new Thread() {
-                        @Override
-                        public void run() {
-                            getCampaign(accessToken, advertiserId, campaignId);
-                        }
-
-                    };
-                    thread.start();
+                    getCampaign(accessToken, advertiserId, campaignId);
                 } else {
                 } else {
                     log.error("创建广告计划失败,advertiser_id:{},返回信息:{}", advertiserId, resultJson);
                     log.error("创建广告计划失败,advertiser_id:{},返回信息:{}", advertiserId, resultJson);
                     returnMap.put("code", -1);
                     returnMap.put("code", -1);

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertiserDataService.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.toutiao.modules.material.service;
 package cn.com.ctop.toutiao.modules.material.service;
 
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import com.alibaba.fastjson.JSONObject;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
@@ -8,6 +9,8 @@ import java.util.Map;
  * @author jeecg-boot
  * @author jeecg-boot
  */
  */
 public interface IByteDanceAdvertiserDataService {
 public interface IByteDanceAdvertiserDataService {
+    JSONObject getAdvertiserList(String token, Long accountId);
+
     Map<String, Object> getAdvertiserInfo(String accountId);
     Map<String, Object> getAdvertiserInfo(String accountId);
 
 
     Map<String, Object> getAdvertiserPlan(CtopOauthToken token, String ids, String date, String updateDate);
     Map<String, Object> getAdvertiserPlan(CtopOauthToken token, String ids, String date, String updateDate);

+ 49 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -37,6 +37,55 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     private IByteDanceVideoInfoService videoInfoService;
     private IByteDanceVideoInfoService videoInfoService;
 
 
     @Override
     @Override
+    public JSONObject getAdvertiserList(String token, Long accountId) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            String url = "https://ad.oceanengine.com/open_api/2/majordomo/advertiser/select/";
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token);
+            TreeMap<String, Object> params = new TreeMap<>();
+            params.put("advertiser_id", accountId);
+            String result = HttpUtils.httpGetRequest(url, headers, params);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if (Check.isNull(jsonObject)) {
+                throw new Exception("返回结果为空");
+
+            }
+
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                JSONObject data = jsonObject.getJSONObject("data");
+                if (Check.isNull(data)) {
+                    throw new Exception("data为空");
+                }
+                JSONArray list = data.getJSONArray("list");
+                if (Check.isNull(list)) {
+                    throw new Exception("账户列表为空");
+
+                }
+                returnJson.put("code", 0);
+                returnJson.put("data", list);
+
+            } else {
+                returnJson.put("code", -1);
+
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", -1);
+
+        }
+
+
+        return returnJson;
+
+
+    }
+
+    @Override
     public Map<String, Object> getAdvertiserInfo(String accountId) {
     public Map<String, Object> getAdvertiserInfo(String accountId) {
         Map<String, Object> resultMap = new HashMap<>();
         Map<String, Object> resultMap = new HashMap<>();
         CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);
         CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);

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

@@ -62,6 +62,8 @@ public class ByteDanceVideoReportDaily {
 	@Excel(name = "公司素材库提供", width = 15)
 	@Excel(name = "公司素材库提供", width = 15)
     @ApiModelProperty(value = "公司素材库提供")
     @ApiModelProperty(value = "公司素材库提供")
 	private String url;
 	private String url;
+
+	private String coverUrl;
 	/**环比*/
 	/**环比*/
 	@Excel(name = "环比", width = 15)
 	@Excel(name = "环比", width = 15)
     @ApiModelProperty(value = "环比")
     @ApiModelProperty(value = "环比")

+ 1 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceVideoReportDailyMapper.xml

@@ -39,6 +39,7 @@
         a.video_url                              as videoUrl,
         a.video_url                              as videoUrl,
         '-'                                      as materialDesc,
         '-'                                      as materialDesc,
         (select info.url from ctop_material_info info where info.code = a.signature limit 1)                                    as url,
         (select info.url from ctop_material_info info where info.code = a.signature limit 1)                                    as url,
+        (select info.cover_url from ctop_material_info info where info.code = a.signature limit 1)                                    as cover_url,
         (select
         (select
             case when video.material_upload_time is null then '-'
             case when video.material_upload_time is null then '-'
             else video.material_upload_time
             else video.material_upload_time

+ 2 - 2
pom.xml

@@ -395,11 +395,11 @@
             <artifactId>javacv-platform</artifactId>
             <artifactId>javacv-platform</artifactId>
             <version>1.4.2</version>
             <version>1.4.2</version>
         </dependency>
         </dependency>
-        <dependency>
+        <!--<dependency>
             <groupId>com.qcloud</groupId>
             <groupId>com.qcloud</groupId>
             <artifactId>cos_api</artifactId>
             <artifactId>cos_api</artifactId>
             <version>5.6.24</version>
             <version>5.6.24</version>
-        </dependency>
+        </dependency>-->
 
 
         <dependency>
         <dependency>
             <groupId>com.tencentcloudapi</groupId>
             <groupId>com.tencentcloudapi</groupId>