瀏覽代碼

Merge branch 'test'

syh 5 年之前
父節點
當前提交
10dc10b0e1
共有 100 個文件被更改,包括 1977 次插入865 次删除
  1. 23 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 41 41
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/RedisUtil.java
  3. 6 0
      jeecg-boot-module-system/pom.xml
  4. 0 250
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AuthTaskController.java
  5. 11 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  6. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java
  7. 27 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  8. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/YardController.java
  9. 0 44
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/AuthTask.java
  10. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceReportLoadJob.java
  11. 0 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AuthTaskMapper.java
  12. 0 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/CustomerPlanStatisticInfoMapper.xml
  13. 0 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAuthTaskService.java
  14. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICreateInternalService.java
  15. 0 23
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReportService.java
  16. 0 31
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/AuthTaskServiceImpl.java
  17. 271 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java
  18. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java
  19. 28 54
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  20. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java
  21. 19 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/HttpClientEntity.java
  22. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IBindAccountLoginService.java
  23. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IFileInfoService.java
  24. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java
  25. 20 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  26. 171 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpClientUtils.java
  27. 33 99
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java
  28. 2 1
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  29. 18 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StringUtils.java
  30. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  31. 132 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/controller/KuaishouWebController.java
  32. 17 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/entity/KuaishouUserCookie.java
  33. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/mapper/KuaishouUserCookieMapper.java
  34. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/IKuaishouUserCookieService.java
  35. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/IKuaishouWebInterfaceService.java
  36. 11 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouUserCookieServiceImpl.java
  37. 768 61
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java
  38. 11 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/vo/KuaishouAcceptVO.java
  39. 16 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/vo/KuaishouQrStartVO.java
  40. 16 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/vo/KuaishouUserVO.java
  41. 17 0
      module-report/pom.xml
  42. 4 0
      module-report/src/main/java/cn/com/ctop/bytedance/aa.java
  43. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserDailyReportController.java
  44. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserHourlyReportController.java
  45. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignDailyReportController.java
  46. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignHourlyReportController.java
  47. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeDailyReportController.java
  48. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeHourlyReportController.java
  49. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanDailyReportController.java
  50. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanHourlyReportController.java
  51. 36 0
      module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java
  52. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CustomerPlanStatisticInfoController.java
  53. 19 24
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/PlatformCampaignStatisticInfoController.java
  54. 13 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReportController.java
  55. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserDailyReport.java
  56. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserHourlyReport.java
  57. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignDailyReport.java
  58. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignHourlyReport.java
  59. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeDailyReport.java
  60. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeHourlyReport.java
  61. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanDailyReport.java
  62. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanHourlyReport.java
  63. 3 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/CustomerPlanStatisticInfo.java
  64. 10 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/PlatformCampaignStatisticInfo.java
  65. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserDailyReportMapper.java
  66. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserHourlyReportMapper.java
  67. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignDailyReportMapper.java
  68. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignHourlyReportMapper.java
  69. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeDailyReportMapper.java
  70. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeHourlyReportMapper.java
  71. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanDailyReportMapper.java
  72. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanHourlyReportMapper.java
  73. 2 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CustomerPlanStatisticInfoMapper.java
  74. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/PlatformCampaignStatisticInfoMapper.java
  75. 5 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceAdvertiserDailyReportMapper.xml
  76. 5 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceAdvertiserHourlyReportMapper.xml
  77. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignDailyReportMapper.xml
  78. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignHourlyReportMapper.xml
  79. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeDailyReportMapper.xml
  80. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeHourlyReportMapper.xml
  81. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanDailyReportMapper.xml
  82. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanHourlyReportMapper.xml
  83. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/AuthTaskMapper.xml
  84. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/PlatformCampaignStatisticInfoMapper.xml
  85. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceAdvertiserDailyReportService.java
  86. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceAdvertiserHourlyReportService.java
  87. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCampaignDailyReportService.java
  88. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCampaignHourlyReportService.java
  89. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCreativeDailyReportService.java
  90. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCreativeHourlyReportService.java
  91. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedancePlanDailyReportService.java
  92. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedancePlanHourlyReportService.java
  93. 7 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceReportService.java
  94. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICustomerPlanStatisticInfoService.java
  95. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IPlatformCampaignStatisticInfoService.java
  96. 24 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IReportService.java
  97. 5 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserDailyReportServiceImpl.java
  98. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java
  99. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignDailyReportServiceImpl.java
  100. 0 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignHourlyReportServiceImpl.java

+ 23 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -1,5 +1,7 @@
 package org.jeecg.common.util;
 
+import org.springframework.util.StringUtils;
+
 import java.beans.PropertyEditorSupport;
 import java.sql.Timestamp;
 import java.text.DateFormat;
@@ -7,8 +9,6 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
-import org.springframework.util.StringUtils;
-
 /**
  * 类描述:时间操作定义类
  *
@@ -94,6 +94,7 @@ public class DateUtils extends PropertyEditorSupport {
 
     /**
      * 日期转换为字符串
+     *
      * @return 字符串
      */
     public static String date2Str() {
@@ -125,6 +126,7 @@ public class DateUtils extends PropertyEditorSupport {
 
     /**
      * 日期转换为字符串
+     *
      * @param format 日期格式
      * @return 字符串
      */
@@ -730,4 +732,23 @@ public class DateUtils extends PropertyEditorSupport {
         }
     }
 
+
+    public static Map<String, Object> getBeforeDate() {
+        Date dNow = new Date(); //当前时间
+        Date dBefore = new Date();
+        Calendar calendar = Calendar.getInstance(); //得到日历
+        calendar.setTime(dNow);//把当前时间赋给日历
+        calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
+        dBefore = calendar.getTime(); //得到前一天的时间
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //设置时间格式
+        String defaultStartDate = sdf.format(dBefore); //格式化前一天
+        defaultStartDate = defaultStartDate + " 00:00:00";
+        String defaultEndDate = defaultStartDate.substring(0, 10) + " 23:59:59";
+        Map<String, Object> map = new HashMap<>();
+        map.put("startDate", defaultStartDate);
+        map.put("endDate", defaultEndDate);
+        return map;
+    }
+
+
 }

+ 41 - 41
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/RedisUtil.java

@@ -1,16 +1,16 @@
 package org.jeecg.common.util;
 
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
 /**
  * redis 工具类
  * @Author Scott
@@ -26,7 +26,7 @@ public class RedisUtil {
 
 	/**
 	 * 指定缓存失效时间
-	 * 
+     *
 	 * @param key  键
 	 * @param time 时间(秒)
 	 * @return
@@ -45,7 +45,7 @@ public class RedisUtil {
 
 	/**
 	 * 根据key 获取过期时间
-	 * 
+     *
 	 * @param key 键 不能为null
 	 * @return 时间(秒) 返回0代表为永久有效
 	 */
@@ -55,7 +55,7 @@ public class RedisUtil {
 
 	/**
 	 * 判断key是否存在
-	 * 
+     *
 	 * @param key 键
 	 * @return true 存在 false不存在
 	 */
@@ -70,7 +70,7 @@ public class RedisUtil {
 
 	/**
 	 * 删除缓存
-	 * 
+     *
 	 * @param key 可以传一个值 或多个
 	 */
 	@SuppressWarnings("unchecked")
@@ -87,7 +87,7 @@ public class RedisUtil {
 	// ============================String=============================
 	/**
 	 * 普通缓存获取
-	 * 
+     *
 	 * @param key 键
 	 * @return 值
 	 */
@@ -97,7 +97,7 @@ public class RedisUtil {
 
 	/**
 	 * 普通缓存放入
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @return true成功 false失败
@@ -115,7 +115,7 @@ public class RedisUtil {
 
 	/**
 	 * 普通缓存放入并设置时间
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
@@ -137,9 +137,9 @@ public class RedisUtil {
 
 	/**
 	 * 递增
-	 * 
+     *
 	 * @param key 键
-	 * @param by  要增加几(大于0)
+     * @param delta  要增加几(大于0)
 	 * @return
 	 */
 	public long incr(String key, long delta) {
@@ -151,9 +151,9 @@ public class RedisUtil {
 
 	/**
 	 * 递减
-	 * 
+     *
 	 * @param key 键
-	 * @param by  要减少几(小于0)
+     * @param delta 要减少几(小于0)
 	 * @return
 	 */
 	public long decr(String key, long delta) {
@@ -166,7 +166,7 @@ public class RedisUtil {
 	// ================================Map=================================
 	/**
 	 * HashGet
-	 * 
+     *
 	 * @param key  键 不能为null
 	 * @param item 项 不能为null
 	 * @return 值
@@ -177,7 +177,7 @@ public class RedisUtil {
 
 	/**
 	 * 获取hashKey对应的所有键值
-	 * 
+     *
 	 * @param key 键
 	 * @return 对应的多个键值
 	 */
@@ -187,7 +187,7 @@ public class RedisUtil {
 
 	/**
 	 * HashSet
-	 * 
+     *
 	 * @param key 键
 	 * @param map 对应多个键值
 	 * @return true 成功 false 失败
@@ -204,7 +204,7 @@ public class RedisUtil {
 
 	/**
 	 * HashSet 并设置时间
-	 * 
+     *
 	 * @param key  键
 	 * @param map  对应多个键值
 	 * @param time 时间(秒)
@@ -225,7 +225,7 @@ public class RedisUtil {
 
 	/**
 	 * 向一张hash表中放入数据,如果不存在将创建
-	 * 
+     *
 	 * @param key   键
 	 * @param item  项
 	 * @param value 值
@@ -243,7 +243,7 @@ public class RedisUtil {
 
 	/**
 	 * 向一张hash表中放入数据,如果不存在将创建
-	 * 
+     *
 	 * @param key   键
 	 * @param item  项
 	 * @param value 值
@@ -265,7 +265,7 @@ public class RedisUtil {
 
 	/**
 	 * 删除hash表中的值
-	 * 
+     *
 	 * @param key  键 不能为null
 	 * @param item 项 可以使多个 不能为null
 	 */
@@ -275,7 +275,7 @@ public class RedisUtil {
 
 	/**
 	 * 判断hash表中是否有该项的值
-	 * 
+     *
 	 * @param key  键 不能为null
 	 * @param item 项 不能为null
 	 * @return true 存在 false不存在
@@ -286,7 +286,7 @@ public class RedisUtil {
 
 	/**
 	 * hash递增 如果不存在,就会创建一个 并把新增后的值返回
-	 * 
+     *
 	 * @param key  键
 	 * @param item 项
 	 * @param by   要增加几(大于0)
@@ -298,7 +298,7 @@ public class RedisUtil {
 
 	/**
 	 * hash递减
-	 * 
+     *
 	 * @param key  键
 	 * @param item 项
 	 * @param by   要减少记(小于0)
@@ -311,7 +311,7 @@ public class RedisUtil {
 	// ============================set=============================
 	/**
 	 * 根据key获取Set中的所有值
-	 * 
+     *
 	 * @param key 键
 	 * @return
 	 */
@@ -326,7 +326,7 @@ public class RedisUtil {
 
 	/**
 	 * 根据value从一个set中查询,是否存在
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @return true 存在 false不存在
@@ -342,7 +342,7 @@ public class RedisUtil {
 
 	/**
 	 * 将数据放入set缓存
-	 * 
+     *
 	 * @param key    键
 	 * @param values 值 可以是多个
 	 * @return 成功个数
@@ -358,7 +358,7 @@ public class RedisUtil {
 
 	/**
 	 * 将set数据放入缓存
-	 * 
+     *
 	 * @param key    键
 	 * @param time   时间(秒)
 	 * @param values 值 可以是多个
@@ -379,7 +379,7 @@ public class RedisUtil {
 
 	/**
 	 * 获取set缓存的长度
-	 * 
+     *
 	 * @param key 键
 	 * @return
 	 */
@@ -394,7 +394,7 @@ public class RedisUtil {
 
 	/**
 	 * 移除值为value的
-	 * 
+     *
 	 * @param key    键
 	 * @param values 值 可以是多个
 	 * @return 移除的个数
@@ -412,7 +412,7 @@ public class RedisUtil {
 
 	/**
 	 * 获取list缓存的内容
-	 * 
+     *
 	 * @param key   键
 	 * @param start 开始
 	 * @param end   结束 0 到 -1代表所有值
@@ -429,7 +429,7 @@ public class RedisUtil {
 
 	/**
 	 * 获取list缓存的长度
-	 * 
+     *
 	 * @param key 键
 	 * @return
 	 */
@@ -444,7 +444,7 @@ public class RedisUtil {
 
 	/**
 	 * 通过索引 获取list中的值
-	 * 
+     *
 	 * @param key   键
 	 * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
 	 * @return
@@ -460,7 +460,7 @@ public class RedisUtil {
 
 	/**
 	 * 将list放入缓存
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @param time  时间(秒)
@@ -478,7 +478,7 @@ public class RedisUtil {
 
 	/**
 	 * 将list放入缓存
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @param time  时间(秒)
@@ -499,7 +499,7 @@ public class RedisUtil {
 
 	/**
 	 * 将list放入缓存
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @param time  时间(秒)
@@ -517,7 +517,7 @@ public class RedisUtil {
 
 	/**
 	 * 将list放入缓存
-	 * 
+     *
 	 * @param key   键
 	 * @param value 值
 	 * @param time  时间(秒)
@@ -538,7 +538,7 @@ public class RedisUtil {
 
 	/**
 	 * 根据索引修改list中的某条数据
-	 * 
+     *
 	 * @param key   键
 	 * @param index 索引
 	 * @param value 值
@@ -556,7 +556,7 @@ public class RedisUtil {
 
 	/**
 	 * 移除N个值为value
-	 * 
+     *
 	 * @param key   键
 	 * @param count 移除多少个
 	 * @param value 值

+ 6 - 0
jeecg-boot-module-system/pom.xml

@@ -101,6 +101,12 @@
             <version>2.0.2</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-report</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>

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

@@ -1,250 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.AuthTask;
-import org.jeecg.modules.ctop.service.IAuthTaskService;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * TODO 相关AuthTask 需要删除
- *
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-@Slf4j
-@Api(tags = "关联用户分配")
-@RestController
-@RequestMapping("/ctop/authTask")
-public class AuthTaskController {
-    @Autowired
-    private IAuthTaskService authTaskService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param authTask
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-分页列表查询")
-    @ApiOperation(value = "关联用户分配-分页列表查询", notes = "关联用户分配-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<AuthTask>> queryPageList(AuthTask authTask,
-                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                 HttpServletRequest req) {
-        Result<IPage<AuthTask>> result = new Result<IPage<AuthTask>>();
-        QueryWrapper<AuthTask> queryWrapper = QueryGenerator.initQueryWrapper(authTask, req.getParameterMap());
-        Page<AuthTask> page = new Page<AuthTask>(pageNo, pageSize);
-        IPage<AuthTask> pageList = authTaskService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param authTask
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-添加")
-    @ApiOperation(value = "关联用户分配-添加", notes = "关联用户分配-添加")
-    @PostMapping(value = "/add")
-    public Result<AuthTask> add(@RequestBody AuthTask authTask) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        try {
-            authTaskService.save(authTask);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param authTask
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-编辑")
-    @ApiOperation(value = "关联用户分配-编辑", notes = "关联用户分配-编辑")
-    @PutMapping(value = "/edit")
-    public Result<AuthTask> edit(@RequestBody AuthTask authTask) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        AuthTask authTaskEntity = authTaskService.getById(authTask.getId());
-        if (authTaskEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = authTaskService.updateById(authTask);
-            //TODO 返回false说明什么?
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-通过id删除")
-    @ApiOperation(value = "关联用户分配-通过id删除", notes = "关联用户分配-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            authTaskService.removeById(id);
-        } catch (Exception e) {
-            log.error("删除失败", e.getMessage());
-            return Result.error("删除失败!");
-        }
-        return Result.ok("删除成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-批量删除")
-    @ApiOperation(value = "关联用户分配-批量删除", notes = "关联用户分配-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<AuthTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.authTaskService.removeByIds(Arrays.asList(ids.split(",")));
-            result.success("删除成功!");
-        }
-        return result;
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-通过id查询")
-    @ApiOperation(value = "关联用户分配-通过id查询", notes = "关联用户分配-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<AuthTask> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        AuthTask authTask = authTaskService.getById(id);
-        if (authTask == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(authTask);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<AuthTask> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                AuthTask authTask = JSON.parseObject(deString, AuthTask.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(authTask, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<AuthTask> pageList = authTaskService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "关联用户分配列表");
-        mv.addObject(NormalExcelConstants.CLASS, AuthTask.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("关联用户分配列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            // 获取上传文件对象
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<AuthTask> listAuthTasks = ExcelImportUtil.importExcel(file.getInputStream(), AuthTask.class, params);
-                authTaskService.saveBatch(listAuthTasks);
-                return Result.ok("文件导入成功!数据行数:" + listAuthTasks.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
-    }
-}

+ 11 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java

@@ -1,10 +1,10 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -13,9 +13,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -61,7 +63,6 @@ public class BindAccountLoginController {
     private ICreateInternalService createInternalService;
 
     /**
-     * TODO  需要爬虫校验用户名密码正确性
      *
      * @param json
      * @return
@@ -79,17 +80,17 @@ public class BindAccountLoginController {
         String userId = json.getString("userId");
         String password = json.getString("password");
         String loginType = json.getString("loginType");
+        // 广告主名称
+        String advertiserName = json.getString("advertiser_name");
         //账号
         String accountName = json.getString("accountName");
-        boolean trueOrFalse = createInternalService.bindLogin(advertiserId, accountName, password, loginType, userId);
+        boolean trueOrFalse = createInternalService.bindLogin(advertiserId, accountName, password, loginType, userId, advertiserName);
         if (trueOrFalse) {
             String realName = json.getString("realName");
             //部门id
             String departmentId = json.getString("departmentId");
             //指定分配人姓名
             String distributionName = json.getString("distributionName");
-            // 广告主名称
-            String advertiserName = json.getString("advertiser_name");
             // 媒体类型: 1 头条 2 快手
             String mediaId = json.getString("mediaId");
             UserAllocation userAllocation = new UserAllocation();
@@ -130,6 +131,11 @@ public class BindAccountLoginController {
                                                          HttpServletRequest req) {
         Result<IPage<BindAccountLogin>> result = new Result<>();
         QueryWrapper<BindAccountLogin> queryWrapper = QueryGenerator.initQueryWrapper(bindAccountLogin, req.getParameterMap());
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (!Check.isNull(user)) {
+            queryWrapper.eq("user_id", user.getId());
+        }
+        queryWrapper.orderByDesc("id");
         Page<BindAccountLogin> page = new Page<>(pageNo, pageSize);
         IPage<BindAccountLogin> pageList = bindAccountLoginService.page(page, queryWrapper);
         result.setSuccess(true);

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

@@ -349,6 +349,12 @@ public class ByteDanceTemplateController {
         return fileInfoService.getSiteList(accountId);
     }
 
+    /**
+     * 获取动态词包信息
+     *
+     * @param accountId
+     * @return
+     */
     @GetMapping("creative/words/get")
     public Map<String, Object> getCreativeWords(Long accountId) {
         return fileInfoService.getCreativeWords(accountId);

+ 27 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -1,14 +1,14 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 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 org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
+import java.util.UUID;
 
 /**
  * @author jeecg-boot
@@ -18,9 +18,32 @@ import java.util.Map;
 public class TestController {
     @Autowired
     private ICreateInternalService createInternalService;
+    @Autowired
+    private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
 
     @PostMapping(value = "/create")
     public Map<String, Object> authorization(@RequestBody JSONObject jsonObject) {
         return createInternalService.createInternal(jsonObject);
     }
+
+    @GetMapping(value = "/t")
+    public String test() {
+        Result<String> result = new Result<String>();
+        try {
+            String requestId = UUID.randomUUID().toString();
+            String img = kuaishouWebInterfaceService.qrLogin(requestId);
+            if (img != null) {
+                result.setSuccess(true);
+                result.setResult(img);
+            } else {
+                result.setSuccess(false);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return "success";
+    }
+
+
 }

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

@@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.digest.DigestUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
+import java.io.FileInputStream;
+import java.io.IOException;
 
 @RestController
 @Slf4j
@@ -268,4 +271,15 @@ public class YardController {
         result.setResult(pageList);
         return result;
     }
+
+    public static void main(String[] args) {
+        String path = "D:\\sign\\2\\2.jpg";
+        String md5 = null;
+        try {
+            md5 = DigestUtils.md5Hex(new FileInputStream(path));
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        System.out.println(md5);
+    }
 }

+ 0 - 44
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/AuthTask.java

@@ -1,44 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-/**
- * 关联用户分配
- * @author jeecg-boot
- * @date 2019-07-31
- * @version V1.0
- */
-@Data
-@TableName("ctop_auth_task")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_auth_task对象", description = "关联用户分配")
-public class AuthTask {
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "主键ID")
-    private Long id;
-    /**
-     * 广告主ID
-     */
-    @Excel(name = "广告主ID", width = 15)
-    @ApiModelProperty(value = "广告主ID")
-    private String advertiserId;
-    /**
-     * task_id
-     */
-    @Excel(name = "task_id", width = 15)
-    @ApiModelProperty(value = "task_id")
-    private String taskId;
-}

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

@@ -0,0 +1,12 @@
+package org.jeecg.modules.ctop.job;
+
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+public class BytedanceReportLoadJob implements Job {
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        //1:查询所有
+    }
+}

+ 0 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AuthTaskMapper.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.entity.AuthTask;
-
-/**
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-public interface AuthTaskMapper extends BaseMapper<AuthTask> {
-
-}

+ 0 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/CustomerPlanStatisticInfoMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.ctop.mapper.CustomerPlanStatisticInfoMapper">
-
-</mapper>

+ 0 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAuthTaskService.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import org.jeecg.modules.ctop.entity.AuthTask;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-public interface IAuthTaskService extends IService<AuthTask> {
-    AuthTask getAuthTask(String taskId);
-}

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICreateInternalService.java

@@ -9,5 +9,5 @@ public interface ICreateInternalService {
 
     Map<String, Object> checkAccountPassword(String account, String password);
 
-    public boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId);
+     boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId,String advertiserName);
 }

+ 0 - 23
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReportService.java

@@ -1,23 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import com.alibaba.fastjson.JSONObject;
-
-import java.util.Map;
-
-public interface IReportService {
-    Map<String, Object> getAdvertiserReport(JSONObject conditions);
-
-    Map<String, Object> getCampaignReport(JSONObject conditions);
-
-    Map<String, Object> getAdReport(JSONObject conditions);
-
-    Map<String, Object> getCreativeReport(JSONObject conditions);
-
-    Map<String, Object> getAgentReport(JSONObject conditions);
-
-    void insertCustomerInfo(String csvPath, String charset);
-
-    void insertPlatformInfo(String excelPath, String charset, Long accountId);
-
-    Map<String, Object> debitAuto(JSONObject data);
-}

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

@@ -1,31 +0,0 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.modules.ctop.entity.AuthTask;
-import org.jeecg.modules.ctop.mapper.AuthTaskMapper;
-import org.jeecg.modules.ctop.service.IAuthTaskService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-/**
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-@Service
-public class AuthTaskServiceImpl extends ServiceImpl<AuthTaskMapper, AuthTask> implements IAuthTaskService {
-
-    @Autowired
-    private AuthTaskMapper authTaskMapper;
-
-    @Override
-    public AuthTask getAuthTask(String taskId) {
-        QueryWrapper<AuthTask> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("task_id", taskId).orderByDesc("create_time");
-        AuthTask authTask = authTaskMapper.selectOne(queryWrapper);
-        return authTask;
-    }
-}

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

@@ -3,15 +3,21 @@ package org.jeecg.modules.ctop.service.impl;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.mapper.BindAccountLoginMapper;
+import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IFileInfoService;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.crawler.modules.core.util.FateadmHttpUtil;
 import cn.com.ctop.crawler.modules.core.util.FateadmUtil;
 import cn.com.ctop.toutiao.entity.ByteDanceUserOrientationTemplate;
+import cn.com.ctop.toutiao.entity.BytedanceCreativeLaunchTemplate;
 import cn.com.ctop.toutiao.entity.BytedanceUrlInfo;
 import cn.com.ctop.toutiao.mapper.ByteDanceUserOrientationTemplateMapper;
+import cn.com.ctop.toutiao.mapper.BytedanceCreativeLaunchTemplateMapper;
 import cn.com.ctop.toutiao.mapper.BytedanceUrlInfoMapper;
 import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonNode;
@@ -40,13 +46,15 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
     @Value("${jeecg.path.chrome-driver}")
     private String chromeDriver;
     @Autowired
+    private IBindAccountLoginService bindAccountLoginService;
+    @Autowired
     private BindAccountLoginMapper bindAccountLoginMapper;
 
     @Autowired
     private BytedanceUrlInfoMapper urlInfoMapper;
 
     @Override
-    public boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId) {
+    public boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId, String advertiserName) {
         Map<String, Object> requestMap = new HashMap<>();
         requestMap.put("advertiser_id", advertiserId);
         requestMap.put("account_name", accountName);
@@ -71,6 +79,7 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         bindAccountLogin.setPassword(password);
         bindAccountLogin.setAccountId(accountId);
         bindAccountLogin.setLoginType(loginType);
+        bindAccountLogin.setAccountName(advertiserName);
         bindAccountLogin.setUserId(userId);
         int i = bindAccountLoginMapper.insert(bindAccountLogin);
         if (i > 0) {
@@ -144,7 +153,6 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                 param.put("captcha", resp.pred_resl);
                 orderId = resp.req_id;
                 res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
-                System.out.println("res:" + res);
                 jsonNode = mapper.readTree(res);
                 errorCode = jsonNode.get("error_code").asInt();
             }
@@ -188,13 +196,18 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         Map<String, Object> resultMap = new HashMap<>();
         //1:获取用户名密码
         Long accountId = requestJson.getLong("accountId");
-        System.out.println(accountId);
         Long userOrientationId = requestJson.getLong("userOrientationId");
-        BindAccountLogin bindAccountLogin = bindAccountLoginMapper.selectById(accountId);
+        BindAccountLogin bindAccountLogin = bindAccountLoginService.selectByAccountId(accountId + "");
         if (null == bindAccountLogin) {
             ResultMapUtils.setResultMap(resultMap, StatusCode.ACCOUNT_HAS_NOT_EXIST.getCode());
             return resultMap;
         }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
+        if (null == token) {
+            ResultMapUtils.setResultMap(resultMap, StatusCode.ACCOUNT_HAS_NOT_EXIST.getCode());
+            return resultMap;
+        }
+        JSONObject wordsObject = fileInfoService.getCreativeWord(token, token.getAccountId());
         String url = "https://ad.oceanengine.com/pages/login/index.html";
         System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
         ChromeOptions chromeOptions = new ChromeOptions();
@@ -209,7 +222,8 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         chromeOptions.setAcceptInsecureCerts(true);
         WebDriver webDriver = new ChromeDriver(chromeOptions);
         try {
-            webDriver.get(url);  //获取登录页面
+            //获取登录页面
+            webDriver.get(url);
             for (Cookie cookie : webDriver.manage().getCookies()) {
                 BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
                 ck.setDomain("ad.oceanengine.com");
@@ -271,10 +285,11 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                     Cookie cookie = new Cookie(ck.getName(), ck.getValue(), "." + ck.getDomain(), ck.getPath(), ck.getExpiryDate());
                     webDriver.manage().addCookie(cookie);
                 }
-
-                webDriver.get("https://ad.oceanengine.com/pages/promotion.html#/ad");//登录成功 进入推广页面
+                //登录成功 进入推广页面
+                webDriver.get("https://ad.oceanengine.com/pages/promotion.html#/ad");
                 Thread.sleep(3000);
-                webDriver.get("https://ad.oceanengine.com/pages/campaign/create.html");//创建广告组页面
+                //创建广告组页面
+                webDriver.get("https://ad.oceanengine.com/pages/campaign/create.html");
                 String templateName = requestJson.getString("templateName");
                 Map<String, Object> campaignParam = new HashMap<>();
                 String uuid = UUID.randomUUID().toString();
@@ -305,14 +320,17 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                 header.put("X-CSRFToken", csrftoken);
                 header.put("X-Requested-With", "XMLHttpRequest");
                 header.put("Referer", "https://ad.oceanengine.com/pages/campaign/create.html");
-                res = HttpUtils2.httpPostRequest("https://ad.oceanengine.com/overture/campaign/create/", campaignParam, header);// 创建广告组返回信息
+                // 创建广告组返回信息
+                res = HttpUtils2.httpPostRequest("https://ad.oceanengine.com/overture/campaign/create/", campaignParam, header);
                 System.out.println(res);
                 Integer itratorNum = requestJson.getInteger("itratorNum");
+                JSONObject data = new JSONObject();
                 if (null != itratorNum && itratorNum > 0) {
                     //循环创建广告计划
                     for (int i = 0; i < itratorNum; i++) {
                         JsonNode node = mapper.readTree(res);
-                        String campaignId = node.get("data").get("campaign_id").asText();  //广告组id
+                        //广告组id
+                        String campaignId = node.get("data").get("campaign_id").asText();
                         String url2 = "https://ad.oceanengine.com/pages/ad/create.html?campaign_id=" + campaignId + "&landing_type=3&temp_id=ADvQb";
                         webDriver.get(url2);
                         header.put("Referer", url2);
@@ -329,16 +347,19 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                         String tokenStr = HttpUtils2.httpPostRequest("https://ad.oceanengine.com/api/v1/hl/ad/audience/estimate/", audienceParam, header);
                         JsonNode tokenNode = mapper.readTree(tokenStr);
                         Map<String, Object> planParam = new HashMap<>();
-                        planParam.put("name", templateName + "-广告计划-" + uuid.substring(1, 7) + i);//模板名称
+                        //模板名称
+                        planParam.put("name", templateName + "-广告计划-" + uuid.substring(1, 7) + i);
                         Integer deliveryRange = requestJson.getInteger("deliveryRange");
-                        planParam.put("delivery_range", deliveryRange);  //投放形式
+                        //投放形式
+                        planParam.put("delivery_range", deliveryRange);
                         if (deliveryRange == 2) {
-                            planParam.put("union_video_type", requestJson.getInteger("deliveryForm")); //投放形式 1:激励视频 2:原生
+                            //投放形式 1:激励视频 2:原生
+                            planParam.put("union_video_type", requestJson.getInteger("deliveryForm"));
                         }
-                        planParam.put("classify", requestJson.getString("adCategory")); //广告类别
-                        planParam.put("projectid", ""); //
+                        planParam.put("projectid", "");
                         Integer downloadType = requestJson.getInteger("downloadType");
-                        planParam.put("download_type", downloadType); //下载方式  1:下载包 2:h5
+                        //下载方式  1:下载包 2:h5
+                        planParam.put("download_type", downloadType);
                         Long urlId = requestJson.getLong("urlId");
                         BytedanceUrlInfo urlInfo = urlInfoMapper.selectById(urlId);
                         if (downloadType == 1) {
@@ -346,59 +367,92 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                             planParam.put("package", urlInfo.getPackageName());
                         }
                         if (downloadType == 2) {
-                            planParam.put("external_url", urlInfo.getUrl());  // 落地页链接
+                            // 落地页链接
+                            planParam.put("external_url", urlInfo.getUrl());
                         }
-                        planParam.put("delivery_range", 1);  // 投放范围
-                        planParam.put("classify", 5);  //广告类别  5 内广
+                        // 投放范围
+                        planParam.put("delivery_range", 1);
+                        //广告类别  5 内广
+                        planParam.put("classify", 5);
                         planParam.put("projectid", "");
                         planParam.put("localGeolocation", new ArrayList<String>());
 //                        planParam.put("external_action", 4);
-                        planParam.put("open_url", ""); //  应用直达链接
+                        //  应用直达链接
+                        planParam.put("open_url", "");
                         planParam.put("style_type", 0);
-                        planParam.put("location_type", 4); //受众位置类型
-                        planParam.put("hide_if_exists", 0); // 过滤已安装,当推广目标为安卓应用下载时可填,0表示不过滤,1表示过滤,默认为不过滤
-                        planParam.put("interest_tag_mode", 0); //兴趣分类
+                        //受众位置类型
+                        planParam.put("location_type", 4);
+                        // 过滤已安装,当推广目标为安卓应用下载时可填,0表示不过滤,1表示过滤,默认为不过滤
+                        planParam.put("hide_if_exists", 0);
+                        //兴趣分类
+                        planParam.put("interest_tag_mode", 0);
                         planParam.put("token", tokenNode.get("data").get("token").asText());
-                        planParam.put("toutiao", 100000005);  //头条预估数据
-                        planParam.put("aweme", 150000005); //抖音预估数据
-                        planParam.put("video_app", 40000005);//西瓜预估数据
-                        planParam.put("hotsoon", 40000005); //火山预估数据
-                        planParam.put("aweme_account_fans", 0); //账号粉丝相似人群
-                        planParam.put("auto_extend_enabled", 0);// 智能放量????
-                        planParam.put("budget_mode", requestJson.getIntValue("budgetPriceMode"));  // 广告预算类型  0 日预算  1 总预算
-                        planParam.put("budget", requestJson.getIntValue("budgetPrice")); //广告预算
+                        //头条预估数据
+                        planParam.put("toutiao", 100000005);
+                        //抖音预估数据
+                        planParam.put("aweme", 150000005);
+                        //西瓜预估数据
+                        planParam.put("video_app", 40000005);
+                        //火山预估数据
+                        planParam.put("hotsoon", 40000005);
+                        //账号粉丝相似人群
+                        planParam.put("aweme_account_fans", 0);
+                        // 智能放量????
+                        planParam.put("auto_extend_enabled", 0);
+                        // 广告预算类型  0 日预算  1 总预算
+                        planParam.put("budget_mode", requestJson.getIntValue("budgetPriceMode"));
+                        //广告预算
+                        planParam.put("budget", requestJson.getIntValue("budgetPrice"));
                         int scheduleType = requestJson.getIntValue("dateQuantum");
-                        planParam.put("schedule_type", scheduleType); //广告投放时间类型   默认1 1:不限  2:按时间???
+                        //广告投放时间类型   默认1 1:不限  2:按时间???
+                        planParam.put("schedule_type", scheduleType);
                         if (scheduleType == 2) {
-                            planParam.put("start_time", requestJson.getString("startDate")); //广告投放起始时间
-                            planParam.put("end_time", requestJson.getString("endDate"));//广告投放结束时间
+                            //广告投放起始时间
+                            planParam.put("start_time", requestJson.getString("startDate"));
+                            //广告投放结束时间
+                            planParam.put("end_time", requestJson.getString("endDate"));
                         }
-                        planParam.put("week_schedule", new ArrayList<String>());  //投放时段
-                        planParam.put("week_time", new ArrayList<ArrayList<Integer>>());//投放时段
+                        //投放时段
+                        planParam.put("week_schedule", new ArrayList<String>());
+                        //投放时段
+                        planParam.put("week_time", new ArrayList<ArrayList<Integer>>());
                         int pricing = requestJson.getIntValue("pricing");
-                        planParam.put("pricing", pricing); //计划出价类型  9 按展示付费  7 按点击付费 8 按转化付费
-                        planParam.put("cpa_phrase", 2); //出价为OCPC时,计划处于哪个阶段??
+                        //计划出价类型  9 按展示付费  7 按点击付费 8 按转化付费
+                        planParam.put("pricing", pricing);
+                        //出价为OCPC时,计划处于哪个阶段??
+                        planParam.put("cpa_phrase", 2);
                         planParam.put("is_union_slot", "");
-                        planParam.put("hide_if_converted", 1); //过滤已转化用户类型字段,只有转化为目标时可填 优化目标为转化才展示
-                        planParam.put("flow_control_mode", requestJson.getIntValue("flowControlMode")); //投放速度/投放方式使用字段
+                        //过滤已转化用户类型字段,只有转化为目标时可填 优化目标为转化才展示
+                        planParam.put("hide_if_converted", 1);
+                        //投放速度/投放方式使用字段
+                        planParam.put("flow_control_mode", requestJson.getIntValue("flowControlMode"));
                         if (pricing == 9) {
                             planParam.put("cpa_bid", requestJson.getIntValue("convertPrice"));
                         } else {
                             planParam.put("bid", requestJson.getIntValue("convertPrice"));
                         }
-                        planParam.put("smart_bid_type", requestJson.getIntValue("bidType")); //自动出价类型,OCPM支持
-                        planParam.put("adjust_cpa", 0); //是否调整自动出价   允许值: "0", "1"  默认值: 0
+                        //自动出价类型,OCPM支持
+                        planParam.put("smart_bid_type", requestJson.getIntValue("bidType"));
+                        //是否调整自动出价   允许值: "0", "1"  默认值: 0
+                        planParam.put("adjust_cpa", 0);
                         planParam.put("app_bid_ratio", new Object());
                         planParam.put("campaign_id", campaignId);
-                        String downLoadMode = requestJson.getString("downloadMode");
                         if ("IOS".equals(urlInfo.getType())) {
-                            planParam.put("app_type", 202); //app 类型 201 应用推广 安卓 201 应用推广 ios
+                            //app 类型 201 应用推广 安卓 201 应用推广 ios
+                            planParam.put("app_type", 202);
                         } else if ("android".equals(urlInfo.getType())) {
                             planParam.put("app_type", 201);
                         }
-                        Long convertId = requestJson.getLong("convertId");
-                        if (null != convertId && convertId != 0) {
-                            planParam.put("convert_id", convertId);
+                        String convertType = requestJson.getString("convertType");
+                        if (null != convertType && convertType.equals("SIMPLE")) {
+                            //普通应用下载
+                            planParam.put("external_action", requestJson.getLong("simpleDeliverytarget"));
+                        }
+                        if (null != convertType && convertType.equals("API")) {
+                            Long convertId = requestJson.getLong("convertId");
+                            if (null != convertId && convertId != 0) {
+                                planParam.put("convert_id", convertId);
+                            }
                         }
                         System.out.println(planParam);
                         String createResult = HttpUtils2.httpPostRequest("https://ad.oceanengine.com/overture/ad/create/", planParam, header);
@@ -412,20 +466,158 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
                             resultMap.put("success", false);
                             return resultMap;
                         }
+                        //广告计划id
                         Long adId = result.getJSONObject("data").getLong("ad_id");
-
                         //修改用户定向
                         ByteDanceUserOrientationTemplate template = userOrientationTemplateMapper.selectById(userOrientationId);
                         if (null != template) {
-                            CtopOauthToken token = tokenService.getOauthTokenByAccountId(bindAccountLogin.getAccountId());
-                            if (null != token) {
-                                //获取modify_time
-                                Thread.sleep(5000L);
-                                advertiserDataService.getAdvertiserPlan(bindAccountLogin.getAccountId(), adId + "");
+                            //获取modify_time
+                            Thread.sleep(5000L);
+                            advertiserDataService.getAdvertiserPlan(bindAccountLogin.getAccountId(), adId + "");
+                            advertiserDataService.updateAd(token, adId, template);
+                        }
+                        Long creativeTemplateId = requestJson.getLong("creativeTemplateId");
+
+                        //创建广告创意
+                        String name = requestJson.getString("name");
+                        data.put("title", name + "_" + System.currentTimeMillis() + "_" + "汇创广告创意");
+                        if (i == 0) {
+                            BytedanceCreativeLaunchTemplate launchTemplate = launchTemplateMapper.selectById(creativeTemplateId);
+                            data.put("ad_id", adId);
+                            String advertiseLoaction = launchTemplate.getAdvertiseLocation();
+                            //优选广告位
+                            if (null != advertiseLoaction && advertiseLoaction.equals("great") && null != launchTemplate.getSmartInventory() && !"".equals(launchTemplate.getSmartInventory())) {
+                                data.put("smart_inventory", launchTemplate.getSmartInventory());
+                            }
+                            //按媒体指定位置
+                            if (null != advertiseLoaction && "media".equals(advertiseLoaction)) {
+                                String inventoryTypeStr = launchTemplate.getInventoryType();
+                                JSONArray inventoryType = JSONArray.parseArray(inventoryTypeStr);
+                                data.put("inventory_type", inventoryType);
+                            }
+                            //按场景指定位置
+                            if (null != advertiseLoaction && "sence".equals(advertiseLoaction)) {
+                                data.put("scene_inventory", launchTemplate.getSceneInventory());
+                            }
+
+                            //广告评论
+                            data.put("is_comment_disable", launchTemplate.getCommentDisable());
+                            //创意展现方式
+                            data.put("creative_display_mode", launchTemplate.getCreativeDisplayMode());
+                            //创意分类
+                            JSONArray categorys = JSONArray.parseArray(launchTemplate.getThirdIndustryId());
+                            String thirdIndustryId = categorys.getString(2);
+                            data.put("third_industry_id", thirdIndustryId);
+                            //创意标签
+                            data.put("ad_keywords", JSONArray.parseArray(launchTemplate.getAdKeywords()));
+                            //创意标题
+                            data.put("title", name + "_" + System.currentTimeMillis() + "_" + "汇创广告创意");
 
-                                System.out.println(111);
-                                advertiserDataService.updateAd(token, adId, template);
+                            //创意方式
+                            String creativeType = requestJson.getString("creativeType");
+                            if (null != creativeType && creativeType.equals("customize")) {
+                                //自定义创意
+                                //拼装creative参数
+                                JSONArray creatives = new JSONArray();
+                                JSONArray getCreatives = requestJson.getJSONArray("creatives");
+                                if (null != getCreatives && getCreatives.size() > 0) {
+                                    getCreatives.forEach(k -> {
+                                        JSONObject createtive = JSONObject.parseObject(JSONObject.toJSONString(k));
+                                        JSONObject setCreatetive = new JSONObject();
+                                        String imageMode = createtive.getString("typeCode");
+                                        setCreatetive.put("image_mode", imageMode);
+                                        String title = createtive.getString("text");
+                                        setCreatetive.put("title", title);
+                                        JSONArray ids = getCreativeWordIds(title, wordsObject);
+                                        setCreatetive.put("creative_word_ids", ids);
+                                        String videoUrl = createtive.getString("vadioUrl");
+                                        String imageUrl = createtive.getString("imageUrl");
+                                        if ("CREATIVE_IMAGE_MODE_VIDEO".equals(imageMode) || "CREATIVE_IMAGE_MODE_VIDEO_VERTICAL".equals(imageMode)) {
+                                            //视频创意
+                                            if (null != videoUrl) {
+                                                Map<String, Object> getImageResult = fileInfoService.uploadImageToBytedance(token.getAccountId() + "", imageUrl);
+                                                JSONArray horizonVideoCoverImageArray = (JSONArray) getImageResult.get("imageIds");
+                                                String imageId = horizonVideoCoverImageArray.getString(0);
+                                                Map<String, Object> getVideoResult = fileInfoService.uploadVideoToBytedance(token.getAccountId() + "", videoUrl);
+                                                String videoId = (String) getVideoResult.get("videoId");
+                                                setCreatetive.put("image_id", imageId);
+                                                setCreatetive.put("video_id", videoId);
+                                                creatives.add(setCreatetive);
+                                            }
+                                        } else {
+                                            //图片创意
+                                            if (null != videoUrl && !"".equals(videoUrl.trim())) {
+                                                Map<String, Object> getImageResult = fileInfoService.uploadImageToBytedance(token.getAccountId() + "", videoUrl);
+                                                JSONArray imageArray = (JSONArray) getImageResult.get("imageIds");
+                                                setCreatetive.put("image_ids", imageArray);
+                                                creatives.add(setCreatetive);
+                                            }
+                                        }
+                                    });
+                                    data.put("creatives", creatives);
+                                }
+                            } else {
+                                data.put("creative_material_mode", "STATIC_ASSEMBLE");
+                                //程序化创意
+                                JSONArray titleArray = requestJson.getJSONArray("titles");
+                                if (null != titleArray && titleArray.size() > 0) {
+                                    JSONArray titleList = new JSONArray();
+                                    titleArray.forEach(v -> {
+                                        JSONObject getTitleObject = JSONObject.parseObject(JSONObject.toJSONString(v));
+                                        ;
+                                        JSONObject titleObject = new JSONObject();
+                                        String getTitle = getTitleObject.getString("text");
+                                        titleObject.put("title", getTitle);
+                                        JSONArray ids = getCreativeWordIds(getTitle, wordsObject);
+                                        titleObject.put("creative_word_ids", ids);
+                                        titleList.add(titleObject);
+                                    });
+                                    data.put("title_list", titleList);
+                                }
+
+                                JSONArray getCreatives = requestJson.getJSONArray("creatives");
+                                if (null != getCreatives && getCreatives.size() > 0) {
+                                    JSONArray imageList = new JSONArray();
+                                    getCreatives.forEach(v -> {
+                                        JSONObject createtive = JSONObject.parseObject(JSONObject.toJSONString(v));
+                                        JSONObject setCreatetive = new JSONObject();
+                                        String imageMode = createtive.getString("typeCode");
+                                        setCreatetive.put("image_mode", imageMode);
+                                        String videoUrl = createtive.getString("vadioUrl");
+                                        String imageUrl = createtive.getString("imageUrl");
+                                        if ("CREATIVE_IMAGE_MODE_VIDEO".equals(imageMode) || "CREATIVE_IMAGE_MODE_VIDEO_VERTICAL".equals(imageMode)) {
+                                            if (null != videoUrl) {
+                                                Map<String, Object> getImageResult = fileInfoService.uploadImageToBytedance(token.getAccountId() + "", imageUrl);
+                                                JSONArray horizonVideoCoverImageArray = (JSONArray) getImageResult.get("imageIds");
+                                                String imageId = horizonVideoCoverImageArray.getString(0);
+                                                Map<String, Object> getVideoResult = fileInfoService.uploadVideoToBytedance(token.getAccountId() + "", videoUrl);
+                                                String videoId = (String) getVideoResult.get("videoId");
+                                                setCreatetive.put("image_id", imageId);
+                                                setCreatetive.put("video_id", videoId);
+                                                imageList.add(setCreatetive);
+                                            }
+                                        } else {
+                                            if (null != videoUrl && !"".equals(videoUrl.trim())) {
+                                                Map<String, Object> getImageResult = fileInfoService.uploadImageToBytedance(token.getAccountId() + "", videoUrl);
+                                                JSONArray imageArray = (JSONArray) getImageResult.get("imageIds");
+                                                setCreatetive.put("image_ids", imageArray);
+                                                imageList.add(setCreatetive);
+                                            }
+                                        }
+                                    });
+                                    data.put("image_list", imageList);
+                                }
                             }
+                            //应用下载详情页
+                            data.put("web_url", requestJson.getString("webUrl"));
+                            //应用名
+                            data.put("app_name", requestJson.getString("appName"));
+                        }
+                        System.out.println(data.toJSONString());
+                        resultMap = byteDanceCreativeService.creativeCreate(token.getAccountId() + "", adId, data.toJSONString());
+                        Boolean createSuccess = (Boolean) resultMap.get("success");
+                        if (null != createSuccess && !createSuccess) {
+                            return resultMap;
                         }
                     }
                 }
@@ -443,6 +635,30 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         return resultMap;
     }
 
+    public JSONArray getCreativeWordIds(String getTitle, JSONObject wordsObject) {
+        ArrayList<String> wordsString = StringUtils.stringCutFromBrace(getTitle);
+        JSONArray creativeWords = wordsObject.getJSONArray("creative_word");
+        JSONArray ids = new JSONArray();
+        wordsString.forEach(v -> {
+            creativeWords.forEach(word -> {
+                JSONObject wordObject = (JSONObject) word;
+                String name = wordObject.getString("name");
+                Integer id = wordObject.getInteger("creative_word_id");
+                if (v.equals(name)) {
+                    ids.add(id);
+                }
+            });
+        });
+        return ids;
+    }
+
+
+    @Autowired
+    private BytedanceCreativeLaunchTemplateMapper launchTemplateMapper;
+    @Autowired
+    private IByteDanceCreativeService byteDanceCreativeService;
+    @Autowired
+    private IFileInfoService fileInfoService;
     @Autowired
     private ByteDanceUserOrientationTemplateMapper userOrientationTemplateMapper;
     @Autowired

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.fileupload.controller;
 
 import cn.com.ctop.common.module.service.IFileInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -21,4 +22,9 @@ public class FileController {
     public Map<String, Object> chenckFile(String code) {
         return fileInfoService.checkFile(code);
     }
+
+    @PostMapping("file/insert")
+    public Map<String, Object> insertFile(String code, String url) {
+        return fileInfoService.insertFile(code, url);
+    }
 }

+ 28 - 54
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,12 +1,11 @@
 package org.jeecg;
 
-import cn.com.ctop.common.module.utils.OSSUtils;
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IFileInfoService;
+import cn.com.ctop.common.module.utils.OSSUtils;
+import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.toutiao.entity.ByteDanceUserOrientationTemplate;
-import cn.com.ctop.toutiao.entity.BytedanceAreaInfo;
 import cn.com.ctop.toutiao.entity.BytedanceInterestCategory;
 import cn.com.ctop.toutiao.mapper.ByteDanceUserOrientationTemplateMapper;
 import cn.com.ctop.toutiao.mapper.BytedanceAreaInfoMapper;
@@ -16,7 +15,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.util.jsonschema.JsonschemaUtil;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
-import org.jeecg.modules.ctop.service.IReportService;
 import org.jeecg.modules.demo.mock.MockController;
 import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
 import org.jeecg.modules.demo.test.service.IJeecgDemoService;
@@ -29,8 +27,8 @@ import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Map;
 
 @RunWith(SpringRunner.class)
@@ -47,26 +45,6 @@ public class SampleTest {
     private MockController mock;
 
     @Autowired
-    private IReportService reportService;
-
-    @Test
-    public void loadCustomerData() {
-        Map<String, Object> result = new HashMap<>();
-        String csvPath = "D:\\工作文件\\360借条\\借条后台数据实时.csv";
-        reportService.insertCustomerInfo(csvPath, "utf8");
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
-    }
-
-    @Test
-    public void loadPlatformData() {
-        Map<String, Object> result = new HashMap<>();
-        String csvPath4 = "D:\\工作文件\\360借条\\快手后台数据-户4.csv";
-        reportService.insertPlatformInfo(csvPath4, "GBK", 4L);
-        String csvPath1 = "D:\\工作文件\\360借条\\快手后台数据-户1.csv";
-        reportService.insertPlatformInfo(csvPath1, "GBK", 1L);
-    }
-
-    @Autowired
     private ICreateInternalService createInternalService;
 
     @Test
@@ -158,36 +136,32 @@ public class SampleTest {
         }
     }
 
+    @Autowired
+    private IFileInfoService fileInfoService;
+
     @Test
     public void setJSONFile() {
-        String path = "C:\\Users\\宋英豪\\Downloads\\data_20190222\\city.json";
-        String jsonString = JsonschemaUtil.readJsonFile(path);
-        JSONObject data = JSONObject.parseObject(jsonString);
-        data.forEach((k, v) -> {
-            JSONObject getData = data.getJSONObject(k);
-            BytedanceAreaInfo areaInfo = new BytedanceAreaInfo();
-            Integer level = getData.getInteger("level");
-            Long id = getData.getLong("id");
-            String name = getData.getString("name");
-            System.out.println(name);
-            String parent = getData.getString("parent");
-            areaInfo.setId(id);
-            areaInfo.setLevel(level);
-            String code = id + "";
-            if (level == 1) {
-                areaInfo.setParentCode(parent);
-                areaInfo.setCode(code);
-            } else if (level == 2) {
-                areaInfo.setParentCode(code.substring(0, 2));
-                areaInfo.setCode(code.substring(0, 4));
-            } else {
-                areaInfo.setParentCode(code.substring(0, 4));
-                areaInfo.setCode(code);
-            }
-            areaInfo.setName(name);
-            areaInfo.setCreateTime(new Date());
-            areaInfo.setUpdateTime(new Date());
-            areaInfoMapper.insert(areaInfo);
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId("93289889842");
+        JSONObject wordsObject = fileInfoService.getCreativeWord(token, token.getAccountId());
+        String getTitle = "哈哈{日期}{男人女人}";
+        JSONArray ids = getCreativeWordIds(getTitle, wordsObject);
+        System.out.println(ids);
+    }
+
+    public JSONArray getCreativeWordIds(String getTitle, JSONObject wordsObject) {
+        ArrayList<String> wordsString = StringUtils.stringCutFromBrace(getTitle);
+        JSONArray creativeWords = wordsObject.getJSONArray("creative_word");
+        JSONArray ids = new JSONArray();
+        wordsString.forEach(v -> {
+            creativeWords.forEach(word -> {
+                JSONObject wordObject = (JSONObject) word;
+                String name = wordObject.getString("name");
+                Integer id = wordObject.getInteger("creative_word_id");
+                if (v.equals(name)) {
+                    ids.add(id);
+                }
+            });
         });
+        return ids;
     }
 }

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java

@@ -40,6 +40,13 @@ public class BindAccountLogin {
     @Excel(name = "广告id", width = 15)
     @ApiModelProperty(value = "广告id")
     private String advertiserId;
+
+    /**
+     * 广告名称
+     */
+    @Excel(name = "广告名称", width = 15)
+    @ApiModelProperty(value = "广告名称")
+    private String advertiserName;
     /**
      * 广告id
      */

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

@@ -0,0 +1,19 @@
+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;
+
+import java.io.Serializable;
+import java.util.Map;
+
+@Data
+public class HttpClientEntity implements Serializable {
+    private String url;
+    private CloseableHttpClient closeableHttpClient;
+    private CookieStore cookieStore;
+    private Map<String, String> headers;
+    private Map<String, Object> params;
+    private String result;
+}

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

@@ -10,4 +10,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Version: V1.0
  */
 public interface IBindAccountLoginService extends IService<BindAccountLogin> {
+    BindAccountLogin selectByAccountId(String accountId);
 }

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IFileInfoService.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.service;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.FileInfo;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -28,4 +29,8 @@ public interface IFileInfoService extends IService<FileInfo> {
     Map<String, Object> getCreativeWords(Long accountId);
 
     public JSONObject getSiteList(Long accountId);
+
+    JSONObject getCreativeWord(CtopOauthToken token, Long advertiserId);
+
+    Map<String, Object> insertFile(String code, String url);
 }

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.mapper.BindAccountLoginMapper;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -16,4 +17,10 @@ import org.springframework.stereotype.Service;
 @Slf4j
 @Service
 public class BindAccountLoginServiceImpl extends ServiceImpl<BindAccountLoginMapper, BindAccountLogin> implements IBindAccountLoginService {
+    @Override
+    public BindAccountLogin selectByAccountId(String accountId) {
+        QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId).orderByDesc("id").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
 }

+ 20 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -161,11 +161,12 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
         return null;
     }
 
+    @Override
     public JSONObject getCreativeWord(CtopOauthToken token, Long advertiserId) {
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/creative_word/select/";
         // 请求参数
-        Map<String, Object> data = new HashMap();
+        JSONObject data = new JSONObject();
         data.put("advertiser_id", advertiserId);
         JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, data);
         JSONArray creativeWords = resultObject.getJSONObject("data").getJSONArray("creative_word");
@@ -186,13 +187,30 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
         return resultObject;
     }
 
+    @Override
+    public Map<String, Object> insertFile(String code, String url) {
+        Map<String, Object> resultMap = new HashMap();
+        FileInfo fileInfo = new FileInfo();
+        fileInfo.setFileName("");
+        fileInfo.setFileUrl(url);
+        fileInfo.setMd5(code);
+        fileInfo.setPath("");
+        fileInfo.setPlatformType("");
+        fileInfo.setAccountId(0L);
+        fileInfo.setFileId("");
+        fileInfo.setType("");
+        this.saveOrUpdate(fileInfo);
+        ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
+        return resultMap;
+    }
+
     public JSONObject searchIndustry(CtopOauthToken token, Integer level) {
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/industry/get/";
         if (null != level) {
             url += "?level=" + level;
         }
-        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, new HashMap<>());
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, new JSONObject());
     }
 
     public JSONObject uploadAdImage(CtopOauthToken token, String imageUrl, String advertiserId) {

+ 171 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpClientUtils.java

@@ -0,0 +1,171 @@
+package cn.com.ctop.common.module.utils;
+
+import cn.com.ctop.common.module.entity.HttpClientEntity;
+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.client.CookieStore;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.CookieSpecs;
+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.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.cookie.Cookie;
+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.message.BasicNameValuePair;
+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.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+public class HttpClientUtils {
+    public CookieStore cookieStore = new BasicCookieStore();
+
+    public CloseableHttpClient createSSLClientDefault() {
+        try {
+            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
+                //信任所有证书
+                @Override
+                public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+                    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();
+        } catch (Exception e) {
+            log.error("处理Https证书异常", e);
+        }
+        return HttpClients.createDefault();
+    }
+
+    public HttpClientEntity httpGetRequest(HttpClientEntity httpClientEntity) {
+        try {
+            CookieStore cs = httpClientEntity.getCookieStore();
+            if (cs != null) {
+                for (Cookie ck : cs.getCookies()) {
+                    cookieStore.addCookie(ck);
+                }
+            }
+            HttpResponse response = null;
+            HttpGet httpGet = new HttpGet(httpClientEntity.getUrl());
+            String result = null;
+            CloseableHttpClient httpClient = httpClientEntity.getCloseableHttpClient();
+            response = httpClient.execute(httpGet);
+
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                httpClientEntity.setUrl(newUrl);
+                return httpGetRequest(httpClientEntity);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                String line = null;
+                StringBuilder builder = new StringBuilder();
+                while ((line = reader.readLine()) != null) {
+                    builder.append(line);
+                }
+                result = builder.toString();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        httpClientEntity.setCookieStore(cookieStore);
+        return httpClientEntity;
+    }
+
+    public HttpClientEntity httpPostParamRequest(HttpClientEntity httpClientEntity) {
+        try {
+            CookieStore cs = httpClientEntity.getCookieStore();
+            if (cs != null) {
+                for (Cookie ck : cs.getCookies()) {
+                    cookieStore.addCookie(ck);
+                }
+            }
+
+            HttpPost httppost = new HttpPost(httpClientEntity.getUrl());
+            for (String key : httpClientEntity.getHeaders().keySet()) {
+                httppost.setHeader(key, httpClientEntity.getHeaders().get(key));
+            }
+            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
+            for (String key : httpClientEntity.getParams().keySet()) {
+                BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(httpClientEntity.getParams().get(key)));
+                paramList.add(basicNameValuePair);
+            }
+            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
+            httppost.setEntity(formEntity);
+            CloseableHttpClient httpClient = httpClientEntity.getCloseableHttpClient();
+            HttpResponse response = httpClient.execute(httppost);
+
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                httpClientEntity.setUrl(newUrl);
+                return httpPostParamRequest(httpClientEntity);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                String result = EntityUtils.toString(response.getEntity());
+                log.info(result);
+                httpClientEntity.setResult(result);
+                httpClientEntity.setCloseableHttpClient(httpClient);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        System.out.println(new Gson().toJson(cookieStore.getCookies()));
+        httpClientEntity.setCookieStore(cookieStore);
+        return httpClientEntity;
+    }
+
+    public HttpClientEntity callingGraph(HttpClientEntity httpClientEntity, String json) {
+        CookieStore cs = httpClientEntity.getCookieStore();
+        if (cs != null) {
+            for (Cookie ck : cs.getCookies()) {
+                cookieStore.addCookie(ck);
+            }
+        }
+        HttpClient httpClient = httpClientEntity.getCloseableHttpClient();
+        HttpResponse response = null;
+        HttpPost httpPost = new HttpPost(httpClientEntity.getUrl());
+        for (String key : httpClientEntity.getHeaders().keySet()) {
+            httpPost.setHeader(key, httpClientEntity.getHeaders().get(key));
+        }
+        httpPost.setHeader("Content-Type", "application/json");
+
+        try {
+            StringEntity entity = new StringEntity(json, "utf-8");
+            httpPost.setEntity(entity);
+            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);
+            }
+            httpClientEntity.setResult(builder.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        httpClientEntity.setCookieStore(cookieStore);
+        System.out.println(new Gson().toJson(cookieStore.getCookies()));
+        return httpClientEntity;
+    }
+}

+ 33 - 99
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java

@@ -11,7 +11,6 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.NameValuePair;
-import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.CookieSpecs;
@@ -54,7 +53,7 @@ import java.util.*;
 @Slf4j
 public class HttpUtils {
 
-    public static JSONObject bytedanceGetRequest(String accessToken, String url, Map<String, Object> params) {
+    public static JSONObject bytedanceGetRequest(String accessToken, String url, JSONObject params) {
         // 构造请求
         HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
             @Override
@@ -68,11 +67,11 @@ public class HttpUtils {
         try {
             client = HttpClientBuilder.create().build();
             httpEntity.setURI(URI.create(url));
-            httpEntity.setEntity(new StringEntity(JSONObject.toJSONString(params), ContentType.APPLICATION_JSON));
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
             response = client.execute(httpEntity);
             if (response != null && response.getStatusLine().getStatusCode() == 200) {
                 BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuffer result = new StringBuffer();
+                StringBuilder result = new StringBuilder();
                 String line = "";
                 while ((line = bufferedReader.readLine()) != null) {
                     result.append(line);
@@ -80,16 +79,16 @@ public class HttpUtils {
                 bufferedReader.close();
                 return JSONObject.parseObject(result.toString());
             }
-        } catch (ClientProtocolException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
+        } catch (Exception e) {
+            log.error(e.getMessage());
         } finally {
             try {
                 if (response != null) {
                     response.close();
                 }
-                client.close();
+                if (client != null) {
+                    client.close();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }
@@ -109,25 +108,24 @@ public class HttpUtils {
             response = client.execute(httpEntity);
             if (response != null && response.getStatusLine().getStatusCode() == 200) {
                 BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuffer result = new StringBuffer();
+                StringBuilder result = new StringBuilder();
                 String line = "";
                 while ((line = bufferedReader.readLine()) != null) {
                     result.append(line);
                 }
                 bufferedReader.close();
-                System.out.println(JSONObject.parseObject(result.toString()));
                 return JSONObject.parseObject(result.toString());
             }
-        } catch (ClientProtocolException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
+        } catch (Exception e) {
             e.printStackTrace();
         } finally {
             try {
                 if (response != null) {
                     response.close();
                 }
-                client.close();
+                if (client != null) {
+                    client.close();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }
@@ -135,7 +133,7 @@ public class HttpUtils {
         return null;
     }
 
-    public static CookieStore cookieStore = new BasicCookieStore();
+    public static CookieStore COOKIESTORE = new BasicCookieStore();
     /**
      * setProxy(new HttpHost("106.125.239.179", 4245))
      */
@@ -153,7 +151,7 @@ public class HttpUtils {
             }).build();
             RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setCookieSpec(CookieSpecs.STANDARD).build();
             SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
-            return HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
+            return HttpClients.custom().setDefaultCookieStore(COOKIESTORE).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
         } catch (Exception e) {
             log.error("处理Https证书异常", e);
         }
@@ -166,19 +164,11 @@ public class HttpUtils {
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
-
-            List<Cookie> list = cookieStore.getCookies();
-            for (Cookie ck : list) {
-                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-            }
-            System.out.println("-------------------------------------");
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
             List<NameValuePair> paramList = new ArrayList<NameValuePair>();
             for (String key : param.keySet()) {
-                System.out.println(key + "=" + String.valueOf(param.get(key)));
-                System.out.println("-------------------------------------");
                 BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
                 paramList.add(basicNameValuePair);
             }
@@ -187,8 +177,6 @@ public class HttpUtils {
             UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
             // 第一步:通过setEntity 将我们的entity对象传递过去
             httppost.setEntity(formEntity);
-
-//            httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -210,21 +198,15 @@ public class HttpUtils {
     }
 
     public static String httpPostRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-//        HttpClient httpclient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            List<Cookie> list = cookieStore.getCookies();
-//            for (Cookie ck : list) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
-            //httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -247,21 +229,19 @@ public class HttpUtils {
 
 
     public static String httpPostRequestTest(String url, String body, Map<String, String> headers) {
-//        HttpClient httpclient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            List<Cookie> list = cookieStore.getCookies();
+            List<Cookie> list = COOKIESTORE.getCookies();
             for (Cookie ck : list) {
                 System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
             }
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
-            //httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -314,21 +294,15 @@ public class HttpUtils {
 
 
     public static String httpPostRequest(String url, JSONObject params, Map<String, String> headers) {
-//        HttpClient httpclient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            List<Cookie> list = cookieStore.getCookies();
-//            for (Cookie ck : list) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
-            //httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(params.toJSONString(), Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -353,19 +327,10 @@ public class HttpUtils {
         HttpClient httpClient = createSslClientDefault();
         HttpResponse response = null;
         HttpGet httpGet = new HttpGet(url);
-//        httpPost.setHeader("Content-Type", "application/json");
         String result = null;
         try {
             httpGet.setHeader("User-Agent", USER_AGENT);
-            List<Cookie> list2 = cookieStore.getCookies();
-//            for (Cookie ck : list2) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             response = httpClient.execute(httpGet);
-            List<Cookie> list = cookieStore.getCookies();
-//            for (Cookie ck : list) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
                 String newUrl = response.getFirstHeader("Location").getValue();
@@ -387,7 +352,6 @@ public class HttpUtils {
     }
 
     public static String httpRequest(String url, String strParams) throws Exception {
-//        HttpClient httpclient = HttpClientBuilder.create().build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
@@ -397,8 +361,6 @@ public class HttpUtils {
             httppost.setEntity(new StringEntity(strParams, Charset.forName("UTF-8")));
             HttpEntity respentity;
             HttpResponse response = httpClient.execute(httppost);
-            int code = response.getStatusLine().getStatusCode();
-
             respentity = response.getEntity();
             strReturn = EntityUtils.toString(respentity);
         } catch (Exception e) {
@@ -409,7 +371,6 @@ public class HttpUtils {
     }
 
     public static String httpRequest(String url, CookieStore cookies, Map<String, String> parameterMap) throws Exception {
-//        HttpClient httpclient = getHttpclient();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
@@ -430,7 +391,7 @@ public class HttpUtils {
     }
 
     public static List<NameValuePair> getParam(Map parameterMap) {
-        List<NameValuePair> param = new ArrayList<NameValuePair>();
+        List<NameValuePair> param = new ArrayList<>();
         Iterator it = parameterMap.entrySet().iterator();
         while (it.hasNext()) {
             Map.Entry parmEntry = (Map.Entry) it.next();
@@ -451,13 +412,7 @@ public class HttpUtils {
         HttpClient httpClient = createSslClientDefault();
         HttpResponse response = null;
         HttpPost httpPost = new HttpPost(url);
-        List<Cookie> list = cookieStore.getCookies();
-//        cookieStore.clear();
-//        for (Cookie ck : list) {
-//
-//            System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//        }
-//        System.out.println("-------------------------------------");
+        List<Cookie> list = COOKIESTORE.getCookies();
         httpPost.setHeader("Content-Type", "application/json");
         String result = null;
 
@@ -472,10 +427,6 @@ public class HttpUtils {
             while ((line = reader.readLine()) != null) {
                 builder.append(line);
             }
-//            for (Cookie ck : list) {
-//
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             result = builder.toString();
         } catch (Exception e) {
             e.printStackTrace();
@@ -483,11 +434,11 @@ public class HttpUtils {
         return result;
     }
 
-    public static Map<String, Integer> kuaishouNumberMap;
+    public static Map<String, Integer> KUAISHOUNUMBERMAP;
 
     public static Integer getKuaishouNumber(String key) {
-        if (kuaishouNumberMap == null) {
-            kuaishouNumberMap = new HashMap<>();
+        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
@@ -498,18 +449,18 @@ public class HttpUtils {
 //            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);
-            kuaishouNumberMap.put("500.0#736.0", 3);
-            kuaishouNumberMap.put("510.0#718.0", 4);
-            kuaishouNumberMap.put("493.0#722.0", 5);
-            kuaishouNumberMap.put("491.0#737.0", 6);
-            kuaishouNumberMap.put("498.0#704.0", 7);
-            kuaishouNumberMap.put("492.0#738.0", 8);
-            kuaishouNumberMap.put("484.0#737.0", 9);
+            KUAISHOUNUMBERMAP.put("494.0#735.0", 0);
+            KUAISHOUNUMBERMAP.put("265.0#713.0", 1);
+            KUAISHOUNUMBERMAP.put("495.0#719.0", 2);
+            KUAISHOUNUMBERMAP.put("500.0#736.0", 3);
+            KUAISHOUNUMBERMAP.put("510.0#718.0", 4);
+            KUAISHOUNUMBERMAP.put("493.0#722.0", 5);
+            KUAISHOUNUMBERMAP.put("491.0#737.0", 6);
+            KUAISHOUNUMBERMAP.put("498.0#704.0", 7);
+            KUAISHOUNUMBERMAP.put("492.0#738.0", 8);
+            KUAISHOUNUMBERMAP.put("484.0#737.0", 9);
         }
-        return kuaishouNumberMap.get(key);
+        return KUAISHOUNUMBERMAP.get(key);
     }
 
     public static void kuaishouTtf(String ttfName) {
@@ -521,44 +472,30 @@ public class HttpUtils {
 
             TTFParser ttfParser = new TTFParser();
             TrueTypeFont ttf = ttfParser.parse(urlconn.getInputStream());
-//            System.out.println(new Gson().toJson(ttf.getGlyph().getGlyphs()));
             GlyphData[] datas = ttf.getGlyph().getGlyphs();
             CmapSubtable[] tables = ttf.getCmap().getCmaps();
-            Gson gson = new Gson();
-//            System.out.println(gson.toJson(tables));
             CmapSubtable table = tables[0];
-            Map<String, Integer> numberMap = new HashMap<String, Integer>();
-            Map<String, String> fontMap = new HashMap<String, String>();
+            Map<String, String> fontMap = new HashMap<>();
             for (int i = 0; i <= 13; i++) {
                 GlyphData data = datas[i];
                 if (data != null) {
-//                    System.out.println("getBoundingBox" + data.getBoundingBox());
                     float fx = data.getBoundingBox().getLowerLeftX();
                     float fy = data.getBoundingBox().getLowerLeftY();
                     float rx = data.getBoundingBox().getUpperRightX();
                     float ry = data.getBoundingBox().getUpperRightY();
                     Integer num = getKuaishouNumber(String.valueOf(rx - fx) + "#" + String.valueOf(ry - fy));
-//                    if (num != null) {
-//                        System.out.println(num);
-//                    }
                     fontMap.put(String.valueOf((char) table.getCharCodes(i).get(0).intValue()), String.valueOf(num));
-
                 }
             }
-//            System.out.println(new Gson().toJson(fontMap));
             fontsMap.put(ttfName, fontMap);
             for (GlyphData data : datas) {
                 if (data != null) {
-//                    System.out.println("getBoundingBox" + data.getBoundingBox());
                     float fx = data.getBoundingBox().getLowerLeftX();
                     float fy = data.getBoundingBox().getLowerLeftY();
                     float rx = data.getBoundingBox().getUpperRightX();
                     float ry = data.getBoundingBox().getUpperRightY();
-                    Integer num = getKuaishouNumber(String.valueOf(fx) + "#" + String.valueOf(fy) + "#" + String.valueOf(rx) + "#" + String.valueOf(ry));
-//                    System.out.println(num);
                 }
             }
-//            System.out.println(new Gson().toJson(numberMap));
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -646,7 +583,6 @@ public class HttpUtils {
     public static String httpGet(String url, Map<String, Object> paramsMap, Map<String, String> headers) {
         String result = null;
         try {
-            // CloseableHttpClient httpClient = HttpClients.createDefault();
             //创建参数列表
             HttpClient httpclient = getHttpclient();
             StringBuilder postBody = null;
@@ -687,6 +623,4 @@ public class HttpUtils {
         }
         return result;
     }
-
-
 }

+ 2 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -22,8 +22,9 @@ public enum StatusCode {
     TEMPLATE_NAME_HAS_EXIST("模板名称已存在", -204, false),
     TEMPLATE_NAME_IS_NULL("模板名称为空", -205, false),
     FILE_HAS_NOT_UPLOAD("文件尚未上传", -206, false),
-    ACCOUNT_HAS_NOT_EXIST("用户信息不存在", -207, false),
+    ACCOUNT_HAS_NOT_EXIST("用户信息不存在", -207, false),
     USERNAME_OR_PASSWORD_ERROR("登录用户名或密码错误", -208, false),
+    ACCOUNT_HAS_NO_AUTHORIZE("该用户尚未进行授权", -209, false),
     FILE_HAS_UPLOAD("文件已经上传过", 0, false),
     COMMON_SERVER_ERROR("服务器内部错误", -102, false);
     private String desc;

+ 18 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StringUtils.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.common.module.utils;
+
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class StringUtils {
+    public static ArrayList<String> stringCutFromBrace(String origin) {
+        String pattern = "(?<=\\{)(.+?)(?=\\})";
+        Pattern p = Pattern.compile(pattern);
+        ArrayList list = new ArrayList();
+        Matcher m = p.matcher(origin);
+        while (m.find()) {
+            list.add(m.group());
+        }
+        return list;
+    }
+}

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

@@ -209,7 +209,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Override
     public KuaishouResult<KuaishouReportHourlyCampaign> getCampaignHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_REPORT;
-        Map<String, String> headers = new HashMap<String, String>();
+        Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", accessToken);
         Map<String, Object> param = new HashMap<String, Object>();

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

@@ -0,0 +1,132 @@
+package cn.com.ctop.kuaishou.modules.graphql.controller;
+
+import cn.com.ctop.kuaishou.modules.graphql.entity.KuaishouUserCookie;
+import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouUserCookieService;
+import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+@RestController
+@RequestMapping("/ks/web")
+public class KuaishouWebController {
+    @Autowired
+    private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
+    @Autowired
+    private IKuaishouUserCookieService kuaishouUserCookieService;
+
+    @PostMapping(value = "/login/qr")
+    public Result<Map<String, Object>> getQrCode() {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> resultMap = new HashMap<>();
+            String requestId = UUID.randomUUID().toString();
+            String img = kuaishouWebInterfaceService.qrLogin(requestId);
+            resultMap.put("requestId", requestId);
+            resultMap.put("qrcode", "data:image/png;base64," + img);
+            if (img != null) {
+                result.setSuccess(true);
+                result.setResult(resultMap);
+            } else {
+                result.setSuccess(false);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/user/list")
+    public Result<List<KuaishouUserCookie>> getUserCookieList() {
+        Result<List<KuaishouUserCookie>> result = new Result<>();
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        QueryWrapper<KuaishouUserCookie> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", user.getId());
+        queryWrapper.select("ksid", "user_name");
+        List<KuaishouUserCookie> list = kuaishouUserCookieService.list(queryWrapper);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
+
+    @PostMapping(value = "/login/status")
+    public Result<Map<String, Object>> getStatus(String requestId) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> statusMap = kuaishouWebInterfaceService.loginStatus(requestId);
+            result.setSuccess(true);
+            result.setResult(statusMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/video/list")
+    public Result<Map<String, Object>> videoList(String ksid, String pcursor) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> statusMap = kuaishouWebInterfaceService.videoList(ksid, pcursor);
+            result.setSuccess(true);
+            result.setResult(statusMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/comment/list")
+    public Result<Map<String, Object>> commentList(String ksid, String photoId, String pcursor) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> statusMap = kuaishouWebInterfaceService.commentList(ksid, photoId, pcursor);
+            result.setSuccess(true);
+            result.setResult(statusMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/comment/delete")
+    public Result<Map<String, Object>> commentDelete(String ksid, String photoId, Long commentId) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> statusMap = kuaishouWebInterfaceService.commentDelete(ksid, photoId, commentId);
+            result.setSuccess(true);
+            result.setResult(statusMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/subcomment/list")
+    public Result<Map<String, Object>> subCommentList(String ksid, String photoId, Long rootCommentId, String pcursor) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> statusMap = kuaishouWebInterfaceService.subCommentList(ksid, photoId, rootCommentId, pcursor);
+            result.setSuccess(true);
+            result.setResult(statusMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return result;
+    }
+}

+ 17 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/entity/KuaishouUserCookie.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.kuaishou.modules.graphql.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("ctop_kuaishou_user_cookie")
+public class KuaishouUserCookie {
+    @TableId
+    private String userId;
+    @TableId
+    private String ksid;
+    private String eid;
+    private String cookie;
+    private String userName;
+}

+ 7 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/mapper/KuaishouUserCookieMapper.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.kuaishou.modules.graphql.mapper;
+
+import cn.com.ctop.kuaishou.modules.graphql.entity.KuaishouUserCookie;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface KuaishouUserCookieMapper extends BaseMapper<KuaishouUserCookie> {
+}

+ 7 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/IKuaishouUserCookieService.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.kuaishou.modules.graphql.service;
+
+import cn.com.ctop.kuaishou.modules.graphql.entity.KuaishouUserCookie;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IKuaishouUserCookieService extends IService<KuaishouUserCookie> {
+}

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

@@ -1,13 +1,32 @@
 package cn.com.ctop.kuaishou.modules.graphql.service;
 
+import cn.com.ctop.kuaishou.modules.graphql.vo.KuaishouAcceptVO;
+import cn.com.ctop.kuaishou.modules.graphql.vo.KuaishouQrStartVO;
+import cn.com.ctop.kuaishou.modules.graphql.vo.KuaishouUserVO;
+
 import java.io.IOException;
 import java.util.Map;
 
 public interface IKuaishouWebInterfaceService {
     public void getVideoList(String uid) throws IOException;
+
     public String checkKuaishouUser(String videoUrl);
 
     public void adkuaishouWebLogin(String phone, String password) throws IOException;
 
     public void deleteAllComment(Map<String, String> pcursorMap);
+
+    public void test();
+
+    public String qrLogin(String taskId) throws Exception;
+
+    public Map<String, Object> loginStatus(String taskId);
+
+    public Map<String, Object> commentDelete(String ksid, String photoId, Long commentId);
+
+    public Map<String, Object> videoList(String ksid, String pcursor);
+
+    public Map<String, Object> commentList(String ksid, String photoId, String pcursor);
+
+    public Map<String, Object> subCommentList(String ksid, String photoId, Long rootCommentId, String pcursor);
 }

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

@@ -0,0 +1,11 @@
+package cn.com.ctop.kuaishou.modules.graphql.service.impl;
+
+import cn.com.ctop.kuaishou.modules.graphql.entity.KuaishouUserCookie;
+import cn.com.ctop.kuaishou.modules.graphql.mapper.KuaishouUserCookieMapper;
+import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouUserCookieService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service
+public class KuaishouUserCookieServiceImpl extends ServiceImpl<KuaishouUserCookieMapper, KuaishouUserCookie> implements IKuaishouUserCookieService {
+}

文件差異過大導致無法顯示
+ 768 - 61
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java


+ 11 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/vo/KuaishouAcceptVO.java

@@ -0,0 +1,11 @@
+package cn.com.ctop.kuaishou.modules.graphql.vo;
+
+import lombok.Data;
+
+@Data
+public class KuaishouAcceptVO {
+    private Integer result;
+    private String qrToken;
+    private String callback;
+    private String sid;
+}

+ 16 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/vo/KuaishouQrStartVO.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.kuaishou.modules.graphql.vo;
+
+import cn.com.ctop.common.module.entity.HttpClientEntity;
+import lombok.Data;
+
+@Data
+public class KuaishouQrStartVO {
+    private Integer result;
+    private Long expireTime;
+    private String qrLoginSignature;
+    private String imageData;
+    private String callback;
+    private String qrLoginToken;
+    private String sid;
+    private String requestId;
+}

+ 16 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/vo/KuaishouUserVO.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.kuaishou.modules.graphql.vo;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+@Data
+public class KuaishouUserVO {
+    @JsonProperty("user_id")
+    private Long userId;
+    private String headurl;
+    @JsonProperty("user_sex")
+    private String userSex;
+    private String eid;
+    @JsonProperty("user_name")
+    private String userName;
+}

+ 17 - 0
module-report/pom.xml

@@ -29,5 +29,22 @@
             <version>4.11</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-common</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>jeecg-boot-base-common</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-kuaishou</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 </project>

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

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

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCreativeDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCreativeDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCreativeHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCreativeHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
-import cn.com.ctop.toutiao.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedancePlanHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

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

@@ -0,0 +1,36 @@
+package cn.com.ctop.bytedance.controller;
+
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/ctop/report")
+public class BytedanceReportController {
+    @Autowired
+    private IBytedanceReportService bytedanceReportService;
+
+    /**
+     * 昨日总花费
+     *
+     * @return
+     */
+    @RequestMapping(value = "/cost")
+    public JSONObject getCost() {
+        /*LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (Check.isNull(user)) {
+            JSONObject json = bytedanceReportService.getCost(user.getId());
+        }*/
+
+
+        JSONObject json = bytedanceReportService.getCost("e9ca23d68d884d4ebb19d07889727dae");
+        return null;
+
+    }
+
+
+}

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CustomerPlanStatisticInfoController.java

@@ -1,5 +1,7 @@
-package org.jeecg.modules.ctop.controller;
+package cn.com.ctop.bytedance.controller;
 
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.service.ICustomerPlanStatisticInfoService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,8 +13,6 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
-import org.jeecg.modules.ctop.service.ICustomerPlanStatisticInfoService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;

+ 19 - 24
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/PlatformCampaignStatisticInfoController.java

@@ -1,42 +1,37 @@
-package org.jeecg.modules.ctop.controller;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
-import org.jeecg.modules.ctop.service.IPlatformCampaignStatisticInfoService;
-
-import java.util.Date;
+package cn.com.ctop.bytedance.controller;
 
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.service.IPlatformCampaignStatisticInfoService;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 快手平台广告组信息

+ 13 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReportController.java

@@ -1,13 +1,14 @@
-package org.jeecg.modules.ctop.controller;
+package cn.com.ctop.bytedance.controller;
 
+import cn.com.ctop.bytedance.service.IReportService;
+import cn.com.ctop.bytedance.vo.ByteDanceAdvertiserReportDTO;
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.service.IReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -28,7 +29,7 @@ public class ReportController {
      * @return
      */
     @GetMapping("bytedance/advertiser")
-    public Map<String, Object> advertiserReport(@RequestBody JSONObject conditions) {
+    public Map<String, Object> advertiserReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getAdvertiserReport(conditions);
     }
 
@@ -38,8 +39,8 @@ public class ReportController {
      * 单次获取最大条数1000
      * @return 广告组报表数据
      */
-    @GetMapping("campaign")
-    public Map<String, Object> campaignReport(@RequestBody JSONObject conditions) {
+    @GetMapping("bytedance/campaign")
+    public Map<String, Object> campaignReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getCampaignReport(conditions);
     }
 
@@ -48,8 +49,8 @@ public class ReportController {
      * @param conditions 查询条件
      * @return 广告计划报表数据
      */
-    @GetMapping("ad")
-    public Map<String, Object> adReport(@RequestBody JSONObject conditions) {
+    @GetMapping("bytedance/ad")
+    public Map<String, Object> adReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getAdReport(conditions);
     }
 
@@ -58,8 +59,8 @@ public class ReportController {
      * @param conditions
      * @return
      */
-    @GetMapping("creative")
-    public Map<String, Object> creativeReport(@RequestBody JSONObject conditions) {
+    @GetMapping("bytedance/creative")
+    public Map<String, Object> creativeReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getCreativeReport(conditions);
     }
 
@@ -69,7 +70,7 @@ public class ReportController {
      * @return
      * TODO 尚未完善
      */
-    @GetMapping("agent")
+    @GetMapping("bytedance/agent")
     public Map<String, Object> agentReport(@RequestBody JSONObject conditions) {
         return reportService.getAgentReport(conditions);
     }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 3 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/CustomerPlanStatisticInfo.java

@@ -1,20 +1,17 @@
-package org.jeecg.modules.ctop.entity;
+package cn.com.ctop.bytedance.entity;
 
-import java.io.Serializable;
-import java.util.Date;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.util.Date;
+
 /**
  * @Description: 用户平台广告计划信息
  * @Author: jeecg-boot

+ 10 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/PlatformCampaignStatisticInfo.java

@@ -1,22 +1,18 @@
-package org.jeecg.modules.ctop.entity;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
+package cn.com.ctop.bytedance.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 /**
  * @Description: 快手平台广告组信息
  * @Author: jeecg-boot
@@ -71,7 +67,7 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "花费", width = 15)
     @ApiModelProperty(value = "花费")
-    private java.math.BigDecimal cost;
+    private BigDecimal cost;
     /**
      * 封面曝光数
      */
@@ -113,19 +109,19 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "平均千次封面曝光花费", width = 15)
     @ApiModelProperty(value = "平均千次封面曝光花费")
-    private java.math.BigDecimal thousandsCoverExposureCost;
+    private BigDecimal thousandsCoverExposureCost;
     /**
      * 平均封面点击单价
      */
     @Excel(name = "平均封面点击单价", width = 15)
     @ApiModelProperty(value = "平均封面点击单价")
-    private java.math.BigDecimal averageCoverClickCost;
+    private BigDecimal averageCoverClickCost;
     /**
      * 平均行为单价
      */
     @Excel(name = "平均行为单价", width = 15)
     @ApiModelProperty(value = "平均行为单价")
-    private java.math.BigDecimal averageActionCost;
+    private BigDecimal averageActionCost;
     /**
      * 提交按钮点击
      */
@@ -143,7 +139,7 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "表单提交单价", width = 15)
     @ApiModelProperty(value = "表单提交单价")
-    private java.math.BigDecimal formSubmissionPrice;
+    private BigDecimal formSubmissionPrice;
     /**
      * 落地页完成件数
      */
@@ -155,7 +151,7 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "落地页完件成本", width = 15)
     @ApiModelProperty(value = "落地页完件成本")
-    private java.math.BigDecimal pageCompleteCost;
+    private BigDecimal pageCompleteCost;
     /**
      * 落地页授信数
      */

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CustomerPlanStatisticInfoMapper.java

@@ -1,9 +1,6 @@
-package org.jeecg.modules.ctop.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 6 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/PlatformCampaignStatisticInfoMapper.java

@@ -1,11 +1,11 @@
-package org.jeecg.modules.ctop.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.vo.StatisticCampaignVo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.vo.StatisticCampaignVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Description: 快手平台广告组信息

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper">
+
+</mapper>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceAdvertiserHourlyReportMapper">
+
+</mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCampaignDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCampaignDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCampaignHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCampaignHourlyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCreativeDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCreativeDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCreativeHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCreativeHourlyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedancePlanDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedancePlanDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedancePlanHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedancePlanHourlyReportMapper">
 
 </mapper>

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/AuthTaskMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.ctop.mapper.AuthTaskMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.CustomerPlanStatisticInfoMapper">
 
 </mapper>

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/PlatformCampaignStatisticInfoMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.ctop.mapper.PlatformCampaignStatisticInfoMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.PlatformCampaignStatisticInfoMapper">
     <resultMap id="voMap" type="org.jeecg.modules.ctop.vo.StatisticCampaignVo">
         <result column="statisticDate" property="statisticDate"/>
         <result column="proxy" property="proxy"/>

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

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

@@ -0,0 +1,7 @@
+package cn.com.ctop.bytedance.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+public interface IBytedanceReportService {
+    JSONObject getCost(String loginId);
+}

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICustomerPlanStatisticInfoService.java

@@ -1,6 +1,6 @@
-package org.jeecg.modules.ctop.service;
+package cn.com.ctop.bytedance.service;
 
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IPlatformCampaignStatisticInfoService.java

@@ -1,6 +1,6 @@
-package org.jeecg.modules.ctop.service;
+package cn.com.ctop.bytedance.service;
 
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 24 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IReportService.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.bytedance.service;
+
+import cn.com.ctop.bytedance.vo.ByteDanceAdvertiserReportDTO;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+public interface IReportService {
+    Map<String, Object> getAdvertiserReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getCampaignReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getAdReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getCreativeReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getAgentReport(JSONObject conditions);
+
+    void insertCustomerInfo(String csvPath, String charset);
+
+    void insertPlatformInfo(String excelPath, String charset, Long accountId);
+
+    Map<String, Object> debitAuto(JSONObject data);
+}

+ 5 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserDailyReportServiceImpl.java

@@ -1,8 +1,9 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceAdvertiserDailyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserDailyReportService;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceAdvertiserHourlyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserHourlyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserHourlyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignDailyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceCampaignDailyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceCampaignDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignDailyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 0 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignHourlyReportServiceImpl.java


部分文件因文件數量過多而無法顯示