浏览代码

Merge branch 'master' into jiaoyang

# Conflicts:
#	jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
#	jeecg-boot-module-system/src/main/resources/application-wps.yml
#	module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
yumeng 4 年之前
父节点
当前提交
251b7b66a1
共有 100 个文件被更改,包括 4356 次插入1458 次删除
  1. 46 4
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 2 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java
  3. 1 1
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/PmsUtil.java
  4. 1 5
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/db/FreemarkerParseFactory.java
  5. 1 7
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/dynamic/db/FreemarkerParseFactory.java
  6. 2 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/oConvertUtils.java
  7. 0 2
      jeecg-boot-module-system/pom.xml
  8. 0 70
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneToMainUtil.java
  9. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  10. 8 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/XmlUtils.java
  11. 23 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java
  12. 202 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceCustomerDdTbtjDataController.java
  13. 133 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  14. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialUploadController.java
  15. 9 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  16. 461 67
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  17. 37 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/BytedanceCustomerDdTbtjData.java
  18. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyGroupReportLoadJob.java
  19. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyGroupReportLoadJob.java
  20. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/BytedanceCustomerDdTbtjDataMapper.java
  21. 24 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/BytedanceCustomerDdTbtjDataMapper.xml
  22. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IBytedanceCustomerDdTbtjDataService.java
  23. 28 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceCustomerDdTbtjDataServiceImpl.java
  24. 50 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/BytedanceCustomTbtjDataExcelListener.java
  25. 0 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/JhsBakendDataExcelListener.java
  26. 73 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/BytedanceCustomTbtjDataEntity.java
  27. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  28. 10 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  29. 2 0
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  30. 2 0
      jeecg-boot-module-system/src/main/resources/application-jiaoyang.yml
  31. 2 0
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  32. 2 0
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  33. 2 0
      jeecg-boot-module-system/src/main/resources/application-test.yml
  34. 18 11
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  35. 4 11
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
  36. 3 3
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
  37. 4 4
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
  38. 1 1
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
  39. 1 18
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  40. 76 483
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  41. 7 7
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java
  42. 20 13
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  43. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialTagInfo.java
  44. 20 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/SysUserDepart.java
  45. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/enums/SceneIdEnum.java
  46. 44 36
      module-common/src/main/java/cn/com/ctop/common/module/mapper/SysDepartMapper.java
  47. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/SysRoleMapper.java
  48. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserDepartMapper.java
  49. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml
  50. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  51. 33 13
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysDepartMapper.xml
  52. 18 14
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysRoleMapper.xml
  53. 16 7
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserDepartMapper.xml
  54. 6 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml
  55. 1 2
      module-common/src/main/java/cn/com/ctop/common/module/service/IBindAccountLoginService.java
  56. 6 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java
  57. 3 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialAscriptionServiceImpl.java
  58. 0 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  59. 2 4
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialTagInfoServiceImpl.java
  60. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java
  61. 794 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/ConverterUtils.java
  62. 3 3
      module-common/src/main/java/cn/com/ctop/common/module/utils/ParseInstallPackageUtil.java
  63. 4 4
      module-common/src/main/java/cn/com/ctop/common/module/utils/QueryGenerator.java
  64. 0 8
      module-common/src/main/java/cn/com/ctop/common/module/utils/RestUtils.java
  65. 4 2
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  66. 2 0
      module-common/src/main/java/com/xxl/job/core/executor/impl/XxlJobSimpleExecutor.java
  67. 1 7
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java
  68. 1 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoTttmServiceImpl.java
  69. 1 1
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/IMaterialUploadService.java
  70. 6 4
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java
  71. 3 0
      module-job-bytedance/src/main/resources/application-dev.yml
  72. 3 0
      module-job-bytedance/src/main/resources/application-jiaoyang.yml
  73. 3 0
      module-job-bytedance/src/main/resources/application-prod.yml
  74. 3 0
      module-job-bytedance/src/main/resources/application-test.yml
  75. 77 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CrowdListQueryJob.java
  76. 0 25
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouAlarmRuleHourlyCheckJob.java
  77. 0 25
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouAlarmRuleMinuteCheckJob.java
  78. 64 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouBudgetJob.java
  79. 0 69
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiAdsNewMaterialCreativityJob.java
  80. 172 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiCreativeJob.java
  81. 0 43
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiSuzaoVideoJob.java
  82. 4 1
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateUnitJob.java
  83. 29 1
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java
  84. 3 3
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java
  85. 48 19
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyGroupReportLoadJob.java
  86. 66 2
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouMatDailyReportJob.java
  87. 5 0
      module-job-kuaishou/src/main/resources/application-dev.yml
  88. 7 0
      module-job-kuaishou/src/main/resources/application-jiaoyang.yml
  89. 5 0
      module-job-kuaishou/src/main/resources/application-prod.yml
  90. 4 0
      module-job-kuaishou/src/main/resources/application-test.yml
  91. 149 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCampaignLevelOperationRecordController.java
  92. 172 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreateCreativeController.java
  93. 143 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreativeLevelOperationRecordController.java
  94. 143 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouProgramCreativeLevelOperationRecordController.java
  95. 143 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouUnitLevelOperationRecordController.java
  96. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java
  97. 403 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaishouCrowdPackController.java
  98. 363 188
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java
  99. 61 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCampaignLevelOperationRecord.java
  100. 0 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java

+ 46 - 4
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -10,7 +10,14 @@ import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * 类描述:时间操作定义类
@@ -115,6 +122,13 @@ public class DateUtils extends PropertyEditorSupport {
         return dsdf.format(parse);
     }
 
+    public static Integer getNowHour() throws ParseException {
+        Calendar cal = Calendar.getInstance();
+        Date date = new Date();
+        cal.setTime(date);
+        return cal.get(Calendar.HOUR_OF_DAY);
+    }
+
     public static Integer getHour(String dateStr) throws ParseException {
         DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Calendar cal = Calendar.getInstance();
@@ -139,8 +153,6 @@ public class DateUtils extends PropertyEditorSupport {
     }
 
 
-
-
     // 指定模式的时间格式
     private static SimpleDateFormat getSDFormat(String pattern) {
         return new SimpleDateFormat(pattern);
@@ -434,6 +446,10 @@ public class DateUtils extends PropertyEditorSupport {
         return datetimeFormat.get().format(getCalendar().getTime());
     }
 
+    public static String formatDateTime(Long time) {
+        return datetimeFormat.get().format(time);
+    }
+
     /**
      * 获取时间字符串
      */
@@ -1568,11 +1584,37 @@ public class DateUtils extends PropertyEditorSupport {
     }
 
     /**
-     * 获取两个日期之间的所有日期集合
+     * 根据数字查询本周对应的日期
+     * 1-7对应周一~周天
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
      * @author ZHAOXA
+     */
+    public static String getdateFromWeek(int number) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+
+        while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
+            calendar.add(Calendar.DAY_OF_WEEK, -1);
+        }
+        for (int i = 1; i <= 7; i++) {
+            if (number == i) {
+                return sdf.format(calendar.getTime());
+            }
+            calendar.add(Calendar.DAY_OF_MONTH, 1);
+        }
+        return null;
+    }
+
+    /**
+     * 获取两个日期之间的所有日期集合
+     *
      * @param
      * @return java.util.List<java.lang.String>
      * @throws
+     * @author ZHAOXA
      */
     public static List<String> getDays(String startTime, String endTime) {
         // 返回的日期集合

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

@@ -34,7 +34,7 @@ public class MD5Util {
 		return toHexStr(md5.digest(url.getBytes()));
 	}
 
-	public static String byteArrayToHexString(byte b[]) {
+	public static String byteArrayToHexString(byte[] b) {
 		StringBuffer resultSb = new StringBuffer();
 		for (int i = 0; i < b.length; i++){
 			resultSb.append(byteToHexString(b[i]));
@@ -80,7 +80,7 @@ public class MD5Util {
 		}
 		return resultString;
 	}
-	private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5",
+	private static final String[] hexDigits = { "0", "1", "2", "3", "4", "5",
 			"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
 	private static final String[] HEX_DIGITS = {"0", "1", "2", "3", "4", "5",
 			"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };

+ 1 - 1
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/PmsUtil.java

@@ -41,7 +41,7 @@ public class PmsUtil {
             for (String s : msg) {
                 //写数据
                 if (s.indexOf("_") > 0) {
-                    String arr[] = s.split("_");
+                    String[] arr = s.split("_");
                     bw.write("第" + arr[0] + "行:" + arr[1]);
                 } else {
                     bw.write(s);

+ 1 - 5
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/db/FreemarkerParseFactory.java

@@ -100,8 +100,6 @@ public class FreemarkerParseFactory {
         } catch (Exception e) {
             log.error(e.getMessage(), e.fillInStackTrace());
             log.error("发送一次的模板key:{ " + tplName + " }");
-            //System.err.println(e.getMessage());
-            //System.err.println("模板名:{ "+ tplName +" }");
             throw new RuntimeException("解析SQL模板异常");
         }
     }
@@ -132,8 +130,6 @@ public class FreemarkerParseFactory {
         } catch (Exception e) {
             log.error(e.getMessage(), e.fillInStackTrace());
             log.error("发送一次的模板key:{ " + tplContent + " }");
-            //System.err.println(e.getMessage());
-            //System.err.println("模板内容:{ "+ tplContent +" }");
             throw new RuntimeException("解析SQL模板异常");
         }
     }
@@ -168,4 +164,4 @@ public class FreemarkerParseFactory {
         }
         return sql;
     }
-}
+}

+ 1 - 7
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/dynamic/db/FreemarkerParseFactory.java

@@ -6,8 +6,6 @@ import freemarker.template.Configuration;
 import freemarker.template.Template;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.jeecgframework.codegenerate.generate.util.SimpleFormat;
 
 import java.io.StringWriter;
@@ -102,8 +100,6 @@ public class FreemarkerParseFactory {
         } catch (Exception e) {
             log.error(e.getMessage(), e.fillInStackTrace());
             log.error("发送一次的模板key:{ " + tplName + " }");
-            //System.err.println(e.getMessage());
-            //System.err.println("模板名:{ "+ tplName +" }");
             throw new RuntimeException("解析SQL模板异常");
         }
     }
@@ -134,8 +130,6 @@ public class FreemarkerParseFactory {
         } catch (Exception e) {
             log.error(e.getMessage(), e.fillInStackTrace());
             log.error("发送一次的模板key:{ " + tplContent + " }");
-            //System.err.println(e.getMessage());
-            //System.err.println("模板内容:{ "+ tplContent +" }");
             throw new RuntimeException("解析SQL模板异常");
         }
     }
@@ -170,4 +164,4 @@ public class FreemarkerParseFactory {
         }
         return sql;
     }
-}
+}

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

@@ -432,7 +432,7 @@ public class oConvertUtils {
 			//update-end--Author:zhoujf  Date:20180503 for:TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
 		}
 		// 用下划线将原始字符串分割
-		String camels[] = name.split("_");
+		String[] camels = name.split("_");
 		for (String camel : camels) {
 			// 跳过原始字符串中开头、结尾的下换线或双重下划线
 			if (camel.isEmpty()) {
@@ -495,7 +495,7 @@ public class oConvertUtils {
 			return name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();
 		}
 		// 用下划线将原始字符串分割
-		String camels[] = name.split("_");
+		String[] camels = name.split("_");
 		for (String camel : camels) {
 			// 跳过原始字符串中开头、结尾的下换线或双重下划线
 			if (camel.isEmpty()) {

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

@@ -75,13 +75,11 @@
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-toutiao</artifactId>
             <version>2.0.2</version>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-oa</artifactId>
             <version>2.0.2</version>
-            <scope>compile</scope>
         </dependency>
 
         <dependency>

+ 0 - 70
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneToMainUtil.java

@@ -1,70 +0,0 @@
-package org.jeecg;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jeecgframework.codegenerate.generate.impl.CodeGenerateOneToMany;
-import org.jeecgframework.codegenerate.generate.pojo.onetomany.MainTableVo;
-import org.jeecgframework.codegenerate.generate.pojo.onetomany.SubTableVo;
-
-/**
- * 代码生成器入口【一对多】
- * 【 GUI模式已弃用,请转移Online模式进行代码生成 】
- * @Author 张代浩
- * @site www.jeecg.org
- *
- */
-public class JeecgOneToMainUtil {
-
-	/**
-	 * 一对多(父子表)数据模型,生成方法
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		//第一步:设置主表配置
-		MainTableVo mainTable = new MainTableVo();
-		mainTable.setTableName("jeecg_order_main");//表名
-		mainTable.setEntityName("GuiTestOrderMain");	 //实体名
-		mainTable.setEntityPackage("gui");	 //包名
-		mainTable.setFtlDescription("GUI订单管理");	 //描述
-
-		//第二步:设置子表集合配置
-		List<SubTableVo> subTables = new ArrayList<SubTableVo>();
-		//[1].子表一
-		SubTableVo po = new SubTableVo();
-		po.setTableName("jeecg_order_customer");//表名
-		po.setEntityName("GuiTestOrderCustom");	    //实体名
-		po.setEntityPackage("gui");	        //包名
-		po.setFtlDescription("客户明细");       //描述
-		//子表外键参数配置
-		/*说明:
-		 * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
-		 * b) 主表和子表的外键字段名字,必须相同(除主键ID外);
-		 * c) 多个外键字段,采用逗号分隔;
-		 */
-		po.setForeignKeys(new String[]{"order_id"});
-		subTables.add(po);
-		//[2].子表二
-		SubTableVo po2 = new SubTableVo();
-		po2.setTableName("jeecg_order_ticket");		//表名
-		po2.setEntityName("GuiTestOrderTicket");			//实体名
-		po2.setEntityPackage("gui"); 				//包名
-		po2.setFtlDescription("产品明细");			//描述
-		//子表外键参数配置
-		/*说明:
-		 * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
-		 * b) 主表和子表的外键字段名字,必须相同(除主键ID外);
-		 * c) 多个外键字段,采用逗号分隔;
-		 */
-		po2.setForeignKeys(new String[]{"order_id"});
-		subTables.add(po2);
-		mainTable.setSubTables(subTables);
-
-		//第三步:一对多(父子表)数据模型,代码生成
-		try {
-			new CodeGenerateOneToMany(mainTable,subTables).generateCodeFile(null);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-}

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -102,6 +102,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/kuaishouChannelRegInfo/*", "anon");
         filterChainDefinitionMap.put("/ctop/byteDance/homePage/report/*", "anon");
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
+        filterChainDefinitionMap.put("/dimension/report/*", "anon");
 
         filterChainDefinitionMap.put("/v1/**", "anon");
 
@@ -183,6 +184,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ruleGroup/*", "anon");
         filterChainDefinitionMap.put("/kuaishou/material/*", "anon");
         filterChainDefinitionMap.put("/kuaishou/create/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchCreativeTemplate/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchGroupTemplate/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchCampaignTemplate/*", "anon");
         filterChainDefinitionMap.put("/template/**", "anon");
         filterChainDefinitionMap.put("/batch/kuaiShouGroupTemplate/*", "anon");
         filterChainDefinitionMap.put("/kuaishouBatch/**", "anon");
@@ -191,7 +195,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/explore/*", "anon");
         filterChainDefinitionMap.put("/ai/batchUpdate/*", "anon");
         filterChainDefinitionMap.put("/ctop/kuaishou/videoReport/*", "anon");
+        filterChainDefinitionMap.put("/ai/create/*", "anon");
         //filterChainDefinitionMap.put("/overView/*", "anon");
+        filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 8 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/XmlUtils.java

@@ -88,13 +88,15 @@ public final class XmlUtils {
 
             private StringBuilder buffer = new StringBuilder();
 
+            @Override
             public void startElement(final String uri, final String localName, final String qName,
-                    final Attributes attributes) throws SAXException {
+                                     final Attributes attributes) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = true;
                 }
             }
 
+            @Override
             public void endElement(final String uri, final String localName, final String qName) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = false;
@@ -103,6 +105,7 @@ public final class XmlUtils {
                 }
             }
 
+            @Override
             public void characters(char[] ch, int start, int length) throws SAXException {
                 if (this.foundElement) {
                     this.buffer.append(ch, start, length);
@@ -139,19 +142,22 @@ public final class XmlUtils {
 
             private boolean foundElement = false;
 
+            @Override
             public void startElement(final String uri, final String localName, final String qName,
-                    final Attributes attributes) throws SAXException {
+                                     final Attributes attributes) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = true;
                 }
             }
 
+            @Override
             public void endElement(final String uri, final String localName, final String qName) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = false;
                 }
             }
 
+            @Override
             public void characters(char[] ch, int start, int length) throws SAXException {
                 if (this.foundElement) {
                     builder.append(ch, start, length);

+ 23 - 10
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java

@@ -62,7 +62,7 @@ public class AiKuaishouAdvertiserStrategyController {
         QueryWrapper<AiKuaishouAdvertiserStrategy> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouAdvertiserStrategy, req.getParameterMap());
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String roleCode = sysRoleService.getRoleCodeByUserId(user.getId());
-        if(!CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)){
+        if (!CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
             queryWrapper.eq("user_id", user.getId());
         }
         Page<AiKuaishouAdvertiserStrategy> page = new Page<>(pageNo, pageSize);
@@ -98,21 +98,25 @@ public class AiKuaishouAdvertiserStrategyController {
         try {
             Long accountId = aiKuaishouAdvertiserStrategy.getAccountId();
             AiKuaishouAdvertiserStrategy getEntity = aiKuaishouAdvertiserStrategyService.getByAccountId(accountId);
-            if(null!=getEntity){
+            if (null != getEntity) {
                 result.error500("该账户配置信息已经被创建");
                 return result;
             }
             UserAllocation allocation = allocationService.getByAccountId(accountId);
-            if(null!=allocation){
+            if (null != allocation) {
                 aiKuaishouAdvertiserStrategy.setUserId(allocation.getUserId());
             }
+            aiKuaishouAdvertiserStrategy.setDescription(aiKuaishouAdvertiserStrategy.getDescription().trim());
             Integer singleAppId = aiKuaishouAdvertiserStrategy.getSingleAppid();
             if (null != singleAppId && singleAppId == 1) {
-                Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
-                aiKuaishouAdvertiserStrategy.setAppId(appId);
+                if (aiKuaishouAdvertiserStrategy.getCampaignType() == 2 || aiKuaishouAdvertiserStrategy.getCampaignType() == 7) {
+                    Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
+                    aiKuaishouAdvertiserStrategy.setAppId(appId);
+                }
+
             }
             aiKuaishouAdvertiserStrategyService.save(aiKuaishouAdvertiserStrategy);
-            Thread thread = new Thread(){
+            Thread thread = new Thread() {
                 @Override
                 public void run() {
                     kuaishouVideoRelateCreativesService.videoRelateCreatives(aiKuaishouAdvertiserStrategy.getAccountId());
@@ -126,6 +130,7 @@ public class AiKuaishouAdvertiserStrategyController {
         }
         return result;
     }
+
     /**
      * 编辑
      *
@@ -140,10 +145,13 @@ public class AiKuaishouAdvertiserStrategyController {
             result.error500("未找到对应实体");
         } else {
             Integer singleAppId = aiKuaishouAdvertiserStrategy.getSingleAppid();
-            if (null != singleAppId && singleAppId == 1) {
-                Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
-                aiKuaishouAdvertiserStrategy.setAppId(appId);
+            if (aiKuaishouAdvertiserStrategy.getCampaignType() == 2 || aiKuaishouAdvertiserStrategy.getCampaignType() == 7) {
+                if (null != singleAppId && singleAppId == 1) {
+                    Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
+                    aiKuaishouAdvertiserStrategy.setAppId(appId);
+                }
             }
+
             boolean ok = aiKuaishouAdvertiserStrategyService.updateById(aiKuaishouAdvertiserStrategy);
             if (ok) {
                 result.success("修改成功!");
@@ -260,7 +268,12 @@ public class AiKuaishouAdvertiserStrategyController {
     }
 
     @GetMapping(value = "testCreate")
-    public Map<String,Object> testCreate(Long accountId){
+    public Map<String, Object> testCreate(Long accountId) {
         return aiKuaishouAdvertiserStrategyService.testCreate(accountId);
     }
+
+    @GetMapping(value = "aiHistoricalMissingMaterial")
+    public Map<String, Object> aiHistoricalMissingMaterial(Long accountId) {
+        return aiKuaishouAdvertiserStrategyService.aiHistoricalMissingMaterial(accountId);
+    }
 }

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

@@ -0,0 +1,202 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.excel.event.AnalysisEventListener;
+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.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.ctop.service.IBytedanceCustomerDdTbtjDataService;
+import org.jeecg.modules.excelutil.BytedanceCustomTbtjDataExcelListener;
+import org.jeecg.modules.excelutil.ExcelUtils;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+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 javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author jeecg-boot
+ * @date   2021-04-22
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="淘宝特价版客户反馈数据")
+@RestController
+@RequestMapping("/ctop/bytedanceCustomerDdTbtjData")
+public class BytedanceCustomerDdTbtjDataController {
+	@Autowired
+	private IBytedanceCustomerDdTbtjDataService bytedanceCustomerDdTbtjDataService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceCustomerDdTbtjData
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="淘宝特价版客户反馈数据-分页列表查询", notes="淘宝特价版客户反馈数据-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceCustomerDdTbtjData>> queryPageList(BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData,
+																	@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																	@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																	HttpServletRequest req) {
+		Result<IPage<BytedanceCustomerDdTbtjData>> result = new Result<>();
+		QueryWrapper<BytedanceCustomerDdTbtjData> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceCustomerDdTbtjData, req.getParameterMap());
+		queryWrapper.orderByDesc("state_date");
+		Page<BytedanceCustomerDdTbtjData> page = new Page<BytedanceCustomerDdTbtjData>(pageNo, pageSize);
+		IPage<BytedanceCustomerDdTbtjData> pageList = bytedanceCustomerDdTbtjDataService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceCustomerDdTbtjData
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-添加")
+	@ApiOperation(value="淘宝特价版客户反馈数据-添加", notes="淘宝特价版客户反馈数据-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceCustomerDdTbtjData> add(@RequestBody BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<>();
+		try {
+			bytedanceCustomerDdTbtjDataService.save(bytedanceCustomerDdTbtjData);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceCustomerDdTbtjData
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-编辑")
+	@ApiOperation(value="淘宝特价版客户反馈数据-编辑", notes="淘宝特价版客户反馈数据-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceCustomerDdTbtjData> edit(@RequestBody BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<BytedanceCustomerDdTbtjData>();
+		BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjDataEntity = bytedanceCustomerDdTbtjDataService.getById(bytedanceCustomerDdTbtjData.getId());
+		if(bytedanceCustomerDdTbtjDataEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceCustomerDdTbtjDataService.updateById(bytedanceCustomerDdTbtjData);
+			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 {
+			bytedanceCustomerDdTbtjDataService.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<BytedanceCustomerDdTbtjData> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceCustomerDdTbtjDataService.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<BytedanceCustomerDdTbtjData> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<>();
+		BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData = bytedanceCustomerDdTbtjDataService.getById(id);
+		if(bytedanceCustomerDdTbtjData==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceCustomerDdTbtjData);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @PostMapping(value = "/importExcel")
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+	  //1.读Excel
+	  MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+	  Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+	  for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+		  FileInputStream fis = null;
+		  try {
+			  MultipartFile file = entity.getValue();
+			  fis = (FileInputStream) file.getInputStream();
+			  AnalysisEventListener listener = new BytedanceCustomTbtjDataExcelListener();
+			  Boolean flag = ExcelUtils.readExcel(fis, BytedanceCustomTbtjDataEntity.class, listener);
+			  System.out.println("导入是否成功:" + flag);
+		  } catch (Exception e) {
+			  e.printStackTrace();
+		  } finally {
+			  if (fis != null) {
+				  try {
+					  fis.close();
+				  } catch (IOException e) {
+					  e.printStackTrace();
+				  }
+			  }
+		  }
+	  }
+	  return Result.ok("文件导入成功!");
+  }
+
+}

+ 133 - 69
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -6,7 +6,10 @@ import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.*;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoService;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -61,7 +64,15 @@ public class MaterialInfoController {
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
     @Autowired
-    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+    private IProjectService projectService;
+    @Autowired
+    private IMessageTemplate messageTemplate;
+    @Autowired
+    private ISysRoleService roleService;
+    @Autowired
+    private ISendMessageService sendMessageService;
+    @Autowired
+    private IBytedanceVideoSlogenInfoService slogenInfoService;
 
 
     @GetMapping("/supplierWatermark")
@@ -104,12 +115,9 @@ public class MaterialInfoController {
         return result;
     }
 
-
     @PostMapping("/correlationUpload")
     public Map<String, Object> insertFile(@RequestBody JSONObject json) {
-        LoginUser user = (LoginUser) SecurityUtils.getSubject()
-                .getPrincipal();
-
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         json.put("userId", user.getId());
         return materialInfoService.correlationUpload(json);
     }
@@ -132,11 +140,9 @@ public class MaterialInfoController {
         return materialInfoService.report(userId);
     }
 
-
     @GetMapping(value = "/getDetail")
     public JSONObject getDetail(String materialId) {
         return materialInfoService.getDetail(materialId);
-
     }
 
     @PostMapping("watermark")
@@ -160,7 +166,6 @@ public class MaterialInfoController {
         return result;
     }
 
-
     @GetMapping("/excellent/list")
     public Result<IPage<MaterialInfo>> excellentList(MaterialInfo materialInfo,
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -189,23 +194,18 @@ public class MaterialInfoController {
         return result;
     }
 
-    @Autowired
-    private ISysRoleService roleService;
-
+    @Deprecated
     @GetMapping(value = "/list")
     public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo,
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                      HttpServletRequest req) {
-
         Result<IPage<MaterialInfo>> result = new Result<>();
         String materialName = materialInfo.getMaterialName();
         String startDate = materialInfo.getStartDate();
         String endDate = materialInfo.getEndDate();
         materialInfo.setStartDate(null);
         materialInfo.setEndDate(null);
-
-
         materialInfo.setMaterialName(null);
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         materialInfo.setCreateTime(null);
@@ -272,7 +272,6 @@ public class MaterialInfoController {
                     material.setByteDance(JSONObject.parseObject(byteDanceString));
                 }
 
-
                 Project project = projectService.getById(material.getProjectId());
                 if (!Check.isNull(project)) {
                     material.setMediaId(project.getMediaId());
@@ -283,17 +282,9 @@ public class MaterialInfoController {
                 imageInfoQueryWrapper.eq("video_id", material.getCode());
                 imageInfoQueryWrapper.eq("status", 0);
                 List<MaterialImageInfo> imageInfoList = iMaterialImageInfoService.list(imageInfoQueryWrapper);
-                if (Check.isNull(imageInfoList)) {
-                    material.setWhetherUnaudited(false);
-                } else {
-                    material.setWhetherUnaudited(true);
-                }
-
+                material.setWhetherUnaudited(!Check.isNull(imageInfoList));
             }
-
-
         }
-
         result.setSuccess(true);
         result.setResult(pageList);
         return result;
@@ -337,7 +328,6 @@ public class MaterialInfoController {
         }
     }
 
-
     @AutoLog(value = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
     @GetMapping(value = "/supplierList")
@@ -345,8 +335,6 @@ public class MaterialInfoController {
                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                     HttpServletRequest req) {
-
-
         Result<IPage<MaterialInfo>> result = new Result<>();
         String materialName = materialInfo.getMaterialName();
         materialInfo.setMaterialName(null);
@@ -356,7 +344,6 @@ public class MaterialInfoController {
         materialInfo.setEndDate(null);
 
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
-
         if (!Check.isNull(materialInfo.getUserId())) {
             String roleCode = roleService.getRoleCodeByUserId(materialInfo.getUserId());
             if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
@@ -408,7 +395,6 @@ public class MaterialInfoController {
 
             }
 
-
         }
 
         result.setSuccess(true);
@@ -468,22 +454,12 @@ public class MaterialInfoController {
     }
 
     /**
-     * 编辑
-     *
+     * 头条素材信息编辑
      * @param materialInfo
      * @return
      */
-    @Autowired
-    private IProjectService projectService;
-    @Autowired
-    private IMessageTemplate messageTemplate;
-    @Autowired
-    private ISendMessageService sendMessageService;
-
-    @AutoLog(value = "素材信息-编辑")
-    @ApiOperation(value = "素材信息-编辑", notes = "素材信息-编辑")
-    @PutMapping(value = "/edit")
-    public Result<MaterialInfo> edit(@RequestBody MaterialInfo materialInfo) {
+    @PutMapping(value = "/bytedance/edit")
+    public Result<MaterialInfo> bytedanceEdit(@RequestBody MaterialInfo materialInfo) {
         Result<MaterialInfo> result = new Result<>();
         MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
         if (materialInfoEntity == null) {
@@ -517,7 +493,6 @@ public class MaterialInfoController {
             } else {
                 materialInfo.setCoverUrl(cutFrame.getUrl());
             }
-
         }
 
         //  修改素材库 相关联code
@@ -541,29 +516,14 @@ public class MaterialInfoController {
                 materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
             }
         }
-
-        //  审核通过自动同步到到媒体后台
-       /* Long projectId = materialInfoEntity.getProjectId();
-        Project project = projectService.getById(projectId);
-        if (!Check.isNull(projectId)) {
-            if ("2".equals(project.getMediaId())) {
-                if (!Check.isNull(materialInfo.getStatus())) {
-                    Integer status = materialInfo.getStatus();
-                    if (status == 1) {
-                        Thread thread = new Thread() {
-                            @Override
-                            public void run() {
-                                log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
-                                uploadService.upload(materialInfoEntity);
-                            }
-                        };
-                        thread.start();
-                    }
-                }
+        //添加视频文案信息
+        if(!Check.isNull(materialInfo.getSlogans())){
+            JSONArray slogans = materialInfo.getSlogans();
+            if(null!=slogans&&!slogans.isEmpty()){
+                LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+                slogenInfoService.insertSlogans(materialInfoEntity.getCode(),slogans,user.getId());
             }
-
-        }*/
-
+        }
         boolean ok = materialInfoService.updateById(materialInfo);
         if (ok) {
             result.success("修改成功!");
@@ -579,8 +539,6 @@ public class MaterialInfoController {
         return result;
 
     }
-
-
     /**
      * 通过id删除
      *
@@ -640,12 +598,19 @@ public class MaterialInfoController {
     @AutoLog(value = "素材信息-通过id查询")
     @ApiOperation(value = "素材信息-通过id查询", notes = "素材信息-通过id查询")
     @GetMapping(value = "/queryById")
-    public Result<MaterialInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+    public Result<MaterialInfo> queryById(@RequestParam(name = "id") String id) {
         Result<MaterialInfo> result = new Result<>();
         MaterialInfo materialInfo = materialInfoService.getById(id);
         if (materialInfo == null) {
             result.error500("未找到对应实体");
         } else {
+            //查询素材下关联的头条文案信息
+            List<BytedanceVideoSlogenInfo>slogenInfos = slogenInfoService.listByParams(materialInfo.getCode(),1);
+            JSONArray slogenArray = new JSONArray();
+            if(null!=slogenInfos&&!slogenInfos.isEmpty()){
+                slogenArray.addAll(slogenInfos);
+            }
+            materialInfo.setSlogans(slogenArray);
             result.setResult(materialInfo);
             result.setSuccess(true);
         }
@@ -696,6 +661,105 @@ public class MaterialInfoController {
         return result;
     }
 
+    @AutoLog(value = "素材信息-编辑")
+    @ApiOperation(value = "素材信息-编辑", notes = "素材信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<MaterialInfo> edit(@RequestBody MaterialInfo materialInfo) {
+        Result<MaterialInfo> result = new Result<>();
+        MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
+        if (materialInfoEntity == null) {
+            return result.error500("未找到对应实体");
+        }
+        String url = materialInfo.getUrl();
+        if (!Check.isNull(url)) {
+            if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
+            }
+            materialInfo.setUrl(url);
+            materialInfo.setCreateTime(new Date());
+            MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(materialInfo.getCode());
+            if (Check.isNull(cutFrame)) {
+                String videoUrl = URLDecoder.decode(url).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
+                String loadImage = "cutFrame/" + materialInfo.getCode() + "/zero.jpg";
+                String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
+                materialInfo.setCoverUrl(coverUrl);
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        try {
+                            log.info("开始抽帧,code:{}", materialInfo.getCode());
+                            materialCutFrameService.getTencentCutFrame(videoUrl, materialInfo.getCode(), coverUrl);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                };
+                thread.start();
+            } else {
+                materialInfo.setCoverUrl(cutFrame.getUrl());
+            }
+
+        }
+
+        //  修改素材库 相关联code
+        if (!Check.isNull(materialInfo.getCode())) {
+            String code = materialInfoEntity.getCode();
+            if (!Check.isNull(code)) {
+                MaterialTag updateMaterialTag = new MaterialTag();
+                updateMaterialTag.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
+                tagQueryWrapper.eq("material_id", code);
+                materialTagService.update(updateMaterialTag, tagQueryWrapper);
+                MaterialParameter updateParameter = new MaterialParameter();
+                updateParameter.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
+                parameterQueryWrapper.eq("material_id", code);
+                materialParameterService.update(updateParameter, parameterQueryWrapper);
+                MaterialAscription updateMaterialAscription = new MaterialAscription();
+                updateMaterialAscription.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialAscription> ascriptionQueryWrapper = new QueryWrapper<>();
+                ascriptionQueryWrapper.eq("material_id", code);
+                materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
+            }
+        }
+
+        //  审核通过自动同步到到媒体后台
+       /* Long projectId = materialInfoEntity.getProjectId();
+        Project project = projectService.getById(projectId);
+        if (!Check.isNull(projectId)) {
+            if ("2".equals(project.getMediaId())) {
+                if (!Check.isNull(materialInfo.getStatus())) {
+                    Integer status = materialInfo.getStatus();
+                    if (status == 1) {
+                        Thread thread = new Thread() {
+                            @Override
+                            public void run() {
+                                log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
+                                uploadService.upload(materialInfoEntity);
+                            }
+                        };
+                        thread.start();
+                    }
+                }
+            }
+
+        }*/
+
+        boolean ok = materialInfoService.updateById(materialInfo);
+        if (ok) {
+            result.success("修改成功!");
+        }
+
+        Integer status = materialInfo.getStatus();
+        // 如果状态为2 审核拒绝 给上传人发送消息
+        if (status == 2) {
+            Project project = projectService.getById(materialInfoEntity.getProjectId());
+            String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
+            sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
+        }
+        return result;
+    }
+
     /**
      * adlab 新加查询素材库接口
      */

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

@@ -37,6 +37,7 @@ public class MaterialUploadController {
     public Map<String, Object> uploadAccount(@RequestBody JSONObject json) {
         Map<String, Object> returnMap = new HashMap<>();
         String mediaId = json.getString("mediaId");
+        Boolean shieldBackwardSwitch = json.getBoolean("shieldBackwardSwitch");
         JSONArray materialArray = json.getJSONArray("materialArray");
         JSONArray accountArray = json.getJSONArray("accountArray");
         try {
@@ -48,7 +49,7 @@ public class MaterialUploadController {
             }
             LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
-            new Thread(() -> materialUploadService.uploadAccount(mediaId, materialArray, accountArray, sysUser.getId())).start();
+            new Thread(() -> materialUploadService.uploadAccount(mediaId, materialArray, accountArray, sysUser.getId(), shieldBackwardSwitch)).start();
             returnMap.put("success", true);
             returnMap.put("message", "开始上传文件");
             returnMap.put("code", 0);
@@ -59,4 +60,6 @@ public class MaterialUploadController {
         }
         return returnMap;
     }
+
+
 }

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

@@ -149,6 +149,11 @@ public class ProjectMemberController {
     }
 
 
+    /**
+     * 获取项目以及账户信息
+     * @param requestJson
+     * @return
+     */
     @PostMapping(value = "/participateListByMediaId")
     public Result<List<JSONObject>> participateListByMediaId(@RequestBody JSONObject requestJson) {
         Result<List<JSONObject>> result = new Result<>();
@@ -168,13 +173,17 @@ public class ProjectMemberController {
                     mediaIds.add(3);
                 }
             }
+            //查询用户角色
             String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+            //角色为 管理员 || 销售 || 媒介 查询全部
             if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
                 userId = null;
             }
+            //查询项目信息以及广告主
             List<JSONObject> projectList = projectMemberService.getProjectByUserIdAndMediaIds(userId, mediaIds);
             List<JSONObject> haveList = new ArrayList<>();
             if (!Check.isNull(projectList)) {
+                //项目id 查询账户人员信息
                 Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectList(projectList);
                 for (int i = 0; i < projectList.size(); i++) {
                     JSONObject project = projectList.get(i);

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

@@ -9,17 +9,26 @@ import cn.com.ctop.common.module.vo.ResFileDTO;
 import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
 import cn.com.ctop.crawler.modules.core.service.CrawlerDouyinMusicTaskService;
 import cn.com.ctop.crawler.modules.douyin.service.DouyinMusicService;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplate;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouProjectData;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouProjectDataService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportHourlyGroupService;
 import cn.com.ctop.manage.modules.material.service.IMaterialUploadService;
+import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
-import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -31,10 +40,8 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.io.IOException;
@@ -56,7 +63,7 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 @RequestMapping("/test")
 @Slf4j
 public class TestController {
-    @Autowired
+    @Resource
     private CtopOauthTokenMapper tokenMapper;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
@@ -69,8 +76,6 @@ public class TestController {
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
     @Autowired
-    private CtopOauthTokenMapper oauthTokenMapper;
-    @Autowired
     private IKuaiShouHistoryReportTaskService historyReportTaskService;
     @Autowired
     private IMaterialInfoService materialInfoService;
@@ -83,8 +88,6 @@ public class TestController {
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
     @Autowired
-    private IBytedanceReportService bytedanceReportService;
-    @Autowired
     private IKuaishouInterfaceService2 kuaishouInterfaceService2;
     @Autowired
     private IUserAllocationService userAllocationService;
@@ -96,40 +99,321 @@ public class TestController {
     private MusicInfoService musicInfoService;
     @Autowired
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
-    @Autowired
-    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
-
 
-    static ExecutorService executorService = Executors.newFixedThreadPool(10);
-    static ExecutorService videoService = Executors.newFixedThreadPool(5);
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
     @Autowired
     private IKuaiShouDailyAgentService dailyAgentService;
     @Autowired
     private IKuaishouTemplateService templateService;
     @Autowired
-    private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
+    private ICtopOauthTokenService ctopOauthTokenService;
+    @Autowired
+    private IBindAccountAuthService bindAccountAuthService;
     @Resource
-    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+    private UserAllocationMapper allocationMapper;
     @Autowired
-    private ICtopOauthTokenService ctopOauthTokenService;
+    private IBytedanceReportService bytedanceReportService;
+    @Autowired
+    private IUserAllocationService allocationService;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
 
     @Autowired
-    private IBindAccountAuthService bindAccountAuthService;
+    private IKuaiShouProjectDataService kuaiShouProjectDataService;
     @Autowired
-    private UserAllocationMapper allocationMapper;
+    private IKuaishouReportHourlyGroupService hourlyGroupService;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+
+    @Autowired
+    private IKuaiShouCreativeService creativeService;
+    @Autowired
+    private IKuaiShouGroupService groupService;
+
+    @Autowired
+    private IBatchService batchService;
+    static ExecutorService videoService = Executors.newFixedThreadPool(3);
     @Autowired
     private IMaterialUploadService materialUploadService;
 
+    @Value("${xxl-job.requestUrl}")
+    private String jobUrl;
+
     @GetMapping("/uploadVideo")
     public String uploadVideo(Long projectId) {
+
+        System.err.println(jobUrl + "/jeecg-boot/ai/create/customCreativeLimit");
+
         //  832
-        JSONArray idList = materialInfoService.getIdListByProject(projectId);
+        JSONArray idList = materialInfoService.getIdListByProject(832L);
         JSONArray accountArray = new JSONArray();
-        accountArray.add(9882357L);
-        accountArray.add(9884574L);
 
-        materialUploadService.uploadAccount("2", idList, accountArray, "2e3b982046a44b5faadaa77a7c0da114");
+        accountArray.add(9549277L);
+        accountArray.add(9635234L);
+        accountArray.add(9767697L);
+        accountArray.add(9825207L);
+
+
+        materialUploadService.uploadAccount("2", idList, accountArray, "2e3b982046a44b5faadaa77a7c0da114", true);
+        return "success";
+    }
+
+
+    @GetMapping(value = "/getProgramCreative")
+    public void getProgramCreative() {
+        List<Long> list = new ArrayList();
+        list.add(10045052L);
+        list.add(10045823L);
+        list.add(10045830L);
+        list.add(10045831L);
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            creativeService.getProgramCreative(oauthToken, 1);
+        }
+
+
+    }
+
+
+    @GetMapping(value = "/campaignList")
+    public void campaignList() {
+        List<Long> list = new ArrayList();
+        list.add(10045052L);
+        list.add(10045823L);
+        list.add(10045830L);
+        list.add(10045831L);
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            // kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
+            videoService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
+                        //   kuaishouInterfaceService.getGroupList(oauthToken, null, null);
+                        //     kuaishouInterfaceService.getCreativeList(oauthToken, null, null);
+                        Thread.sleep(1500);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+
+        }
+
+    }
+
+
+    @GetMapping(value = "/creativeList")
+    public void creativeList() {
+        List<Long> list = new ArrayList();
+        list.add(10045052L);
+        list.add(10045823L);
+        list.add(10045830L);
+        list.add(10045831L);
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
+            campaignQueryWrapper.eq("account_id", accountId);
+
+            List<KuaiShouCampaign> list1 = campaignService.list(campaignQueryWrapper);
+            for (KuaiShouCampaign campaign : list1) {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        kuaishouInterfaceService.getCreativeList(oauthToken, null, null);
+                    }
+                });
+                try {
+                    Thread.sleep(400L);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+
+
+        }
+
+    }
+
+
+    @GetMapping(value = "/updateUnit")
+    public void updateUnit() throws Exception {
+        List<Long> list = new ArrayList();
+        list.add(9556344L);
+        list.add(9743738L);
+        list.add(9743727L);
+        list.add(9812671L);
+        list.add(9838554L);
+        list.add(9743746L);
+        list.add(9767055L);
+        list.add(9556274L);
+        list.add(9767096L);
+        list.add(9792538L);
+        list.add(9766952L);
+        list.add(9677440L);
+        list.add(9677334L);
+        list.add(9556465L);
+        list.add(9677236L);
+        list.add(9556227L);
+        list.add(9556188L);
+        list.add(9556431L);
+        list.add(9677408L);
+        list.add(9677284L);
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
+            groupQueryWrapper.eq("account_id", accountId);
+            //      groupQueryWrapper.ne("schedule_time","000000111111111111111111000000111111111111111111000000111111111111111111000000111111111111111111000000111111111111111111000000111111111111111111000000111111111111111111");
+            //     groupQueryWrapper.eq("use_app_market", 1);
+            //    groupQueryWrapper.gt("cpa_bid", 19000);
+
+
+            List<KuaiShouGroup> list1 = groupService.list(groupQueryWrapper);
+          /*  for (KuaiShouGroup group : list1) {
+
+                JSONObject json = new JSONObject();
+                json.put("unitId", group.getUnitId());
+                json.put("useAppMarket", 0);
+                json.put("appStore", new JSONArray());
+                batchService.updateUnit(json, oauthToken);
+            }*/
+
+            for (KuaiShouGroup group : list1) {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            JSONObject json = new JSONObject();
+                            json.put("unitId", group.getUnitId());
+                            json.put("cpaBid", 18 * 1000);
+                            //     json.put("gender", "2");
+                            batchService.updateUnit(json, oauthToken);
+                            Thread.sleep(1500);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+
+
+            }
+
+
+        }
+
+
+    }
+
+
+    @GetMapping(value = "/updateCreative")
+    public void updateCreative() {
+        List<Long> list = new ArrayList();
+        list.add(10045052L);
+        list.add(10045823L);
+        list.add(10045830L);
+        list.add(10045831L);
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+
+
+            QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
+            creativeQueryWrapper.eq("account_id", accountId);
+
+
+            List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
+            for (KuaiShouCreative creative : creativeList) {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            JSONObject json = new JSONObject();
+                            json.put("creativeId", creative.getCreativeId());
+                            String url = "https://click-wailaxin.1sapp.com/vendor/feedback/reportClick?platform=kuaishou&feedback_type=android&account_id=19&plan_id=__DID__&adgroup_id=__AID__&creative_id=__CID__&imei=__IMEI2__&mac=__MAC__&androidid=__ANDROIDID2__&ts=__TS__&ip=__IP__&ua=__UA__&callback=__CALLBACK__&oaid=__OAID__&app=dxqlb";
+
+                            if (creative.getCreativeMaterialType() == 1) {
+                                json.put("clickTrackUrl", url);
+                            } else if (creative.getCreativeMaterialType() == 4) {
+                                json.put("impressionUrl", url);
+                                json.put("clickTrackUrl", url);
+
+                            }
+                            JSONObject jsonObject = batchService.updateCreative(json, oauthToken);
+                            log.info("修改创意返回信息:creative:{},结果:{}", creative.getCreativeId(), jsonObject);
+                            Thread.sleep(1000L);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            }
+        }
+    }
+
+
+    @GetMapping("/cleanNewlyData")
+    public void cleanNewlyData(String startDate, String endDate) throws ParseException {
+
+
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        //1:查询当日数据
+        QueryWrapper<KuaiShouProjectData> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("project_status", 0);
+        List<KuaiShouProjectData> list = kuaiShouProjectDataService.list(queryWrapper);
+        if (Check.isNull(list)) {
+            return;
+        }
+        for (KuaiShouProjectData projectData : list) {
+            Long projectId = projectData.getProjectId();
+            if (Check.isNull(projectId)) {
+                continue;
+            }
+            QueryWrapper<UserAllocation> allocationQueryWrapper = new QueryWrapper<>();
+            allocationQueryWrapper.eq("project_id", projectId);
+            allocationQueryWrapper.eq("account_status", 0);
+            List<UserAllocation> accountIds = allocationService.list(allocationQueryWrapper);
+            if (Check.isNull(accountIds)) {
+                continue;
+            }
+            for (UserAllocation allocation : accountIds) {
+                CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
+                if (Check.isNull(token)) {
+                    continue;
+                }
+
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), yesterday, yesterday, "HOURLY", 1);
+
+                        //  hourlyGroupService.getAdvertiserGroupReportHourly(token.getAccountId(), token.getAccessToken(), yesterday, yesterday);
+                    }
+                });
+            }
+        }
+
+
+    }
+
+    @GetMapping("/getVideoByProjectId")
+    public String getVideoByProjectId(Long projectId) {
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", projectId);
+        List<UserAllocation> list = allocationService.list(queryWrapper);
+        for (UserAllocation allocation : list) {
+            CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
+            kuaishouInterfaceService.getVideoList(token, null, null);
+        }
         return "success";
     }
 
@@ -246,15 +530,13 @@ public class TestController {
 
     @GetMapping("/getBytedanceMatReport")
     public Map<String, Object> getData() {
-        List<BytedanceAccountReportTaskRecord> records = reportTaskRecordService.listByParams(100, "ACCOUNT_DAILY");
-        executorService = Executors.newFixedThreadPool(1);
-        CountDownLatch countDownLatch = new CountDownLatch(records.size());
-        records.forEach(record -> executorService.submit(() -> {
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        executorService = Executors.newFixedThreadPool(10);
+        CountDownLatch countDownLatch = new CountDownLatch(tokens.size());
+        tokens.forEach(record -> executorService.submit(() -> {
             try {
-//                reportService.getAdvertiserReport(record, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//                log.info("账户数据获取完成:account:{},时间:{}-{}",record.getAccountId(),record.getStartDate(),record.getEndDate());
-                bytedanceReportService.bytedanceMaterialReportV2(record);
-                log.info("素材数据获取完成:account:{},时间:{}-{}", record.getAccountId(), record.getStartDate(), record.getEndDate());
+                reportService.getAdvertiserReport(record, DateUtils.parseDate("2021-01-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+                log.info("账户数据获取完成:account:{},时间:{}-{}", record.getAccountId(), "2021-01-01", "2020-01-31");
             } catch (Exception e) {
 
             } finally {
@@ -266,10 +548,6 @@ public class TestController {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-        System.out.println("数据获取完成");
-
-        bytedanceReportMaterialDailyMapper.updateImageReportPlaneId();
-        bytedanceReportMaterialDailyMapper.updateImageReportPlaneName();
         Map<String, Object> result = new HashMap<>();
         ResultMapUtils.setResultMap(new HashMap<>(), StatusCode.COMMON_SUCCESS);
         return result;
@@ -331,7 +609,7 @@ public class TestController {
                     QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
                     tokenQueryWrapper.eq("media_id", 2);
                     tokenQueryWrapper.eq("account_id", accountId);
-                    CtopOauthToken token = oauthTokenMapper.selectOne(tokenQueryWrapper);
+                    CtopOauthToken token = tokenMapper.selectOne(tokenQueryWrapper);
                     if (!Check.isNull(token)) {
                         suzhaoService.submit(new Runnable() {
                             @Override
@@ -513,7 +791,6 @@ public class TestController {
 
             QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
             userAllocationQueryWrapper.eq("project_id", projectId);
-            // userAllocationQueryWrapper.eq("account_status", 0);
             List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
             if (!Check.isNull(list)) {
                 for (UserAllocation allocation : list) {
@@ -521,7 +798,7 @@ public class TestController {
                     QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
                     tokenQueryWrapper.eq("media_id", 2);
                     tokenQueryWrapper.eq("account_id", accountId);
-                    CtopOauthToken ctopOauthTokens = oauthTokenMapper.selectOne(tokenQueryWrapper);
+                    CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
                     if (!Check.isNull(ctopOauthTokens)) {
                         historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
 
@@ -554,7 +831,7 @@ public class TestController {
                     QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
                     tokenQueryWrapper.eq("media_id", 2);
                     tokenQueryWrapper.eq("account_id", accountId);
-                    CtopOauthToken ctopOauthTokens = oauthTokenMapper.selectOne(tokenQueryWrapper);
+                    CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
                     if (!Check.isNull(ctopOauthTokens)) {
                         historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
 
@@ -581,7 +858,7 @@ public class TestController {
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
             tokenQueryWrapper.eq("account_id", accountId);
-            CtopOauthToken ctopOauthTokens = oauthTokenMapper.selectOne(tokenQueryWrapper);
+            CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
                 historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), statDate, statDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
 
@@ -651,9 +928,6 @@ public class TestController {
     }
 
 
-
-
-
     @GetMapping(value = "/createCutTask")
     public String createCutTask(String startDate, String endDate) throws IOException {
         List<MaterialInfo> materialInfos = materialInfoService.getListByDate(startDate, endDate);
@@ -676,11 +950,19 @@ public class TestController {
     }
 
 
-   /* @GetMapping(value = "/getToken")
-    public String getToken(Long accountId, String token, String refreshToken, Integer agentType) {
-        oauthTokenService.getKuaiShouRefreshToken(accountId, token, refreshToken, agentType);
+    @GetMapping(value = "/getAccountReport")
+    public String getAccountReport(Long accountId, String startDate, String endDate) throws ParseException {
+        QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+        oauthTokenQueryWrapper.eq("media_id", 2);
+        oauthTokenQueryWrapper.eq("account_id", accountId);
+        oauthTokenQueryWrapper.last("limit 1");
+        CtopOauthToken token = tokenMapper.selectOne(oauthTokenQueryWrapper);
+        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+        Date date1 = sim.parse(startDate);
+        Date date2 = sim.parse(endDate);
+        //    kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2);
         return "Success";
-    }*/
+    }
 
 
     @GetMapping(value = "/updateCode")
@@ -747,7 +1029,7 @@ public class TestController {
             oauthTokenQueryWrapper.eq("media_id", 2);
             oauthTokenQueryWrapper.eq("account_id", accountId);
             oauthTokenQueryWrapper.last("limit 1");
-            CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+            CtopOauthToken token = tokenMapper.selectOne(oauthTokenQueryWrapper);
             String endDateStr = DateUtils.getDate("yyyy-MM-dd");
             String startDate = DateUtils.addMonth(endDateStr, -6);
             historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
@@ -768,7 +1050,7 @@ public class TestController {
             String startDate = DateUtils.addMonth(endDateStr, -6);
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
-            List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
+            List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
                 for (CtopOauthToken token : ctopOauthTokens) {
                     historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-01", "2020-10-01", CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
@@ -784,17 +1066,16 @@ public class TestController {
 
 
     @GetMapping(value = "/getHistoryDataByAccountId")
-    public String getHistoryDataByAccountId(Long accountId) {
+    public String getHistoryDataByAccountId(Long accountId, String startDte, String endDate) {
         Result<String> result = new Result<>();
         try {
-            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
-            String startDate = DateUtils.addMonth(endDateStr, -6);
+
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
             tokenQueryWrapper.eq("account_id", accountId);
-            CtopOauthToken ctopOauthTokens = oauthTokenMapper.selectOne(tokenQueryWrapper);
+            CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
-                historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
+                historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDte, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
 
             }
         } catch (Exception e) {
@@ -824,7 +1105,7 @@ public class TestController {
     public void gerCreative() {
         QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
         oauthTokenQueryWrapper.eq("media_id", 2);
-        List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
+        List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(oauthTokenQueryWrapper);
         for (CtopOauthToken token : ctopOauthTokens) {
             executorService.submit(new Runnable() {
                 @Override
@@ -897,7 +1178,7 @@ public class TestController {
         oauthTokenQueryWrapper.eq("media_id", 2);
         oauthTokenQueryWrapper.eq("account_id", accountId);
         oauthTokenQueryWrapper.last("limit 1");
-        CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+        CtopOauthToken token = tokenMapper.selectOne(oauthTokenQueryWrapper);
         try {
             // kuaishouInterfaceService.getCampaignList(token, null, null);
             //1:获取全量广告组数据
@@ -909,13 +1190,6 @@ public class TestController {
         }
     }
 
-
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-
-
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
 
@@ -952,7 +1226,7 @@ public class TestController {
 
             QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
             oauthTokenQueryWrapper.eq("media_id", 2);
-            List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
+            List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(oauthTokenQueryWrapper);
 
             if (!Check.isNull(ctopOauthTokens)) {
                 for (CtopOauthToken token : ctopOauthTokens) {
@@ -982,7 +1256,7 @@ public class TestController {
 
             QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
             oauthTokenQueryWrapper.eq("media_id", 2);
-            List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
+            List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(oauthTokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
                 for (CtopOauthToken token : ctopOauthTokens) {
                     executorService.submit(new Runnable() {
@@ -1170,4 +1444,124 @@ public class TestController {
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
+
+    @GetMapping("loadMatData")
+    public Map<String, Object> getData(String startDate, String endDate, Long accountId) {
+        Map<String, Object> result = new HashMap<>();
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        Date start = DateUtils.parseDate(startDate, "yyyy-MM-dd");
+        int days = DateUtils.getdaysOfTwoDate(startDate, endDate) + 1;
+        for (int i = 0; i < days; i++) {
+            String getDate = DateUtils.formatDate(DateUtils.addDay(start, i));
+            bytedanceReportService.bytedanceMaterialReport(token, getDate, getDate);
+        }
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @GetMapping("loadAccountData")
+    public Map<String, Object> getData(Long accountId) {
+        Map<String, Object> result = new HashMap<>();
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Autowired
+    IBytedanceVideoReportService bytedanceVideoReportService;
+    @Autowired
+    IETLReportBytedanceVideoService etlReportBytedanceVideoService;
+
+
+    @Autowired
+    private IKuaishouAudienceReportDailyService kuaishouAudienceReportDailyService;
+    @Autowired
+    private IKuaiShouGroupService kuaiShouGroupService;
+    @Autowired
+    private IKuaishouStrategyService kuaishouStrategyService;
+
+    /**
+     * 勿动勿删,煜一人群报表数据拉取接口。
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    @PostMapping(value = "/getAudienceData")
+    public Result getAudienceData(@RequestBody JSONObject request) throws Exception {
+        Long accountId = request.getLong("accountId");
+        Long planId = request.getLong("planId");
+        Long unitId = request.getLong("unitId");
+        String type = request.getString("type");
+        String startTime = request.getString("startTime");
+        String endTime = request.getString("endTime");
+        if (Check.isNull(accountId) || Check.isNull(planId) || Check.isNull(unitId) || Check.isNull(type) || Check.isNull(endTime) || Check.isNull(startTime)) {
+            return Result.error("缺少参数");
+        }
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        List<String> dayList = new ArrayList<>();
+        if (startTime.equals(endTime)) {
+            dayList.add(startTime);
+        } else {
+            dayList = DateUtils.getDays(startTime, endTime);
+        }
+        ExecutorService executorServic1e = Executors.newFixedThreadPool(8);
+        int page = 1;
+        int pageSize = 2000;
+        dayList.forEach(date -> executorServic1e.submit(() -> {
+            try {
+                kuaishouAudienceReportDailyService.crowdAnalysisReport(token, date, type, planId, unitId, page, pageSize);
+                Thread.sleep(500);
+            } catch (InterruptedException e) {
+                log.error("获取人群消息异常", e);
+            }
+        }));
+        return Result.ok("success");
+    }
+
+    @Autowired
+    private IAiKuaishouAdvertiserStrategyService strategyService;
+    @Autowired
+    private IAiKuaishouCreateCreativeService createCreativeService;
+
+    @GetMapping("testCreateCreative")
+    public Map<String, Object> testCreateCreative(Long accountId, Integer createType) {
+        Map<String, Object> result = new HashMap<>();
+        AiKuaishouAdvertiserStrategy strategy = strategyService.getByAccountId(accountId);
+        if (strategy == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        createCreativeService.autoCreateCreative(strategy, createType, 150L);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @GetMapping("testProgramCreative")
+    public Map<String, Object> testProgramCreative(Long accountId, Integer createType) {
+        Map<String, Object> result = new HashMap<>();
+        AiKuaishouAdvertiserStrategy strategy = strategyService.getByAccountId(accountId);
+        if (strategy == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        createCreativeService.autoCreateProgramCreative(strategy, createType, 150L);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @GetMapping("testCreateCreativeLimit")
+    public Map<String, Object> testCreateCreativeLimit(Long accountId, Integer hour) throws ParseException {
+        Map<String, Object> result = new HashMap<>();
+        AiKuaishouAdvertiserStrategy strategy = strategyService.getByAccountId(accountId);
+        if (strategy == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        createCreativeService.customCreativeSupplement(strategy, hour);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }

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

@@ -0,0 +1,37 @@
+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 lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author jeecg-boot
+ * @date   2021-04-22
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_bytedance_customer_ad_tbtj_data")
+public class BytedanceCustomerDdTbtjData {
+    
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**adId*/
+	private Long adId;
+	/**stateDate*/
+	private String stateDate;
+	/**loginCnt*/
+	private Integer loginCnt;
+	/**bugerCnt*/
+	private Integer buyerCnt;
+	/**nextDayStay*/
+	private Integer nextDayStay;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+}

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

@@ -1,64 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 获取广告组分天报表
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouDailyGroupReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private IKuaishouReportDailyGroupService reportDailyGroupService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = DateUtils.addDay(new Date(), -1);
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-
-                log.info("快手广告租报表同步完成");
-                executorService = Executors.newFixedThreadPool(3);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            //获取广告组信息数据
-                            reportDailyGroupService.getAdvertiserGroupReportDaily(token, getDate, getDate);
-                        }
-                    });
-                });
-            }
-
-        };
-        thread.start();
-
-    }
-}

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

@@ -1,84 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 获取 广告组分时数据
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouHourlyGroupReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = new Date();
-                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-                String hour = simpleDateFormat.format(getDate);
-                if (null != hour && "00".equals(hour)) {
-                    getDate = DateUtils.addDay(getDate, -1);
-                }
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(5);
-                countDownLatch = new CountDownLatch(tokens.size());
-                Date finalGetDate = getDate;
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                //3:获取广告组信息数据
-                                kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, finalGetDate, finalGetDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                                countDownLatch.countDown();
-                            }
-                        }
-                    });
-                });
-                try {
-                    countDownLatch.await();
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-
-                executorService.shutdown();
-            }
-        };
-        thread.start();
-
-    }
-}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.ctop.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author: jeecg-boot
+ * @date:   2021-04-22
+ * @cersion: V1.0
+ */
+public interface BytedanceCustomerDdTbtjDataMapper extends BaseMapper<BytedanceCustomerDdTbtjData> {
+
+    void replaceDatas(@Param(value = "datas") List<BytedanceCustomTbtjDataEntity> datas);
+}

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

@@ -0,0 +1,24 @@
+<?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.BytedanceCustomerDdTbtjDataMapper">
+
+    <insert id="replaceDatas">
+        REPLACE INTO
+        ctop_bytedance_customer_ad_tbtj_data
+        (ad_id,
+        state_date,
+        login_cnt,
+        buyer_cnt,
+        next_day_stay)
+        values
+        <foreach collection="datas" item="data" separator=",">
+            (
+            #{data.adId},
+            #{data.dateString},
+            #{data.loginCnt},
+            #{data.buyerCnt},
+            #{data.nextDayStay}
+            )
+        </foreach>
+    </insert>
+</mapper>

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

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+
+import java.util.List;
+
+/**
+ * @Description: 淘宝特价版客户反馈数据
+ * @Author: jeecg-boot
+ * @Date:   2021-04-22
+ * @Version: V1.0
+ */
+public interface IBytedanceCustomerDdTbtjDataService extends IService<BytedanceCustomerDdTbtjData> {
+
+    void replaceEntityList(List<BytedanceCustomTbtjDataEntity> datas);
+}

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

@@ -0,0 +1,28 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import org.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.ctop.mapper.BytedanceCustomerDdTbtjDataMapper;
+import org.jeecg.modules.ctop.service.IBytedanceCustomerDdTbtjDataService;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author jeecg-boot
+ * @date   2021-04-22
+ * @version V1.0
+ */
+@Service
+public class BytedanceCustomerDdTbtjDataServiceImpl extends ServiceImpl<BytedanceCustomerDdTbtjDataMapper, BytedanceCustomerDdTbtjData> implements IBytedanceCustomerDdTbtjDataService {
+    @Resource
+    private BytedanceCustomerDdTbtjDataMapper tbtjDataMapper;
+    @Override
+    public void replaceEntityList(List<BytedanceCustomTbtjDataEntity> datas) {
+        tbtjDataMapper.replaceDatas(datas);
+    }
+}

+ 50 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/BytedanceCustomTbtjDataExcelListener.java

@@ -0,0 +1,50 @@
+package org.jeecg.modules.excelutil;
+
+import cn.com.ctop.common.module.utils.SpringUtils;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.ctop.service.impl.BytedanceCustomerDdTbtjDataServiceImpl;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class BytedanceCustomTbtjDataExcelListener extends AnalysisEventListener<BytedanceCustomTbtjDataEntity> {
+    //自定义用于暂时存储data。
+    //可以通过实例获取该值
+    private List<BytedanceCustomTbtjDataEntity> datas = new ArrayList<>();
+    private static final int BATCH_COUNT = 200;
+
+    @Override
+    public void invoke(BytedanceCustomTbtjDataEntity object, AnalysisContext context) {
+        //数据存储到list,供批量处理,或后续自己业务逻辑处理。
+        Date date = object.getStateDate();
+        object.setDateString(DateUtils.formatDate(date,"yyyy-MM-dd HH:mm:ss"));
+        datas.add(object);
+        if(null!=datas&&datas.size()>=BATCH_COUNT){
+            saveDate();
+            datas.clear();
+        }
+    }
+
+    private void saveDate() {
+        BytedanceCustomerDdTbtjDataServiceImpl dataService = SpringUtils.getApplicationContext().getBean(BytedanceCustomerDdTbtjDataServiceImpl.class);
+        dataService.replaceEntityList(datas);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+        // 解析结束销毁不用的资源
+         datas.clear();
+    }
+
+    public List<BytedanceCustomTbtjDataEntity> getDatas() {
+        return datas;
+    }
+
+    public void setDatas(List<BytedanceCustomTbtjDataEntity> datas) {
+        this.datas = datas;
+    }
+}

+ 0 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/JhsBakendDataExcelListener.java

@@ -38,23 +38,6 @@ public class JhsBakendDataExcelListener extends AnalysisEventListener<JhsBakendD
         dataService.replaceEntityList(datas);
     }
 
-    private void doSomething(Object object) {
-        //入库调用接口
-        JhsBakendDataEntity dataEntity = (JhsBakendDataEntity) object;
-        dataEntity.setCreateTime(new Date());
-        dataEntity.setUpdateTime(new Date());
-        String date = dataEntity.getStateDate();
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
-        try {
-            date = DateUtils.formatDate(dateFormat.parse(date));
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-        dataEntity.setStateDate(date);
-        JhsBakendDataServiceImpl dataService = SpringUtils.getApplicationContext().getBean(JhsBakendDataServiceImpl.class);
-        dataService.replaceEntity(dataEntity);
-    }
-
     @Override
     public void doAfterAllAnalysed(AnalysisContext context) {
         // datas.clear();//解析结束销毁不用的资源

+ 73 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/BytedanceCustomTbtjDataEntity.java

@@ -0,0 +1,73 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.util.Date;
+
+public class BytedanceCustomTbtjDataEntity extends BaseRowModel {
+    /**日期*/
+    @ExcelProperty(value = "日期", index = 0)
+    private Date stateDate;
+    /**计划id*/
+    @ExcelProperty(value = "计划id", index = 1)
+    private Long adId;
+    @ExcelProperty(value = "登录人数", index = 2)
+    private Integer loginCnt;
+    /**bugerCnt*/
+    @ExcelProperty(value = "首购人数", index = 3)
+    private Integer buyerCnt;
+    /**nextDayStay*/
+    @ExcelProperty(value = "次留数", index = 4)
+    private Integer nextDayStay;
+    
+    private String dateString;
+
+    public Date getStateDate() {
+        return stateDate;
+    }
+
+    public void setStateDate(Date stateDate) {
+        this.stateDate = stateDate;
+    }
+
+    public Long getAdId() {
+        return adId;
+    }
+
+    public void setAdId(Long adId) {
+        this.adId = adId;
+    }
+
+    public Integer getLoginCnt() {
+        return loginCnt;
+    }
+
+    public void setLoginCnt(Integer loginCnt) {
+        this.loginCnt = loginCnt;
+    }
+
+    public Integer getBuyerCnt() {
+        return buyerCnt;
+    }
+
+    public void setBuyerCnt(Integer buyerCnt) {
+        this.buyerCnt = buyerCnt;
+    }
+
+    public Integer getNextDayStay() {
+        return nextDayStay;
+    }
+
+    public void setNextDayStay(Integer nextDayStay) {
+        this.nextDayStay = nextDayStay;
+    }
+
+    public String getDateString() {
+        return dateString;
+    }
+
+    public void setDateString(String dateString) {
+        this.dateString = dateString;
+    }
+}

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java

@@ -376,7 +376,7 @@ public class SysDepartController {
         LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
         query.orderByAsc(SysDepart::getOrgCode);
         if (oConvertUtils.isNotEmpty(id)) {
-            String arr[] = id.split(",");
+            String [] arr = id.split(",");
             query.in(SysDepart::getId, arr);
         }
         List<SysDepart> ls = this.sysDepartService.list(query);

+ 10 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -315,7 +315,8 @@ public class SysUserController {
         String selectedDeparts = jsonObject.getString("selecteddeparts");
         try {
             SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
-            user.setCreateTime(new Date());//设置创建时间
+            //设置创建时间
+            user.setCreateTime(new Date());
             String salt = oConvertUtils.randomGen(8);
             user.setSalt(salt);
             String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt);
@@ -351,25 +352,28 @@ public class SysUserController {
     public Result<SysUser> edit(@RequestBody JSONObject jsonObject) {
         Result<SysUser> result = new Result<SysUser>();
         try {
+            //根据id查询用户信息
             SysUser sysUser = sysUserService.getById(jsonObject.getString("id"));
             sysBaseAPI.addLog("编辑用户,id: " + jsonObject.getString("id"), CommonConstant.LOG_TYPE_2, 2);
             if (sysUser == null) {
                 result.error500("未找到对应实体");
             } else {
                 SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
+                user.setLeaderName(user.getLeaderName().trim());
                 user.setUpdateTime(new Date());
+                user.setLeaderName(user.getLeaderName().trim());
                 //String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
                 user.setPassword(sysUser.getPassword());
-                String roles = jsonObject.getString("selectedroles");
-                String departs = jsonObject.getString("selecteddeparts");
+                String roles = jsonObject.getString("selectedroles");//用户角色
+                String departs = jsonObject.getString("selecteddeparts");//用户部门
                 if (!Check.isNull(departs)) {
                     SysDepart depart = departService.getById(departs);
                     if (!Check.isNull(depart)) {
                         user.setOrgCode(depart.getOrgCode());
                     }
                 }
-                sysUserService.editUserWithRole(user, roles);
-                sysUserService.editUserWithDepart(user, departs);
+                sysUserService.editUserWithRole(user, roles);//修改角色
+                sysUserService.editUserWithDepart(user, departs);//修改部门
                 sysUserService.updateNullPhoneEmail();
 
                 userCompanyService.addOrUpdateUserWithCompany(user);
@@ -383,7 +387,7 @@ public class SysUserController {
                                 memberQueryWrapper.eq("user_id", user.getId());
                                 ProjectMember updateMember = new ProjectMember();
                                 updateMember.setRoleCode(sysRole.getRoleCode());
-                                memberService.update(updateMember, memberQueryWrapper);
+                                memberService.update(updateMember, memberQueryWrapper);//更新项目人员角色信息
                             }
                         }
                     };

+ 2 - 0
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -290,3 +290,5 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
+xxl-job:
+  requestUrl: http://jiaoyangapi.shyouteng.com.cn

+ 2 - 0
jeecg-boot-module-system/src/main/resources/application-jiaoyang.yml

@@ -261,3 +261,5 @@ ai:
   callback:
     callback-unit-url: http://139.186.27.96:31012/ai_callback_add_group
     callback-creative-url: http://139.186.27.96:31012/ai_callback_add_creative
+xxl-job:
+  requestUrl: http://jiaoyangapi.shyouteng.com.cn

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

@@ -261,3 +261,5 @@ ai:
   callback:
     callback-unit-url: http://139.186.27.96:31012/ai_callback_add_group
     callback-creative-url: http://139.186.27.96:31012/ai_callback_add_creative
+xxl-job:
+  requestUrl: http://api.tjyourong.com.cn

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

@@ -253,3 +253,5 @@ ai:
   callback:
     callback-unit-url: http://139.186.27.96:31012/ai_callback_add_group
     callback-creative-url: http://139.186.27.96:31012/ai_callback_add_creative
+xxl-job:
+  requestUrl: http://api.tjyourong.com.cn

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

@@ -250,3 +250,5 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
+xxl-job:
+  requestUrl: http://jiaoyangapi.shyouteng.com.cn

+ 18 - 11
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -56,9 +56,9 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-    url: jdbc:mysql://172.30.0.4:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&useSSL=false
-    username: hcst
-    password: hcst@2020
+    url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    username: data
+    password: hcst@2021
     driver-class-name: com.mysql.jdbc.Driver
     druid:
       stat-view-servlet:
@@ -69,7 +69,8 @@ spring:
         enabled: true
     #      remove-abandoned: false
     dynamic:
-      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+      druid:
+        # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
         # 连接池的配置信息
         # 初始化大小,最小,最大
         connection-init-sql: set names utf8mb4
@@ -94,16 +95,21 @@ spring:
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
+        master:
+          url: jdbc:mysql://139.186.27.96:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: data
+          password: hcst@2021
+          driver-class-name: com.mysql.jdbc.Driver
 #        master:
 #          url: jdbc:mysql://139.186.151.174:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
 #          username: hcst
 #          password: hcst@2020
 #          driver-class-name: com.mysql.jdbc.Driver
-        master:
-          url: jdbc:mysql://172.30.0.4:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&useSSL=false
-          username: hcst
-          password: hcst@2020
-          driver-class-name: com.mysql.jdbc.Driver
+#        master:
+#          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+#          username: data
+#          password: hcst@2021
+#          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0
@@ -159,7 +165,7 @@ jeecg:
     #webapp文件路径
     webapp: /mnt/webapp
     video-upload: /mnt/upload/video/
-    image-upload: /mnt/upload/image/
+    image-upload: D://data//image//
     kuaishou-agent-image: D://temp.png
     kuaishou-account-captcha-image: D://captcha.png
     chrome-driver: D://chromedriver.exe
@@ -242,4 +248,5 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
-
+xxl-job:
+  requestUrl: http://jiaoyangapi.shyouteng.com.cn

+ 4 - 11
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai

@@ -9,8 +9,7 @@ import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import ${bussiPackage}.${entityPackage}.entity.${entityName};
 import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
@@ -57,7 +56,6 @@ public class ${entityName}Controller {
 	 * @param req
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
 	@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
 	@GetMapping(value = "/list")
 	public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
@@ -78,7 +76,6 @@ public class ${entityName}Controller {
 	 * @param ${entityName?uncap_first}
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-添加")
 	@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
 	@PostMapping(value = "/add")
 	public Result<${entityName}> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
@@ -98,7 +95,6 @@ public class ${entityName}Controller {
 	 * @param ${entityName?uncap_first}
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-编辑")
 	@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
 	@PutMapping(value = "/edit")
 	public Result<${entityName}> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
@@ -121,10 +117,9 @@ public class ${entityName}Controller {
 	 * @param id
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
 	@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+	public Result<?> delete(@RequestParam(name="id") String id) {
 		try {
 			${entityName?uncap_first}Service.removeById(id);
 		} catch (Exception e) {
@@ -135,14 +130,13 @@ public class ${entityName}Controller {
 	}
 
 	/**
-	  *  批量删除
+	 *  批量删除
 	 * @param ids
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
 	@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
-	public Result<${entityName}> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+	public Result<${entityName}> deleteBatch(@RequestParam(name="ids") String ids) {
 		Result<${entityName}> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
@@ -158,7 +152,6 @@ public class ${entityName}Controller {
 	 * @param id
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
 	@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {

+ 3 - 3
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai

@@ -8,9 +8,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * ${tableVo.ftlDescription}
- * @author: jeecg-boot
- * @date:   ${.now?string["yyyy-MM-dd"]}
- * @cersion: V1.0
+ * @author jeecg-boot
+ * ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
  */
 public interface ${entityName}Mapper extends BaseMapper<${entityName}> {
 

+ 4 - 4
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai

@@ -4,10 +4,10 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
- * @Description: ${tableVo.ftlDescription}
- * @Author: jeecg-boot
- * @Date:   ${.now?string["yyyy-MM-dd"]}
- * @Version: V1.0
+ * ${tableVo.ftlDescription}
+ * @author jeecg-boot
+ * ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
  */
 public interface I${entityName}Service extends IService<${entityName}> {
 

+ 1 - 1
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai

@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 /**
  * ${tableVo.ftlDescription}
  * @author jeecg-boot
- * @date   ${.now?string["yyyy-MM-dd"]}
+ * ${.now?string["yyyy-MM-dd"]}
  * @version V1.0
  */
 @Service

+ 1 - 18
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -7,21 +7,4 @@ url=jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicod
 username=data
 password=hcst@2021
 database_name=jeecg-boot
-#oracle
-#diver_name=oracle.jdbc.driver.OracleDriver
-#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
-#username=scott
-#password=tiger
-#database_name=ORCL
-#postgre
-#diver_name=org.postgresql.Driver
-#url=jdbc:postgresql://localhost:5432/jeecg
-#username=postgres
-#password=postgres
-#database_name=jeecg
-#SQLServer2005\u4ee5\u4e0a
-#diver_name=org.hibernate.dialect.SQLServerDialect
-#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=jeecg
-#username=sa
-#password=SA
-#database_name=jeecg
+

+ 76 - 483
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -2,24 +2,18 @@ package org.jeecg;
 
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
-import cn.com.ctop.kuaishou.modules.batch.service.*;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
-import cn.com.ctop.kuaishou.modules.report.service.*;
-import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
+import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
-import cn.com.ctop.oa.modules.service.IWechatUserListService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
 import cn.com.ctop.toutiao.modules.report.service.*;
+import com.csvreader.CsvReader;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -30,8 +24,10 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
+import java.io.IOException;
+import java.nio.charset.Charset;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -39,123 +35,60 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import static org.jeecg.common.util.DateUtils.getAnotherDay;
-
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ActiveProfiles("dev")
+@ActiveProfiles("wps")
 @Slf4j
 public class SampleTest {
     @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-    @Autowired
-    private IReportService reportService;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired
-    private IKuaiShouVideoGetService videoGetService;
-    @Autowired
-    private IKuaishouVideoRelateCreativesService kuaishouVideoRelateCreativesService;
-    @Autowired
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
-    /*   @Autowired
-       private IByteDanceAdvertiserDataService advertiserDataService;
-
-   */
-    @Autowired
-    private IKuaishouReportDailyGroupService reportDailyGroupService;
-    @Autowired
-    private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
     @Autowired
-    private IKuaiShouGroupService kuaiShouGroupService;
-
+    private IKuaishouInterfaceService kuaishouInterfaceService;
 
     @Test
-    public void loadBytedanceCreativeData() throws ParseException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        Date getDate2 = DateUtils.addDay(new Date(), -2);
-
-        CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9901975L);
-        token.setAccessToken("1c7cebebc3174c39fe941d136df65b1d");
+    public void loadKuaishouCookie() throws ParseException {
 
-        kuaiShouGroupService.getGroupListByPage("90f31a01c2137aa11c8686e86064b630",9845316L,null,1);
 
-//        kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
-
-     /*   JSONObject materialOverview = kuaiShouAccountMaterialOverviewService.getMaterialOverview(5473041L, "2021-03-09");
-        System.err.println(materialOverview);*/
-
-      /*  CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9901975L);
-        token.setAccessToken("e609f9d3f56f3d6b4653f32c98a6d119");
-        kuaiShouAccountMaterialOverviewService.cleanAccountMaterialOverview(9901975L, "2021-03-09");
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse("2021-03-09");
-        reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse);*/
-
-        //    1662234704806924
-       /* CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9549277L);
-        token.setAccessToken("bc5327c8f2bd8a67513e51148c9206c8");
+        try {
+            // 用来保存数据
+            ArrayList<String[]> csvFileList = new ArrayList<String[]>();
+            // 定义一个CSV路径
+            String csvFilePath = "D:\\test\\123.csv";
+            // 创建CSV读对象 例如:CsvReader(文件路径,分隔符,编码格式);
+            CsvReader reader = new CsvReader(csvFilePath, ',', Charset.forName("UTF-8"));
+            // 跳过表头 如果需要表头的话,这句可以忽略
+            reader.readHeaders();
+            // 逐行读入除表头的数据
+            while (reader.readRecord()) {
+                System.out.println(reader.getRawRecord());
+                csvFileList.add(reader.getValues());
+            }
+            reader.close();
 
+            // 遍历读取的CSV文件
+            for (int row = 0; row < csvFileList.size(); row++) {
+                // 取得第row行第0列的数据
+                String cell = csvFileList.get(row)[0];
+                System.out.println("------------>" + cell);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
 
 
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse("2021-02-02");
-        kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
 
-     /*   CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9767055L);
-        token.setAccessToken("28e4e6b124e1443d6971ba4c699de6c9");
 
-        kuaishouInterfaceService.getVideoList(token, null, null);
-        kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9", 9767055L, "5208131540349742192");*/
 
-     /*   CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1662234704806924L);
-        advertiserDataService.getMaterialList(tokenByAccountId);*/
-       /* getVideoByPage(token, "", 1);
-        List<KuaiShouVideoGet> KuaiShouVideoGets = videoGetService.selectPhotoIdsByAccountId(9743746L);
-        if (!Check.isNull(KuaiShouVideoGets)) {
-            JSONArray dateList = new JSONArray();
-            JSONArray photoIds = new JSONArray();
-            Map<String, Object> statdateMap = new HashMap<>();
-            int count = 0;
-            for (KuaiShouVideoGet video : KuaiShouVideoGets) {
-                count++;
-                if (count < 10) {
-                    photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
-                } else {
-                    photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
-                    dateList.add(photoIds);
-                    photoIds = new JSONArray();
-                    count = 0;
-                }
-            }
-            dateList.add(photoIds);
-            kuaishouVideoRelateCreativesService.videoRelateCreatives(9743746L, dateList, statdateMap);
-        }*/
+       /* CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(9792526L);
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = dateFormat.parse("2021-04-02");
+        kuaishouInterfaceService.getAdvertiserReportDaily(tokenByAccountId, parse, parse, null);*/
     }
 
-    @Test
-    public void loadKuaishouCookie() {
-        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
-        if (list != null && !list.isEmpty()) {
-            int i = 0;
-            for (BindAccountLogin login : list) {
-                if (null == login.getCookie() || "".equals(login.getCookie().trim())) {
-                    kuaishouWebInterfaceService.getkuaishouWebLoginCookie(login);
-                    i++;
-                }
-            }
-        }
-    }
 
     static ExecutorService executorService = null;
     static CountDownLatch countDownLatch = null;
@@ -187,236 +120,55 @@ public class SampleTest {
     }
 
     @Autowired
-    private IUserAllocationService allocationService;
-
-    @Test
-    public void testLoadBytedanceData() {
-        List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
-        if (null != allocations && !allocations.isEmpty()) {
-            for (UserAllocation allocation : allocations) {
-                CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
-                String startDate = "2020-11-10";
-                String endDate = "2020-11-10";
-                reportService.getAdvertiserReport(token, DateUtils.parseDate(startDate, "yyyy-MM-dd"), DateUtils.parseDate(endDate, "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-            }
-        }
-        System.out.println("任务结束");
-    }
-
-    @Test
-    public void loadKuaishouPlanData() {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate));
-    }
-
-    @Autowired
-    private IBytedanceFundDailyService bytedanceFundDailyService;
-
-    @Test
-    public void loadFoudData() {
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        for (CtopOauthToken token : tokens) {
-            System.out.println(token.getAccountId() + "############################");
-            for (int i = 20; i < 130; i++) {
-                Date date = DateUtils.addDay(new Date(), -i);
-                bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(date), DateUtils.formatDate(date), 1);
-                System.out.println(i + "############################");
-            }
-        }
-    }
-
-    @Autowired
-    private IKuaiShouHistoryReportTaskService reportTaskService;
-
-    /**
-     * 测试获取快手图片消耗数据任务
-     */
-    @Test
-    public void loadKuaishouImageTask() {
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for (int i = 1; i < 130; i++) {
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            String getDateStr = DateUtils.formatDate(getDate);
-            tokens.forEach(token -> reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY));
-        }
-    }
-
-    @Autowired
-    private IKuaiShouDailyReportTaskService dailyReportTaskService;
-
-    /**
-     * 测试获取快手图片消耗数据入库
-     */
-    @Test
-    public void loadKuaishouImageTaskFile() {
-        String nowDate = DateUtils.getDate("yyyy-MM-dd");
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for (int i = 1; i < 15; i++) {
-            String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -i);
-            tokens.forEach(token -> dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate));
-        }
-        //  查询快手token
-    }
-
-    @Test
-    public void testLoadBytedanceImageData() {
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        countDownLatch = new CountDownLatch(tokens.size());
-        executorService = Executors.newFixedThreadPool(8);
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                advertiserDataService.getMaterialList(token);
-            } catch (Exception e) {
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        System.out.println("素材数据获取完成");
-
-    }
-
-    @Autowired
-    private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
-
-    @Test
-    public void testData() {
-        Date date = new Date();
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        executorService = Executors.newFixedThreadPool(10);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                reportService.getAdvertiserPlanRuleData(token, date, date, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-            } catch (Exception e) {
-
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void loadKuaishouAgentData() {
-        kuaishouReportDailyAgentService.loginAgent();
-        try {
-            for (int i = 1; i < 30; i++) {
-                kuaishouReportDailyAgentService.getAccount(i);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void loadKuaishouData() {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for (CtopOauthToken token : tokens) {
-            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
-        }
-    }
-
-    @Autowired
     private IBytedanceReportService bytedanceReportService;
 
     @Test
     public void loadBytedanceVideoReportData() {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        String date = DateUtils.formatDate(getDate);
+        String startDate = "2021-04-01";
+        String endDate = "2021-04-26";
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        for (CtopOauthToken token : tokens) {
-            bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
-        }
-    }
+        Long start = System.currentTimeMillis();
 
-    @Test
-    public void loadKuaishouHourlyReportData() {
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        if ("00".equals(hour)) {
-            getDate = DateUtils.addDay(getDate, -1);
-        }
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        Date finalGetDate = getDate;
-        tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate));
+        tokens.forEach(token -> {
+            bytedanceReportService.bytedanceVideoMaterialReport(token, startDate, endDate);
+        });
+        Long end = System.currentTimeMillis();
+        log.info("查询素材消耗用时:{}毫秒", end - start);
     }
 
     @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    @Test
-    public void loadKuaishouGroupData() throws ParseException {
-        Date endDate = new Date();
-        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
-        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-        Date startDate = sim.parse(anotherDay);
-        CtopOauthToken token = tokenService.getTokenByAccountId(7087890L);
-        kuaishouInterfaceService.getGroupList(token, startDate, endDate);
-    }
-
+    private IWechatNoListService wechatNoListService;
+    @Autowired
+    private IETLReportBytedanceVideoService bytedanceVideoService;
 
     @Test
-    public void loadAccountData() {
-//        List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
-//        for (UserAllocation allocation:allocations) {
-        CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
-        for (int i = 92; i < 100; i++) {
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+    public void etlBytedanceVideoInfo() {
+        String startDate = "2021-02-01";
+        for (int i = 0; i < 100; i++) {
+            bytedanceVideoService.cleanData(DateUtils.addDay(startDate, i));
         }
-//        }
     }
 
-    @Autowired
-    private IWechatCheckinDataService wechatCheckinDataService;
-    @Autowired
-    private IWechatUserListService wechatUserInfoService;
-    @Autowired
-    private IWechatNoListService wechatNoListService;
-
     @Test
     public void getData() {
         //汇创 人员
 //        wechatUserInfoService.getUserList();
 //        //考勤记录
-//        wechatCheckinDataService.getCheckinData("2020-11-01 00:00:00", "2020-12-01 23:59:59");
+//        wechatCheckinDataService.getCheckinData("2021-03-01 00:00:00", "2021-03-31 23:59:59");
         //异常记录
-//        wechatNoListService.getNoDateByNo("2020-11-01 00:00:00", "2020-12-01 23:59:59", "0");
+        wechatNoListService.getNoDateByNo("2021-03-01 00:00:00", "2021-03-31 23:59:59", "0");
         //优容
-        wechatUserInfoService.getYRUserList();
-        wechatCheckinDataService.getYRCheckinData("2020-11-01 00:00:00", "2020-11-30 23:59:59");
-        wechatNoListService.getNoDateByNo("2020-11-01 00:00:00", "2020-12-01 23:59:59", "1");
+//        wechatUserInfoService.getYRUserList();
+//        wechatCheckinDataService.getYRCheckinData("2021-03-01 00:00:00", "2021-03-31 23:59:59");
+        wechatNoListService.getNoDateByNo("2021-03-01 00:00:00", "2021-03-31 23:59:59", "1");
     }
 
-    @Autowired
-    private IKuaiShouCommentService kuaiShouCommentService;
-
-    @Test
-    public void kuaishouDeleteComment() {
-        kuaiShouCommentService.shieldComment(8018853L);
-    }
 
     @Autowired
     private IByteDanceVideoReportDailyService videoReportDailyService;
 
     @Test
-    synchronized public void formatVideoReportData() {
-
+    public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
             Date getDate = DateUtils.addDay(new Date(), -i);
             String date = DateUtils.formatDate(getDate);
@@ -425,200 +177,41 @@ public class SampleTest {
     }
 
     @Autowired
-    private IRuleKuaiShouPlanService ruleKuaiShouPlanService;
-
-    @Autowired
-    private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
-
-    @Test
-    public void execute() {
-        List<UserAllocation> allocations = allocationService.listByMediaId("3", 0);
-        for (UserAllocation allocation : allocations) {
-            BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-10-01", "2020-10-31");
-            reportTaskRecordService.save(reportTaskRecord1);
-            BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-11-01", "2020-11-30");
-            reportTaskRecordService.save(reportTaskRecord2);
-            BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-12-01", "2020-12-31");
-            reportTaskRecordService.save(reportTaskRecord3);
-        }
-    }
-
-    @Test
-    public void loadBDAccoutData() {
-        CtopOauthToken token2 = tokenService.getTokenByAccountId(1674206482908163L);
-        bytedanceReportService.bytedanceMaterialReport(token2, "2020-10-14", "2020-10-14");
-    }
-
-    @Resource
-    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
-
-    private void load12AccountData(CtopOauthToken token) {
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-10-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-10-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-11-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-11-30", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-12-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-    }
-
-    private void load12Data(CtopOauthToken token) {
-        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-11", "2020-10-13");
-        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-14", "2020-10-16");
-        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-17", "2020-10-19");
-        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-20", "2020-10-21");
-    }
-
-    @Autowired
-    private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
-
-    @Test
-    public void etlKuaishouData() {
-        String dateString = "2021-01-05";
-        Date startDate = DateUtils.parseDate(dateString, "yyyy-MM-dd");
-        for (int i = 0; i <= 10; i++) {
-            Date getDate = DateUtils.addDay(startDate, i);
-            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
-            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
-        }
-    }
-
-    @Autowired
     private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
-
-    @Test
-    public void loadBytedanceVideo() {
-        CtopOauthToken token = tokenService.getTokenByAccountId(1673731601820686L);
-        for (int i = 15; i < 60; i++) {
-            reportService.getAdvertiserReport(token, DateUtils.addDay(new Date(), -i), DateUtils.addDay(new Date(), -i), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        }
-    }
-
-    @Test
-    public void loadKuaishouVideo() {
-        Date date = new Date();
-        CtopOauthToken token = tokenService.getTokenByAccountId(9556344L);
-//        kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, new Date(), new Date(), null, null);
-        kuaishouInterfaceService.getVideoList(token, DateUtils.formatDate(DateUtils.addDay(date, -5)), DateUtils.formatDate(date));
-        // 获取图片信息数据
-//        kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
-    }
-
-
-    @Autowired
-    IRuleByteDanceAccountService ruleByteDanceAccountService;
-    @Autowired
-    IAiKuaishouNewCreateCampaign aiKuaishouNewCreateCampaign;
-
-    @Test
-    public void testLoadBytedanceDataV2() {
-        String accountIds =
-                "1675440464386062," +
-                        "1688606248211533," +
-                        "1669181787105294," +
-                        "1687571097467912," +
-                        "1650079154438157," +
-                        "1680697900744711," +
-                        "1678156679964680," +
-                        "1670727177043982," +
-                        "1676160388944910," +
-                        "1687559760306190," +
-                        "1687382871519240," +
-                        "1680312075164686," +
-                        "1675440465991688," +
-                        "1664657972166663," +
-                        "1688193173408782," +
-                        "1675616147056647," +
-                        "1687308848716814," +
-                        "1686394621234247," +
-                        "1683594409340935," +
-                        "1683676478859341," +
-                        "1686384860112904," +
-                        "1668290872519693," +
-                        "1674063202781191," +
-                        "1685024266033160," +
-                        "1669714891201544," +
-                        "1687758256277512," +
-                        "1675434231118856," +
-                        "1686394621807687," +
-                        "1678411706704903," +
-                        "1686223489547271," +
-                        "1660120711467022," +
-                        "1686833795211278," +
-                        "1680697899143175," +
-                        "1661313994984462," +
-                        "1661313995480077," +
-                        "1636295780727820," +
-                        "1676540490482759," +
-                        "1675342904713223," +
-                        "1686771461984327," +
-                        "1685841129360391," +
-                        "1683676477736973," +
-                        "1661313994470413," +
-                        "1663465141771272," +
-                        "1687758256732174," +
-                        "1686223482927117," +
-                        "1686835166313479," +
-                        "1642648003678215," +
-                        "1639753233213454," +
-                        "1675239584963662," +
-                        "1674634579279885," +
-                        "1650263841162253," +
-                        "1672178052130888";
-        String[] accountArray = accountIds.split(",");
-        for (int i = 0; i < accountArray.length; i++) {
-            CtopOauthToken token = tokenService.getTokenByAccountId(Long.parseLong(accountArray[i]));
-
-            reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        }
-    }
-
     @Autowired
     IBytedanceVideoReportService bytedanceVideoReportService;
-
     @Autowired
     IETLReportBytedanceVideoService ietlReportBytedanceVideoService;
-
     @Autowired
     IKuaishouReportDailyImageService kuaishouReportDailyImageService;
+    @Autowired
+    IRuleByteDanceAccountService ruleByteDanceAccountService;
 
     @Test
-    public void loadKuaiShouImage() {
-        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
-        executorService = Executors.newFixedThreadPool(22);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                kuaishouReportDailyImageService.getMaterialImageReport(token.getAccountId(), token.getAccessToken(), "2021-01-17", "2021-01-31", 1);
-            } catch (Exception e) {
-
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
+    public void loadBDAccoutData() {
+        Date startDate = DateUtils.addDay(new Date(), -2000);
+        for (int i = 0; i <= 2000; i++) {
+            Date getDate = DateUtils.addDay(startDate, i);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
         }
     }
 
-    @Autowired
-    private IEtlKuaishouAccountMaterialReportDailyService dailyService;
+    @Resource
+    private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
 
     @Test
-    public void etlKuaishouInfo() {
-        Date startDate = DateUtils.parseDate("2020-05-03", "yyyy-MM-dd");
-        for (int i = 0; i < 365; i++) {
-            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
-        }
+    public void etlKuaishouVideoInfo() {
+        etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
     }
 
     @Autowired
-    private IEtlKuaishouVideoInfoService videoEtlInfoService;
+    private IByteDanceCampaignService campaignService;
 
     @Test
-    public void etlKuaishouVideoInfo() {
-        Date startDate = DateUtils.parseDate("2020-09-11", "yyyy-MM-dd");
-        for (int i = 0; i < 365; i++) {
-//            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
-            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
+    public void testLoadBytedanceCampaign() {
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        for (CtopOauthToken token : tokens) {
+            campaignService.getAdvertiserCampaign(token, null, null);
         }
     }
 

+ 7 - 7
module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java

@@ -20,7 +20,7 @@ import java.util.List;
 @Slf4j
 public class MatchLogic {
     /**
-     * @param type      数据类型
+     * @param indicator      数据类型
      * @param condition 条件
      * @param threshold 阈值
      * @param value     比对值
@@ -261,7 +261,7 @@ public class MatchLogic {
                         Long tplanId = targetDatas.getJSONObject(k).getLong("planId");
                         for (int j = 0; j < creativeDatas.size(); j++) {
                             Long cplanId = creativeDatas.getJSONObject(j).getLong("planId");
-                            if (cplanId == tplanId && cplanId == pplanId) {
+                            if (cplanId.equals(tplanId) && cplanId.equals(pplanId)) {
                                 sendData.add(creativeDatas.getJSONObject(j));
                             }
                         }
@@ -272,7 +272,7 @@ public class MatchLogic {
                     Long pplanId = planDatas.getJSONObject(i).getLong("planId");
                     for (int k = 0; k < targetDatas.size(); k++) {
                         Long tplanId = targetDatas.getJSONObject(k).getLong("planId");
-                        if (tplanId == pplanId) {
+                        if (tplanId.equals(pplanId)) {
                             sendData.add(targetDatas.getJSONObject(k));
                         }
                     }
@@ -282,7 +282,7 @@ public class MatchLogic {
                     Long pplanId = planDatas.getJSONObject(i).getLong("planId");
                     for (int k = 0; k < creativeDatas.size(); k++) {
                         Long cplanId = creativeDatas.getJSONObject(k).getLong("planId");
-                        if (cplanId == pplanId) {
+                        if (cplanId.equals(pplanId)) {
                             sendData.add(creativeDatas.getJSONObject(k));
                         }
                     }
@@ -292,7 +292,7 @@ public class MatchLogic {
                     Long tplanId = targetDatas.getJSONObject(i).getLong("planId");
                     for (int k = 0; k < creativeDatas.size(); k++) {
                         Long cplanId = creativeDatas.getJSONObject(k).getLong("planId");
-                        if (cplanId == tplanId) {
+                        if (cplanId.equals(tplanId)) {
                             sendData.add(creativeDatas.getJSONObject(k));
                         }
                     }
@@ -332,14 +332,14 @@ public class MatchLogic {
                         if (!Check.isNull(targetDatas) && Check.isNull(groupDatas)) {
                             for (int k = 0; k < targetDatas.size(); k++) {
                                 Long tgPlanId = targetDatas.getJSONObject(k).getLong("planId");
-                                if (tgPlanId == planId) {
+                                if (tgPlanId.equals(planId)) {
                                     sendData.add(creativeDatas.getJSONObject(k));
                                 }
                             }
                         } else if (Check.isNull(targetDatas) && !Check.isNull(groupDatas)) {
                             for (int k = 0; k < groupDatas.size(); k++) {
                                 Long tgPlanId = groupDatas.getJSONObject(k).getLong("planId");
-                                if (tgPlanId == planId) {
+                                if (tgPlanId.equals(planId)) {
                                     sendData.add(creativeDatas.getJSONObject(k));
                                 }
                             }

+ 20 - 13
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -126,15 +127,21 @@ public class MaterialInfo {
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     private Date updateTime;
 
-    private Integer toutiaoEffiType; //判断是否为头条有效素材0否_1是
+    //判断是否为头条有效素材0否_1是
+    private Integer toutiaoEffiType;
+    // 素造供应商
+    private String supplierCode;
 
-    private Integer kuaishouEffiType; //判断是否为快手有效素材0否_1是
+    //判断是否为快手有效素材0否_1是
+    private Integer kuaishouEffiType;
 
+    //判断是否已经同步到快手平台0否_1是
     @TableField(exist = false)
-    private Integer kuaishouVideoIsUp;  //判断是否已经同步到快手平台0否_1是
+    private Integer kuaishouVideoIsUp;
 
+    //判断是否已经同步到头条平台0否_1是
     @TableField(exist = false)
-    private Integer toutiaoVideoIsUp;  //判断是否已经同步到头条平台0否_1是
+    private Integer toutiaoVideoIsUp;
 
     @TableField(exist = false)
     private JSONObject byteDance;
@@ -142,11 +149,13 @@ public class MaterialInfo {
     @TableField(exist = false)
     private JSONObject kuaiShou;
 
+    //拍摄时候担任的角色
     @TableField(exist = false)
-    private String videoRoleCode;  //拍摄时候担任的角色
+    private String videoRoleCode;
 
+    //原本的角色
     @TableField(exist = false)
-    private String originRoleName;  //原本的角色
+    private String originRoleName;
 
     @TableField(exist = false)
     private BigDecimal cost;
@@ -157,9 +166,9 @@ public class MaterialInfo {
     @TableField(exist = false)
     private String realname;
 
+    // 是否有未审核封面
     @TableField(exist = false)
-    private Boolean whetherUnaudited;  // 是否有未审核封面
-
+    private Boolean whetherUnaudited;
 
     @TableField(exist = false)
     private String mediaId;  // 是否有未审核封面
@@ -167,15 +176,13 @@ public class MaterialInfo {
     @TableField(exist = false)
     private String projectName;  // 是否有未审核封面
 
-
-    private String supplierCode; // 素造供应商
-
-
     @TableField(exist = false)
     private String startDate;  // 是否有未审核封面
 
     @TableField(exist = false)
     private String endDate;  // 是否有未审核封面
 
-
+    //视频关联广告语信息--头条
+    @TableField(exist = false)
+    private JSONArray slogans;
 }

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

@@ -43,6 +43,7 @@ public class MaterialTagInfo {
 		this.tagCode = tagInfo.getTagCode();
 		this.tagName = tagInfo.getTagName();
 		this.userId = userId;
+		this.categoryId = tagInfo.getTagCategoryId();
 		this.createTime = new Date();
 		this.updateTime = new Date();
 	}

+ 20 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/SysUserDepart.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Date;
 
 @Data
 @TableName("sys_user_depart")
@@ -19,6 +20,25 @@ public class SysUserDepart implements Serializable {
 	private String userId;
 	/**部门id*/
 	private String depId;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+	/**
+	 * 创建人id
+	 */
+	private String createUserId;
+
+
+	public SysUserDepart(String id, String userId, String depId, Date createTime, String createUserId) {
+		this.id = id;
+		this.userId = userId;
+		this.depId = depId;
+		this.createTime = createTime;
+		this.createUserId = createUserId;
+	}
+
 	public SysUserDepart(String id, String userId, String depId) {
 		super();
 		this.id = id;

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/enums/SceneIdEnum.java

@@ -27,7 +27,7 @@ public enum SceneIdEnum {
 
     public static SceneIdEnum getEnumById(Integer id) {
         for (SceneIdEnum em : SceneIdEnum.values()) {
-            if (em.id == id) {
+            if (em.id.equals(id)) {
                 return em;
             }
         }

+ 44 - 36
module-common/src/main/java/cn/com/ctop/common/module/mapper/SysDepartMapper.java

@@ -1,9 +1,10 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.SysDepart;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
-import org.springframework.data.repository.query.Param;
 
 import java.util.List;
 
@@ -13,42 +14,49 @@ import java.util.List;
  * <p>
  *
  * @Author: Steve
- * @Since:   2019-01-22
+ * @Since: 2019-01-22
  */
 public interface SysDepartMapper extends BaseMapper<SysDepart> {
 
-	/**
-	 * 根据用户ID查询部门集合
-	 */
-	public List<SysDepart> queryUserDeparts(@Param("userId") String userId);
-
-	/**
-	 * 根据用户名查询部门
-	 *
-	 * @param username
-	 * @return
-	 */
-	public List<SysDepart> queryDepartsByUsername(@Param("username") String username);
-
-	@Select("select id from sys_depart where org_code=#{orgCode}")
-	public String queryDepartIdByOrgCode(@Param("orgCode") String orgCode);
-
-	@Select("select id,parent_id from sys_depart where id=#{departId}")
-	public SysDepart getParentDepartId(@Param("departId") String departId);
-
-	/**
-	 *  根据部门Id查询,当前和下级所有部门IDS
-	 * @param departId
-	 * @return
-	 */
-	List<String> getSubDepIdsByDepId(@Param("departId") String departId);
-
-	/**
-	 * 根据部门编码获取部门下所有IDS
-	 * @param orgCodes
-	 * @return
-	 */
-	List<String> getSubDepIdsByOrgCodes(@org.apache.ibatis.annotations.Param("orgCodes") String[] orgCodes);
-
-	SysDepart queryUserDepartsByDepartId(@Param("departId") String departId);
+    /**
+     * 根据用户ID查询部门集合
+     */
+    public List<SysDepart> queryUserDeparts(@Param("userId") String userId);
+
+    /**
+     * 根据用户名查询部门
+     *
+     * @param username
+     * @return
+     */
+    public List<SysDepart> queryDepartsByUsername(@Param("username") String username);
+
+    @Select("select id from sys_depart where org_code=#{orgCode}")
+    public String queryDepartIdByOrgCode(@Param("orgCode") String orgCode);
+
+    @Select("select id,parent_id from sys_depart where id=#{departId}")
+    public SysDepart getParentDepartId(@Param("departId") String departId);
+
+    /**
+     * 根据部门Id查询,当前和下级所有部门IDS
+     *
+     * @param departId
+     * @return
+     */
+    List<String> getSubDepIdsByDepId(@Param("departId") String departId);
+
+    /**
+     * 根据部门编码获取部门下所有IDS
+     *
+     * @param orgCodes
+     * @return
+     */
+    List<String> getSubDepIdsByOrgCodes(@org.apache.ibatis.annotations.Param("orgCodes") String[] orgCodes);
+
+    SysDepart queryUserDepartsByDepartId(@Param("departId") String departId);
+
+    List<JSONObject> getDepartmentIds(@Param("userId") String userId);
+
+    List<JSONObject> checkLowestLevelDepartment(@Param("departIds") List<JSONObject> departIds);
+
 }

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/SysRoleMapper.java

@@ -34,4 +34,5 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
     @Delete("delete from sys_role_permission where role_id = #{roleId}")
     void deleteRolePermissionRelation(@Param("roleId") String roleId);
 
+    SysRole queryRoleByUserId(@Param("userId") String userId);
 }

+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserDepartMapper.java

@@ -2,7 +2,7 @@ package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.SysUserDepart;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -15,4 +15,6 @@ public interface SysUserDepartMapper extends BaseMapper<SysUserDepart>{
     List<SysUserDepart> getUserDepartByUid(@Param("userId") String userId);
 
 	SysUserDepart getUserDepartByUserId(@Param("userId") String userId);
+
+    List<String> getUserIds(@Param("ids") List<String> ids);
 }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml

@@ -21,7 +21,7 @@
         limit 1) as 'id'
        from (select distinct signature
       from ctop_material_cut_frame
-      where video_signature = #{videoSignature}) a;
+      where video_signature = #{videoSignature}) a
     </select>
 
 

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -52,6 +52,7 @@
     </select>
 
 
+
     <select id="getEffiSignature" resultType="string">
         select
         efficient_video_signature

+ 33 - 13
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysDepartMapper.xml

@@ -2,9 +2,11 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.SysDepartMapper">
 
-	<select id="queryUserDeparts" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysDepart">
-	   select * from sys_depart where id IN ( select dep_id from sys_user_depart where user_id = #{userId} )
-	</select>
+    <select id="queryUserDeparts" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysDepart">
+        select *
+        from sys_depart
+        where id IN (select dep_id from sys_user_depart where user_id = #{userId})
+    </select>
 
     <!-- 根据username查询所拥有的部门 -->
     <select id="queryDepartsByUsername" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysDepart">
@@ -23,22 +25,40 @@
 
     <!-- 根据部门Id查询,当前和下级所有部门IDS -->
     <select id="getSubDepIdsByDepId" resultType="java.lang.String">
-		select id from sys_depart where del_flag = '0' and org_code like concat((select org_code from sys_depart where id=#{departId}),'%')
-	</select>
+        select id
+        from sys_depart
+        where del_flag = '0'
+          and org_code like concat((select org_code from sys_depart where id = #{departId}), '%')
+    </select>
 
     <!--根据部门编码获取我的部门下所有部门ids -->
     <select id="getSubDepIdsByOrgCodes" resultType="java.lang.String">
-		select id from sys_depart where del_flag = '0' and
-        <foreach collection="orgCodes" item="item" index="index"  open="(" separator="or" close=")">
+        select id from sys_depart where del_flag = '0' and
+        <foreach collection="orgCodes" item="item" index="index" open="(" separator="or" close=")">
             org_code LIKE CONCAT(#{item},'%')
         </foreach>
-	</select>
+    </select>
+
+    <select id="queryUserDepartsByDepartId" parameterType="String"
+            resultType="cn.com.ctop.common.module.entity.SysDepart">
+        select *
+        from sys_depart
+        where id = #{departId} limit 1
+    </select>
 
-    <select id="queryUserDepartsByDepartId" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysDepart">
-		select * from sys_depart
-			where id = #{departId}
-			limit 1
-	</select>
+    <select id="getDepartmentIds" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT dep_id as 'id'
+        FROM sys_user_depart
+        WHERE user_id = #{userId}
+    </select>
+
+    <select id="checkLowestLevelDepartment" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT id,parent_id FROM sys_depart WHERE parent_id IN
+        <foreach item="item" index="index" collection="departIds"
+                 open="(" separator="," close=")">
+            #{item.id}
+        </foreach>
+    </select>
 
 
 </mapper>

+ 18 - 14
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysRoleMapper.xml

@@ -4,22 +4,26 @@
 
     <!-- 根据roleCode获取roleId -->
     <select id="getRoleIdByRoleCode" resultType="java.lang.String">
-		select
-		id
-		from sys_role
-		where role_code = #{roleCode}
-	</select>
+        select id
+        from sys_role
+        where role_code = #{roleCode}
+    </select>
 
     <!-- 根据userId获取角色code -->
     <select id="getRoleCodeByUserId" resultType="java.lang.String">
-		select
-		c.role_code
-		from
-		sys_user a
-		left join sys_user_role b on a.id = b.user_id
-		left join sys_role c on b.role_id = c.id
-        where
-        a.id = #{userId}
-	</select>
+        select c.role_code
+        from sys_user a
+                 left join sys_user_role b on a.id = b.user_id
+                 left join sys_role c on b.role_id = c.id
+        where a.id = #{userId}
+    </select>
+
+
+    <select id="queryRoleByUserId" resultType="cn.com.ctop.common.module.entity.SysRole">
+        SELECT t2.role_name,t2.role_code
+        FROM sys_user_role t1
+                 LEFT JOIN sys_role t2 ON t1.role_id = t2.id
+        WHERE t1.user_id = #{userId} LIMIT 1
+    </select>
 
 </mapper>

+ 16 - 7
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserDepartMapper.xml

@@ -2,17 +2,26 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.SysUserDepartMapper">
     <select id="getUserDepartByUid" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysUserDepart">
-		SELECT *
-		FROM sys_user_depart
-		WHERE user_id = #{userId, jdbcType=VARCHAR}
+        SELECT *
+        FROM sys_user_depart
+        WHERE user_id = #{userId, jdbcType=VARCHAR}
     </select>
 
     <select id="getUserDepartByUserId" parameterType="String"
             resultType="cn.com.ctop.common.module.entity.SysUserDepart">
-		SELECT *
-		FROM sys_user_depart
-		WHERE user_id = #{userId, jdbcType=VARCHAR}
-		limit 1
+        SELECT *
+        FROM sys_user_depart
+        WHERE user_id = #{userId, jdbcType=VARCHAR} limit 1
+    </select>
+
+    <select id="getUserIds" resultType="java.lang.String">
+        SELECT user_id
+        FROM sys_user_depart
+        WHERE dep_id IN
+        <foreach item="id" index="index" collection="ids"
+                 open="(" separator="," close=")">
+            #{id}
+        </foreach>
     </select>
 
 </mapper>

+ 6 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml

@@ -276,8 +276,10 @@ SELECT
             role.role_code = 'designTeamLeader'
     </select>
 
+    <!-- 查询用户列表-->
     <select id="queryPageList" resultType="cn.com.ctop.common.module.entity.SysUser">
-        SELECT t1.*,t3.depart_name ,role.role_name
+        SELECT t4.* from (
+        SELECT t1.*,t3.depart_name ,role.role_name,t2.create_time AS updTime
         FROM sys_user t1
         LEFT JOIN sys_user_depart t2 ON t1.id = t2.user_id
         LEFT JOIN sys_depart t3 ON t2.dep_id = t3.id
@@ -311,6 +313,9 @@ SELECT
         <if test="sex != null and sex != ''">
             AND t1.sex =#{sex}
         </if>
+
+        ) t4
+        GROUP BY t4.id
     </select>
     <select id="getUserMapByMap" resultType="com.alibaba.fastjson.JSONObject">
         select id,realname from sys_user

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

@@ -3,7 +3,6 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.vo.PangolinProjectVO;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import org.apache.http.client.CookieStore;
 
 import java.util.List;
@@ -30,7 +29,7 @@ public interface IBindAccountLoginService extends IService<BindAccountLogin> {
 
     List<BindAccountLogin> getListByParams(String loginType,Integer status);
 
-    CookieStore setCookie(BindAccountLogin bindAccountLogin,String domain) throws JsonProcessingException;
+    CookieStore setCookie(BindAccountLogin bindAccountLogin,String domain);
 
     BindAccountLogin getByParams(String accountName, String password, String advertiserId);
 

+ 6 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java

@@ -116,9 +116,13 @@ public class BindAccountLoginServiceImpl extends ServiceImpl<BindAccountLoginMap
     }
 
     @Override
-    public CookieStore setCookie(BindAccountLogin bindAccountLogin,String domain) throws JsonProcessingException {
+    public CookieStore setCookie(BindAccountLogin bindAccountLogin,String domain){
         ObjectMapper mapper = new ObjectMapper();
-        List<String> cookieList = mapper.readValue(bindAccountLogin.getCookie(), new TypeReference<List<String>>() {});
+        List<String> cookieList = null;
+        try {
+            cookieList = mapper.readValue(bindAccountLogin.getCookie(), new TypeReference<List<String>>() {});
+        } catch (JsonProcessingException e) {
+        }
         if(cookieList == null||cookieList.isEmpty()){
             return null;
         }

+ 3 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialAscriptionServiceImpl.java

@@ -5,10 +5,11 @@ import cn.com.ctop.common.module.mapper.MaterialAscriptionMapper;
 import cn.com.ctop.common.module.service.IMaterialAscriptionService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+
 /**
  * 素材归属标
  *
@@ -19,7 +20,7 @@ import org.springframework.stereotype.Service;
 @Service
 @Primary
 public class MaterialAscriptionServiceImpl extends ServiceImpl<MaterialAscriptionMapper, MaterialAscription> implements IMaterialAscriptionService {
-    @Autowired
+    @Resource
     private MaterialAscriptionMapper ascriptionMapper;
 
     @Override

+ 0 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -312,7 +312,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     @Override
     public JSONObject getDetail(String materialId) {
         JSONObject json = new JSONObject();
-
         MaterialInfo materialInfo = this.getById(materialId);
         if (!Check.isNull(materialInfo.getAuditorId())) {
             String auditorName = materialInfoMapper.selectUserNameById(materialInfo.getAuditorId());
@@ -339,7 +338,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         if (!Check.isNull(ascriptionJson)) {
             json.put("ascription", ascriptionJson);
         }
-
         return json;
     }
 

+ 2 - 4
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialTagInfoServiceImpl.java

@@ -11,15 +11,13 @@ import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.common.system.vo.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
+import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -36,7 +34,7 @@ public class MaterialTagInfoServiceImpl extends ServiceImpl<MaterialTagInfoMappe
     private IMaterialInfoService materialInfoService;
     @Autowired
     private ITagInfoService tagInfoService;
-    @Autowired
+    @Resource
     private MaterialTagInfoMapper materialTagInfoMapper;
     @Override
     public Map<String, Object> mark(JSONObject data, LoginUser user) {

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

@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CacheConstant;
 import org.jeecg.common.constant.CommonConstant;
@@ -372,9 +373,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     public void addUserWithDepart(SysUser user, String selectedParts) {
 //		this.save(user);  //保存角色的时候已经添加过一次了
         if (oConvertUtils.isNotEmpty(selectedParts)) {
+            LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             String[] arr = selectedParts.split(",");
             for (String deaprtId : arr) {
                 SysUserDepart userDeaprt = new SysUserDepart(user.getId(), deaprtId);
+                userDeaprt.setCreateUserId(loginUser.getId());
+                userDeaprt.setCreateTime(new Date());//添加创建时间 和 创建人id
                 sysUserDepartMapper.insert(userDeaprt);
             }
         }
@@ -406,11 +410,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 }
             }
         }
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         //先删后加
         sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
         if (oConvertUtils.isNotEmpty(departs)) {
             for (String departId : arr) {
                 SysUserDepart userDepart = new SysUserDepart(user.getId(), departId);
+                userDepart.setCreateUserId(loginUser.getId());
+                userDepart.setCreateTime(new Date());
                 sysUserDepartMapper.insert(userDepart);
             }
         }

+ 794 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/ConverterUtils.java

@@ -0,0 +1,794 @@
+package cn.com.ctop.common.module.utils;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+/**
+ * A simple object converter
+ * <br>
+ * 一个简单的数据类型转换工具类
+ */
+public class ConverterUtils {
+
+    public static void main(String[] args) {
+        Long asLong = ConverterUtils.getAsLong("12121.3444");
+        System.err.println(asLong);
+    }
+
+
+    /**
+     * Gets a String from a Object in a null-safe manner.
+     * <p>
+     * The String is obtained via <code>toString</code>.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a String, <code>null</code> if null object input
+     */
+    public static String getAsString(final Object obj) {
+        if (obj != null) {
+            return obj.toString();
+        }
+        return null;
+    }
+
+    /**
+     * Gets a String from a Object in a null-safe manner.
+     * <p>
+     * The String is obtained via <code>toString</code>.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value of the Object as a String, <code>defaultValue</code> if null object input
+     */
+    public static String getAsString(final Object obj, final String defaultValue) {
+        String answer = getAsString(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a Number from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Number</code> it is returned directly.
+     * If the value is a <code>String</code> it is converted using
+     * {@link NumberFormat#parse(String)} on the system default formatter
+     * returning <code>null</code> if the conversion fails.
+     * Otherwise, <code>null</code> is returned.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Number, <code>null</code> if null object input
+     */
+    public static Number getAsNumber(final Object obj) {
+        if (obj != null) {
+            if (obj instanceof Number) {
+                return (Number) obj;
+            } else if (obj instanceof Boolean) {
+                return ((Boolean) obj) ? 1 : 0;
+            } else if (obj instanceof String) {
+                try {
+                    return NumberFormat.getInstance().parse((String) obj);
+                } catch (final ParseException e) {
+                    throw new NumberFormatException("For input string: \"" + obj + "\"");
+                }
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Converting the Object into a number,
+     * using the default value if the the conversion fails.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value of the object as a number, or defaultValue if the
+     * original value is null, the object is null or the number conversion
+     * fails
+     */
+    @SuppressWarnings("unchecked")
+    public static <R extends Number> R getAsNumber(final Object obj, R defaultValue) {
+        Number answer = getAsNumber(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return (R) answer;
+    }
+
+    /**
+     * Gets a Boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> it is returned directly.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>null</code> is returned.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Boolean, <code>null</code> if null object input
+     */
+    public static Boolean getAsBoolean(final Object obj) {
+        if (obj != null) {
+            if (obj instanceof Boolean) {
+                return (Boolean) obj;
+            } else if (obj instanceof String) {
+                return Boolean.valueOf((String) obj);
+            } else if (obj instanceof Number) {
+                final Number n = (Number) obj;
+                return (n.intValue() != 0) ? Boolean.TRUE : Boolean.FALSE;
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets a Boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> it is returned directly.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>null</code> is returned.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value of the Object as a Boolean, <code>defaultValue</code> if null object input
+     */
+    public static Boolean getAsBoolean(final Object obj, final Boolean defaultValue) {
+        Boolean answer = getAsBoolean(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> its value is returned.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>false</code> is returned.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Boolean, <code>false</code> if null object input
+     */
+    public static boolean getAsBooleanValue(final Object obj) {
+        final Boolean booleanObject = getAsBoolean(obj);
+        if (booleanObject == null) {
+            return false;
+        }
+        return booleanObject.booleanValue();
+    }
+
+    /**
+     * Gets a boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> its value is returned.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>false</code> is returned.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value in the Map as a Boolean, <code>defaultValue</code> if null object input
+     */
+    public static boolean getAsBooleanValue(final Object obj, final boolean defaultValue) {
+        final Boolean booleanObject = getAsBoolean(obj);
+        if (booleanObject == null) {
+            return defaultValue;
+        }
+        return booleanObject.booleanValue();
+    }
+
+    /**
+     * Gets a Byte from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a Byte, <code>null</code> if null object input
+     */
+    public static Byte getAsByte(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Byte) {
+            return (Byte) answer;
+        }
+        return Byte.valueOf(answer.byteValue());
+    }
+
+    /**
+     * Gets a Byte from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Byte, <code>defaultValue</code> if null object input
+     */
+    public static Byte getAsByte(final Object obj, final Byte defaultValue) {
+        Byte answer = getAsByte(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a byte from a Object in a null-safe manner.
+     * <p>
+     * The byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a byte, <code>0</code> if null object input
+     */
+    public static byte getAsByteValue(final Object obj) {
+        final Byte byteObject = getAsByte(obj);
+        if (byteObject == null) {
+            return 0;
+        }
+        return byteObject.byteValue();
+    }
+
+    /**
+     * Gets a byte from a Object in a null-safe manner.
+     * <p>
+     * The byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of the Object as a byte, <code>defaultValue</code> if null object input
+     */
+    public static byte getAsByteValue(final Object obj, final byte defaultValue) {
+        final Byte byteObject = getAsByte(obj);
+        if (byteObject == null) {
+            return defaultValue;
+        }
+        return byteObject.byteValue();
+    }
+
+    /**
+     * Gets a Short from a Object in a null-safe manner.
+     * <p>
+     * The Short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Short, <code>null</code> if null object input
+     */
+    public static Short getAsShort(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Short) {
+            return (Short) answer;
+        }
+        return Short.valueOf(answer.shortValue());
+    }
+
+    /**
+     * Gets a Short from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Short, <code>defaultValue</code> if null object input
+     */
+    public static Short getAsShort(final Object obj, final Short defaultValue) {
+        Short answer = getAsShort(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a short from a Object in a null-safe manner.
+     * <p>
+     * The short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a short, <code>0</code> if null object input
+     */
+    public static short getAsShortValue(final Object obj) {
+        final Short shortObject = getAsShort(obj);
+        if (shortObject == null) {
+            return 0;
+        }
+        return shortObject.shortValue();
+    }
+
+    /**
+     * Gets a short from a Object in a null-safe manner.
+     * <p>
+     * The short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of the Object as a short, <code>defaultValue</code> if null object input
+     */
+    public static short getAsShortValue(final Object obj, final short defaultValue) {
+        final Short shortObject = getAsShort(obj);
+        if (shortObject == null) {
+            return defaultValue;
+        }
+        return shortObject.shortValue();
+    }
+
+    /**
+     * Gets a Integer from a Object in a null-safe manner.
+     * <p>
+     * The Integer is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Integer, <code>null</code> if null object input
+     */
+    public static Integer getAsInteger(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Integer) {
+            return (Integer) answer;
+        }
+        return Integer.valueOf(answer.intValue());
+    }
+
+    /**
+     * Gets a Integer from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Integer is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Integer, <code>defaultValue</code> if null object input
+     */
+    public static Integer getAsInteger(final Object obj, final Integer defaultValue) {
+        Integer answer = getAsInteger(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a int from a Object in a null-safe manner.
+     * <p>
+     * The int is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a int, <code>0</code> if null object input
+     */
+    public static int getAsIntValue(final Object obj) {
+        final Integer integerObject = getAsInteger(obj);
+        if (integerObject == null) {
+            return 0;
+        }
+        return integerObject.intValue();
+    }
+
+    /**
+     * Gets a int from a Object in a null-safe manner.
+     * <p>
+     * The int is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of the Object as a int, <code>defaultValue</code> if null object input
+     */
+    public static int getAsIntValue(final Object obj, final int defaultValue) {
+        final Integer integerObject = getAsInteger(obj);
+        if (integerObject == null) {
+            return defaultValue;
+        }
+        return integerObject.intValue();
+    }
+
+    /**
+     * Gets a Long from a Object in a null-safe manner.
+     * <p>
+     * The Long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Long, <code>null</code> if null object input
+     */
+    public static Long getAsLong(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (Check.isNull(answer)) {
+            return null;
+        } else if (answer instanceof Long) {
+            return (Long) answer;
+        }
+        return Long.valueOf(answer.longValue());
+    }
+
+    /**
+     * Gets a Long from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Long, <code>defaultValue</code> if null object input
+     */
+    public static Long getAsLong(final Object obj, final Long defaultValue) {
+        Long answer = getAsLong(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a long from a Object in a null-safe manner.
+     * <p>
+     * The long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a long, <code>0L</code> if null object input
+     */
+    public static long getAsLongValue(final Object obj) {
+        final Long longObject = getAsLong(obj);
+        if (longObject == null) {
+            return 0L;
+        }
+        return longObject.longValue();
+    }
+
+    /**
+     * Gets a long from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a long, <code>defaultValue</code> if null object input
+     */
+    public static long getAsLongValue(final Object obj, final long defaultValue) {
+        final Long longObject = getAsLong(obj);
+        if (longObject == null) {
+            return defaultValue;
+        }
+        return longObject.longValue();
+    }
+
+    /**
+     * Gets a Float from a Object in a null-safe manner.
+     * <p>
+     * The Float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Float, <code>null</code> if null object input
+     */
+    public static Float getAsFloat(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Float) {
+            return (Float) answer;
+        }
+        return Float.valueOf(answer.floatValue());
+    }
+
+    /**
+     * Gets a Float from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Float, <code>defaultValue</code> if null object input
+     */
+    public static Float getAsFloat(final Object obj, final Float defaultValue) {
+        Float answer = getAsFloat(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a float from a Object in a null-safe manner.
+     * <p>
+     * The float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a float, <code>0.0F</code> if null object input
+     */
+    public static float getAsFloatValue(final Object obj) {
+        final Float floatObject = getAsFloat(obj);
+        if (floatObject == null) {
+            return 0f;
+        }
+        return floatObject.floatValue();
+    }
+
+    /**
+     * Gets a float from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a float, <code>defaultValue</code> if null object input
+     */
+    public static float getAsFloatValue(final Object obj, final float defaultValue) {
+        final Float floatObject = getAsFloat(obj);
+        if (floatObject == null) {
+            return defaultValue;
+        }
+        return floatObject.floatValue();
+    }
+
+    /**
+     * Gets a Double from a Object in a null-safe manner.
+     * <p>
+     * The Double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Double, <code>null</code> if null object input
+     */
+    public static Double getAsDouble(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (Check.isNull(answer)) {
+            return null;
+        } else if (answer instanceof Double) {
+            return (Double) answer;
+        }
+        return Double.valueOf(answer.doubleValue());
+    }
+
+    /**
+     * Gets a Double from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Double, <code>defaultValue</code> if null object input
+     */
+    public static Double getAsDouble(final Object obj, final Double defaultValue) {
+        Double answer = getAsDouble(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a double from a Object in a null-safe manner.
+     * <p>
+     * The double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a double, <code>0.0</code> if null object input
+     */
+    public static double getAsDoubleValue(final Object obj) {
+        final Double doubleObject = getAsDouble(obj);
+        if (doubleObject == null) {
+            return 0d;
+        }
+        return doubleObject.doubleValue();
+    }
+
+    /**
+     * Gets a double from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a double, <code>defaultValue</code> if null object input
+     */
+    public static double getAsDoubleValue(final Object obj, final double defaultValue) {
+        final Double doubleObject = getAsDouble(obj);
+        if (doubleObject == null) {
+            return defaultValue;
+        }
+        return doubleObject.doubleValue();
+    }
+
+    /**
+     * Gets a BigInteger from a Object in a null-safe manner.
+     * <p>
+     * The BigInteger is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a BigInteger, <code>0</code> if null object input
+     */
+    public static BigInteger getAsBigInteger(final Object obj) {
+        if (obj != null) {
+            if (obj instanceof BigInteger) {
+                return (BigInteger) obj;
+            } else if (obj instanceof String) {
+                return new BigInteger((String) obj);
+            } else if (obj instanceof Number || obj instanceof Boolean) {
+                final Number answer = getAsNumber(obj);
+                if (answer != null) {
+                    return BigInteger.valueOf(answer.longValue());
+                }
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets a BigInteger from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The BigInteger is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a BigInteger, <code>defaultValue</code> if null object input
+     */
+    @SuppressWarnings("unchecked")
+    public static <R extends BigInteger> R getAsBigInteger(final Object obj, final R defaultValue) {
+        BigInteger answer = getAsBigInteger(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return (R) answer;
+    }
+
+    /**
+     * Gets a BigDecimal from a Object in a null-safe manner.
+     * <p>
+     * The BigDecimal is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a BigDecimal, <code>0</code> if null object input
+     */
+    public static BigDecimal getAsBigDecimal(final Object obj) {
+        if (!Check.isNull(obj)) {
+            if (obj instanceof BigDecimal) {
+                return (BigDecimal) obj;
+            } else if (obj instanceof String) {
+                return new BigDecimal((String) obj);
+            } else if (obj instanceof Number || obj instanceof Boolean) {
+                final Number answer = getAsNumber(obj);
+                if (answer != null) {
+                    return BigDecimal.valueOf(answer.doubleValue());
+                }
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets a BigDecimal from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The BigDecimal is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a BigDecimal, <code>defaultValue</code> if null object input
+     */
+    @SuppressWarnings("unchecked")
+    public static <R extends BigDecimal> R getAsBigDecimal(final Object obj, final R defaultValue) {
+        BigDecimal answer = getAsBigDecimal(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return (R) answer;
+    }
+
+    /**
+     * This method is mainly used to provide data type conversion services.
+     *
+     * @param obj the object to use
+     * @param clz the type for conversion
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <R> R cast(final Object obj, final Class<R> clz) {
+        if (obj == null) {
+            throw new IllegalArgumentException("'obj' must not be null");
+        }
+        if (clz == null) {
+            throw new IllegalArgumentException("'clz' must not be null");
+        }
+        R result = null;
+        if (Boolean.class.equals(clz) || boolean.class.equals(clz)) {
+            result = (R) getAsBoolean(obj);
+        } else if (Byte.class.equals(clz) || byte.class.equals(clz)) {
+            result = (R) getAsByte(obj);
+        } else if (Short.class.equals(clz) || short.class.equals(clz)) {
+            result = (R) getAsShort(obj);
+        } else if (Integer.class.equals(clz) || int.class.equals(clz)) {
+            result = (R) getAsInteger(obj);
+        } else if (Long.class.equals(clz) || long.class.equals(clz)) {
+            result = (R) getAsLong(obj);
+        } else if (Float.class.equals(clz) || float.class.equals(clz)) {
+            result = (R) getAsFloat(obj);
+        } else if (Double.class.equals(clz) || double.class.equals(clz)) {
+            result = (R) getAsDouble(obj);
+        } else if (String.class.equals(clz)) {
+            result = (R) getAsString(obj);
+        } else if (BigInteger.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigInteger(obj);
+        } else if (BigDecimal.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigDecimal(obj);
+        } else if (Number.class.isAssignableFrom(clz)) {
+            result = (R) getAsNumber(obj);
+        } else {
+            throw new UnsupportedOperationException();
+        }
+        return result;
+    }
+
+    /**
+     * This method is mainly used to provide data type conversion services.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <R> R cast(final Object obj, final R defaultValue) {
+        if (obj == null) {
+            throw new IllegalArgumentException("'obj' must not be null");
+        }
+        if (defaultValue == null) {
+            throw new IllegalArgumentException("'defaultValue' must not be null");
+        }
+        R result = null;
+        final Class<?> clz = defaultValue.getClass();
+        if (Boolean.class.equals(clz) || boolean.class.equals(clz)) {
+            result = (R) getAsBoolean(obj, (Boolean) defaultValue);
+        } else if (Byte.class.equals(clz) || byte.class.equals(clz)) {
+            result = (R) getAsByte(obj, (Byte) defaultValue);
+        } else if (Short.class.equals(clz) || short.class.equals(clz)) {
+            result = (R) getAsShort(obj, (Short) defaultValue);
+        } else if (Integer.class.equals(clz) || int.class.equals(clz)) {
+            result = (R) getAsInteger(obj, (Integer) defaultValue);
+        } else if (Long.class.equals(clz) || long.class.equals(clz)) {
+            result = (R) getAsLong(obj, (Long) defaultValue);
+        } else if (Float.class.equals(clz) || float.class.equals(clz)) {
+            result = (R) getAsFloat(obj, (Float) defaultValue);
+        } else if (Double.class.equals(clz) || double.class.equals(clz)) {
+            result = (R) getAsDouble(obj, (Double) defaultValue);
+        } else if (String.class.equals(clz)) {
+            result = (R) getAsString(obj, (String) defaultValue);
+        } else if (BigInteger.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigInteger(obj, (BigInteger) defaultValue);
+        } else if (BigDecimal.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigDecimal(obj, (BigDecimal) defaultValue);
+        } else if (Number.class.isAssignableFrom(clz)) {
+            result = (R) getAsNumber(obj, (Number) defaultValue);
+        } else {
+            throw new UnsupportedOperationException();
+        }
+        return result;
+    }
+
+}

+ 3 - 3
module-common/src/main/java/cn/com/ctop/common/module/utils/ParseInstallPackageUtil.java

@@ -25,9 +25,9 @@ public class ParseInstallPackageUtil {
 
     private static final Logger log = LoggerFactory.getLogger(ParseInstallPackageUtil.class);
 
-    private static final float RADIX_MULTS[] = {0.00390625F, 3.051758E-005F, 1.192093E-007F, 4.656613E-010F};
-    private static final String DIMENSION_UNITS[] = {"px", "dip", "sp", "pt", "in", "mm", "", ""};
-    private static final String FRACTION_UNITS[] = {"%", "%p", "", "", "", "", "", ""};
+    private static final float[] RADIX_MULTS = {0.00390625F, 3.051758E-005F, 1.192093E-007F, 4.656613E-010F};
+    private static final String[] DIMENSION_UNITS = {"px", "dip", "sp", "pt", "in", "mm", "", ""};
+    private static final String[] FRACTION_UNITS = {"%", "%p", "", "", "", "", "", ""};
 
     /**
      * 解析apk文件

+ 4 - 4
module-common/src/main/java/cn/com/ctop/common/module/utils/QueryGenerator.java

@@ -115,7 +115,7 @@ public class QueryGenerator {
 		*/
 
         //区间条件组装 模糊查询 高级查询组装 简单排序 权限查询
-        PropertyDescriptor origDescriptors[] = PropertyUtils.getPropertyDescriptors(searchObj);
+        PropertyDescriptor[] origDescriptors = PropertyUtils.getPropertyDescriptors(searchObj);
         Map<String, SysPermissionDataRuleModel> ruleMap = getRuleMap();
 
         //权限规则自定义SQL表达式
@@ -691,7 +691,7 @@ public class QueryGenerator {
 
     private static String getInConditionValue(Object value, boolean isString) {
         if (isString) {
-            String temp[] = value.toString().split(",");
+            String[] temp = value.toString().split(",");
             String res = "";
             for (String string : temp) {
                 if (DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())) {
@@ -761,7 +761,7 @@ public class QueryGenerator {
         StringBuffer sb = new StringBuffer();
         //权限查询
         Map<String, SysPermissionDataRuleModel> ruleMap = getRuleMap();
-        PropertyDescriptor origDescriptors[] = PropertyUtils.getPropertyDescriptors(clazz);
+        PropertyDescriptor[] origDescriptors = PropertyUtils.getPropertyDescriptors(clazz);
         String sql_and = " and ";
         for (String c : ruleMap.keySet()) {
             if (oConvertUtils.isNotEmpty(c) && c.startsWith(SQL_RULES_COLUMN)) {
@@ -801,7 +801,7 @@ public class QueryGenerator {
     public static void installAuthMplus(QueryWrapper<?> queryWrapper, Class<?> clazz) {
         //权限查询
         Map<String, SysPermissionDataRuleModel> ruleMap = getRuleMap();
-        PropertyDescriptor origDescriptors[] = PropertyUtils.getPropertyDescriptors(clazz);
+        PropertyDescriptor[] origDescriptors = PropertyUtils.getPropertyDescriptors(clazz);
         for (String c : ruleMap.keySet()) {
             if (oConvertUtils.isNotEmpty(c) && c.startsWith(SQL_RULES_COLUMN)) {
                 queryWrapper.and(i -> i.apply(getSqlRuleValue(ruleMap.get(c).getRuleValue())));

+ 0 - 8
module-common/src/main/java/cn/com/ctop/common/module/utils/RestUtils.java

@@ -1,8 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-/**
- *  Created by JQ.bi on 2020.9.23
- */
-public class RestUtils {
-
-}

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

@@ -58,9 +58,11 @@ public enum StatusCode {
     BYTEDACNE_API_GROUP_CREATE_ERROR("头条API创建广告组异常",-4001,false),
 
     KUAISHOU_API_ACCOUNT_SPEED_EXPLORING("此账户加速探索尚未完成",-5001,false),
+    KUAISHOU_SPEED_EXPLORE_ACTION_TYPE_NOT_CONFIG("加速探索尚不支持此类优化目标",-5002,false),
+    KUAISHOU_SPEED_EXPLORE_FAIL("加速探索失败",-5003,false),
 
-    KUAISHOU_SPEED_EXPLORE_ACTION_TYPE_NOT_CONFIG("加速探索尚不支持此类优化目标",-6001,false),
-    KUAISHOU_SPEED_EXPLORE_FAIL("加速探索失败",-6002,false),
+    KUAISHOU_AI_STRATEGY_HAS_NOT_EXIST("账户策略未配置或者已经被关闭",-6001,false),
+    KUAISHOU_AI_STRATEGY_HAS_NO_HISTORY_MATERIAL("历史素材不存在",-6002,false),
 
     KUAISHOU_CRAWLER_APP_SUCCESS("爬虫运行正常", 0, true),
     KUAISHOU_CRAWLER_APP_TASK_END("爬虫任务运行结束", 1, true),

+ 2 - 0
module-common/src/main/java/com/xxl/job/core/executor/impl/XxlJobSimpleExecutor.java

@@ -29,6 +29,7 @@ public class XxlJobSimpleExecutor extends XxlJobExecutor {
     }
 
 
+    @Override
     public void start() {
 
         // init JobHandler Repository (for method)
@@ -42,6 +43,7 @@ public class XxlJobSimpleExecutor extends XxlJobExecutor {
         }
     }
 
+    @Override
     public void destroy() {
         super.destroy();
     }

+ 1 - 7
module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java

@@ -1,21 +1,15 @@
 package cn.com.ctop.crawler.modules.taobao.service.impl;
 
-import cn.com.ctop.common.module.entity.BindAccountLogin;
-import cn.com.ctop.common.module.utils.ChaojiyingUtils;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.HttpUtils2;
 import cn.com.ctop.crawler.modules.taobao.service.TaobaoJhsbybtService;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.http.cookie.Cookie;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.cookie.BasicClientCookie;
 import org.openqa.selenium.By;
-import org.openqa.selenium.OutputType;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.chrome.ChromeDriver;
@@ -95,7 +89,7 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
         Map<String, Object> paramMap = new HashMap<String, Object>();
         paramMap.put("jsv", "2.5.1");
         paramMap.put("appKey", "12574478");
-        paramMap.put("t", new Date().getTime());
+        paramMap.put("t", System.currentTimeMillis());
         paramMap.put("sign", "56b679fe3a6de0cd4ffa8ccb8680ff83");
         paramMap.put("timeout", 3000);
         paramMap.put("api", "mtop.tmall.kangaroo.core.service.route.AldLampServiceFixedRes");

+ 1 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoTttmServiceImpl.java

@@ -20,7 +20,7 @@ public class TaobaoTttmServiceImpl implements TaobaoTttmService {
         Map<String, Object> paramMap = new HashMap<String, Object>();
         paramMap.put("jsv", "2.6.0");
         paramMap.put("appKey", "12574478");
-        paramMap.put("t", new Date().getTime());
+        paramMap.put("t", System.currentTimeMillis());
         paramMap.put("sign", "56b679fe3a6de0cd4ffa8ccb8680ff83");
         paramMap.put("timeout", 3000);
         paramMap.put("api", "mtop.panama.fiona.commonbizservice");

+ 1 - 1
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/IMaterialUploadService.java

@@ -11,6 +11,6 @@ public interface IMaterialUploadService {
      * @param materialArray
      * @param accountArray
      */
-    void uploadAccount(String mediaId, JSONArray materialArray, JSONArray accountArray,String userId);
+    void uploadAccount(String mediaId, JSONArray materialArray, JSONArray accountArray,String userId,Boolean shieldBackwardSwitch);
 
 }

+ 6 - 4
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java

@@ -77,10 +77,10 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
      * @param accountArray
      */
     @Override
-    public void uploadAccount(String mediaId, JSONArray materialArray, JSONArray accountArray, String userId) {
+    public void uploadAccount(String mediaId, JSONArray materialArray, JSONArray accountArray, String userId, Boolean shieldBackwardSwitch) {
         try {
             if ("2".equals(mediaId) || "4".equals(mediaId)) {
-                this.kuaiShouUpload(mediaId, materialArray, accountArray, userId);
+                this.kuaiShouUpload(mediaId, materialArray, accountArray, userId, shieldBackwardSwitch);
             } else if ("1".equals(mediaId) || "3".equals(mediaId)) {
                 this.touTiaoUpload(mediaId, materialArray, accountArray, userId);
             }
@@ -138,7 +138,7 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
     @Autowired
     private IKuaiShouAdvertiserBaseInfoService advertiserBaseInfoService;
 
-    private void kuaiShouUpload(String mediaId, JSONArray materialArray, JSONArray accountArray, String userId) {
+    private void kuaiShouUpload(String mediaId, JSONArray materialArray, JSONArray accountArray, String userId, Boolean shieldBackwardSwitch) {
         for (int j = 0; j < materialArray.size(); j++) {
             String materialId = materialArray.getString(j);
             MaterialInfo materialInfo = materialInfoMapper.selectById(materialId);
@@ -155,7 +155,9 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                 JSONObject requestJson = new JSONObject();
                 requestJson.put("file", resource);
                 requestJson.put("signature", materialInfo.getCode());
-
+                if (!Check.isNull(shieldBackwardSwitch)) {
+                    requestJson.put("shield_backward_switch", shieldBackwardSwitch);
+                }
                 QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
                 parameterQueryWrapper.eq("material_id", materialInfo.getCode());
                 parameterQueryWrapper.orderByDesc("create_time").last("limit 1");

+ 3 - 0
module-job-bytedance/src/main/resources/application-dev.yml

@@ -212,3 +212,6 @@ xxl:
       logretentiondays: 30
     admin:
       addresses: http://127.0.0.1:8090/xxl-job-admin
+zip:
+  local:
+    download-path: /data/unzip/

+ 3 - 0
module-job-bytedance/src/main/resources/application-jiaoyang.yml

@@ -227,3 +227,6 @@ xxl:
       logretentiondays: 30
     admin:
       addresses: http://129.28.150.229:8090/xxl-job-admin
+zip:
+  local:
+    download-path: /data/unzip/

+ 3 - 0
module-job-bytedance/src/main/resources/application-prod.yml

@@ -231,3 +231,6 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
+zip:
+  local:
+    download-path: /data/unzip/

+ 3 - 0
module-job-bytedance/src/main/resources/application-test.yml

@@ -236,3 +236,6 @@ xxl:
       logretentiondays: 30
     admin:
       addresses: http://127.0.0.1:8090/xxl-job-admin
+zip:
+  local:
+    download-path: /data/unzip/

+ 77 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CrowdListQueryJob.java

@@ -0,0 +1,77 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouCrowdPack;
+import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouCrowdPackMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouCrowdPackService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouPopulationService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class CrowdListQueryJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private KuaishouCrowdPackMapper crowdPackMapper;
+    @Autowired
+    private IKuaishouPopulationService iKuaishouPopulationService;
+    @Autowired
+    private IKuaishouCrowdPackService crowdPackService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    @XxlJob("crowdListQueryJob")
+    public void execute() {
+        List<Integer> list = new ArrayList<>();
+        for (int i = 0; i <= 7; i++) {
+            if (i != 2) {
+                list.add(i);
+            }
+        }
+        list.forEach(status -> executorService.submit(() -> {
+            List<KuaishouCrowdPack> crowdList = crowdPackMapper.queryListByStatus();
+            for (KuaishouCrowdPack crowdPack : crowdList) {
+                CtopOauthToken token = tokenService.getTokenByAccountId(crowdPack.getAccountId());
+                JSONObject jsonObject = iKuaishouPopulationService.getPopulationList(crowdPack.getAccountId(), token.getAccessToken(), status);
+                if (jsonObject.getInteger("code") == 0) {
+                    JSONObject data = jsonObject.getJSONObject("data");
+                    if (!Check.isNull(data)) {
+                        JSONArray details = data.getJSONArray("details");
+                        if (details.size() > 0) {
+                            for (int j = 0; j < details.size(); j++) {
+                                JSONObject obj = details.getJSONObject(j);
+                                if (Check.isNull(crowdPackMapper.queryByAccountId(obj.getLong("account_id"), obj.getLong("orientation_id")))) {
+                                    KuaishouCrowdPack oldPack = crowdPackMapper.queryByAccountId(null, obj.getLong("orientation_id"));
+                                    KuaishouCrowdPack crowdPackEntity = JSONObject.toJavaObject(obj, KuaishouCrowdPack.class);
+                                    if (!Check.isNull(oldPack)) {
+                                        crowdPackEntity.setStatDate(oldPack.getStatDate());
+                                        crowdPackEntity.setUrl(oldPack.getUrl());
+                                        crowdPackEntity.setSignature(oldPack.getSignature());
+                                    }
+                                    crowdPackEntity.setMessage("PUSH OK");
+                                    crowdPackEntity.setDataStatus(1);
+                                    crowdPackService.save(crowdPackEntity);
+                                } else {
+                                    crowdPackMapper.update(obj);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }));
+        XxlJobHelper.log("快手人群报表更新成功");
+    }
+}

+ 0 - 25
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouAlarmRuleHourlyCheckJob.java

@@ -1,25 +0,0 @@
-//package cn.com.ctop.job.kuaishou.handler;
-//
-//import cn.com.ctop.alarm.modules.service.IAlarmEventSendService;
-//import com.xxl.job.core.handler.annotation.XxlJob;
-//import org.quartz.JobExecutionException;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.stereotype.Component;
-//
-//@Component
-//public class KuaiShouAlarmRuleHourlyCheckJob {
-//    @Autowired
-//    private IAlarmEventSendService alarmEventSendService;
-//
-//    /**
-//     * 定时获取成本数据
-//     *
-//     * @throws JobExecutionException
-//     */
-//    @XxlJob("kuaiShouAlarmRuleHourlyCheckJob")
-//    public void execute() throws Exception {
-//        //检查频率 HOUR - 每小时;HALF_HOUR-每半小时
-//        alarmEventSendService.matchAlarmRules("HOUR");
-//    }
-//}
-//

+ 0 - 25
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouAlarmRuleMinuteCheckJob.java

@@ -1,25 +0,0 @@
-//package cn.com.ctop.job.kuaishou.handler;
-//
-//import cn.com.ctop.alarm.modules.service.IAlarmEventSendService;
-//import com.xxl.job.core.handler.annotation.XxlJob;
-//import org.quartz.JobExecutionException;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.stereotype.Component;
-//
-//@Component
-//public class KuaiShouAlarmRuleMinuteCheckJob {
-//    @Autowired
-//    private IAlarmEventSendService alarmEventSendService;
-//
-//    /**
-//     * 定时获取成本数据
-//     *
-//     * @throws JobExecutionException
-//     */
-//    @XxlJob("kuaiShouAlarmRuleMinuteCheckJob")
-//    public void execute(String param) throws Exception {
-//        //检查频率 HOUR - 每小时;HALF_HOUR-每半小时
-//        alarmEventSendService.matchAlarmRules("HALF_HOUR");
-//    }
-//}
-//

+ 64 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouBudgetJob.java

@@ -0,0 +1,64 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.app.entity.KuaishouAccountBalanceBudget;
+import cn.com.ctop.kuaishou.modules.app.service.IKuaishouAccountBalanceBudgetService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouAccountBudgetService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaiShouBudgetJob {
+    @Autowired
+    private IKuaishouAccountBalanceBudgetService balanceBudgetService;
+    @Autowired
+    private IKuaishouInterfaceService iKuaishouInterfaceService;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouAccountBudgetService accountBudgetService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(8);
+
+    /**
+     * 定时更新快手账户余额和预算
+     *
+     * @throws
+     */
+    @XxlJob("kuaiShouBudgetJob")
+    public void execute() throws Exception {
+        if (DateUtils.getNowHour() == 2) {
+            //每日凌晨2点将预算全部置为无效,避免已关闭的账户留有僵尸数据。
+            balanceBudgetService.updateAllIsInvalidState();
+        }
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        tokens.forEach(token -> executorService.submit(() -> {
+            KuaishouAccountBalanceBudget budget = new KuaishouAccountBalanceBudget();
+            JSONObject fundJson = iKuaishouInterfaceService.fundGet(token);
+            JSONObject accountBudget = accountBudgetService.getAccountBudget(token);
+            if (!Check.isNull(accountBudget) && !Check.isNull(fundJson)) {
+                budget.setBalance(fundJson.getBigDecimal("balance"));
+                budget.setDayBudget(accountBudget.getBigDecimal("day_budget").divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_UP));
+                budget.setDayBudgetSchedule(accountBudget.getString("day_budget_schedule"));
+                budget.setAccountId(token.getAccountId());
+                budget.setState(1);
+                balanceBudgetService.replace(budget);
+            }
+        }));
+        XxlJobHelper.log("定时更新快手账户余额和预算完成");
+    }
+}
+

+ 0 - 69
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiAdsNewMaterialCreativityJob.java

@@ -1,69 +0,0 @@
-package cn.com.ctop.job.kuaishou.handler;
-
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountTargetTemplateService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
-import com.xxl.job.core.context.XxlJobHelper;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Component
-public class KuaishouAiAdsNewMaterialCreativityJob {
-
-    @Autowired
-    IAiKuaishouNewCreateCampaign aiKuaishouNewCreateCampaign;
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-    static CountDownLatch countDownLatch = null;
-
-    @Autowired
-    private IAiKuaishouAccountTargetTemplateService aiKuaishouAccountTargetTemplateService;
-    @XxlJob("kuaishouAiAdsNewMaterialCreativityJob")
-    public void kuaishouAiAdsNewMaterialCreativityJob() {
-        List<AiKuaishouAccountTargetTemplate> accountTargetTemplates = aiKuaishouAccountTargetTemplateService.getAllEffectTemplate();
-        if(null==accountTargetTemplates||accountTargetTemplates.isEmpty()){
-            return;
-        }
-        accountTargetTemplates.forEach(targetTemplate -> aiKuaishouNewCreateCampaign.kuaishouAiAdsNewMaterialCreativity(targetTemplate));
-    }
-
-
-    @XxlJob("kuaishouAiAddNewMaterialCreativityJob")
-    public void kuaishouAiAddNewMaterialCreativityJob() {
-        List<AiKuaishouAccountTargetTemplate> accountTargetTemplates = aiKuaishouAccountTargetTemplateService.getAllEffectTemplate();
-        if(null==accountTargetTemplates||accountTargetTemplates.isEmpty()){
-            return;
-        }
-        countDownLatch = new CountDownLatch(accountTargetTemplates.size());
-        accountTargetTemplates.forEach(targetTemplate -> executorService.submit(()->{
-            try {
-                aiKuaishouNewCreateCampaign.kuaishouAiAddNewMaterialCreativity(targetTemplate, 10);
-                XxlJobHelper.log("账户上新结束=>accountId:{}",targetTemplate.getAccountId());
-            }catch (Exception e) {
-                e.printStackTrace();
-            }finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        XxlJobHelper.log("全部账户上新结束");
-    }
-
-    @XxlJob("kuaishouAiAdsHotMaterialCreativityJob")
-    public void kuaishouAiAdsHotMaterialCreativityJob() {
-        List<AiKuaishouAccountTargetTemplate> accountTargetTemplates = aiKuaishouAccountTargetTemplateService.getAllEffectTemplate();
-        if(null==accountTargetTemplates||accountTargetTemplates.isEmpty()){
-            return;
-        }
-        accountTargetTemplates.forEach(targetTemplate -> aiKuaishouNewCreateCampaign.kuaishouAiAdsHotMaterialCreativity(targetTemplate));
-    }
-}

+ 172 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiCreativeJob.java

@@ -0,0 +1,172 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils2;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author syh
+ * 自动投放定时任务
+ */
+@Component
+@Slf4j
+public class KuaishouAiCreativeJob {
+
+    @Value("${xxl-job.requestUrl}")
+    private String jobUrl;
+
+    @Autowired
+    private IAiKuaishouAdvertiserStrategyService strategyService;
+
+    /**
+     * 自定义上新创意
+     */
+    @XxlJob("kuaishouCustomCreativeAuto")
+    public void kuaishouCustomCreativeAuto() {
+        List<AiKuaishouAdvertiserStrategy> strategies = strategyService.getAllEffectStrategy();
+        if (null == strategies || strategies.isEmpty()) {
+            return;
+        }
+        String url = jobUrl + "/jeecg-boot/ai/create/customCreativeLimit";
+        for (AiKuaishouAdvertiserStrategy strategy : strategies) {
+            if (null != strategy.getOpenProgramCreate() && strategy.getOpenProgramCreate() != 1) {
+                Map<String, Object> requestMap = new HashMap<>();
+                requestMap.put("id", strategy.getId());
+                String result = HttpUtils2.httpGet(url, requestMap, null);
+                JSONObject jsonObject = JSONObject.parseObject(result);
+                if (!Check.isNull(jsonObject)) {
+                    Integer code = jsonObject.getInteger("code");
+                    if (code == 0) {
+                        log.info("快手自动上新异步执行中,accountId:{}", strategy.getAccountId());
+                    } else {
+                        log.error("快手自动上新异执行失败,accountId:{}", strategy.getAccountId());
+                    }
+                } else {
+                    log.error("快手自动上新返回结果为空,accountId:{}", strategy.getAccountId());
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 补充创意
+     */
+    @XxlJob("kuaishouCustomCreativeSupplement")
+    public void kuaishouCustomCreativeSupplement() {
+        List<AiKuaishouAdvertiserStrategy> strategies = strategyService.getAllEffectStrategy();
+        if (null == strategies || strategies.isEmpty()) {
+            return;
+        }
+        try {
+            String url = jobUrl + "/jeecg-boot/ai/create/kuaishouCustomCreativeSupplement";
+            int hour = DateUtils.getNowHour();
+            for (AiKuaishouAdvertiserStrategy strategy : strategies) {
+                if (null != strategy.getOpenProgramCreate() && strategy.getOpenProgramCreate() != 1) {
+                    Map<String, Object> requestMap = new HashMap<>();
+                    requestMap.put("id", strategy.getId());
+                    requestMap.put("hour", hour);
+                    String result = HttpUtils2.httpGet(url, requestMap, null);
+                    JSONObject jsonObject = JSONObject.parseObject(result);
+                    if (!Check.isNull(jsonObject)) {
+                        Integer code = jsonObject.getInteger("code");
+                        if (code == 0) {
+                            log.info("快手创意补充异步执行中,accountId:{}", strategy.getAccountId());
+                        } else {
+                            log.error("快手创意补充异步执行失败,accountId:{}", strategy.getAccountId());
+                        }
+                    } else {
+                        log.error("快手创意补充返回结果为空,accountId:{}", strategy.getAccountId());
+                    }
+                }
+            }
+
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 程序化上新创意
+     */
+    @XxlJob("kuaishouProgramCreativeAuto")
+    public void kuaishouProgramCreativeAuto() {
+        List<AiKuaishouAdvertiserStrategy> strategies = strategyService.getAllEffectStrategy();
+        if (null == strategies || strategies.isEmpty()) {
+            return;
+        }
+        String url = jobUrl + "/jeecg-boot/ai/create/kuaishouProgramCreativeAuto";
+        for (AiKuaishouAdvertiserStrategy strategy : strategies) {
+            if (null != strategy.getOpenProgramCreate() && strategy.getOpenProgramCreate() != 0) {
+                long videoCnt = strategy.getProgramUnitCnt() * 5 / 2;
+                Map<String, Object> requestMap = new HashMap<>();
+                requestMap.put("id", strategy.getId());
+                requestMap.put("videoCnt", videoCnt);
+                String result = HttpUtils2.httpGet(url, requestMap, null);
+                JSONObject jsonObject = JSONObject.parseObject(result);
+                if (!Check.isNull(jsonObject)) {
+                    Integer code = jsonObject.getInteger("code");
+                    if (code == 0) {
+                        log.info("快手上新程序化创意补充异步执行中,accountId:{}", strategy.getAccountId());
+                    } else {
+                        log.error("快手上新程序化异步执行失败,accountId:{}", strategy.getAccountId());
+                    }
+                } else {
+                    log.error("快手上新程序化充返回结果为空,accountId:{}", strategy.getAccountId());
+                }
+
+
+            }
+        }
+
+
+    }
+
+    /**
+     * 程序化高质量创意
+     */
+    @XxlJob("kuaishouProgramCreativeTop")
+    public void kuaishouProgramCreativeTop() {
+        List<AiKuaishouAdvertiserStrategy> strategies = strategyService.getAllEffectStrategy();
+        if (null == strategies || strategies.isEmpty()) {
+            return;
+        }
+        String url = jobUrl + "/jeecg-boot/ai/create/autoCreateProgramHistoryTopCreative";
+        for (AiKuaishouAdvertiserStrategy strategy : strategies) {
+            if (null != strategy.getOpenProgramCreate() && strategy.getOpenProgramCreate() != 0) {
+                long videoCnt = strategy.getProgramUnitCnt() * 5 / 2;
+                Map<String, Object> requestMap = new HashMap<>();
+                requestMap.put("id", strategy.getId());
+                requestMap.put("videoCnt", videoCnt);
+                String result = HttpUtils2.httpGet(url, requestMap, null);
+                JSONObject jsonObject = JSONObject.parseObject(result);
+                if (!Check.isNull(jsonObject)) {
+                    Integer code = jsonObject.getInteger("code");
+                    if (code == 0) {
+                        log.info("快手历史高质量程序化创意补充异步执行中,accountId:{}", strategy.getAccountId());
+                    } else {
+                        log.error("快手历史高质量程序化异步执行失败,accountId:{}", strategy.getAccountId());
+                    }
+                } else {
+                    log.error("快手历史高质量程序化充返回结果为空,accountId:{}", strategy.getAccountId());
+                }
+            }
+        }
+
+    }
+}

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

@@ -1,43 +0,0 @@
-package cn.com.ctop.job.kuaishou.handler;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountTargetTemplateService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import org.jeecg.common.util.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-import java.util.List;
-
-@Component
-public class KuaishouAiSuzaoVideoJob {
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    IAiKuaishouNewCreateCampaign aiKuaishouNewCreateCampaign;
-    @Autowired
-    private IAiKuaishouAccountTargetTemplateService aiKuaishouAccountTargetTemplateService;
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @XxlJob("kuaishouAiSuzaoVideoJob")
-    public void kuaishouAiSuzaoVideoJob() {
-        List<AiKuaishouAccountTargetTemplate> accountTargetTemplates = aiKuaishouAccountTargetTemplateService.getAllEffectTemplate();
-        if(null==accountTargetTemplates||accountTargetTemplates.isEmpty()){
-            return;
-        }
-        accountTargetTemplates.forEach(targetTemplate -> {
-            CtopOauthToken token = tokenService.getTokenByAccountId(targetTemplate.getAccountId());
-            int timeStart = -3;
-            int timeEnd = 0;
-            Long now = System.currentTimeMillis();
-            String startTime = DateUtils.formatDate(new Date(now + timeStart*60*1000),"yyyy-MM-dd HH:mm:ss");
-            String endTime = DateUtils.formatDate(new Date(now + timeEnd*60*1000),"yyyy-MM-dd HH:mm:ss");
-           // kuaishouInterfaceService.getSuZaoList(token.getAccessToken(), token.getAccountId(), 1, startTime,endTime);
-        });
-    }
-}

+ 4 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateUnitJob.java

@@ -6,6 +6,7 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.util.HashMap;
@@ -18,6 +19,8 @@ public class KuaishouCreateUnitJob {
 
     @Autowired
     private IKuaiShouGroupTemplateService groupTemplateService;
+    @Value("${xxl-job.requestUrl}")
+    private String jobUrl;
 
     @XxlJob("kuaihouCreateUnit")
     public void execute() {
@@ -27,7 +30,7 @@ public class KuaishouCreateUnitJob {
             XxlJobHelper.log("批量2.0暂时没有未创建的组");
             return;
         }
-        String url = "http://api.tjyourong.com.cn/jeecg-boot/batch/kuaiShouGroupTemplate/createUnit";
+        String url = jobUrl + "/jeecg-boot/batch/kuaiShouGroupTemplate/createUnit";
         for (int i = 0; i < idList.size(); i++) {
             Long id = idList.get(i);
             Map<String, Object> requestMap = new HashMap<>();

+ 29 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java

@@ -1,11 +1,18 @@
 package cn.com.ctop.job.kuaishou.handler;
 
+import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouAccountMaterialReportDailyService;
 import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountHourlyService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
+import java.util.Date;
+
 /**
  * 账户维度-盯盘每日数据
  *
@@ -16,11 +23,32 @@ public class KuaishouDailyAccountReportLoadEtlJob {
 
     @Autowired
     private IEtlKuaishouReportAccountDailyService iEtlKuaishouReportAccountDailyService;
-
+    @Autowired
+    private IEtlKuaishouAccountMaterialReportDailyService etlKuaishouAccountMaterialReportDailyService;
+    @Resource
+    private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
+    @Autowired
+    private IEtlKuaishouReportAccountHourlyService hourlyService;
     @XxlJob("kuaishouDailyAccountReportLoadEtl")
     public void execute() throws Exception {
         try {
             iEtlKuaishouReportAccountDailyService.queryEveryDayDataForAccount();
+            hourlyService.updateYesterdayEtlHourlyData();
+            XxlJobHelper.log("queryEveryDayDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+
+    /**
+     * 快手账户素材数据清洗任务
+     * @throws Exception
+     */
+    @XxlJob("etlKuaishouAccountMaterialReportDailyData")
+    public void etlKuaishouAccountMaterialReportDailyData() throws Exception {
+        try {
+            etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
+            etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(new Date(),-1)));
             XxlJobHelper.log("queryEveryDayDataForAccount success");
         } catch (Exception e) {
             XxlJobHelper.log(e.getMessage());

+ 3 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java

@@ -25,7 +25,8 @@ public class KuaishouDailyAccountReportLoadJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(3);
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    static ExecutorService adSceneExecutorService = Executors.newFixedThreadPool(10);
 
     @XxlJob("kuaishouDailyAccountReport")
     public void execute() throws Exception {
@@ -43,7 +44,6 @@ public class KuaishouDailyAccountReportLoadJob {
         }));
     }
 
-
     @XxlJob("kuaishouDailyAccountAdSceneReport")
     public void kuaishouDailyAccountAdSceneReport() throws Exception {
         Date getDate = DateUtils.addDay(new Date(), -1);
@@ -55,7 +55,7 @@ public class KuaishouDailyAccountReportLoadJob {
             XxlJobHelper.handleFail();
             return;
         }
-        tokens.forEach(token -> executorService.submit(() -> {
+        tokens.forEach(token -> adSceneExecutorService.submit(() -> {
             kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
         }));
     }

+ 48 - 19
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyGroupReportLoadJob.java

@@ -1,16 +1,19 @@
 package cn.com.ctop.job.kuaishou.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import com.xxl.job.core.context.XxlJobHelper;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouProjectData;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouProjectDataService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportHourlyGroupService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -24,26 +27,52 @@ import java.util.concurrent.Executors;
 public class KuaishouHourlyGroupReportLoadJob {
     @Autowired
     private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
     static ExecutorService executorService = Executors.newFixedThreadPool(5);
+    @Autowired
+    private IKuaiShouProjectDataService kuaiShouProjectDataService;
+    @Autowired
+    private IUserAllocationService allocationService;
+    @Autowired
+    private IKuaishouReportHourlyGroupService hourlyGroupService;
+
 
     @XxlJob("kuaishouHourlyGroupReport")
     public void execute() throws Exception {
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        if (null != hour && "00".equals(hour)) {
-            getDate = DateUtils.addDay(getDate, -1);
-        }
+        //增加接口的开始和结束日期
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
         //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        if (null == tokens || tokens.isEmpty()) {
-            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
-            XxlJobHelper.handleFail();
-            return ;
+        QueryWrapper<KuaiShouProjectData> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("project_status", 0);
+        List<KuaiShouProjectData> list = kuaiShouProjectDataService.list(queryWrapper);
+        if (Check.isNull(list)) {
+            return;
+        }
+        for (KuaiShouProjectData projectData : list) {
+            Long projectId = projectData.getProjectId();
+            if (Check.isNull(projectId)) {
+                continue;
+            }
+            QueryWrapper<UserAllocation> allocationQueryWrapper = new QueryWrapper<>();
+            allocationQueryWrapper.eq("project_id", projectId);
+            allocationQueryWrapper.eq("account_status", 0);
+            List<UserAllocation> accountIds = allocationService.list(allocationQueryWrapper);
+            if (Check.isNull(accountIds)) {
+                continue;
+            }
+            for (UserAllocation allocation : accountIds) {
+                CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
+                if (Check.isNull(token)) {
+                    continue;
+                }
+
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        hourlyGroupService.getAdvertiserGroupReportHourly(token.getAccountId(), token.getAccessToken(), yesterday, yesterday);
+                    }
+                });
+            }
         }
-        Date finalGetDate = getDate;
-        tokens.forEach(token -> executorService.submit(() -> kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, finalGetDate, finalGetDate)));
     }
 }

+ 66 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouMatDailyReportJob.java

@@ -1,8 +1,14 @@
 package cn.com.ctop.job.kuaishou.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouProjectData;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouProjectDataService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.jeecg.common.util.DateUtils;
@@ -19,20 +25,78 @@ public class KuaishouMatDailyReportJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+    @Autowired
+    private IKuaiShouProjectDataService kuaiShouProjectDataService;
+    @Autowired
+    private IUserAllocationService allocationService;
+
     static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    static ExecutorService hourExecutorService = Executors.newFixedThreadPool(5);
 
+    /**
+     * 素材日报
+     *
+     * @throws Exception
+     */
     @XxlJob("kuaishouMaterialReportByStateDate")
     public void execute() throws Exception {
         //增加接口的开始和结束日期
         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-        String endDate =DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
         String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         tokens.forEach(token -> executorService.submit(() -> {
-            kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(),token.getAccessToken(),startDate,endDate,1);
+            kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "DAILY", 1);
         }));
         XxlJobHelper.log("快手物料数据同步完成");
     }
 
+
+    /**
+     * 素材时报
+     *
+     * @throws Exception
+     */
+    @XxlJob("kuaishouMaterialHourReportByStateDate")
+    public void kuaishouMaterialHourReportByStateDate() throws Exception {
+        //增加接口的开始和结束日期
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        //1:查询当日数据
+        QueryWrapper<KuaiShouProjectData> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("project_status", 0);
+        List<KuaiShouProjectData> list = kuaiShouProjectDataService.list(queryWrapper);
+        if (Check.isNull(list)) {
+            return;
+        }
+
+        for (KuaiShouProjectData projectData : list) {
+            Long projectId = projectData.getProjectId();
+            if (Check.isNull(projectId)) {
+                continue;
+            }
+            QueryWrapper<UserAllocation> allocationQueryWrapper = new QueryWrapper<>();
+            allocationQueryWrapper.eq("project_id", projectId);
+            allocationQueryWrapper.eq("account_status", 0);
+            List<UserAllocation> accountIds = allocationService.list(allocationQueryWrapper);
+            if (Check.isNull(accountIds)) {
+                continue;
+            }
+            for (UserAllocation allocation : accountIds) {
+                CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
+                if (Check.isNull(token)) {
+                    continue;
+                }
+
+                hourExecutorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), yesterday, yesterday, "HOURLY", 1);
+                    }
+                });
+            }
+        }
+    }
+
 }

+ 5 - 0
module-job-kuaishou/src/main/resources/application-dev.yml

@@ -183,6 +183,7 @@ bytedance:
     ad-report-get: /2/report/ad/get/
     ad-creative-get: /2/report/creative/get/
     advertiser-fund-daily-stat: /2/advertiser/fund/daily_stat/
+
 xxl:
   job:
     accessToken:
@@ -194,4 +195,8 @@ xxl:
       logretentiondays: 30
     admin:
       addresses: 127.0.0.1:8090/xxl-job-admin/
+xxl-job:
+  requestUrl: http://localhost:8080
+
+
 

+ 7 - 0
module-job-kuaishou/src/main/resources/application-jiaoyang.yml

@@ -232,3 +232,10 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
+zip:
+  local:
+    download-path: /data/unzip/
+xxl-job:
+    requestUrl: http://jiaoyangapi.shyouteng.com.cn
+
+

+ 5 - 0
module-job-kuaishou/src/main/resources/application-prod.yml

@@ -237,3 +237,8 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
+zip:
+  local:
+    download-path: /data/unzip/
+xxl-job:
+  requestUrl: http://api.tjyourong.com.cn

+ 4 - 0
module-job-kuaishou/src/main/resources/application-test.yml

@@ -212,3 +212,7 @@ xxl:
       logretentiondays: 30
     admin:
       addresses: http://127.0.0.1:8090/xxl-job-admin
+xxl-job:
+  requestUrl:
+
+

+ 149 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCampaignLevelOperationRecordController.java

@@ -0,0 +1,149 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCampaignLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCampaignLevelOperationRecordService;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 计划创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="计划创建记录")
+@RestController
+@RequestMapping("/ctop/aiKuaishouCampaignLevelOperationRecord")
+public class AiKuaishouCampaignLevelOperationRecordController {
+	@Autowired
+	private IAiKuaishouCampaignLevelOperationRecordService aiKuaishouCampaignLevelOperationRecordService;
+
+	/**
+	  * 分页列表查询
+	 * @param aiKuaishouCampaignLevelOperationRecord
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<AiKuaishouCampaignLevelOperationRecord>> queryPageList(AiKuaishouCampaignLevelOperationRecord aiKuaishouCampaignLevelOperationRecord,
+																			   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																			   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																			   HttpServletRequest req) {
+		Result<IPage<AiKuaishouCampaignLevelOperationRecord>> result = new Result<>();
+		QueryWrapper<AiKuaishouCampaignLevelOperationRecord> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouCampaignLevelOperationRecord, req.getParameterMap());
+		Page<AiKuaishouCampaignLevelOperationRecord> page = new Page<AiKuaishouCampaignLevelOperationRecord>(pageNo, pageSize);
+		IPage<AiKuaishouCampaignLevelOperationRecord> pageList = aiKuaishouCampaignLevelOperationRecordService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param aiKuaishouCampaignLevelOperationRecord
+	 * @return
+	 */
+	@AutoLog(value = "计划创建记录-添加")
+	@ApiOperation(value="计划创建记录-添加", notes="计划创建记录-添加")
+	@PostMapping(value = "/add")
+	public Result<AiKuaishouCampaignLevelOperationRecord> add(@RequestBody AiKuaishouCampaignLevelOperationRecord aiKuaishouCampaignLevelOperationRecord) {
+		Result<AiKuaishouCampaignLevelOperationRecord> result = new Result<>();
+		try {
+			aiKuaishouCampaignLevelOperationRecordService.save(aiKuaishouCampaignLevelOperationRecord);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param aiKuaishouCampaignLevelOperationRecord
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<AiKuaishouCampaignLevelOperationRecord> edit(@RequestBody AiKuaishouCampaignLevelOperationRecord aiKuaishouCampaignLevelOperationRecord) {
+		Result<AiKuaishouCampaignLevelOperationRecord> result = new Result<AiKuaishouCampaignLevelOperationRecord>();
+		AiKuaishouCampaignLevelOperationRecord aiKuaishouCampaignLevelOperationRecordEntity = aiKuaishouCampaignLevelOperationRecordService.getById(aiKuaishouCampaignLevelOperationRecord.getCampaignUuid());
+		if(aiKuaishouCampaignLevelOperationRecordEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = aiKuaishouCampaignLevelOperationRecordService.updateById(aiKuaishouCampaignLevelOperationRecord);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			aiKuaishouCampaignLevelOperationRecordService.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<AiKuaishouCampaignLevelOperationRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<AiKuaishouCampaignLevelOperationRecord> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.aiKuaishouCampaignLevelOperationRecordService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<AiKuaishouCampaignLevelOperationRecord> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<AiKuaishouCampaignLevelOperationRecord> result = new Result<>();
+		AiKuaishouCampaignLevelOperationRecord aiKuaishouCampaignLevelOperationRecord = aiKuaishouCampaignLevelOperationRecordService.getById(id);
+		if(aiKuaishouCampaignLevelOperationRecord==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(aiKuaishouCampaignLevelOperationRecord);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 172 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreateCreativeController.java

@@ -0,0 +1,172 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.ParseException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@Api(tags = "快手-自动投放")
+@RestController
+@RequestMapping("/ai/create")
+public class AiKuaishouCreateCreativeController {
+    @Autowired
+    private IAiKuaishouCreateCreativeService createCreativeService;
+    @Autowired
+    private IAiKuaishouAdvertiserStrategyService strategyService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(2);
+    static ExecutorService kuaishouCustomCreativeSupplementExecutorService = Executors.newFixedThreadPool(2);
+    static ExecutorService kuaishouProgramCreativeAutoService = Executors.newFixedThreadPool(2);
+    static ExecutorService kuaishouProgramTopCreativeAutoService = Executors.newFixedThreadPool(2);
+
+
+    /**
+     * 自动上新
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/customCreativeLimit")
+    public JSONObject customCreativeLimit(String id) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            AiKuaishouAdvertiserStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            executorService.submit(() ->
+                    createCreativeService.customCreativeLimit(strategy)
+            );
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+
+    /**
+     * 自定义创意补充
+     *
+     * @param id
+     * @param hour
+     * @return
+     */
+    @GetMapping(value = "/kuaishouCustomCreativeSupplement")
+    public JSONObject kuaishouCustomCreativeSupplement(String id, Integer hour) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            AiKuaishouAdvertiserStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            if (Check.isNull(hour)) {
+                throw new Exception("小时数据为空");
+            }
+            kuaishouCustomCreativeSupplementExecutorService.submit(() -> {
+                try {
+                    createCreativeService.customCreativeSupplement(strategy, hour);
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
+            });
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+
+    /**
+     * 程序化上新素材
+     *
+     * @param id
+     * @param videoCnt
+     * @return
+     */
+    @GetMapping(value = "/kuaishouProgramCreativeAuto")
+    public JSONObject kuaishouCustomCreativeSupplement(String id, Long videoCnt) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            AiKuaishouAdvertiserStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            if (Check.isNull(videoCnt)) {
+                throw new Exception("视频数量不能为空");
+            }
+            kuaishouProgramCreativeAutoService.submit(() -> {
+                createCreativeService.autoCreateProgramCreative(strategy, 1, videoCnt);
+
+            });
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+
+    /**
+     * 程序化历史高质量
+     *
+     * @param id
+     * @param videoCnt
+     * @return
+     */
+    @GetMapping(value = "/autoCreateProgramHistoryTopCreative")
+    public JSONObject autoCreateProgramHistoryTopCreative(String id, Long videoCnt) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            AiKuaishouAdvertiserStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            if (Check.isNull(videoCnt)) {
+                throw new Exception("视频数量不能为空");
+            }
+            kuaishouProgramTopCreativeAutoService.submit(() -> {
+                createCreativeService.autoCreateProgramCreative(strategy, 2, videoCnt);
+            });
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+
+
+}

+ 143 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreativeLevelOperationRecordController.java

@@ -0,0 +1,143 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCreativeLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreativeLevelOperationRecordService;
+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 lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 自定义创意创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="自定义创意创建记录")
+@RestController
+@RequestMapping("/ctop/aiKuaishouCreativeLevelOperationRecord")
+public class AiKuaishouCreativeLevelOperationRecordController {
+	@Autowired
+	private IAiKuaishouCreativeLevelOperationRecordService aiKuaishouCreativeLevelOperationRecordService;
+
+	/**
+	  * 分页列表查询
+	 * @param aiKuaishouCreativeLevelOperationRecord
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<AiKuaishouCreativeLevelOperationRecord>> queryPageList(AiKuaishouCreativeLevelOperationRecord aiKuaishouCreativeLevelOperationRecord,
+																			   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																			   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																			   HttpServletRequest req) {
+		Result<IPage<AiKuaishouCreativeLevelOperationRecord>> result = new Result<>();
+		QueryWrapper<AiKuaishouCreativeLevelOperationRecord> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouCreativeLevelOperationRecord, req.getParameterMap());
+		Page<AiKuaishouCreativeLevelOperationRecord> page = new Page<AiKuaishouCreativeLevelOperationRecord>(pageNo, pageSize);
+		IPage<AiKuaishouCreativeLevelOperationRecord> pageList = aiKuaishouCreativeLevelOperationRecordService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param aiKuaishouCreativeLevelOperationRecord
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<AiKuaishouCreativeLevelOperationRecord> add(@RequestBody AiKuaishouCreativeLevelOperationRecord aiKuaishouCreativeLevelOperationRecord) {
+		Result<AiKuaishouCreativeLevelOperationRecord> result = new Result<>();
+		try {
+			aiKuaishouCreativeLevelOperationRecordService.save(aiKuaishouCreativeLevelOperationRecord);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param aiKuaishouCreativeLevelOperationRecord
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<AiKuaishouCreativeLevelOperationRecord> edit(@RequestBody AiKuaishouCreativeLevelOperationRecord aiKuaishouCreativeLevelOperationRecord) {
+		Result<AiKuaishouCreativeLevelOperationRecord> result = new Result<AiKuaishouCreativeLevelOperationRecord>();
+		AiKuaishouCreativeLevelOperationRecord aiKuaishouCreativeLevelOperationRecordEntity = aiKuaishouCreativeLevelOperationRecordService.getById(aiKuaishouCreativeLevelOperationRecord.getCreativeUuid());
+		if(aiKuaishouCreativeLevelOperationRecordEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = aiKuaishouCreativeLevelOperationRecordService.updateById(aiKuaishouCreativeLevelOperationRecord);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			aiKuaishouCreativeLevelOperationRecordService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<AiKuaishouCreativeLevelOperationRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<AiKuaishouCreativeLevelOperationRecord> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.aiKuaishouCreativeLevelOperationRecordService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<AiKuaishouCreativeLevelOperationRecord> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<AiKuaishouCreativeLevelOperationRecord> result = new Result<>();
+		AiKuaishouCreativeLevelOperationRecord aiKuaishouCreativeLevelOperationRecord = aiKuaishouCreativeLevelOperationRecordService.getById(id);
+		if(aiKuaishouCreativeLevelOperationRecord==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(aiKuaishouCreativeLevelOperationRecord);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 143 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouProgramCreativeLevelOperationRecordController.java

@@ -0,0 +1,143 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouProgramCreativeLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouProgramCreativeLevelOperationRecordService;
+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 lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 程序换创意创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="程序换创意创建记录")
+@RestController
+@RequestMapping("/ctop/aiKuaishouProgramCreativeLevelOperationRecord")
+public class AiKuaishouProgramCreativeLevelOperationRecordController {
+	@Autowired
+	private IAiKuaishouProgramCreativeLevelOperationRecordService aiKuaishouProgramCreativeLevelOperationRecordService;
+
+	/**
+	  * 分页列表查询
+	 * @param aiKuaishouProgramCreativeLevelOperationRecord
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<AiKuaishouProgramCreativeLevelOperationRecord>> queryPageList(AiKuaishouProgramCreativeLevelOperationRecord aiKuaishouProgramCreativeLevelOperationRecord,
+																					  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																					  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																					  HttpServletRequest req) {
+		Result<IPage<AiKuaishouProgramCreativeLevelOperationRecord>> result = new Result<>();
+		QueryWrapper<AiKuaishouProgramCreativeLevelOperationRecord> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouProgramCreativeLevelOperationRecord, req.getParameterMap());
+		Page<AiKuaishouProgramCreativeLevelOperationRecord> page = new Page<AiKuaishouProgramCreativeLevelOperationRecord>(pageNo, pageSize);
+		IPage<AiKuaishouProgramCreativeLevelOperationRecord> pageList = aiKuaishouProgramCreativeLevelOperationRecordService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param aiKuaishouProgramCreativeLevelOperationRecord
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<AiKuaishouProgramCreativeLevelOperationRecord> add(@RequestBody AiKuaishouProgramCreativeLevelOperationRecord aiKuaishouProgramCreativeLevelOperationRecord) {
+		Result<AiKuaishouProgramCreativeLevelOperationRecord> result = new Result<>();
+		try {
+			aiKuaishouProgramCreativeLevelOperationRecordService.save(aiKuaishouProgramCreativeLevelOperationRecord);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param aiKuaishouProgramCreativeLevelOperationRecord
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<AiKuaishouProgramCreativeLevelOperationRecord> edit(@RequestBody AiKuaishouProgramCreativeLevelOperationRecord aiKuaishouProgramCreativeLevelOperationRecord) {
+		Result<AiKuaishouProgramCreativeLevelOperationRecord> result = new Result<AiKuaishouProgramCreativeLevelOperationRecord>();
+		AiKuaishouProgramCreativeLevelOperationRecord aiKuaishouProgramCreativeLevelOperationRecordEntity = aiKuaishouProgramCreativeLevelOperationRecordService.getById(aiKuaishouProgramCreativeLevelOperationRecord.getCreativeUuid());
+		if(aiKuaishouProgramCreativeLevelOperationRecordEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = aiKuaishouProgramCreativeLevelOperationRecordService.updateById(aiKuaishouProgramCreativeLevelOperationRecord);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			aiKuaishouProgramCreativeLevelOperationRecordService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<AiKuaishouProgramCreativeLevelOperationRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<AiKuaishouProgramCreativeLevelOperationRecord> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.aiKuaishouProgramCreativeLevelOperationRecordService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<AiKuaishouProgramCreativeLevelOperationRecord> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<AiKuaishouProgramCreativeLevelOperationRecord> result = new Result<>();
+		AiKuaishouProgramCreativeLevelOperationRecord aiKuaishouProgramCreativeLevelOperationRecord = aiKuaishouProgramCreativeLevelOperationRecordService.getById(id);
+		if(aiKuaishouProgramCreativeLevelOperationRecord==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(aiKuaishouProgramCreativeLevelOperationRecord);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 143 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouUnitLevelOperationRecordController.java

@@ -0,0 +1,143 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouUnitLevelOperationRecordService;
+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 lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 组创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="组创建记录")
+@RestController
+@RequestMapping("/ctop/aiKuaishouUnitLevelOperationRecord")
+public class AiKuaishouUnitLevelOperationRecordController {
+	@Autowired
+	private IAiKuaishouUnitLevelOperationRecordService aiKuaishouUnitLevelOperationRecordService;
+
+	/**
+	  * 分页列表查询
+	 * @param aiKuaishouUnitLevelOperationRecord
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<AiKuaishouUnitLevelOperationRecord>> queryPageList(AiKuaishouUnitLevelOperationRecord aiKuaishouUnitLevelOperationRecord,
+																		   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																		   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																		   HttpServletRequest req) {
+		Result<IPage<AiKuaishouUnitLevelOperationRecord>> result = new Result<>();
+		QueryWrapper<AiKuaishouUnitLevelOperationRecord> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouUnitLevelOperationRecord, req.getParameterMap());
+		Page<AiKuaishouUnitLevelOperationRecord> page = new Page<AiKuaishouUnitLevelOperationRecord>(pageNo, pageSize);
+		IPage<AiKuaishouUnitLevelOperationRecord> pageList = aiKuaishouUnitLevelOperationRecordService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param aiKuaishouUnitLevelOperationRecord
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<AiKuaishouUnitLevelOperationRecord> add(@RequestBody AiKuaishouUnitLevelOperationRecord aiKuaishouUnitLevelOperationRecord) {
+		Result<AiKuaishouUnitLevelOperationRecord> result = new Result<>();
+		try {
+			aiKuaishouUnitLevelOperationRecordService.save(aiKuaishouUnitLevelOperationRecord);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param aiKuaishouUnitLevelOperationRecord
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<AiKuaishouUnitLevelOperationRecord> edit(@RequestBody AiKuaishouUnitLevelOperationRecord aiKuaishouUnitLevelOperationRecord) {
+		Result<AiKuaishouUnitLevelOperationRecord> result = new Result<AiKuaishouUnitLevelOperationRecord>();
+		AiKuaishouUnitLevelOperationRecord aiKuaishouUnitLevelOperationRecordEntity = aiKuaishouUnitLevelOperationRecordService.getById(aiKuaishouUnitLevelOperationRecord.getGroupUuid());
+		if(aiKuaishouUnitLevelOperationRecordEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = aiKuaishouUnitLevelOperationRecordService.updateById(aiKuaishouUnitLevelOperationRecord);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			aiKuaishouUnitLevelOperationRecordService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<AiKuaishouUnitLevelOperationRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<AiKuaishouUnitLevelOperationRecord> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.aiKuaishouUnitLevelOperationRecordService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<AiKuaishouUnitLevelOperationRecord> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<AiKuaishouUnitLevelOperationRecord> result = new Result<>();
+		AiKuaishouUnitLevelOperationRecord aiKuaishouUnitLevelOperationRecord = aiKuaishouUnitLevelOperationRecordService.getById(id);
+		if(aiKuaishouUnitLevelOperationRecord==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(aiKuaishouUnitLevelOperationRecord);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 0 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java

@@ -215,7 +215,6 @@ public class KuaiShouMaterialControer {
      */
     @PostMapping(value = "/getHistoryTopVideoList")
     public JSONObject getHistoryTopVideoList(@RequestBody JSONObject requestJson) {
-        //   log.info("获取历史Top素材入参:{}", requestJson);
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(requestJson)) {

+ 403 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaishouCrowdPackController.java

@@ -0,0 +1,403 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouCrowdPack;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouCrowdPackService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+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.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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+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.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+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;
+
+/**
+ * 人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-03-26
+ */
+@Slf4j
+@Api(tags = "人群报表")
+@RestController
+@RequestMapping("/kuaishouCrowdPack")
+public class KuaishouCrowdPackController {
+    @Autowired
+    private IKuaishouCrowdPackService kuaishouCrowdPackService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaishouCrowdPack
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "人群报表-分页列表查询")
+    @ApiOperation(value = "人群报表-分页列表查询", notes = "人群报表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaishouCrowdPack>> list(KuaishouCrowdPack kuaishouCrowdPack,
+                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                 HttpServletRequest req) {
+        Result<IPage<KuaishouCrowdPack>> result = new Result<>();
+        QueryWrapper<KuaishouCrowdPack> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouCrowdPack, req.getParameterMap());
+        Page<KuaishouCrowdPack> page = new Page<KuaishouCrowdPack>(pageNo, pageSize);
+        IPage<KuaishouCrowdPack> pageList = kuaishouCrowdPackService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 人群包列表
+     *
+     * @param
+     * @return org.jeecg.common.api.vo.Result<java.lang.Object>
+     * @throws
+     * @author ZHAOXA
+     */
+    @GetMapping(value = "/queryPageList")
+    public Result<Object> queryPageList(KuaishouCrowdPack kuaishouCrowdPack,
+                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        try {
+            return kuaishouCrowdPackService.queryPageList(kuaishouCrowdPack, pageNo, pageSize);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 相关账户查询
+     *
+     * @param
+     * @return org.jeecg.common.api.vo.Result<java.lang.Object>
+     * @throws
+     * @author ZHAOXA
+     */
+    @GetMapping(value = "/queryRel")
+    public Result<Object> queryRel(String type, String signature,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        try {
+            if (Check.isNull(type) || Check.isNull(signature)) {
+                return Result.error("缺失参数");
+            }
+            return kuaishouCrowdPackService.queryRel(type, signature, pageNo, pageSize);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 查询原因
+     *
+     * @param
+     * @return org.jeecg.common.api.vo.Result<java.lang.Object>
+     * @throws
+     * @author ZHAOXA
+     */
+    @GetMapping(value = "/queryFailReason")
+    public Result<Object> queryFailReason(String signature,
+                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        try {
+            return kuaishouCrowdPackService.queryFailReason(signature, pageNo, pageSize);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 上传前的人群包校验
+     *
+     * @param
+     * @return org.jeecg.common.api.vo.Result<java.lang.Object>
+     * @throws
+     * @author ZHAOXA
+     */
+    @GetMapping(value = "/checkCrowdPackage")
+    public Result<Object> checkCrowdPackage(String signature) {
+        try {
+            return kuaishouCrowdPackService.checkCrowdPackage(signature);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 上传人群包
+     *
+     * @param kuaishouCrowdPack
+     * @return
+     */
+
+    @PostMapping(value = "/uploadCrowdPack")
+    public Result<Object> uploadCrowdPack(@RequestBody JSONObject request) {
+        Integer type = request.getInteger("type");
+        String orientationName = request.getString("orientationName");
+        Long accountId = request.getLong("accountId");
+        String url = request.getString("url");
+        try {
+            if (Check.isNull(type) || Check.isNull(orientationName) || Check.isNull(url) || Check.isNull(accountId)) {
+                return Result.error("缺少参数");
+            }
+            return kuaishouCrowdPackService.uploadCrowdPack(type, orientationName, accountId, url);
+        } catch (Exception e) {
+            log.error("上传异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("上传失败");
+    }
+
+    /**
+     * 账户推送
+     *
+     * @param kuaishouCrowdPack
+     * @return
+     */
+    @AutoLog(value = "账户推送")
+    @ApiOperation(value = "账户推送", notes = "账户推送")
+    @PostMapping(value = "/accountPush")
+    public Result<Object> accountPush(@RequestBody JSONObject request) {
+        try {
+            JSONArray accountIds = request.getJSONArray("accountIds");
+            String signature = request.getString("signature");
+            if (Check.isNull(accountIds) || Check.isNull(signature)) {
+                return Result.error("缺少参数");
+            }
+            return kuaishouCrowdPackService.accountPush(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    @RequestMapping(value = "/crowdListQuery")
+    public Result<Object> crowdListQuery() {
+        try {
+            kuaishouCrowdPackService.crowdListQuery();
+            return Result.ok("success");
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaishouCrowdPack
+     * @return
+     */
+    @AutoLog(value = "人群报表-添加")
+    @ApiOperation(value = "人群报表-添加", notes = "人群报表-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaishouCrowdPack> add(@RequestBody KuaishouCrowdPack kuaishouCrowdPack) {
+        Result<KuaishouCrowdPack> result = new Result<>();
+        try {
+            kuaishouCrowdPackService.save(kuaishouCrowdPack);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaishouCrowdPack
+     * @return
+     */
+    @AutoLog(value = "人群报表-编辑")
+    @ApiOperation(value = "人群报表-编辑", notes = "人群报表-编辑")
+    @PostMapping(value = "/edit")
+    public Result<KuaishouCrowdPack> edit(@RequestBody KuaishouCrowdPack kuaishouCrowdPack) {
+        Result<KuaishouCrowdPack> result = new Result<KuaishouCrowdPack>();
+        KuaishouCrowdPack kuaishouCrowdPackEntity = kuaishouCrowdPackService.getById(kuaishouCrowdPack.getId());
+        if (kuaishouCrowdPackEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaishouCrowdPackService.updateById(kuaishouCrowdPack);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "人群报表-通过id删除")
+    @ApiOperation(value = "人群报表-通过id删除", notes = "人群报表-通过id删除")
+    @GetMapping(value = "/delete")
+    public Result<Object> delete(KuaishouCrowdPack kuaishouCrowdPack) {
+        KuaishouCrowdPack kuaishouCrowdPackEntity = kuaishouCrowdPackService.getById(kuaishouCrowdPack.getId());
+        if (kuaishouCrowdPackEntity == null) {
+            return Result.error("未找到对应实体");
+        } else {
+            kuaishouCrowdPackEntity.setDataStatus(0);
+            return kuaishouCrowdPackService.updateDataStatus(kuaishouCrowdPackEntity);
+        }
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "人群报表-批量删除")
+    @ApiOperation(value = "人群报表-批量删除", notes = "人群报表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaishouCrowdPack> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaishouCrowdPack> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaishouCrowdPackService.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<KuaishouCrowdPack> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaishouCrowdPack> result = new Result<>();
+        KuaishouCrowdPack kuaishouCrowdPack = kuaishouCrowdPackService.getById(id);
+        if (kuaishouCrowdPack == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaishouCrowdPack);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaishouCrowdPack> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaishouCrowdPack kuaishouCrowdPack = JSON.parseObject(deString, KuaishouCrowdPack.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouCrowdPack, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaishouCrowdPack> pageList = kuaishouCrowdPackService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "人群报表列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaishouCrowdPack.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<KuaishouCrowdPack> listKuaishouCrowdPacks = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouCrowdPack.class, params);
+                kuaishouCrowdPackService.saveBatch(listKuaishouCrowdPacks);
+                return Result.ok("文件导入成功!数据行数:" + listKuaishouCrowdPacks.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("文件导入失败!");
+    }
+
+}

+ 363 - 188
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java

@@ -1,6 +1,9 @@
 package cn.com.ctop.kuaishou.modules.ai.entity;
 
-import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -8,199 +11,371 @@ import java.util.Date;
 
 /**
  * 快手账户策略设置信息表
+ *
  * @author jeecg-boot
- * @date   2021-01-25
  * @version V1.0
+ * @date 2021-01-25
  */
 @Data
 @TableName("ctop_ai_kuaishou_advertiser_strategy")
 @EqualsAndHashCode(callSuper = false)
 public class AiKuaishouAdvertiserStrategy {
 
-	/**客户策略ID*/
-	@TableId(type = IdType.AUTO)
-	private Long id;
-	/**账户ID*/
-	private Long accountId;
-	private String userId;
-	private Integer channelType;
-	/**策略状态 1-使用 0-停用*/
-	private Integer status;
-	/**客户要求的计划名称规范*/
-	private String campaignName;
-	/**计划类型 2-提升应用安装 3-获取电商下单 4-推广品牌活动 5-收集销售线索 7-提高应用活跃*/
-	private Integer campaignType;
-	/**客户要求的广告组名称规范*/
-	private String groupName;
-	/**定向模板id*/
-	private Integer templateId;
-	/**优化目标出价类型*/
-	private Integer bidType;
-	/**优先从系统应用商店下载*/
-	private Integer useAppMarket;
-	/**应用商店列表*/
-	private String appStore;
-	/**出价*/
-	private Integer bid;
-	/**深度出价*/
-	private Long cpaBid;
-	private Long deepConversionBid;
-	/**优先低成本出价*/
-	private Integer smartBid;
-	/**优化目标*/
-	private Integer ocpxActionType;
-	/**深度转化目标*/
-	private Integer deepConversionType;
-	/**付费ROI系数*/
-	private Float roiRatio;
-	/**资源位置*/
-	private String sceneId;
-	/** 创意制作方式 4-自定义 5-程序化创意 7-程序化创意2.0*/
-	private Integer unitType;
-	/**投放开始时间*/
-	private String beginTime;
-	/**投放结束时间*/
-	private String endTime;
-	/**投放时间段*/
-	private String scheduleTime;
-	/**转化目标ID*/
-	private Integer convertId;
-	/**url类型*/
-	private Integer urlType;
-	/**url类型*/
-	private Integer webUriType;
-	/**投放链接*/
-	private String url;
-	/**调起链接*/
-	private String schemaUri;
-	/**应用ID*/
-	private Integer appId;
-	/**创意展现方式 1-轮播  2-优选*/
-	private Integer showMode;
-	/**投放方式 1-加速投放  2-平滑投放 3-优先低成本*/
-	private Integer speed;
-	/**预约广告*/
-	private Integer siteType;
-	/**游戏礼包码*/
-	private String giftData;
-	/**是否使用落地页前置功能*/
-	private Integer videoLandingPage;
-	/**智能定向*/
-	private Integer autoTarget;
-	/**是否开启自动生成视频*/
-	private Integer autoCreatePhoto;
-	/**地域*/
-	private String region;
-	/**商圈定向*/
-	private String districtIds;
-	/**用户类型*/
-	private Integer userType;
-	/**最大年龄*/
-	private Integer ageMin;
-	/**最小年龄*/
-	private Integer ageMax;
-	/**固定年龄段*/
-	private String agesRange;
-	/**性别*/
-	private Integer gender;
-	/**操作系统*/
-	private Integer platformOs;
-	/**Android版本*/
-	private Integer androidOsv;
-	/**iOS版本*/
-	private Integer iosOsv;
-	/**网络环境*/
-	private Integer network;
-	/**设备品牌*/
-	private String deviceBrand;
-	/**设备价格*/
-	private String devicePrice;
-	/**商业兴趣类型*/
-	private Integer businessInterestType;
-	/**商业兴趣*/
-	private String businessInterest;
-	/**网红粉丝*/
-	private String fansStar;
-	/**兴趣视频用户*/
-	private String interestVideo;
-	/**APP行为-按分类*/
-	private String appInterest;
-	/**APP行为-按APP名称*/
-	private String appIds;
-	/**过滤已转化人群纬度*/
-	private Integer filterConvertedLevel;
-	/**人群包定向*/
-	private String population;
-	/**人群包排除*/
-	private String excludePopulation;
-	/**付费人群包id*/
-	private String paidAudience;
-	/**开启智能扩量*/
-	private Integer isOpen;
-	/**不可突破年龄*/
-	private Integer noAgeBreak;
-	/**不可突破性别*/
-	private Integer noGenderBreak;
-	/**不可突破地域*/
-	private Integer noAreaBreak;
-	/**行为兴趣定向*/
-	private String behaviorInterest;
-	/**创意名称*/
-	private String creativeName;
-	/**行动号召按钮文案*/
-	private String actionBarText;
-	/**广告语*/
-	private String description;
-	/**便利贴创意短广告语*/
-	private String shortSlogan;
-	/**封面广告语标题*/
-	private String stickerTitle;
-	/**贴纸样式类型*/
-	private String overlayType;
-	/**广告标签*/
-	private String exposeTag;
-	/**广告标签2期*/
-	private String newExposeTag;
-	/**安卓下载中间页ID*/
-	private Integer siteId;
-	/**第三方点击检测链接*/
-	private String clickTrackUrl;
-	/**第三方开始播放监测链接*/
-	private String impressionUrl;
-	private Integer generalTrack;
-	/**第三方有效播放监测链接*/
-	private String adPhotoPlayedT3sUrl;
-	/**第三方点击按钮监测链接*/
-	private String actionbarClickUrl;
-	/**创意分类*/
-	private Integer creativeCategory;
-	/**创意标签*/
-	private String creativeTag;
-	/**物料关联的封面个数*/
-	private Integer imageCnt;
-	/**创建时间*/
-	private Date createTime;
-	/**生效时间*/
-	private Date effectiveTime;
-	/**失效时间*/
-	private Date expiryTime;
-	/**
-	 * 是否开启智能封面
-	 */
-	private Integer smartCover;
-	/**
-	 * 是否开启素材挖掘
-	 */
-	private Integer assetMining;
-	/**
-	 * 是否单应用
-	 */
-	private Integer singleAppid;
-	/**
-	 * 投放中的appId数组
-	 */
-	private String appIdArray;
-	private Integer openProgramCreate;
-	@TableField(exist = false)
-	private String authName;
+    /**
+     * 客户策略ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    private String userId;
+    private Integer channelType;
+    /**
+     * 策略状态 1-使用 0-停用
+     */
+    private Integer status;
+    /**
+     * 客户要求的计划名称规范
+     */
+    private String campaignName;
+    /**
+     * 计划类型 2-提升应用安装 3-获取电商下单 4-推广品牌活动 5-收集销售线索 7-提高应用活跃
+     */
+    private Integer campaignType;
+    /**
+     * 客户要求的广告组名称规范
+     */
+    private String groupName;
+    /**
+     * 定向模板id
+     */
+    private Integer templateId;
+    /**
+     * 优化目标出价类型
+     */
+    private Integer bidType;
+    /**
+     * 优先从系统应用商店下载
+     */
+    private Integer useAppMarket;
+    /**
+     * 应用商店列表
+     */
+    private String appStore;
+    /**
+     * 出价
+     */
+    private Integer bid;
+    /**
+     * 深度出价
+     */
+    private Long cpaBid;
+    private Long deepConversionBid;
+    /**
+     * 优先低成本出价
+     */
+    private Integer smartBid;
+    /**
+     * 优化目标
+     */
+    private Integer ocpxActionType;
+    /**
+     * 深度转化目标
+     */
+    private Integer deepConversionType;
+    /**
+     * 付费ROI系数
+     */
+    private Float roiRatio;
+    /**
+     * 资源位置
+     */
+    private String sceneId;
+    /**
+     * 创意制作方式 4-自定义 5-程序化创意 7-程序化创意2.0
+     */
+    private Integer unitType;
+    /**
+     * 投放开始时间
+     */
+    private String beginTime;
+    /**
+     * 投放结束时间
+     */
+    private String endTime;
+    /**
+     * 投放时间段
+     */
+    private String scheduleTime;
+    /**
+     * 转化目标ID
+     */
+    private Integer convertId;
+    /**
+     * url类型
+     */
+    private Integer urlType;
+    /**
+     * url类型
+     */
+    private Integer webUriType;
+    /**
+     * 投放链接
+     */
+    private String url;
+    /**
+     * 调起链接
+     */
+    private String schemaUri;
+    /**
+     * 应用ID
+     */
+    private Integer appId;
+    /**
+     * 创意展现方式 1-轮播  2-优选
+     */
+    private Integer showMode;
+    /**
+     * 投放方式 1-加速投放  2-平滑投放 3-优先低成本
+     */
+    private Integer speed;
+    /**
+     * 预约广告
+     */
+    private Integer siteType;
+    /**
+     * 游戏礼包码
+     */
+    private String giftData;
+    /**
+     * 是否使用落地页前置功能
+     */
+    private Integer videoLandingPage;
+    /**
+     * 智能定向
+     */
+    private Integer autoTarget;
+    /**
+     * 是否开启自动生成视频
+     */
+    private Integer autoCreatePhoto;
+    /**
+     * 地域
+     */
+    private String region;
+    /**
+     * 商圈定向
+     */
+    private String districtIds;
+    /**
+     * 用户类型
+     */
+    private Integer userType;
+    /**
+     * 最大年龄
+     */
+    private Integer ageMin;
+    /**
+     * 最小年龄
+     */
+    private Integer ageMax;
+    /**
+     * 固定年龄段
+     */
+    private String agesRange;
+    /**
+     * 性别
+     */
+    private Integer gender;
+    /**
+     * 操作系统
+     */
+    private Integer platformOs;
+    /**
+     * Android版本
+     */
+    private Integer androidOsv;
+    /**
+     * iOS版本
+     */
+    private Integer iosOsv;
+    /**
+     * 网络环境
+     */
+    private Integer network;
+    /**
+     * 设备品牌
+     */
+    private String deviceBrand;
+    /**
+     * 设备价格
+     */
+    private String devicePrice;
+    /**
+     * 商业兴趣类型
+     */
+    private Integer businessInterestType;
+    /**
+     * 商业兴趣
+     */
+    private String businessInterest;
+    /**
+     * 网红粉丝
+     */
+    private String fansStar;
+    /**
+     * 兴趣视频用户
+     */
+    private String interestVideo;
+    /**
+     * APP行为-按分类
+     */
+    private String appInterest;
+    /**
+     * APP行为-按APP名称
+     */
+    private String appIds;
+    /**
+     * 过滤已转化人群纬度
+     */
+    private Integer filterConvertedLevel;
+    /**
+     * 人群包定向
+     */
+    private String population;
+    /**
+     * 人群包排除
+     */
+    private String excludePopulation;
+    /**
+     * 付费人群包id
+     */
+    private String paidAudience;
+    /**
+     * 开启智能扩量
+     */
+    private Integer isOpen;
+    /**
+     * 不可突破年龄
+     */
+    private Integer noAgeBreak;
+    /**
+     * 不可突破性别
+     */
+    private Integer noGenderBreak;
+    /**
+     * 不可突破地域
+     */
+    private Integer noAreaBreak;
+    /**
+     * 行为兴趣定向
+     */
+    private String behaviorInterest;
+    /**
+     * 创意名称
+     */
+    private String creativeName;
+    /**
+     * 行动号召按钮文案
+     */
+    private String actionBarText;
+    /**
+     * 广告语
+     */
+    private String description;
+    /**
+     * 便利贴创意短广告语
+     */
+    private String shortSlogan;
+    /**
+     * 封面广告语标题
+     */
+    private String stickerTitle;
+    /**
+     * 贴纸样式类型
+     */
+    private String overlayType;
+    /**
+     * 广告标签
+     */
+    private String exposeTag;
+    /**
+     * 广告标签2期
+     */
+    private String newExposeTag;
+    /**
+     * 安卓下载中间页ID
+     */
+    private Integer siteId;
+    /**
+     * 第三方点击检测链接
+     */
+    private String clickTrackUrl;
+    /**
+     * 第三方开始播放监测链接
+     */
+    private String impressionUrl;
+    private Integer generalTrack;
+    /**
+     * 第三方有效播放监测链接
+     */
+    private String adPhotoPlayedT3sUrl;
+    /**
+     * 第三方点击按钮监测链接
+     */
+    private String actionbarClickUrl;
+    /**
+     * 创意分类
+     */
+    private Integer creativeCategory;
+    /**
+     * 创意标签
+     */
+    private String creativeTag;
+    /**
+     * 物料关联的封面个数
+     */
+    private Integer imageCnt;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 生效时间
+     */
+    private Date effectiveTime;
+    /**
+     * 失效时间
+     */
+    private Date expiryTime;
+    /**
+     * 是否开启智能封面
+     */
+    private Integer smartCover;
+    /**
+     * 是否开启素材挖掘
+     */
+    private Integer assetMining;
+    /**
+     * 是否单应用
+     */
+    private Integer singleAppid;
+    /**
+     * 投放中的appId数组
+     */
+    private String appIdArray;
+    private Integer openProgramCreate;
+
+    private Long campaignDayBudget;
+    private String campaignDayBudgetSchedule;
+    private Long unitDayBudget;
+    private String unitDayBudgetSchedule;
+    private Long customUnitCnt;
+    private Long programUnitCnt;
+    private String materialKeyword;
+
+    @TableField(exist = false)
+    private String authName;
 }

+ 61 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCampaignLevelOperationRecord.java

@@ -0,0 +1,61 @@
+package cn.com.ctop.kuaishou.modules.ai.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 计划创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_ai_kuaishou_campaign_level_operation_record")
+public class AiKuaishouCampaignLevelOperationRecord {
+
+	/**计划操作表uuid*/
+	@TableId(type = IdType.ASSIGN_UUID)
+	private String campaignUuid;
+	/**AI策略ID*/
+	private String aiStrategyUuid;
+	/**账户ID*/
+	private Long accountId;
+	/**广告计划ID*/
+	private Long campaignId;
+	/**广告计划名称*/
+	private String campaignName;
+	/**计划类型 2-提升应用安装 3-获取电商下单 4-推广品牌活动 5-收集销售线索 7-提高应用活跃*/
+	private Integer campaignType;
+	/**单日预算*/
+	private Long dayBudget;
+	/**分日预算*/
+	private String dayBudgetSchedule;
+	/**操作类型 1-新增 2-修改*/
+	private Integer operationType;
+	/**计划创建时间*/
+	private Date campaignCreateTime;
+	/**计划更新时间*/
+	private Date campaignUpdateTime;
+	/**创建时间*/
+	private Date createTime;
+	/**状态*/
+	private Integer status;
+	/**状态详情*/
+	private String message;
+
+	public AiKuaishouCampaignLevelOperationRecord(AiKuaishouAdvertiserStrategy strategy, Long campaignId, Integer code, String message) {
+		this.accountId = strategy.getAccountId();
+		this.dayBudget = strategy.getCampaignDayBudget();
+		this.dayBudgetSchedule = strategy.getCampaignDayBudgetSchedule();
+		this.campaignType = strategy.getCampaignType();
+		this.campaignId = campaignId;
+		this.status = code;
+		this.message = message;
+		this.operationType = 1;
+		this.createTime = new Date();
+	}
+}

+ 0 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java


部分文件因为文件数量过多而无法显示