syh преди 5 години
родител
ревизия
c6d672e2ef
променени са 29 файла, в които са добавени 1359 реда и са изтрити 187 реда
  1. 114 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/MybatisPlusConfig.java
  3. 9 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceAdvertiserPostController.java
  4. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java
  5. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java
  6. 1 1
      jeecg-boot-module-system/src/main/resources/application-test.yml
  7. 0 1
      module-common/src/main/java/cn/com/ctop/common/module/entity/HttpClientEntity.java
  8. 25 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/IpPool.java
  9. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/IpPoolMapper.java
  10. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IIpPoolService.java
  11. 69 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/IpPoolServiceImpl.java
  12. 163 22
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpClientUtils.java
  13. 0 10
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils2.java
  14. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/controller/KuaishouWebController.java
  15. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/IKuaishouWebInterfaceService.java
  16. 187 134
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java
  17. 18 0
      module-report/pom.xml
  18. 0 4
      module-report/src/main/java/cn/com/ctop/bytedance/aa.java
  19. 23 0
      module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java
  20. 2 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceCampaignDailyReportMapper.java
  21. 98 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceReportMapper.java
  22. 150 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceReportMapper.xml
  23. 19 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceReportService.java
  24. 312 1
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java
  25. 1 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java
  26. 26 0
      module-report/src/main/java/cn/com/ctop/bytedance/vo/ReportVO.java
  27. 22 8
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceUserOrientationTemplate.java
  28. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceAdvertiserDataService.java
  29. 86 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java

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

@@ -751,4 +751,118 @@ public class DateUtils extends PropertyEditorSupport {
     }
 
 
+    /**
+     * @param format 返回日期格式
+     * @param date   传入的初始日期
+     * @param num    天数
+     * @return
+     * @throws ParseException
+     */
+    public static String getAnotherDay(String format, String date, Integer num) throws ParseException {
+
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        Date date_ = sdf.parse(date);// 将字符串转化为时间格式
+        Calendar calendar = Calendar.getInstance(); // 得到日历
+        calendar.setTime(date_);// 把开始日期赋给日历
+        calendar.add(Calendar.DAY_OF_MONTH, num); // 设置为num天
+        Date resultDate = calendar.getTime(); // 得到时间
+        return sdf.format(resultDate);
+    }
+
+
+    public static String getNowDate(String format) {
+
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+
+        Date date = new Date();
+
+        return sdf.format(date);
+    }
+
+
+    public static String getMonthBefore(String format, String nowTime, int amount) throws ParseException {
+        // 获取当前时间
+        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
+        Date date = dateFormat.parse(nowTime);
+
+        Calendar calendar = Calendar.getInstance(); //得到日历
+        calendar.setTime(date);//把当前时间赋给日历
+        calendar.add(calendar.MONTH, amount); //设置为前2月,可根据需求进行修改
+        date = calendar.getTime();//获取2个月前的时间
+
+        return dateFormat.format(date);
+    }
+
+    public static Map<String, Object> compare_date(String format, String DATE1, String DATE2) {
+
+
+        DateFormat df = new SimpleDateFormat(format);
+        Map<String, Object> map = new HashMap<>();
+        try {
+            Date dt1 = df.parse(DATE1);
+            Date dt2 = df.parse(DATE2);
+            if (dt1.getTime() > dt2.getTime()) {
+                map.put("bigDate", DATE1);
+                map.put("smallDate", DATE2);
+                return map;
+            } else if (dt1.getTime() < dt2.getTime()) {
+                map.put("bigDate", DATE2);
+                map.put("smallDate", DATE1);
+                return map;
+            }
+        } catch (Exception exception) {
+            exception.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 日期中获取年份
+     *
+     * @param format
+     * @param date
+     * @return
+     * @throws ParseException
+     */
+    public static String getYear(String format, String date) throws ParseException {
+
+        SimpleDateFormat df = new SimpleDateFormat(format);
+        Date parse = df.parse(date);
+        return String.format("%tY", parse);
+
+    }
+
+    /**
+     * 日期中获取月份
+     *
+     * @param format
+     * @param date
+     * @return
+     * @throws ParseException
+     */
+    public static String getMonth(String format, String date) throws ParseException {
+
+        SimpleDateFormat df = new SimpleDateFormat(format);
+        Date parse = df.parse(date);
+        return String.format("%tm", parse);
+
+    }
+
+    /**
+     * 日期中获取天
+     *
+     * @param format
+     * @param date
+     * @return
+     * @throws ParseException
+     */
+    public static String getDay(String format, String date) throws ParseException {
+
+        SimpleDateFormat df = new SimpleDateFormat(format);
+        Date parse = df.parse(date);
+        return String.format("%td", parse);
+
+    }
+
+
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/MybatisPlusConfig.java

@@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
  *
  */
 @Configuration
-@MapperScan(value = {"org.jeecg.modules.**.mapper*", "cn.com.ctop.**.mapper*"})
+@MapperScan(value = {"org.jeecg.modules.**.mapper*", "cn.com.ctop.**.mapper*", "cn.com.ctop.bytedance.mapper*"})
 
 public class MybatisPlusConfig {
 

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceAdvertiserPostController.java

@@ -175,6 +175,15 @@ public class ByteDanceAdvertiserPostController {
     }
 
     /**
+     * 14:获取流量包数据
+     */
+    @RequestMapping("/advertiser/custom/package/get")
+    public Map<String, Object> flowPackageGet(String accountId) {
+        return advertiserDataService.flowPackageGet(accountId);
+    }
+
+
+    /**
      * 15:上传视频信息
      *
      * @param accountId 本平台广告主id

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

@@ -25,6 +25,7 @@ public class KuaishouCrawlerJob implements Job {
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         try {
             Integer page = 1;
+            System.out.println("begin");
             QueryWrapper<KuaishouAppAccount> queryWrapper = new QueryWrapper<KuaishouAppAccount>();
             queryWrapper.eq("path","/rest/n/feed/hot");
             List<KuaishouAppAccount> list = kuaishouAppAccountService.list(queryWrapper);

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -342,6 +342,14 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                     JsonNode node = mapper.readTree(res);
                     campaignId = node.get("data").get("campaign_id").asText();
                     System.out.println(res);
+                } else {
+                    header.put("Accept", "application/json, text/javascript, */*; q=0.01");
+                    header.put("Connection", "keep-alive");
+                    header.put("Host", "ad.oceanengine.com");
+                    header.put("Content-Type", "application/json");
+                    header.put("Origin", "https://ad.oceanengine.com");
+                    header.put("X-Requested-With", "XMLHttpRequest");
+                    header.put("Referer", "https://ad.oceanengine.com/pages/campaign/create.html");
                 }
 
                 Integer itratorNum = requestJson.getInteger("itratorNum");
@@ -354,12 +362,16 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                         webDriver.get(url2);
                         header.put("Referer", url2);
                         for (Cookie cookie : webDriver.manage().getCookies()) {
+                            if ("csrftoken".equals(cookie.getName())) {
+                                csrftoken = cookie.getValue();
+                            }
                             BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
                             ck.setDomain("ad.oceanengine.com");
                             ck.setExpiryDate(cookie.getExpiry());
                             ck.setPath(cookie.getPath());
                             HttpUtils2.cookieStore.addCookie(ck);
                         }
+                        header.put("X-CSRFToken", csrftoken);
                         Map<String, Object> audienceParam = new HashMap<>();
                         audienceParam.put("location_type", 4);
                         audienceParam.put("aweme_account_fans", 0);

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -120,7 +120,7 @@ spring:
     port: 6379
 #mybatis plus 设置
 mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/kuaishou/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/crawler/modules/**/xml/*Mapper.xml
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
   global-config:
     # 关闭MP3.0自带的banner
     banner: false

+ 0 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/HttpClientEntity.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.utils.HttpClientUtils;
 import lombok.Data;
 import org.apache.http.client.CookieStore;
 import org.apache.http.impl.client.CloseableHttpClient;

+ 25 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/IpPool.java

@@ -0,0 +1,25 @@
+package cn.com.ctop.common.module.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("ctop_ip_pool")
+public class IpPool {
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+    private String ip;
+    private Integer port;
+    private String city;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date expireTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date lastUseTime;
+    private String isp;
+    private Integer status;
+}

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/IpPoolMapper.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.common.module.mapper;
+
+import cn.com.ctop.common.module.entity.IpPool;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface IpPoolMapper extends BaseMapper<IpPool> {
+}

+ 8 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IIpPoolService.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.IpPool;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IIpPoolService extends IService<IpPool> {
+    public IpPool getAvaliableIp();
+}

+ 69 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/IpPoolServiceImpl.java

@@ -0,0 +1,69 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.IpPool;
+import cn.com.ctop.common.module.mapper.IpPoolMapper;
+import cn.com.ctop.common.module.service.IIpPoolService;
+import cn.com.ctop.common.module.utils.HttpClientUtils;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+@Service
+public class IpPoolServiceImpl extends ServiceImpl<IpPoolMapper, IpPool> implements IIpPoolService {
+
+    public IpPool getAvaliableIp() {
+        QueryWrapper<IpPool> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("status", 1);
+        queryWrapper.gt("expire_time", new Date());
+        queryWrapper.orderByAsc("last_use_time");
+        IpPool ipPool = this.getOne(queryWrapper);
+        if (ipPool == null) {
+            syncIpPool();
+        } else {
+            ipPool.setLastUseTime(new Date());
+            this.updateById(ipPool);
+        }
+        return ipPool;
+    }
+
+    private void syncIpPool() {
+        HttpClientUtils httpClientUtils = new HttpClientUtils();
+        try {
+            String result = httpClientUtils.get("http://d.jghttp.golangapi.com/getip?num=10&type=2&pro=&city=0&yys=0&port=11&pack=14503&ts=1&ys=1&cs=1&lb=1&sb=0&pb=45&mr=2&regions=");
+            ObjectMapper mapper = new ObjectMapper();
+            JsonNode jsonNode = mapper.readTree(result);
+            if (jsonNode.get("code").asInt() == 0) {
+                List<IpPool> ipList = JSON.parseObject(jsonNode.get("data").toString(), new TypeReference<List<IpPool>>() {
+                });
+                if (ipList != null && ipList.size() > 0) {
+                    for (IpPool ipPool : ipList) {
+                        Thread thread = new Thread() {
+                            @Override
+                            public void run() {
+                                Boolean avaliable = httpClientUtils.checkProxyIp(ipPool.getIp(), ipPool.getPort());
+                                if (!avaliable) {
+                                    ipPool.setStatus(2);
+                                    log.info("ip" + ipPool.getIp() + " is not avaliable");
+                                }
+                                save(ipPool);
+                            }
+                        };
+                        thread.start();
+                    }
+//                    this.saveBatch(ipList);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 163 - 22
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpClientUtils.java

@@ -1,12 +1,12 @@
 package cn.com.ctop.common.module.utils;
 
 import cn.com.ctop.common.module.entity.HttpClientEntity;
+import cn.com.ctop.common.module.entity.IpPool;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.gson.Gson;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.NameValuePair;
+import org.apache.http.*;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.CookieSpecs;
@@ -14,6 +14,7 @@ import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
+import org.apache.http.config.ConnectionConfig;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
 import org.apache.http.conn.ssl.TrustStrategy;
 import org.apache.http.cookie.Cookie;
@@ -21,23 +22,26 @@ import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.cookie.BasicClientCookie;
 import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
 import org.apache.http.ssl.SSLContextBuilder;
 import org.apache.http.util.EntityUtils;
 
 import javax.net.ssl.SSLContext;
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 
 @Slf4j
 public class HttpClientUtils {
     public CookieStore cookieStore = new BasicCookieStore();
 
-    public CloseableHttpClient createSSLClientDefault() {
+    public CloseableHttpClient createSSLClientDefault(IpPool ipPool) {
         try {
             SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
                 //信任所有证书
@@ -46,16 +50,71 @@ public class HttpClientUtils {
                     return true;
                 }
             }).build();
-            RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(60000).setSocketTimeout(60000).setCookieSpec(CookieSpecs.STANDARD).build();
-            SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
-            return HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
+            RequestConfig globalConfig = null;
+            SSLConnectionSocketFactory sslFactory = null;
+            ConnectionConfig connectionConfig = ConnectionConfig.custom()
+                    .setBufferSize(4096)
+                    .build();
+            if (ipPool != null) {
+                HttpHost proxy = new HttpHost(ipPool.getIp(), ipPool.getPort(), "http");
+                globalConfig = RequestConfig.custom().setProxy(proxy).setConnectTimeout(60000).setSocketTimeout(60000).setCookieSpec(CookieSpecs.STANDARD).build();
+                sslFactory = new SSLConnectionSocketFactory(sslContext);
+            } else {
+                globalConfig = RequestConfig.custom().setConnectTimeout(60000).setSocketTimeout(60000).setCookieSpec(CookieSpecs.STANDARD).build();
+                sslFactory = new SSLConnectionSocketFactory(sslContext);
+            }
+            return HttpClients.custom().setDefaultConnectionConfig(connectionConfig).setDefaultCookieStore(cookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
         } catch (Exception e) {
             log.error("处理Https证书异常", e);
         }
         return HttpClients.createDefault();
     }
 
+    public Boolean checkProxyIp(String ip, int port) {
+        int status = 0;
+        try {
+            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
+                //信任所有证书
+                @Override
+                public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+                    return true;
+                }
+            }).build();
+            ConnectionConfig connectionConfig = ConnectionConfig.custom()
+                    .setBufferSize(4096)
+                    .build();
+            HttpHost proxy = new HttpHost(ip, port, "http");
+            RequestConfig globalConfig = RequestConfig.custom().setProxy(proxy).setConnectTimeout(1000).setSocketTimeout(1000).setCookieSpec(CookieSpecs.STANDARD).build();
+            SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
+
+            HttpClient httpClient = HttpClients.custom().setDefaultConnectionConfig(connectionConfig).setDefaultCookieStore(cookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
+            HttpGet httpGet = new HttpGet("https://www.baidu.com");
+            status = httpClient.execute(httpGet).getStatusLine().getStatusCode();
+        } catch (Exception e) {
+            log.info("ip: " + ip + " is not aviable");
+        }
+        if (status == 200) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public String get(String urlStr) throws Exception {
+        URL url = new URL(urlStr);
+        URLConnection urlConnection = url.openConnection(); // 打开连接
+        BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream(), "utf-8")); // 获取输入流
+        String line = null;
+        StringBuilder sb = new StringBuilder();
+        while ((line = br.readLine()) != null) {
+            sb.append(line + "\n");
+        }
+        br.close();
+        return sb.toString();
+    }
+
     public HttpClientEntity httpGetRequest(HttpClientEntity httpClientEntity) {
+        String result = null;
         try {
             CookieStore cs = httpClientEntity.getCookieStore();
             if (cs != null) {
@@ -65,10 +124,37 @@ public class HttpClientUtils {
             }
             HttpResponse response = null;
             HttpGet httpGet = new HttpGet(httpClientEntity.getUrl());
-            String result = null;
+
             CloseableHttpClient httpClient = httpClientEntity.getCloseableHttpClient();
             response = httpClient.execute(httpGet);
+            Header[] headers = response.getHeaders("Set-Cookie");
+            if (headers != null && headers.length > 0) {
+                for (Header header : headers) {
+                    String[] cookieArr = header.getValue().split(";");
+                    String[] ck = cookieArr[0].split("=");
+                    BasicClientCookie basicClientCookie = new BasicClientCookie(ck[0], ck[1]);
+                    Map<String, String> cookieMap = new HashMap<>();
+                    if (cookieArr.length > 1) {
+                        for (int i = 1; i < cookieArr.length; i++) {
+                            String[] ckParam = cookieArr[i].split("=");
+                            if (ckParam.length > 1) {
+                                cookieMap.put(ckParam[0].trim(), ckParam[1]);
+                            }
+                        }
+                    }
 
+                    basicClientCookie.setPath(cookieMap.get("Path"));
+                    if (cookieMap.get("Domain") == null || cookieMap.get("Domain").equals("")) {
+                        if (httpClientEntity.getHeaders() != null && httpClientEntity.getHeaders().get("Origin") != null) {
+                            basicClientCookie.setDomain(httpClientEntity.getHeaders().get("Origin").split("//")[1]);
+                        }
+                    } else {
+                        basicClientCookie.setDomain(cookieMap.get("Domain"));
+                    }
+                    basicClientCookie.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+                    cookieStore.addCookie(basicClientCookie);
+                }
+            }
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
                 String newUrl = response.getFirstHeader("Location").getValue();
@@ -86,7 +172,9 @@ public class HttpClientUtils {
             log.info(httpClientEntity.getResult());
         } catch (Exception e) {
             e.printStackTrace();
+            return httpGetRequest(httpClientEntity);
         }
+        httpClientEntity.setResult(result);
         httpClientEntity.setCookieStore(cookieStore);
         return httpClientEntity;
     }
@@ -110,11 +198,35 @@ public class HttpClientUtils {
                 BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(httpClientEntity.getParams().get(key)));
                 paramList.add(basicNameValuePair);
             }
-            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
+            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList, "UTF-8");
             httppost.setEntity(formEntity);
             CloseableHttpClient httpClient = httpClientEntity.getCloseableHttpClient();
             HttpResponse response = httpClient.execute(httppost);
-
+            Header[] headers = response.getHeaders("Set-Cookie");
+            if (headers != null && headers.length > 0) {
+                for (Header header : headers) {
+                    String[] cookieArr = header.getValue().split(";");
+                    String[] ck = cookieArr[0].split("=");
+                    BasicClientCookie basicClientCookie = new BasicClientCookie(ck[0], ck[1]);
+                    Map<String, String> cookieMap = new HashMap<>();
+                    if (cookieArr.length > 1) {
+                        for (int i = 1; i < cookieArr.length; i++) {
+                            String[] ckParam = cookieArr[i].split("=");
+                            if (ckParam.length > 1) {
+                                cookieMap.put(ckParam[0].trim(), ckParam[1]);
+                            }
+                        }
+                    }
+                    basicClientCookie.setPath(cookieMap.get("Path"));
+                    if (cookieMap.get("Domain") == null || cookieMap.get("Domain").equals("")) {
+                        basicClientCookie.setDomain(httpClientEntity.getHeaders().get("Origin").split("//")[1]);
+                    } else {
+                        basicClientCookie.setDomain(cookieMap.get("Domain"));
+                    }
+                    basicClientCookie.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+                    cookieStore.addCookie(basicClientCookie);
+                }
+            }
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
                 String newUrl = response.getFirstHeader("Location").getValue();
@@ -129,9 +241,9 @@ public class HttpClientUtils {
         } catch (Exception e) {
             e.printStackTrace();
             log.error(e.getMessage());
+            return httpGetRequest(httpClientEntity);
         }
         httpClientEntity.setResult(result);
-        System.out.println(new Gson().toJson(cookieStore.getCookies()));
         httpClientEntity.setCookieStore(cookieStore);
         return httpClientEntity;
     }
@@ -154,21 +266,50 @@ public class HttpClientUtils {
         try {
             StringEntity entity = new StringEntity(json, "utf-8");
             httpPost.setEntity(entity);
+            httpPost.setProtocolVersion(HttpVersion.HTTP_1_0);
+            httpPost.addHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
             response = httpClient.execute(httpPost);
-
-            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-            String line = null;
-            StringBuilder builder = new StringBuilder();
-            while ((line = reader.readLine()) != null) {
-                builder.append(line);
+//            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+//            String line = null;
+//            StringBuilder builder = new StringBuilder();
+//            while ((line = reader.readLine()) != null) {
+//                builder.append(line);
+//            }
+            String result = EntityUtils.toString(response.getEntity(), "utf-8");
+            Header[] headers = response.getHeaders("Set-Cookie");
+            if (headers != null && headers.length > 0) {
+                for (Header header : headers) {
+                    String[] cookieArr = header.getValue().split(";");
+                    String[] ck = cookieArr[0].split("=");
+                    BasicClientCookie basicClientCookie = new BasicClientCookie(ck[0], ck[1]);
+                    Map<String, String> cookieMap = new HashMap<>();
+                    if (cookieArr.length > 1) {
+                        for (int i = 1; i < cookieArr.length; i++) {
+                            String[] ckParam = cookieArr[i].split("=");
+                            if (ckParam.length > 1) {
+                                cookieMap.put(ckParam[0].trim(), ckParam[1]);
+                            }
+                        }
+                    }
+                    basicClientCookie.setPath(cookieMap.get("Path"));
+                    if (cookieMap.get("Domain") == null || cookieMap.get("Domain").equals("")) {
+                        basicClientCookie.setDomain(httpClientEntity.getHeaders().get("Origin").split("//")[1]);
+                    } else {
+                        basicClientCookie.setDomain(cookieMap.get("Domain"));
+                    }
+                    basicClientCookie.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+                    cookieStore.addCookie(basicClientCookie);
+                }
             }
-            httpClientEntity.setResult(builder.toString());
+
+//            httpClientEntity.setResult(builder.toString());
+            httpClientEntity.setResult(result);
             log.info(httpClientEntity.getResult());
         } catch (Exception e) {
             e.printStackTrace();
+            return httpGetRequest(httpClientEntity);
         }
         httpClientEntity.setCookieStore(cookieStore);
-        System.out.println(new Gson().toJson(cookieStore.getCookies()));
         return httpClientEntity;
     }
 }

+ 0 - 10
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils2.java

@@ -395,16 +395,6 @@ public class HttpUtils2 {
     public static Integer getKuaishouNumber(String key) {
         if (kuaishouNumberMap == null) {
             kuaishouNumberMap = new HashMap<>();
-//            kuaishouNumberMap.put("32.0#-6.0#526.0#729.0",0);//735
-//            kuaishouNumberMap.put("98.0#13.0#363.0#726.0",1);//713
-//            kuaishouNumberMap.put("32.0#13.0#527.0#732.0",2);//719
-//            kuaishouNumberMap.put("25.0#-6.0#525.0#730.0",3);//736
-//            kuaishouNumberMap.put("26.0#13.0#536.0#731.0",4);//718
-//            kuaishouNumberMap.put("33.0#-5.0#526.0#717.0",5);//722
-//            kuaishouNumberMap.put("39.0#-5.0#530.0#732.0",6);//737
-//            kuaishouNumberMap.put("38.0#13.0#536.0#717.0",7);//704
-//            kuaishouNumberMap.put("33.0#-7.0#525.0#731.0",8);//738
-//            kuaishouNumberMap.put("37.0#-7.0#521.0#730.0",9);//737
             kuaishouNumberMap.put("494.0#735.0", 0);
             kuaishouNumberMap.put("265.0#713.0", 1);
             kuaishouNumberMap.put("495.0#719.0", 2);

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/controller/KuaishouWebController.java

@@ -117,10 +117,10 @@ public class KuaishouWebController {
     }
 
     @PostMapping(value = "/comment/add")
-    public Result<Map<String, Object>> commentAdd(String ksid, String photoId, String principalId, String content, Long replyToCommentId, Long repltTo) {
+    public Result<Map<String, Object>> commentAdd(String ksid, String photoId, String content, Long replyToCommentId, Long repltTo) {
         Result<Map<String, Object>> result = new Result<Map<String, Object>>();
         try {
-            Map<String, Object> statusMap = kuaishouWebInterfaceService.commentAdd(ksid, photoId, principalId, content, replyToCommentId, repltTo);
+            Map<String, Object> statusMap = kuaishouWebInterfaceService.commentAdd(ksid, photoId, content, replyToCommentId, repltTo);
             result.setSuccess(true);
             result.setResult(statusMap);
         } catch (Exception e) {

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/IKuaishouWebInterfaceService.java

@@ -28,7 +28,7 @@ public interface IKuaishouWebInterfaceService {
 
     public Map<String, Object> commentList(String ksid, String photoId, String pcursor);
 
-    public Map<String, Object> commentAdd(String ksid, String photoId, String principalId, String content, Long replyToCommentId, Long replyTo);
+    public Map<String, Object> commentAdd(String ksid, String photoId, String content, Long replyToCommentId, Long replyTo);
 
     public Map<String, Object> subCommentList(String ksid, String photoId, Long rootCommentId, String pcursor);
 }

Файловите разлики са ограничени, защото са твърде много
+ 187 - 134
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java


+ 18 - 0
module-report/pom.xml

@@ -47,4 +47,22 @@
             <scope>compile</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <resources>
+            <!-- 解决MyBatis配置文件引入问题 -->
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <!-- 是否替换资源中的属性-->
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+    </build>
 </project>

+ 0 - 4
module-report/src/main/java/cn/com/ctop/bytedance/aa.java

@@ -1,4 +0,0 @@
-package cn.com.ctop.bytedance;
-
-public class aa {
-}

+ 23 - 0
module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java

@@ -4,9 +4,13 @@ import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 @Slf4j
 @RestController
 @RequestMapping("/ctop/report")
@@ -32,4 +36,23 @@ public class BytedanceReportController {
     }
 
 
+    @PostMapping("/kuaiShou/accountReport")
+    public JSONObject getKuaiShouAccountReport(@RequestBody JSONObject requestJson) {
+        System.err.println(requestJson);
+        JSONObject json = bytedanceReportService.getKuaiShouAccountReport(requestJson);
+        return json;
+
+    }
+
+
+    @PostMapping("/kuaiShou/accountDetailReport")
+    public List<JSONObject> getKuaiShouAccountDetailReport(@RequestBody JSONObject requestJson) {
+        System.err.println(requestJson);
+
+        List<JSONObject> kuaiShouAccounDetailtReport = bytedanceReportService.getKuaiShouAccounDetailtReport(requestJson);
+        return kuaiShouAccounDetailtReport;
+
+    }
+
+
 }

+ 2 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceCampaignDailyReportMapper.java

@@ -1,7 +1,9 @@
 package cn.com.ctop.bytedance.mapper;
 
 import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.vo.ReportVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * @Description: 广告组日报表信息

+ 98 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceReportMapper.java

@@ -1,6 +1,104 @@
 package cn.com.ctop.bytedance.mapper;
 
 
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
 public interface BytedanceReportMapper {
 
+    /**
+     * 今日消耗
+     *
+     * @param date
+     * @return
+     */
+    JSONObject selectDayReport(@Param("date") String date);
+
+
+    /**
+     * 查询明细
+     *
+     * @param date
+     * @return
+     */
+    List<JSONObject> selectReportDetail(@Param("date") String date);
+
+    /**
+     * 根据开始、结束日期查询消耗
+     *
+     * @param anotherDay
+     * @param endDate
+     * @return
+     */
+    JSONObject selectByDate(@Param("startDate") String anotherDay, @Param("endDate") String endDate);
+
+    /**
+     * 查询全部消耗 包括今日消耗
+     *
+     * @return
+     */
+    JSONObject selectAllAccount();
+
+
+    /**
+     * 根据日期 小时 查询信息
+     *
+     * @param date
+     * @param statHour
+     * @return
+     */
+    JSONObject selectYesterdayByHourAndDate(@Param("date") String date, @Param("statHour") String statHour);
+
+    /**
+     * 查询 七天汇总数据
+     *
+     * @param anotherDay
+     * @param endDate
+     * @return
+     */
+    List<JSONObject> selectDayDetailByDate(@Param("startDate") String anotherDay, @Param("endDate") String endDate);
+
+    /**
+     * 按月 明细
+     *
+     * @param anotherDay
+     * @param endDate
+     * @return
+     */
+    List<JSONObject> selectDayDetailByMonth(@Param("startDate") String anotherDay, @Param("endDate") String endDate);
+
+    /**
+     * 查询所有按月统计数据
+     *
+     * @return
+     */
+    List<JSONObject> selectAllDayDetailByMonth();
+
+
+    /**
+     * 根据月份 查询
+     *
+     * @param date
+     * @return
+     */
+    JSONObject selectMonthReportByDate(@Param("date") String date);
+
+
+    /**
+     * 根据月份查询按日明细
+     *
+     * @param date
+     * @return
+     */
+    List<JSONObject> selectDayDetailsByMonth(@Param("date") String date);
+
+    /**
+     * 根据日期查询汇总数据
+     *
+     * @param statDate
+     * @return
+     */
+    JSONObject selectDayDailyByDate(@Param("statDate") String statDate);
 }

+ 150 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceReportMapper.xml

@@ -2,4 +2,154 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceReportMapper">
 
+
+    <select id="selectDayReport" resultType="com.alibaba.fastjson.JSONObject">
+        select
+         sum(charge) cost,
+         sum(photo_show) photoShow,
+         sum(photo_click) photoClick,
+         sum(aclick) aclick
+       from
+        ctop_kuaishou_report_hourly_account
+        where stat_date = #{date}
+      </select>
+
+
+
+    <select id="selectByDate" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick
+     from
+      ctop_kuaishou_report_daily_account
+      where stat_date &lt;= #{startDate}
+      and  stat_date &gt;= #{endDate}
+    </select>
+
+    <select id="selectAllAccount" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick
+     from
+      ctop_kuaishou_report_hourly_account
+    </select>
+
+
+    <select id="selectReportDetail" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick,
+       stat_hour statHour
+     from
+      ctop_kuaishou_report_hourly_account
+      where stat_date = #{date}
+      group by stat_hour
+      order by stat_hour desc
+    </select>
+
+
+    <select id="selectYesterdayByHourAndDate" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick
+     from
+      ctop_kuaishou_report_hourly_account
+      where stat_date = #{date}
+      and stat_hour = #{statHour}
+    </select>
+
+
+    <select id="selectDayDetailByDate" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       charge cost,
+       photo_show photoShow,
+       photo_click photoClick,
+       aclick aclick,
+       stat_date statDate
+     from
+      ctop_kuaishou_report_daily_account
+      where stat_date &lt;= #{startDate}
+      and  stat_date &gt;= #{endDate}
+      order by stat_date desc
+    </select>
+
+
+    <select id="selectDayDetailByMonth" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick,
+       DATE_FORMAT(stat_date,'%Y-%m') statDate
+     from
+      ctop_kuaishou_report_daily_account
+      where stat_date &lt;= #{startDate}
+      and  stat_date &gt;= #{endDate}
+      group by DATE_FORMAT(stat_date,'%Y-%m')
+      order by stat_date desc
+    </select>
+
+    <select id="selectAllDayDetailByMonth" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick,
+       DATE_FORMAT(stat_date,'%Y-%m') statDate
+     from
+      ctop_kuaishou_report_daily_account
+      group by DATE_FORMAT(stat_date,'%Y-%m')
+      order by stat_date desc
+    </select>
+
+
+    <select id="selectMonthReportByDate" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick,
+       DATE_FORMAT(stat_date,'%Y-%m') statDate
+     from
+      ctop_kuaishou_report_daily_account
+      where DATE_FORMAT(stat_date,'%Y-%m') = #{date}
+    </select>
+
+
+    <select id="selectDayDetailsByMonth" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick,
+       stat_date statDate
+     from
+      ctop_kuaishou_report_daily_account
+      where DATE_FORMAT(stat_date,'%Y-%m') = #{date}
+      group by stat_date
+      order by stat_date desc
+    </select>
+
+
+    <select id="selectDayDailyByDate" resultType="com.alibaba.fastjson.JSONObject">
+      select
+       sum(charge) cost,
+       sum(photo_show) photoShow,
+       sum(photo_click) photoClick,
+       sum(aclick) aclick,
+       stat_date statDate
+     from
+      ctop_kuaishou_report_daily_account
+      where stat_date = #{statDate}
+      group by stat_date
+    </select>
+
 </mapper>

+ 19 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceReportService.java

@@ -2,6 +2,25 @@ package cn.com.ctop.bytedance.service;
 
 import com.alibaba.fastjson.JSONObject;
 
+import java.util.List;
+
 public interface IBytedanceReportService {
     JSONObject getAccountReport(String loginId);
+
+    /**
+     * 快手 大盘报表
+     *
+     * @param requestJson
+     * @return
+     */
+    JSONObject getKuaiShouAccountReport(JSONObject requestJson);
+
+
+    /**
+     * 获取明细
+     *
+     * @param
+     * @return
+     */
+    List<JSONObject> getKuaiShouAccounDetailtReport(JSONObject requestJson);
 }

+ 312 - 1
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java

@@ -2,6 +2,7 @@ package cn.com.ctop.bytedance.service.impl;
 
 import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
 import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper;
+import cn.com.ctop.bytedance.mapper.BytedanceCampaignDailyReportMapper;
 import cn.com.ctop.bytedance.mapper.BytedanceReportMapper;
 import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import cn.com.ctop.common.module.entity.UserAllocation;
@@ -12,11 +13,14 @@ import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapp
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class BytedanceReportServiceImpl implements IBytedanceReportService {
@@ -27,7 +31,7 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
     private BytedanceAdvertiserDailyReportMapper bytedanceAdvertiserDailyReportMapper;
 
     @Autowired
-    private BytedanceReportMapper bytedanceReportMapper;
+    private BytedanceReportMapper reportMapper;
 
     @Autowired
     private KuaishouReportDailyAccountMapper kuaishouReportDailyAccountMapper;
@@ -185,5 +189,312 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
         return returnJson;
     }
 
+    /**
+     * 快手-大盘报表
+     *
+     * @param requestJson
+     * @return
+     */
+    @Autowired
+    private BytedanceCampaignDailyReportMapper campaignDailyReportMapper;
+
+    @Override
+    public JSONObject getKuaiShouAccountReport(JSONObject requestJson) {
+        Integer type = requestJson.getInteger("type");
+        JSONObject accountJson = new JSONObject();
+
+        try {
+            String nowDate = DateUtils.getNowDate("yyyy-MM-dd"); // 当前日期
+            String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1); // 当前日期-1
+            if (type == 1) { // 今日总消耗
+                accountJson = reportMapper.selectDayReport(nowDate);
+                if (!Check.isNull(accountJson)) {
+                    JSONObject yesterJson = reportMapper.selectDayReport(anotherDay);
+                    if (!Check.isNull(yesterJson)) {
+                        BigDecimal cost = accountJson.getBigDecimal("cost"); // 今日消耗
+                        BigDecimal yesterCost = yesterJson.getBigDecimal("cost");// 昨日消耗
+                        BigDecimal compareBigDecima = new BigDecimal(0);
+                        if (yesterCost.compareTo(compareBigDecima) != 0) {
+                            BigDecimal costProportion = (cost.subtract(yesterCost)).divide(yesterCost, BigDecimal.ROUND_HALF_UP);
+                            accountJson.put("costProportion", costProportion); // 较昨日增加比例
+                        } else {
+                            accountJson.put("costProportion", 0); // 较昨日增加比例
+                        }
+
+                        Long photoShow = accountJson.getLong("photoShow");// 今日封面展示
+                        Long yesterPhotoShow = yesterJson.getLong("photoShow");// 昨日封面展示
+                        if (yesterPhotoShow != 0L) {
+                            double showProportion = (photoShow.doubleValue() - yesterPhotoShow.doubleValue()) / yesterPhotoShow.doubleValue();
+                            accountJson.put("showProportion", showProportion); // 较昨日增加比例
+                        } else {
+                            accountJson.put("showProportion", 0); // 较昨日增加比例
+                        }
+
+                        Long photoClick = accountJson.getLong("photoClick");// 今日封面展示
+                        Long yesterphotoClick = yesterJson.getLong("photoShow");// 昨日封面展示
+                        if (yesterPhotoShow != 0L) {
+                            double photoClickProportion = (photoClick.doubleValue() - yesterphotoClick.doubleValue()) / yesterphotoClick.doubleValue();
+                            accountJson.put("photoClickProportion", photoClickProportion); // 较昨日增加比例
+                        } else {
+                            accountJson.put("photoClickProportion", 0); // 较昨日增加比例
+                        }
+
+                        Long aclick = accountJson.getLong("aclick");// 今日封面展示
+                        Long yesterAclick = yesterJson.getLong("photoShow");// 昨日封面展示
+                        if (yesterPhotoShow != 0L) {
+                            double aClickProportion = (aclick.doubleValue() - yesterAclick.doubleValue()) / yesterAclick.doubleValue();
+                            accountJson.put("aClickProportion", aClickProportion); // 较昨日增加比例
+                        } else {
+                            accountJson.put("aClickProportion", 0); // 较昨日增加比例
+                        }
+
+                    }
+                }
+            } else if (type == 2) { // 昨日总消耗
+                accountJson = reportMapper.selectDayReport(anotherDay);
+
+            } else if (type == 3) { // 近七天
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                accountJson = reportMapper.selectByDate(anotherDay, endDate);
 
+            } else if (type == 4) { // 近15天
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                accountJson = reportMapper.selectByDate(anotherDay, endDate);
+
+            } else if (type == 5) {// 近一个月
+                String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
+                accountJson = reportMapper.selectByDate(anotherDay, endDate);
+
+            } else if (type == 6) {// 近三个月
+                String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -3);
+                accountJson = reportMapper.selectByDate(anotherDay, endDate);
+
+            } else if (type == 7) {// 近六个月
+                String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -6);
+                accountJson = reportMapper.selectByDate(anotherDay, endDate);
+
+            } else if (type == 8) {  // 所有
+                accountJson = reportMapper.selectAllAccount();
+
+            } else if (type == 9) {  // 自定义查询日期
+                String startDate = requestJson.getString("startDate");
+                String endDate = requestJson.getString("endDate");
+                accountJson = reportMapper.selectByDate(startDate, endDate);
+            } else if (type == 10) {
+                String sign = requestJson.getString("sign");
+                String bigDate = requestJson.getString("bigDate");
+                String smallDate = requestJson.getString("smallDate");
+                if ("month".equals(sign)) {
+                    Map<String, Object> dateMap = DateUtils.compare_date("yyyy-MM", bigDate, smallDate);
+                    JSONObject beComparedJson = reportMapper.selectMonthReportByDate((String) dateMap.get("smallDate"));   // 被除数数据
+                    JSONObject comparedJson = reportMapper.selectMonthReportByDate((String) dateMap.get("bigDate"));   // 除数数据
+                    BigDecimal cost = comparedJson.getBigDecimal("cost");
+                    BigDecimal comparedCost = beComparedJson.getBigDecimal("cost");
+
+                    if (comparedCost.compareTo(new BigDecimal(0)) != 0) {
+                        BigDecimal costProportion = (cost.subtract(comparedCost)).divide(comparedCost, BigDecimal.ROUND_HALF_UP);
+                        comparedJson.put("costProportion", costProportion);
+                    } else {
+                        comparedJson.put("costProportion", 0);
+                    }
+
+                    Long photoClick = comparedJson.getLong("photoClick");
+                    Long comparedPhotoClick = beComparedJson.getLong("photoShow");
+                    if (comparedPhotoClick != 0L) {
+                        double photoClickProportion = (photoClick.doubleValue() - comparedPhotoClick.doubleValue()) / comparedPhotoClick.doubleValue();
+                        comparedJson.put("photoClickProportion", photoClickProportion);
+                    } else {
+                        comparedJson.put("photoClickProportion", 0);
+                    }
+                    Long comparedPhotoShow = beComparedJson.getLong("photoShow");
+                    Long photoShow = comparedJson.getLong("photoShow");
+                    if (comparedPhotoShow != 0L) {
+                        double showProportion = (photoShow.doubleValue() - comparedPhotoShow.doubleValue()) / comparedPhotoShow.doubleValue();
+                        comparedJson.put("showProportion", showProportion);
+                    } else {
+                        comparedJson.put("showProportion", 0);
+                    }
+                    Long aClick = comparedJson.getLong("aclick");
+                    Long comparedAclick = beComparedJson.getLong("photoShow");
+                    if (comparedAclick != 0L) {
+                        double aClickProportion = (aClick.doubleValue() - comparedAclick.doubleValue()) / comparedAclick.doubleValue();
+                        comparedJson.put("comparedAclick", aClickProportion);
+                    } else {
+                        comparedJson.put("comparedAclick", 0);
+                    }
+                    accountJson.put("beCompared", beComparedJson);
+                    accountJson.put("compared", comparedJson);
+                }
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        System.err.println(accountJson);
+        return accountJson;
+    }
+
+    @Override
+    public List<JSONObject> getKuaiShouAccounDetailtReport(JSONObject requestJson) {
+        Integer type = requestJson.getInteger("type");
+        List<JSONObject> detail = new ArrayList<>();
+        try {
+            String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+            String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+            if (type == 1) { //  今日明细
+                List<JSONObject> dayDetail = reportMapper.selectReportDetail(nowDate);
+                for (int i = 0; i < dayDetail.size(); i++) {
+                    JSONObject detailJson = dayDetail.get(i);
+                    String statHour = detailJson.getString("statHour");
+                    JSONObject yesterDayJson = reportMapper.selectYesterdayByHourAndDate(anotherDay, statHour);
+                    if (!Check.isNull(yesterDayJson)) {
+                        BigDecimal cost = detailJson.getBigDecimal("cost"); // 今日消耗
+                        BigDecimal yesterCost = yesterDayJson.getBigDecimal("cost");// 昨日消耗
+                        BigDecimal compareBigDecima = new BigDecimal(0);
+                        if (yesterCost.compareTo(compareBigDecima) != 0) {
+                            BigDecimal costProportion = (cost.subtract(yesterCost)).divide(yesterCost, BigDecimal.ROUND_HALF_UP);
+                            detailJson.put("proportion", costProportion); // 较昨日增加比例
+                        } else {
+                            detailJson.put("proportion", 0); // 较昨日增加比例
+                        }
+                        Long photoShow = detailJson.getLong("photoShow");// 今日封面展示
+                        Long yesterPhotoShow = yesterDayJson.getLong("photoShow");// 昨日封面展示
+                        if (yesterPhotoShow != 0L) {
+                            double showProportion = (photoShow.doubleValue() - yesterPhotoShow.doubleValue()) / yesterPhotoShow.doubleValue();
+                            detailJson.put("proportion", showProportion); // 较昨日增加比例
+                        } else {
+                            detailJson.put("proportion", 0); // 较昨日增加比例
+                        }
+
+                        Long photoClick = detailJson.getLong("photoClick");// 今日封面展示
+                        Long yesterphotoClick = yesterDayJson.getLong("photoShow");// 昨日封面展示
+                        if (yesterPhotoShow != 0L) {
+                            double photoClickroportion = (photoClick.doubleValue() - yesterphotoClick.doubleValue()) / yesterphotoClick.doubleValue();
+                            detailJson.put("proportion", photoClickroportion); // 较昨日增加比例
+                        } else {
+                            detailJson.put("proportion", 0); // 较昨日增加比例
+                        }
+                        Long aclick = detailJson.getLong("aclick");// 今日封面展示
+                        Long yesterAclick = yesterDayJson.getLong("photoShow");// 昨日封面展示
+                        if (yesterPhotoShow != 0L) {
+                            double aClickProportion = (aclick.doubleValue() - yesterAclick.doubleValue()) / yesterAclick.doubleValue();
+                            detailJson.put("proportion", aClickProportion); // 较昨日增加比例
+                        } else {
+                            detailJson.put("proportion", 0); // 较昨日增加比例
+                        }
+
+                    }
+                    detail.add(detailJson);
+
+                }
+            } else if (type == 2) { // 昨日明细
+                detail = reportMapper.selectReportDetail(anotherDay);
+            } else if (type == 3) { // 近七天明细
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                detail = reportMapper.selectDayDetailByDate(anotherDay, endDate);
+
+            } else if (type == 4) { // 近十五天明细
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                detail = reportMapper.selectDayDetailByDate(anotherDay, endDate);
+            } else if (type == 5) { // 近1个月明细
+                String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
+                detail = reportMapper.selectDayDetailByDate(anotherDay, endDate);
+            } else if (type == 6) { // 近三个月明细
+                String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -3);
+                detail = reportMapper.selectDayDetailByDate(anotherDay, endDate);
+            } else if (type == 7) { // 近半年明细
+                String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -6);
+                detail = reportMapper.selectDayDetailByMonth(anotherDay, endDate);
+            } else if (type == 8) {
+                detail = reportMapper.selectAllDayDetailByMonth();
+            } else if (type == 9) {
+                String startDate = requestJson.getString("startDate");
+                String endDate = requestJson.getString("endDate");
+                detail = reportMapper.selectDayDetailByDate(startDate, endDate);
+            } else if (type == 10) {
+                String sign = requestJson.getString("sign");
+                String bigDate = requestJson.getString("bigDate");
+                String smallDate = requestJson.getString("smallDate");
+                if ("month".equals(sign)) {
+                    Map<String, Object> dateMap = DateUtils.compare_date("yyyy-MM", bigDate, smallDate);
+                    List<JSONObject> comparedArr = reportMapper.selectDayDetailsByMonth((String) dateMap.get("bigDate"));   // 除数数据
+                    String comparedDate = (String) dateMap.get("smallDate");
+                    for (int i = 0; i < comparedArr.size(); i++) {
+                        JSONObject comparedJson = comparedArr.get(i);
+                        if (!Check.isNull(comparedJson)) {
+                            String statDate = comparedJson.getString("statDate");
+                            String day = DateUtils.getDay("yyyy-MM-dd", statDate);
+                            String beComparedDate = comparedDate + "-" + day;
+                            JSONObject beComparedJson = reportMapper.selectDayDailyByDate(beComparedDate);
+                            if (!Check.isNull(beComparedJson)) {
+                                JSONObject json = new JSONObject();
+                                BigDecimal cost = comparedJson.getBigDecimal("cost");
+                                Long photoShow = comparedJson.getLong("photoShow");
+                                Long photoClick = comparedJson.getLong("photoClick");
+                                Long aClick = comparedJson.getLong("aclick");
+                                json.put("cost", cost);
+                                json.put("photoShow", photoShow);
+                                json.put("photoClick", photoClick);
+                                json.put("aClick", aClick);
+                                json.put("statDate", statDate);
+
+                                BigDecimal comparedCost = beComparedJson.getBigDecimal("cost");
+                                Long comparedPhotoShow = beComparedJson.getLong("photoShow");
+                                Long comparedPhotoClick = beComparedJson.getLong("photoClick");
+                                Long comparedAClick = beComparedJson.getLong("aclick");
+                                json.put("beComparedCost", comparedCost);
+                                json.put("beComparedPhotoShow", comparedPhotoShow);
+                                json.put("beComparedPhotoClick", comparedPhotoClick);
+                                json.put("beComparedAClick", comparedAClick);
+                                json.put("beComparedDate", beComparedDate);
+                                if (comparedCost.compareTo(new BigDecimal(0)) != 0) {
+                                    BigDecimal costProportion = (cost.subtract(comparedCost)).divide(comparedCost, BigDecimal.ROUND_HALF_UP);
+                                    json.put("costProportion", costProportion);
+                                } else {
+                                    json.put("costProportion", 0);
+                                }
+
+                                if (comparedPhotoClick != 0L) {
+                                    double photoClickProportion = (photoClick.doubleValue() - comparedPhotoClick.doubleValue()) / comparedPhotoClick.doubleValue();
+                                    json.put("photoClickProportion", photoClickProportion);
+                                } else {
+                                    json.put("photoClickProportion", 0);
+                                }
+
+                                if (comparedPhotoShow != 0L) {
+                                    double showProportion = (photoShow.doubleValue() - comparedPhotoShow.doubleValue()) / comparedPhotoShow.doubleValue();
+                                    json.put("showProportion", showProportion);
+                                } else {
+                                    json.put("showProportion", 0);
+                                }
+
+                                if (comparedAClick != 0L) {
+                                    double aClickProportion = (aClick.doubleValue() - comparedAClick.doubleValue()) / comparedAClick.doubleValue();
+                                    json.put("comparedAclick", aClickProportion);
+                                } else {
+                                    json.put("comparedAclick", 0);
+                                }
+
+                                detail.add(json);
+
+                            }
+
+                        }
+
+                    }
+
+
+                }
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        }
+
+        System.err.println(detail);
+
+        return detail;
+    }
 }

+ 1 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java

@@ -73,6 +73,7 @@ public class ReportServiceImpl implements IReportService {
     @Autowired
     private IBytedanceCreativeHourlyReportService creativeHourlyReportService;
 
+
     @Override
     public Map<String, Object> getAdvertiserReport(ByteDanceAdvertiserReportDTO conditions) {
         conditions.setAdvertiserId(111463131228L);

+ 26 - 0
module-report/src/main/java/cn/com/ctop/bytedance/vo/ReportVO.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.bytedance.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class ReportVO implements Serializable {
+    private BigDecimal cost;
+    private Long photoShow;
+    private Long photoClick;
+    private Long aclick;
+    private String statDate;
+
+    @Override
+    public String toString() {
+        return "ReportVO{" +
+                "cost=" + cost +
+                ", photoShow=" + photoShow +
+                ", photoClick=" + photoClick +
+                ", aclick=" + aclick +
+                ", statDate='" + statDate + '\'' +
+                '}';
+    }
+}

+ 22 - 8
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceUserOrientationTemplate.java

@@ -245,6 +245,8 @@ public class ByteDanceUserOrientationTemplate {
 
     private String adTagStr;
 
+    private String deviceType;
+
     /**
      * status
      */
@@ -266,6 +268,10 @@ public class ByteDanceUserOrientationTemplate {
     }
 
     public ByteDanceUserOrientationTemplate(String userId, JSONObject template) {
+        Long id = template.getLong("id");
+        if (null != id && id != 0) {
+            this.id = id;
+        }
         this.userId = userId;
         String name = template.getString("name");
         if (null != name && !name.equals("")) {
@@ -284,6 +290,14 @@ public class ByteDanceUserOrientationTemplate {
         if (null != ageRange) {
             this.age = ageRange.toJSONString();
         }
+        String deviceType = template.getString("deviceType");
+        if (null != deviceType && !deviceType.trim().equals("")) {
+            this.deviceType = deviceType;
+        }
+        String superiorPopularityType = template.getString("superiorPopularityType");
+        if (null != superiorPopularityType && !"".equals(superiorPopularityType.trim())) {
+            this.superiorPopularityType = superiorPopularityType;
+        }
         //兴趣定向类别
         String intrestType = template.getString("intrestType");
         if (null != intrestType && !intrestType.equals("")) {
@@ -301,8 +315,8 @@ public class ByteDanceUserOrientationTemplate {
                     categoryList.forEach(category -> {
                         JSONObject categoryObject = JSONObject.parseObject(JSONObject.toJSONString(category));
                         adTagStr.add(categoryObject);
-                        Long id = categoryObject.getLong("value");
-                        tags.add(id);
+                        Long tagId = categoryObject.getLong("value");
+                        tags.add(tagId);
                     });
                 }
                 this.adTag = tags.toJSONString();
@@ -347,8 +361,8 @@ public class ByteDanceUserOrientationTemplate {
             cityList.forEach(city -> {
                 JSONObject cityObject = JSONObject.parseObject(JSONObject.toJSONString(city));
                 cityStr.add(cityObject);
-                Long id = cityObject.getLong("value");
-                cityArray.add(id);
+                Long cityId = cityObject.getLong("value");
+                cityArray.add(cityId);
             });
         }
         this.city = cityArray.toJSONString();
@@ -361,8 +375,8 @@ public class ByteDanceUserOrientationTemplate {
             areaList.forEach(area -> {
                 JSONObject areaObject = JSONObject.parseObject(JSONObject.toJSONString(area));
                 areaStr.add(areaObject);
-                Long id = areaObject.getLong("value");
-                areaArray.add(id);
+                Long areaId = areaObject.getLong("value");
+                areaArray.add(areaId);
             });
         }
         this.district = areaArray.toJSONString();
@@ -374,8 +388,8 @@ public class ByteDanceUserOrientationTemplate {
         if (null != intrestTagList && intrestTagList.size() > 0) {
             intrestTagList.forEach(intrestCategory -> {
                 JSONObject intrestCategoryObject = JSONObject.parseObject(JSONObject.toJSONString(intrestCategory));
-                Long id = intrestCategoryObject.getLong("value");
-                intrestTagArray.add(id);
+                Long intrestId = intrestCategoryObject.getLong("value");
+                intrestTagArray.add(intrestId);
             });
         }
         this.interestTags = areaArray.toJSONString();

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceAdvertiserDataService.java

@@ -45,4 +45,6 @@ public interface IByteDanceAdvertiserDataService {
     JSONObject setUserOrentationData(JSONObject data, ByteDanceUserOrientationTemplate template);
 
     Map<String, Object> getAdvertiserCampaignList(String accountId);
+
+    Map<String, Object> flowPackageGet(String accountId);
 }

+ 86 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -1,5 +1,7 @@
 package cn.com.ctop.toutiao.service.impl;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.PropertiesUtils;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
@@ -11,8 +13,6 @@ import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -632,6 +632,42 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         //根据adId获取公告计划信息
         ByteDanceAdvertisePlan advertisePlan = advertisePlanService.getById(adId);
         data.put("modify_time", advertisePlan.getModifyTime());
+        Integer deliveryType = requestJson.getInteger("deviceType");
+        if (null != deliveryType && deliveryType == 2) {
+            //穿山甲
+            //精选流量包类型
+            String superiorPopularityType = template.getSuperiorPopularityType();
+            if (null != superiorPopularityType && "ZDY".equals(superiorPopularityType)) {
+                JSONArray flowPackage = requestJson.getJSONArray("flowPackage");
+                if (null != flowPackage && flowPackage.size() > 0) {
+                    JSONArray getFlowPackage = new JSONArray();
+                    for (int i = 0; i < flowPackage.size(); i++) {
+                        String flowPackageString = flowPackage.getString(i);
+                        getFlowPackage.add(Long.parseLong(flowPackageString));
+                    }
+                    data.put("flow_package", getFlowPackage);
+                }
+                JSONArray excludeFlowPackage = requestJson.getJSONArray("excludeFlowPackage");
+                if (null != excludeFlowPackage && excludeFlowPackage.size() > 0) {
+                    JSONArray getExcludeFlowPackage = new JSONArray();
+                    for (int i = 0; i < excludeFlowPackage.size(); i++) {
+                        String excludeFlowPackageString = excludeFlowPackage.getString(i);
+                        getExcludeFlowPackage.add(Long.parseLong(excludeFlowPackageString));
+                    }
+                    data.put("exclude_flow_package", getExcludeFlowPackage);
+                }
+            } else {
+                data.put("superior_popularity_type", superiorPopularityType);
+            }
+            //设备类型
+            String deviceType = template.getDeviceType();
+            if (null != deviceType && !"".equals(deviceType) && !"NONE".equals(deviceType)) {
+                JSONArray typeArray = new JSONArray();
+                typeArray.add(deviceType);
+                data.put("device_type", typeArray);
+            }
+        }
+
         JSONArray retargetingTagsExclude = requestJson.getJSONArray("retargetingTagsExclude");
         JSONArray retargetingTagsInclude = requestJson.getJSONArray("retargetingTagsInclude");
         if (null != retargetingTagsExclude && retargetingTagsExclude.size() > 0) {
@@ -805,6 +841,54 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return resultMap;
     }
 
+    /**
+     * 获取流量包数据接口
+     *
+     * @param accountId
+     * @return
+     */
+    @Override
+    public Map<String, Object> flowPackageGet(String accountId) {
+        JSONObject jsonObject = flowPackageGetJSONObject(accountId);
+        JSONObject result = new JSONObject();
+        Integer code = jsonObject.getInteger("code");
+        String message = jsonObject.getString("message");
+        result.put("code", code);
+        result.put("message", message);
+        if (null == code || code != 0) {
+            result.put("success", false);
+            return result;
+        }
+        JSONArray packageList = jsonObject.getJSONObject("data").getJSONArray("list");
+        if (null != packageList && packageList.size() > 0) {
+            JSONArray packageArray = new JSONArray();
+            for (int i = 0; i < packageList.size(); i++) {
+                JSONObject packageObject = packageList.getJSONObject(i);
+                packageObject.remove("rit");
+                String status = packageObject.getString("status");
+                if (null != status && status.equals("FLOW_PACKAGE_ENABLE")) {
+                    packageArray.add(packageObject);
+                }
+            }
+            result.put("data", packageArray);
+        }
+        result.put("success", true);
+        return result;
+    }
+
+    public JSONObject flowPackageGetJSONObject(String accountId) {
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
+        // 请求地址
+        String url = "https://ad.toutiao.com/open_api/2/tools/union/flow_package/get/";
+        // 请求参数
+        JSONObject params = new JSONObject();
+        params.put("advertiser_id", token.getAccountId());
+        params.put("page", 1);
+        params.put("page_size", 100);
+        JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
+        return resultObject;
+    }
+
 
     private void getAdvertiserCreativeByPageNumber(String accountId, Integer pageNumber, String ids) {
         CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);