Selaa lähdekoodia

Merge remote-tracking branch 'origin/V1.1.7' into V1.1.7

zhaoxian 4 vuotta sitten
vanhempi
commit
49de37536e
100 muutettua tiedostoa jossa 3703 lisäystä ja 1171 poistoa
  1. 11 0
      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. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  8. 8 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/XmlUtils.java
  9. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java
  10. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialUploadController.java
  11. 50 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  12. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyGroupReportLoadJob.java
  13. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  14. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  15. 11 11
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  16. 32 98
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  17. 7 7
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java
  18. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialTagInfo.java
  19. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/enums/SceneIdEnum.java
  20. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml
  21. 1 2
      module-common/src/main/java/cn/com/ctop/common/module/service/IBindAccountLoginService.java
  22. 6 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java
  23. 3 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialAscriptionServiceImpl.java
  24. 2 4
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialTagInfoServiceImpl.java
  25. 3 3
      module-common/src/main/java/cn/com/ctop/common/module/utils/ParseInstallPackageUtil.java
  26. 4 4
      module-common/src/main/java/cn/com/ctop/common/module/utils/QueryGenerator.java
  27. 0 8
      module-common/src/main/java/cn/com/ctop/common/module/utils/RestUtils.java
  28. 4 2
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  29. 2 0
      module-common/src/main/java/com/xxl/job/core/executor/impl/XxlJobSimpleExecutor.java
  30. 1 7
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java
  31. 1 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoTttmServiceImpl.java
  32. 1 1
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/IMaterialUploadService.java
  33. 6 4
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java
  34. 0 25
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouAlarmRuleHourlyCheckJob.java
  35. 0 25
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouAlarmRuleMinuteCheckJob.java
  36. 0 69
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiAdsNewMaterialCreativityJob.java
  37. 167 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiCreativeJob.java
  38. 0 43
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAiSuzaoVideoJob.java
  39. 23 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java
  40. 149 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCampaignLevelOperationRecordController.java
  41. 172 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreateCreativeController.java
  42. 143 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreativeLevelOperationRecordController.java
  43. 143 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouProgramCreativeLevelOperationRecordController.java
  44. 143 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouUnitLevelOperationRecordController.java
  45. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java
  46. 363 188
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java
  47. 61 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCampaignLevelOperationRecord.java
  48. 87 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java
  49. 71 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouProgramCreativeLevelOperationRecord.java
  50. 167 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouUnitLevelOperationRecord.java
  51. 56 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/enums/KuaishouCreativeAdsenceTypeEnum.java
  52. 55 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/enums/KuaishouCreativeCreateTypeEnum.java
  53. 101 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/enums/KuaishouCreativeMatTypeEnum.java
  54. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouCampaignLevelOperationRecordMapper.java
  55. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouCreativeLevelOperationRecordMapper.java
  56. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouProgramCreativeLevelOperationRecordMapper.java
  57. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouUnitLevelOperationRecordMapper.java
  58. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouCampaignLevelOperationRecordMapper.xml
  59. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouCreativeLevelOperationRecordMapper.xml
  60. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouProgramCreativeLevelOperationRecordMapper.xml
  61. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouUnitLevelOperationRecordMapper.xml
  62. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaiShouAppInfoService.java
  63. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAdvertiserStrategyService.java
  64. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouCampaignLevelOperationRecordService.java
  65. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouCreateCreativeService.java
  66. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouCreativeLevelOperationRecordService.java
  67. 0 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouNewCreateCampaign.java
  68. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouProgramCreativeLevelOperationRecordService.java
  69. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouUnitLevelOperationRecordService.java
  70. 3 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiCreativeLimitServiceImpl.java
  71. 13 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaiShouAppInfoServiceImpl.java
  72. 66 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAdvertiserStrategyServiceImpl.java
  73. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCampaignLevelOperationRecordServiceImpl.java
  74. 1179 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java
  75. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreativeLevelOperationRecordServiceImpl.java
  76. 0 480
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouNewCreateCampaignServiceImpl.java
  77. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProgramCreativeLevelOperationRecordServiceImpl.java
  78. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouUnitLevelOperationRecordServiceImpl.java
  79. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiStrategyServiceImpl.java
  80. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouVideoLastTimeServiceImpl.java
  81. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/Enums/CampaignTypeEnum.java
  82. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouBatchCampaignPreviewController.java
  83. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java
  84. 70 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml
  85. 5 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  86. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  87. 0 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java
  88. 25 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  89. 5 6
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouBatchCampaignPreviewServiceImpl.java
  90. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouCampaignCopyDataServiceImpl.java
  91. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouStrategyServiceImpl.java
  92. 2 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/EtlKuaishouVideoInfoServiceImpl.java
  93. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouGroupDailyReport.java
  94. 0 18
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouAgentAccount.java
  95. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccount.java
  96. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyGroup.java
  97. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyAccount.java
  98. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouGroupDailyReportMapper.xml
  99. 1 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml
  100. 0 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

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

@@ -115,6 +115,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();
@@ -434,6 +441,10 @@ public class DateUtils extends PropertyEditorSupport {
         return datetimeFormat.get().format(getCalendar().getTime());
     }
 
+    public static String formatDateTime(Long time) {
+        return datetimeFormat.get().format(time);
+    }
+
     /**
      * 获取时间字符串
      */

+ 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()) {

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

@@ -184,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");
@@ -192,6 +195,7 @@ 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");
 

+ 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);

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

@@ -106,6 +106,7 @@ public class AiKuaishouAdvertiserStrategyController {
             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));
@@ -263,4 +264,9 @@ public class AiKuaishouAdvertiserStrategyController {
     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);
+    }
 }

+ 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;
     }
+
+
 }

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

@@ -9,21 +9,23 @@ 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.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.service.*;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyService;
 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.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -31,12 +33,7 @@ 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.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.io.IOException;
@@ -96,43 +93,23 @@ public class TestController {
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
 
     static ExecutorService executorService = Executors.newFixedThreadPool(15);
-    static ExecutorService videoService = Executors.newFixedThreadPool(5);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
     @Autowired
     private IKuaiShouDailyAgentService dailyAgentService;
     @Autowired
     private IKuaishouTemplateService templateService;
     @Autowired
-    private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
-    @Resource
-    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
-    @Autowired
     private ICtopOauthTokenService ctopOauthTokenService;
-
     @Autowired
     private IBindAccountAuthService bindAccountAuthService;
     @Resource
     private UserAllocationMapper allocationMapper;
     @Autowired
     private IBytedanceReportService bytedanceReportService;
-
     @Autowired
     private IUserAllocationService allocationService;
     @Autowired
-    private IEtlKuaiShouNewlyService kuaiShouNewlyService;
-    static ExecutorService materialExecutorService = Executors.newFixedThreadPool(8);
-
-    @Autowired
     private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IEtlKuaiShouGroupDailyReportService etlKuaiShouGroupDailyReportService;
-    @Autowired
-    private IEtlKuaiShouAccountMaterialOverviewService accountMaterialOverviewService;
-
-    @Autowired
-    private IEtlKuaiShouNewlyService newlyService;
-    @Autowired
-    private IKuaishouReportDailyGroupService reportDailyGroupService;
 
 
     @GetMapping("/cleanNewlyData")
@@ -298,11 +275,6 @@ public class TestController {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-//        bytedanceReportMaterialDailyMapper.updateImageReportCode();
-//        bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
-//        bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
-//        bytedanceReportMaterialDailyMapper.updateImageReportPlaneId();
-//        bytedanceReportMaterialDailyMapper.updateImageReportPlaneName();
         Map<String, Object> result = new HashMap<>();
         ResultMapUtils.setResultMap(new HashMap<>(), StatusCode.COMMON_SUCCESS);
         return result;
@@ -546,7 +518,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) {
@@ -1277,4 +1248,48 @@ public class TestController {
         }));
         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;
+    }
 }

+ 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();
-
-    }
-}

+ 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);

+ 3 - 1
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);
@@ -358,6 +359,7 @@ public class SysUserController {
                 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());

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

@@ -95,21 +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://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+#          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.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+#          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

+ 32 - 98
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -7,10 +7,10 @@ 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.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
+import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
@@ -18,7 +18,6 @@ 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.report.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -43,7 +42,7 @@ 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
@@ -157,6 +156,15 @@ public class SampleTest {
         }
     }
 
+    @Test
+    public void loadKuaishouCamgaignData(){
+        Date getDate = DateUtils.parseDate("2021-03-24","yyyy-MM-dd");
+        List<UserAllocation> list = allocationService.getByParams(50L,null,0);
+        list.forEach(userAllocation -> {
+            CtopOauthToken token = tokenService.getOauthTokenByAccountId(userAllocation.getAccountId().toString());
+            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
+        });
+    }
     static ExecutorService executorService = null;
     static CountDownLatch countDownLatch = null;
 
@@ -425,11 +433,21 @@ public class SampleTest {
     }
 
     @Autowired
-    private IRuleKuaiShouPlanService ruleKuaiShouPlanService;
-
+    private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
+    @Autowired
+    IBytedanceVideoReportService bytedanceVideoReportService;
+    @Autowired
+    IETLReportBytedanceVideoService ietlReportBytedanceVideoService;
+    @Autowired
+    IKuaishouReportDailyImageService kuaishouReportDailyImageService;
+    @Autowired
+    IRuleByteDanceAccountService ruleByteDanceAccountService;
+    @Autowired
+    private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
     @Autowired
     private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
 
+
     @Test
     public void execute() {
         List<UserAllocation> allocations = allocationService.listByMediaId("3", 0);
@@ -445,28 +463,16 @@ public class SampleTest {
 
     @Test
     public void loadBDAccoutData() {
-        CtopOauthToken token2 = tokenService.getTokenByAccountId(1674206482908163L);
-        bytedanceReportService.bytedanceMaterialReport(token2, "2020-10-14", "2020-10-14");
+        Date startDate = DateUtils.addDay(new Date(),-2000);
+        for(int i=0;i<=2000;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
+        }
     }
 
-    @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() {
@@ -479,9 +485,6 @@ public class SampleTest {
         }
     }
 
-    @Autowired
-    private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
-
     @Test
     public void loadBytedanceVideo() {
         CtopOauthToken token = tokenService.getTokenByAccountId(1673731601820686L);
@@ -501,83 +504,17 @@ public class SampleTest {
     }
 
 
-    @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 accountIds = "1675440464386062";
         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;
-
     @Test
     public void loadKuaiShouImage() {
         List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
@@ -612,14 +549,11 @@ public class SampleTest {
 
     @Autowired
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
-
+    @Resource
+    private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
     @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)));
-        }
+        etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
     }
 
 

+ 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));
                                 }
                             }

+ 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();
 	}

+ 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;
             }
         }

+ 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 - 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

+ 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) {

+ 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");

+ 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");
-//    }
-//}
-//

+ 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));
-    }
-}

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

@@ -0,0 +1,167 @@
+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.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 {
+    @Autowired
+    private IAiKuaishouAdvertiserStrategyService strategyService;
+
+    /**
+     * 自定义上新创意
+     */
+    @XxlJob("kuaishouCustomCreativeAuto")
+    public void kuaishouCustomCreativeAuto() {
+        List<AiKuaishouAdvertiserStrategy> strategies = strategyService.getAllEffectStrategy();
+        if (null == strategies || strategies.isEmpty()) {
+            return;
+        }
+        String url = "http://api.tjyourong.com.cn/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 = "http://api.tjyourong.com.cn/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 = "http://api.tjyourong.com.cn/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 = "http://api.tjyourong.com.cn/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);
-        });
-    }
-}

+ 23 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java

@@ -1,11 +1,16 @@
 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 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;
+
 /**
  * 账户维度-盯盘每日数据
  *
@@ -16,6 +21,10 @@ public class KuaishouDailyAccountReportLoadEtlJob {
 
     @Autowired
     private IEtlKuaishouReportAccountDailyService iEtlKuaishouReportAccountDailyService;
+    @Autowired
+    private IEtlKuaishouAccountMaterialReportDailyService etlKuaishouAccountMaterialReportDailyService;
+    @Resource
+    private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
 
     @XxlJob("kuaishouDailyAccountReportLoadEtl")
     public void execute() throws Exception {
@@ -26,4 +35,18 @@ public class KuaishouDailyAccountReportLoadEtlJob {
             XxlJobHelper.log(e.getMessage());
         }
     }
+
+    /**
+     * 快手账户素材数据清洗任务
+     * @throws Exception
+     */
+    @XxlJob("etlKuaishouAccountMaterialReportDailyData")
+    public void etlKuaishouAccountMaterialReportDailyData() throws Exception {
+        try {
+            etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
+            XxlJobHelper.log("queryEveryDayDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
 }

+ 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)) {

+ 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();
+	}
+}

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

@@ -0,0 +1,87 @@
+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_creative_level_operation_record")
+public class AiKuaishouCreativeLevelOperationRecord {
+
+	/**创意操作表uuid*/
+	@TableId(type = IdType.ASSIGN_UUID)
+	private String creativeUuid;
+	/**AI策略ID*/
+	private String aiStrategyUuid;
+	/**账户ID*/
+	private Long accountId;
+	/**广告计划ID*/
+	private Long campaignId;
+	/**广告组ID*/
+	private Long unitId;
+	/**广告创意ID*/
+	private Long creativeId;
+	/**是否为便利贴,默认为0*/
+	private Integer isSticky;
+	/**创意名称*/
+	private String creativeName;
+	/**视频ID*/
+	private String photoId;
+	/**封面md5*/
+	private String imageMd5;
+	/**封面图片token*/
+	private String imageToken;
+	/**素材类型*/
+	private Integer creativeMaterialType;
+	/**便利贴单图图片创意token*/
+	private String imageTokens;
+	/**行动号召按钮文案*/
+	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 String adPhotoPlayedT3sUrl;
+	/**第三方点击按钮监测链接*/
+	private String actionbarClickUrl;
+	/**创意分类*/
+	private Integer creativeCategory;
+	/**创意标签*/
+	private String creativeTag;
+	/**操作类型 1-新增 2-修改*/
+	private Integer operationType;
+	/**创意创建时间*/
+	private Date creativeCreateTime;
+	/**创意更新时间*/
+	private Date creativeUpdateTime;
+	/**创建时间*/
+	private Date createTime;
+	/**状态*/
+	private Integer status;
+	/**状态详情*/
+	private String message;
+}

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

@@ -0,0 +1,71 @@
+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_program_creative_level_operation_record")
+public class AiKuaishouProgramCreativeLevelOperationRecord {
+
+	/**程序化创意操作表uuid*/
+	@TableId(type = IdType.ASSIGN_UUID)
+	private String creativeUuid;
+	/**AI策略ID*/
+	private String aiStrategyUuid;
+	/**账户ID*/
+	private Integer accountId;
+	/**广告计划ID*/
+	private Integer campaignId;
+	/**广告组ID*/
+	private Integer unitId;
+	/**是否为便利贴,默认为0*/
+	private Integer isSticky;
+	/**程序化创意名称*/
+	private String packageName;
+	/**横版视频ID list*/
+	private String horizontalPhotoIds;
+	/**竖版视频ID list*/
+	private String verticalPhotoIds;
+	/**封面list image_token*/
+	private String coverImageTokens;
+	/**落地页ID*/
+	private Integer siteId;
+	/**封面贴纸*/
+	private String stickerStyles;
+	/**封面广告语*/
+	private String coverSlogans;
+	/**行动号召按钮*/
+	private String actionBar;
+	/**作品广告语*/
+	private String captions;
+	/**第三方点击检测链接*/
+	private String clickUrl;
+	/**第三方点击检测链接*/
+	private String actionbarClickUrl;
+	/**创意分类*/
+	private Integer creativeCategory;
+	/**创意标签*/
+	private String creativeTag;
+	/**状态值 1-已提交等待回调 0-创建成功 */
+	private Integer status;
+	/**状态详情*/
+	private String message;
+	/**操作类型 1-新增 2-修改*/
+	private Integer operationType;
+	/**创意创建时间*/
+	private Date creativeCreateTime;
+	/**创意更新时间*/
+	private Date creativeUpdateTime;
+	/**创建时间*/
+	private Date createTime;
+}

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

@@ -0,0 +1,167 @@
+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_unit_level_operation_record")
+public class AiKuaishouUnitLevelOperationRecord {
+
+	/**组操作表uuid*/
+	@TableId(type = IdType.ASSIGN_UUID)
+	private String groupUuid;
+	/**AI策略ID*/
+	private String aiStrategyUuid;
+	/**账户ID*/
+	private Long accountId;
+	/**广告计划ID*/
+	private Long campaignId;
+	/**广告组ID*/
+	private Long unitId;
+	/**广告组名称*/
+	private String groupName;
+	/**定向模板id*/
+	private Integer templateId;
+	/**优化目标出价类型*/
+	private Integer bidType;
+	/**优先从系统应用商店下载*/
+	private Integer useAppMarket;
+	/**应用商店列表*/
+	private String appStore;
+	/**出价*/
+	private Integer bid;
+	/**出价*/
+	private Integer cpaBid;
+	/**优先低成本出价*/
+	private Integer smartBid;
+	/**优化目标*/
+	private Integer ocpxActionType;
+	/**深度转化目标*/
+	private Integer deepConversionType;
+	/**付费ROI系数*/
+	private Float roiRatio;
+	/**资源位置*/
+	private String sceneId;
+	/** 创意制作方式*/
+	private Integer unitType;
+	/**投放开始时间*/
+	private String beginTime;
+	/**投放结束时间*/
+	private String endTime;
+	/**投放时间段*/
+	private String scheduleTime;
+	/**单日预算*/
+	private Integer dayBudget;
+	/**分日预算*/
+	private String dayBudgetSchedule;
+	/**转化目标ID*/
+	private Integer convertId;
+	/**url类型*/
+	private Integer urlType;
+	/**url类型*/
+	private Integer webUriType;
+	/**投放链接*/
+	private String url;
+	/**调起链接*/
+	private String schemaUri;
+	/**应用ID*/
+	private Integer appId;
+	/**创意展现方式*/
+	private Integer showMode;
+	/**投放方式*/
+	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;
+	/**操作类型 1-新增 2-修改*/
+	private Integer operationType;
+	/**组创建时间*/
+	private Date groupCreateTime;
+	/**组更新时间*/
+	private Date groupUpdateTime;
+	/**创建时间*/
+	private Date createTime;
+	/**状态*/
+	private Integer status;
+	/**状态详情*/
+	private String message;
+	/**程序化创意2.0-是否开启智能抽帧*/
+	private Integer smartCover;
+	/**程序化创意2.0-是否开启素材挖掘*/
+	private Integer assetMining;
+	/**深度转化目标出价*/
+	private Integer deepConversionBid;
+}

+ 56 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/enums/KuaishouCreativeAdsenceTypeEnum.java

@@ -0,0 +1,56 @@
+package cn.com.ctop.kuaishou.modules.ai.enums;
+
+/**
+ * @author syh
+ */
+public enum KuaishouCreativeAdsenceTypeEnum {
+    /**
+     * 快手广告组投放资源位置
+     */
+    KUAISHOU_CREATIVE_ADSENCE_TYPE_ENUM_SELECT(1,"优选"),
+    KUAISHOU_CREATIVE_ADSENCE_TYPE_ENUM_STICKY(3,"便利贴"),
+    KUAISHOU_CREATIVE_ADSENCE_TYPE_ENUM_ALLIANCE(5,"联盟"),
+    KUAISHOU_CREATIVE_ADSENCE_TYPE_ENUM_SCREEN(6,"上下滑"),
+    KUAISHOU_CREATIVE_ADSENCE_TYPE_ENUM_FEEDS(7,"信息流"),
+    KUAISHOU_CREATIVE_ADSENCE_TYPE_ENUM_ALLIANCE_SCENCE(10,"联盟场景");
+
+    /**
+     * 类型
+     */
+    private Integer type;
+    /**
+     * 名称
+     */
+    private String name;
+
+    KuaishouCreativeAdsenceTypeEnum(Integer type, String name) {
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type) {
+        for (KuaishouCreativeAdsenceTypeEnum createTypeEnum : KuaishouCreativeAdsenceTypeEnum.values()) {
+            if (createTypeEnum.getType().equals(type)) {
+                return createTypeEnum.getName();
+            }
+        }
+        return "";
+    }
+
+
+    public Integer getType() {
+        return this.type;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public void setName(String value) {
+        this.name = value;
+    }
+}

+ 55 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/enums/KuaishouCreativeCreateTypeEnum.java

@@ -0,0 +1,55 @@
+package cn.com.ctop.kuaishou.modules.ai.enums;
+
+import cn.com.ctop.kuaishou.modules.batch.Enums.CampaignTypeEnum;
+
+/**
+ * @author syh
+ */
+public enum KuaishouCreativeCreateTypeEnum {
+    /**
+     * 快手创意创建方式
+     */
+    KUAISHOU_CREATIVE_CREATETYPE_ENUM_PROGRAM(1,"程序化"),
+    KUAISHOU_CREATIVE_CREATETYPE_ENUM_UNLIMITED(2,"不限"),
+    KUAISHOU_CREATIVE_CREATETYPE_ENUM_CUSTOM(0,"自定义");
+
+    /**
+     * 类型
+     */
+    private Integer type;
+    /**
+     * 名称
+     */
+    private String value;
+
+    KuaishouCreativeCreateTypeEnum(Integer type, String value) {
+        this.type = type;
+        this.value = value;
+    }
+
+    public static String getNameByType(Integer type) {
+        for (KuaishouCreativeCreateTypeEnum createTypeEnum : KuaishouCreativeCreateTypeEnum.values()) {
+            if (createTypeEnum.getType().equals(type)) {
+                return createTypeEnum.getValue();
+            }
+        }
+        return "";
+    }
+
+
+    public Integer getType() {
+        return type;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

+ 101 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/enums/KuaishouCreativeMatTypeEnum.java

@@ -0,0 +1,101 @@
+package cn.com.ctop.kuaishou.modules.ai.enums;
+
+/**
+ * @author syh
+ */
+public enum KuaishouCreativeMatTypeEnum {
+    /**
+     * 13 23 分别是历史遗漏素材,归类到上新素材中
+     * type字段 第一位创意创建方式,第二位素材获取方式
+     * 快手创意素材获取类型
+     */
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_NEW("41","自定义上新",-10L,-5L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_HIGH_quality("42","自定义高质量",-14*60*24L,-1*60*24L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_MISSING("43","自定义上新",-60*60*24L,-1*60*24L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_HISTORY("44","自定义历史",-60*60*24L,-1*60*24L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_NEW("71","程序化上新",-1*60*24L,-5L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_HIGH_quality("72","程序化高质量",-14*60*24L,-1*60*24L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_MISSING("73","程序化上新",-60*60*24L,-1*60*24L),
+    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_HISTORY("74","程序化历史",-60*60*24L,-1*60*24L),;
+
+    /**
+     * 类型
+     */
+    private String type;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 素材查询的时间区间
+     */
+    private Long videoGetStartTime;
+    private Long videoGetEndTime;
+
+    KuaishouCreativeMatTypeEnum(String type, String name,Long videoGetStartTime,Long videoGetEndTime) {
+        this.type = type;
+        this.name = name;
+        this.videoGetStartTime = videoGetStartTime;
+        this.videoGetEndTime = videoGetEndTime;
+    }
+
+    public static String getNameByType(String type) {
+        for (KuaishouCreativeMatTypeEnum createTypeEnum : KuaishouCreativeMatTypeEnum.values()) {
+            if (createTypeEnum.getType().equals(type)) {
+                return createTypeEnum.getName();
+            }
+        }
+        return "";
+    }
+
+    public static Long getStartTimeByType(String type) {
+        for (KuaishouCreativeMatTypeEnum createTypeEnum : KuaishouCreativeMatTypeEnum.values()) {
+            if (createTypeEnum.getType().equals(type)) {
+                return createTypeEnum.getVideoGetStartTime();
+            }
+        }
+        return -10L;
+    }
+
+    public static Long getEndTimeByType(String type) {
+        for (KuaishouCreativeMatTypeEnum createTypeEnum : KuaishouCreativeMatTypeEnum.values()) {
+            if (createTypeEnum.getType().equals(type)) {
+                return createTypeEnum.getVideoGetEndTime();
+            }
+        }
+        return -5L;
+    }
+
+
+    public String getType() {
+        return this.type;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    public Long getVideoGetStartTime() {
+        return videoGetStartTime;
+    }
+
+    public void setVideoGetStartTime(Long videoGetStartTime) {
+        this.videoGetStartTime = videoGetStartTime;
+    }
+
+    public Long getVideoGetEndTime() {
+        return videoGetEndTime;
+    }
+
+    public void setVideoGetEndTime(Long videoGetEndTime) {
+        this.videoGetEndTime = videoGetEndTime;
+    }
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouCampaignLevelOperationRecordMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCampaignLevelOperationRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 计划创建记录
+ * @author: jeecg-boot
+ * @date:   2021-04-12
+ * @cersion: V1.0
+ */
+public interface AiKuaishouCampaignLevelOperationRecordMapper extends BaseMapper<AiKuaishouCampaignLevelOperationRecord> {
+
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouCreativeLevelOperationRecordMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCreativeLevelOperationRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 自定义创意创建记录
+ * @author: jeecg-boot
+ * @date:   2021-04-12
+ * @cersion: V1.0
+ */
+public interface AiKuaishouCreativeLevelOperationRecordMapper extends BaseMapper<AiKuaishouCreativeLevelOperationRecord> {
+
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouProgramCreativeLevelOperationRecordMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouProgramCreativeLevelOperationRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 程序换创意创建记录
+ * @author: jeecg-boot
+ * @date:   2021-04-12
+ * @cersion: V1.0
+ */
+public interface AiKuaishouProgramCreativeLevelOperationRecordMapper extends BaseMapper<AiKuaishouProgramCreativeLevelOperationRecord> {
+
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouUnitLevelOperationRecordMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 组创建记录
+ * @author: jeecg-boot
+ * @date:   2021-04-12
+ * @cersion: V1.0
+ */
+public interface AiKuaishouUnitLevelOperationRecordMapper extends BaseMapper<AiKuaishouUnitLevelOperationRecord> {
+
+}

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouCampaignLevelOperationRecordMapper.xml

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

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouCreativeLevelOperationRecordMapper.xml

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

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouProgramCreativeLevelOperationRecordMapper.xml

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

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouUnitLevelOperationRecordMapper.xml

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

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

@@ -19,4 +19,5 @@ public interface IAiKuaiShouAppInfoService extends IService<AiKuaiShouAppInfo> {
 
     void appCreative(Long accountId, String accessToken);
 
+    AiKuaiShouAppInfo getByParams(Long accountId,Long appId);
 }

+ 10 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAdvertiserStrategyService.java

@@ -3,6 +3,7 @@ package cn.com.ctop.kuaishou.modules.ai.service;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -16,4 +17,13 @@ public interface IAiKuaishouAdvertiserStrategyService extends IService<AiKuaisho
     AiKuaishouAdvertiserStrategy getByAccountId(Long accountId);
 
     Map<String, Object> testCreate(Long accountId);
+
+    /**
+     * 补充历史遗漏素材
+     * @param accountId
+     * @return
+     */
+    Map<String, Object> aiHistoricalMissingMaterial(Long accountId);
+
+    List<AiKuaishouAdvertiserStrategy> getAllEffectStrategy();
 }

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouCampaignLevelOperationRecordService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCampaignLevelOperationRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 计划创建记录
+ * @Author: jeecg-boot
+ * @Date:   2021-04-12
+ * @Version: V1.0
+ */
+public interface IAiKuaishouCampaignLevelOperationRecordService extends IService<AiKuaishouCampaignLevelOperationRecord> {
+
+}
+

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouCreateCreativeService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
+
+import java.text.ParseException;
+
+public interface IAiKuaishouCreateCreativeService {
+    Long autoCreateCreative(AiKuaishouAdvertiserStrategy strategy, Integer createType, Long videoCnt);
+
+    void autoCreateProgramCreative(AiKuaishouAdvertiserStrategy strategy,Integer createType,Long videoCnt);
+
+    void customCreativeSupplement(AiKuaishouAdvertiserStrategy strategy,Integer hour) throws ParseException;
+
+    void customCreativeLimit(AiKuaishouAdvertiserStrategy strategy);
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouCreativeLevelOperationRecordService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCreativeLevelOperationRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 自定义创意创建记录
+ * @Author: jeecg-boot
+ * @Date:   2021-04-12
+ * @Version: V1.0
+ */
+public interface IAiKuaishouCreativeLevelOperationRecordService extends IService<AiKuaishouCreativeLevelOperationRecord> {
+
+}

+ 0 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouNewCreateCampaign.java

@@ -1,11 +0,0 @@
-package cn.com.ctop.kuaishou.modules.ai.service;
-
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
-
-public interface IAiKuaishouNewCreateCampaign {
-    void kuaishouAiAdsNewMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate);
-
-    void kuaishouAiAdsHotMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate);
-
-    void kuaishouAiAddNewMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate,Integer matNum);
-}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouProgramCreativeLevelOperationRecordService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouProgramCreativeLevelOperationRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 程序换创意创建记录
+ * @Author: jeecg-boot
+ * @Date:   2021-04-12
+ * @Version: V1.0
+ */
+public interface IAiKuaishouProgramCreativeLevelOperationRecordService extends IService<AiKuaishouProgramCreativeLevelOperationRecord> {
+
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouUnitLevelOperationRecordService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 组创建记录
+ * @Author: jeecg-boot
+ * @Date:   2021-04-12
+ * @Version: V1.0
+ */
+public interface IAiKuaishouUnitLevelOperationRecordService extends IService<AiKuaishouUnitLevelOperationRecord> {
+
+}

+ 3 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiCreativeLimitServiceImpl.java

@@ -4,9 +4,10 @@ import cn.com.ctop.kuaishou.modules.ai.entity.AiCreativeLimit;
 import cn.com.ctop.kuaishou.modules.ai.mapper.AiCreativeLimitMapper;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiCreativeLimitService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+
 /**
  * 关联数超限
  *
@@ -16,7 +17,7 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class AiCreativeLimitServiceImpl extends ServiceImpl<AiCreativeLimitMapper, AiCreativeLimit> implements IAiCreativeLimitService {
-    @Autowired
+    @Resource
     private AiCreativeLimitMapper creativeLimitMapper;
 
     @Override

+ 13 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaiShouAppInfoServiceImpl.java

@@ -192,6 +192,19 @@ public class AiKuaiShouAppInfoServiceImpl extends ServiceImpl<AiKuaiShouAppInfoM
         }
     }
 
+    @Override
+    public AiKuaiShouAppInfo getByParams(Long accountId,Long appId) {
+        QueryWrapper<AiKuaiShouAppInfo>queryWrapper = new QueryWrapper<>();
+        if(null!=accountId&&accountId!=0){
+            queryWrapper.eq("account_id",accountId);
+        }
+        if(null!=appId&&appId!=0){
+            queryWrapper.eq("app_id",appId);
+        }
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+
 
     private List<AiKuaiShouAppInfo> getAppListByStatus(Long accountId, Integer status) {
         QueryWrapper<AiKuaiShouAppInfo> queryWrapper = new QueryWrapper<>();

+ 66 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAdvertiserStrategyServiceImpl.java

@@ -2,12 +2,15 @@ package cn.com.ctop.kuaishou.modules.ai.service.impl;
 
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouAdvertiserStrategyMapper;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -29,6 +33,11 @@ public class AiKuaishouAdvertiserStrategyServiceImpl extends ServiceImpl<AiKuais
     public static final String TEST_PROGRAM_CREATIVE_URL= "http://139.186.27.96:31012/ai_programme_new_material";
     @Autowired
     private IUserAllocationService userAllocationService;
+    @Autowired
+    private IKuaiShouVideoGetService videoGetService;
+    @Autowired
+    private IKuaishouVideoRelateCreativesService relateCreativesService;
+
     @Override
     public AiKuaishouAdvertiserStrategy getByAccountId(Long accountId) {
         QueryWrapper<AiKuaishouAdvertiserStrategy>queryWrapper =new QueryWrapper<>();
@@ -72,4 +81,61 @@ public class AiKuaishouAdvertiserStrategyServiceImpl extends ServiceImpl<AiKuais
         result.put("message",message);
         return result;
     }
+    @Override
+    public Map<String, Object> aiHistoricalMissingMaterial(Long accountId) {
+        Map<String,Object>result = new HashMap<>();
+        if(null == accountId||accountId == 0){
+            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        AiKuaishouAdvertiserStrategy strategy = this.getByAccountId(accountId);
+        if(null == strategy||strategy.getStatus()!=1){
+            ResultMapUtils.setResultMap(result,StatusCode.KUAISHOU_AI_STRATEGY_HAS_NOT_EXIST);
+            return result;
+        }
+        this.historicalMissingMaterialCreateCreative(strategy);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Override
+    public List<AiKuaishouAdvertiserStrategy> getAllEffectStrategy() {
+        QueryWrapper<AiKuaishouAdvertiserStrategy>queryWrapper= new QueryWrapper<>();
+        queryWrapper.eq("status",1);
+        queryWrapper.orderByDesc("id");
+        return this.list(queryWrapper);
+    }
+
+    private Map<String,Object> historicalMissingMaterialCreateCreative(AiKuaishouAdvertiserStrategy strategy) {
+        Map<String,Object>result =new HashMap<>();
+        //判定是否单一应用
+        if(strategy.getSingleAppid()==1){
+            //TODO 参数拼接
+            Map<String,Object>params =new HashMap<>();
+            //1:直接查询历史素材
+            List<JSONObject> materialList = relateCreativesService.getVideoZeroListByMap(params);
+            if (Check.isNull(materialList)) {
+                ResultMapUtils.setResultMap(result,StatusCode.KUAISHOU_AI_STRATEGY_HAS_NO_HISTORY_MATERIAL);
+                return result;
+            }
+            materialList = videoGetService.getVideoInfoAndImageList(materialList);
+            //补充遗漏素材
+            JSONObject hisMatParams = formatHisMatParams(strategy,materialList,"补充遗漏素材");
+        }else{
+            //
+
+        }
+        return result;
+    }
+
+    private JSONObject formatHisMatParams(AiKuaishouAdvertiserStrategy strategy, List<JSONObject> materialList, String fixString) {
+        JSONObject result = new JSONObject();
+        result.put("video",materialList);
+        result.put("operation_type",1);
+        result.put("account_id",strategy.getAccountId());
+        result.put("ai_strategy_remark",fixString);
+
+        return result;
+    }
+
 }

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCampaignLevelOperationRecordServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCampaignLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouCampaignLevelOperationRecordMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCampaignLevelOperationRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 计划创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Service
+public class AiKuaishouCampaignLevelOperationRecordServiceImpl extends ServiceImpl<AiKuaishouCampaignLevelOperationRecordMapper, AiKuaishouCampaignLevelOperationRecord> implements IAiKuaishouCampaignLevelOperationRecordService {
+
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1179 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java


+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreativeLevelOperationRecordServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCreativeLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouCreativeLevelOperationRecordMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreativeLevelOperationRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 自定义创意创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Service
+public class AiKuaishouCreativeLevelOperationRecordServiceImpl extends ServiceImpl<AiKuaishouCreativeLevelOperationRecordMapper, AiKuaishouCreativeLevelOperationRecord> implements IAiKuaishouCreativeLevelOperationRecordService {
+
+}

+ 0 - 480
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouNewCreateCampaignServiceImpl.java

@@ -1,480 +0,0 @@
-package cn.com.ctop.kuaishou.modules.ai.service.impl;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.MaterialCutFrame;
-import cn.com.ctop.common.module.entity.MaterialImageInfo;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IMaterialCutFrameService;
-import cn.com.ctop.common.module.service.IMaterialImageInfoService;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouStrategyMapCreative;
-import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountCreativeOverrunInfo;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouStrategyMapCreativeService;
-import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountCreativeOverrunInfoService;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouVideoRelateCreatives;
-import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouVideoGetMapper;
-import cn.com.ctop.kuaishou.modules.batch.service.*;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.jeecg.common.util.JsonResourceUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-@Service
-@Slf4j
-public class AiKuaishouNewCreateCampaignServiceImpl implements IAiKuaishouNewCreateCampaign {
-
-    @Autowired
-    private IKuaiShouVideoGetService videoGetService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IAiKuaishouStrategyMapCreativeService mapCreativeService;
-    @Autowired
-    private IMaterialCutFrameService materialCutFrameService;
-    @Autowired
-    private IMaterialImageInfoService materialImageInfoService;
-    @Autowired
-    private IKuaiShouImageGetService imageGetService;
-    @Autowired
-    private IKuaiShouMaterialUploadService materialUploadService;
-    @Resource
-    private KuaiShouVideoGetMapper videoGetMapper;
-    @Autowired
-    private IKuaishouVideoRelateCreativesService relateCreativesService;
-    @Autowired
-    private IKuaishouAccountCreativeOverrunInfoService overrunInfoService;
-
-    @Override
-    public void kuaishouAiAdsNewMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate) {
-        Long accountId = targetTemplate.getAccountId();
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
-        if(null == token){
-            log.info("token获取失败=>accountId:{}",accountId);
-            return;
-        }
-
-        // 2、执行素材的同步数据服务
-        // 2.1 执行 非素造的 视频拉取服务,时间过滤支持 yyyy-MM-dd, 拉取当天凌晨到此刻的数据
-        kuaishouInterfaceService.getVideoList(token, DateUtils.date2Str(),DateUtils.date2Str());
-
-        // 2.2 执行 素造的 视频拉取服务,时间过滤执行 yyyy-MM-dd HH:mm:ss
-        // 时间差,单位为分钟
-        int timeStart = -10;
-        int timeEnd = -5;
-        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");
-        // 3、获取5分钟内,ctop_kuaishou_video_get 的视频数据,记为 N,如果有数据则执行下面步骤
-        List<KuaiShouVideoGet> newVideos = videoGetService.getNewVideoBetweenTime(accountId,startTime,endTime);
-        int newVideosCnt = newVideos.size();
-        if (newVideosCnt == 0){
-            log.info("账户:{},{} 到 {} 这段时间没有上新素材",accountId, startTime, endTime);
-            return;
-        }
-
-        //2、判断该账户下当天有没有“上新”计划,没有则创建一个“上新”计划
-        // time_filter_type 传入 "start_date",与 "end_date" 字段,且此字段为1时,按照创建时间进行筛选
-        JSONArray campaignList = kuaishouInterfaceService.getCampaignList(token, new Date(), new Date(),1);
-        boolean isHaveNewCampaign = false;
-        Long newCampaignId = 0L;
-        if (null!=campaignList&&campaignList.size()>0){
-            for(int i = 0;i<campaignList.size();i++){
-                JSONObject jsonObject = campaignList.getJSONObject(i);
-                if (jsonObject.getString("campaign_name").contains("素材上新")){
-                    isHaveNewCampaign = true;
-                    newCampaignId = jsonObject.getLong("campaign_id");
-                    break;
-                }
-            }
-        }
-        // 不存在“上新”计划,则创建一个计划
-        if (!isHaveNewCampaign){
-            Date campaignDate = new Date();
-            String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
-            JSONObject campaignParams = new JSONObject();
-            campaignParams.put("advertiser_id",token.getAccountId());
-            String campaignName = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
-            campaignParams.put("campaign_name",campaignName);
-            campaignParams.put("type",Integer.parseInt(targetTemplate.getMarketingGoal()));
-            campaignParams.put("day_budget",0L);
-            Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
-            Integer code = (Integer) campaignCreateResult.get("code");
-            String message = (String) campaignCreateResult.get("message");
-            if(code != 0 ){
-                log.info("计划创建失败=>message:{}",message);
-                return;
-            }
-            newCampaignId = (Long) campaignCreateResult.get("campaignId");
-        }
-
-        //3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
-        String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
-        String unitNamePrefix = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
-        int unitCnt = 0;
-        for(KuaiShouVideoGet videoItem: newVideos){
-            KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
-            if(null!=overrunInfo){
-                return;
-            }
-            unitCnt ++;
-            String unitName = unitNamePrefix + "-" + unitCnt;
-            JSONObject unitParams = createUnitParams(token, newCampaignId, targetTemplate, unitName);
-            Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
-            Integer unitCode = (Integer) unitCreateResult.get("code");
-            String unitMessage = (String) unitCreateResult.get("message");
-            if(unitCode != 0 ){
-                log.info("组创建失败=>accountId:{};message:{}",accountId,unitMessage);
-                continue;
-            }
-            Long unitId = (Long) unitCreateResult.get("unitId");
-
-            // 每个组,搭配5个创意
-            List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
-            List<MaterialImageInfo> orgFrameList = materialImageInfoService.getListByVideoSignature(videoItem.getSignature());
-            if ((null == cutFrameList||cutFrameList.isEmpty())&&(null == orgFrameList|| orgFrameList.isEmpty())){
-                log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
-                continue;
-            }
-            JSONObject creativeParams = creativeParams(token, unitId, videoItem, targetTemplate);
-            createCreativeByImage(cutFrameList, orgFrameList,token, creativeParams, newCampaignId, unitId, videoItem,targetTemplate.getImageNumber());
-        }
-    }
-
-    @Override
-    public void kuaishouAiAdsHotMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate) {
-        Long accountId = targetTemplate.getAccountId();
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
-        if(null == token){
-            log.info("token获取失败=>accountId:{}",accountId);
-            return;
-        }
-
-        int days = 14;
-        int highQualityVideoCnt = 100;
-        List<KuaiShouVideoGet>highQualityVideos = videoGetMapper.getHighQualityVideo(accountId,days,highQualityVideoCnt);
-        if (null == highQualityVideos||highQualityVideos.isEmpty()){
-            log.info("此项目下无视频");
-            return;
-        }
-
-        JSONArray campaignList = kuaishouInterfaceService.getCampaignList(token, new Date(), new Date(),1);
-        boolean isHaveHotCampaign = false;
-        Long newCampaignId = 0L;
-        if (null!=campaignList&&campaignList.size()>0){
-            for(int i = 0;i<campaignList.size();i++){
-                JSONObject jsonObject = campaignList.getJSONObject(i);
-                if (jsonObject.getString("campaign_name").contains("爆量素材")){
-                    isHaveHotCampaign = true;
-                    newCampaignId = jsonObject.getLong("campaign_id");
-                    break;
-                }
-            }
-        }
-
-        if (!isHaveHotCampaign){
-            Date campaignDate = new Date();
-            String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
-            JSONObject campaignParams = new JSONObject();
-            campaignParams.put("advertiser_id",token.getAccountId());
-            String campaignName = targetTemplate.getTitlePrefix() + "爆量素材"+ targetTemplate.getTitleMiddle() + timestamp;
-            campaignParams.put("campaign_name",campaignName);
-            campaignParams.put("type",Integer.parseInt(targetTemplate.getMarketingGoal()));
-            campaignParams.put("day_budget",0L);
-            Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
-            Integer code = (Integer) campaignCreateResult.get("code");
-            String message = (String) campaignCreateResult.get("message");
-            if(code != 0 ){
-                log.info("计划创建失败=>message:{}",message);
-                return;
-            }
-            newCampaignId = (Long) campaignCreateResult.get("campaignId");
-        }
-
-        //3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
-        String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
-        String unitNamePrefix = targetTemplate.getTitlePrefix() + "爆量素材"+ targetTemplate.getTitleMiddle()+timestamp;
-        int unitCnt = 0;
-        for(KuaiShouVideoGet videoItem: highQualityVideos){
-            KuaishouAccountCreativeOverrunInfo overrunInfo  =  overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
-            if(null!=overrunInfo){
-                return;
-            }
-            unitCnt ++;
-            String unitName = unitNamePrefix + "-" + unitCnt;
-            JSONObject unitParams = createUnitParams(token, newCampaignId, targetTemplate, unitName);
-            Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
-            Integer unitCode = (Integer) unitCreateResult.get("code");
-            String unitMessage = (String) unitCreateResult.get("message");
-            if(unitCode != 0 ){
-                log.info("组创建失败=>accountId:{};message:{}",accountId,unitMessage);
-                continue;
-            }
-            Long unitId = (Long) unitCreateResult.get("unitId");
-
-            // 每个组,搭配5个创意
-            List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
-            List<MaterialImageInfo> orgFrameList = materialImageInfoService.getListByVideoSignature(videoItem.getSignature());
-            if ((null == cutFrameList||cutFrameList.isEmpty())&&(null == orgFrameList|| orgFrameList.isEmpty())){
-                log.info("未获取到视频封面=>videoSignature:{}",videoItem.getSignature());
-                continue;
-            }
-            JSONObject creativeParams = creativeParams(token, unitId, videoItem, targetTemplate);
-            createCreativeByImage(cutFrameList, orgFrameList,token, creativeParams, newCampaignId, unitId, videoItem,targetTemplate.getImageNumber());
-        }
-
-    }
-    @Override
-    public void kuaishouAiAddNewMaterialCreativity(AiKuaishouAccountTargetTemplate targetTemplate,Integer matNum) {
-        Long accountId = targetTemplate.getAccountId();
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId.toString());
-        if(null == token){
-            log.info("token获取失败=>accountId:{}",accountId);
-            return;
-        }
-        kuaishouInterfaceService.getVideoList(token, DateUtils.date2Str(),DateUtils.date2Str());
-
-        //获取创意关联数为0的素材
-        List<KuaishouVideoRelateCreatives> kuaishouVideoRelateCreatives = relateCreativesService.listByParams(accountId,matNum);
-        if(null == kuaishouVideoRelateCreatives||kuaishouVideoRelateCreatives.isEmpty()){
-            log.info("账户:{}, 不存在未创建创意素材",accountId);
-            return;
-        }
-
-        //2、判断该账户下当天有没有“上新”计划,没有则创建一个“上新”计划
-        JSONArray campaignList = kuaishouInterfaceService.getCampaignList(token, new Date(), new Date(),1);
-        boolean isHaveNewCampaign = false;
-        Long newCampaignId = 0L;
-        if (null!=campaignList&&campaignList.size()>0){
-            for(int i = 0;i<campaignList.size();i++){
-                JSONObject jsonObject = campaignList.getJSONObject(i);
-                if (jsonObject.getString("campaign_name").contains("素材上新")){
-                    isHaveNewCampaign = true;
-                    newCampaignId = jsonObject.getLong("campaign_id");
-                    break;
-                }
-            }
-        }
-        // 不存在“上新”计划,则创建一个计划
-        if (!isHaveNewCampaign){
-            Date campaignDate = new Date();
-            String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
-            JSONObject campaignParams = new JSONObject();
-            campaignParams.put("advertiser_id",token.getAccountId());
-            String campaignName = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
-            campaignParams.put("campaign_name",campaignName);
-            campaignParams.put("type",Integer.parseInt(targetTemplate.getMarketingGoal()));
-            campaignParams.put("day_budget",0L);
-            Map<String, Object> campaignCreateResult = kuaishouInterfaceService.campaignCreate(token.getAccessToken(), token.getAccountId(), campaignParams);
-            Integer code = (Integer) campaignCreateResult.get("code");
-            String message = (String) campaignCreateResult.get("message");
-            if(code != 0 ){
-                log.info("计划创建失败=>message:{}",message);
-                return;
-            }
-            newCampaignId = (Long) campaignCreateResult.get("campaignId");
-        }
-
-        //3、在“上新”计划中新增广告组,一个素材搭配5张封面,组成一个广告组
-        String timestamp = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
-        String unitNamePrefix = targetTemplate.getTitlePrefix() + "素材上新"+ targetTemplate.getTitleMiddle()+ timestamp;
-        int unitCnt = 0;
-        for(KuaishouVideoRelateCreatives videoItem: kuaishouVideoRelateCreatives){
-            KuaishouAccountCreativeOverrunInfo overrunInfo  =  overrunInfoService.getByParams(accountId,DateUtils.formatDate(new Date()));
-            if(null!=overrunInfo){
-                return;
-            }
-            unitCnt ++;
-            KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(videoItem.getPhotoId());
-            if(null == videoGet){
-                log.info("未获取到视频信息=>photoId:{}",videoItem.getPhotoId());
-                continue;
-            }
-            // 每个组,搭配5个创意
-            List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoGet.getSignature());
-            List<MaterialImageInfo> orgFrameList = materialImageInfoService.getListByVideoSignature(videoGet.getSignature());
-            if ((null == cutFrameList||cutFrameList.isEmpty())&&(null == orgFrameList|| orgFrameList.isEmpty())){
-                log.info("未获取到视频封面=>videoSignature:{}",videoGet.getSignature());
-                continue;
-            }
-            String unitName = unitNamePrefix + "-" + unitCnt;
-            JSONObject unitParams = createUnitParams(token, newCampaignId, targetTemplate, unitName);
-            Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams,1);
-            Integer unitCode = (Integer) unitCreateResult.get("code");
-            String unitMessage = (String) unitCreateResult.get("message");
-            if(unitCode != 0 ){
-                log.info("组创建失败=>accountId:{};message:{}",accountId,unitMessage);
-                continue;
-            }
-            Long unitId = (Long) unitCreateResult.get("unitId");
-            JSONObject creativeParams = creativeParams(token, unitId, videoGet, targetTemplate);
-            createCreativeByImage(cutFrameList, orgFrameList,token, creativeParams, newCampaignId, unitId, videoGet,targetTemplate.getImageNumber());
-            videoItem.setCreativeCount(5);
-            relateCreativesService.updateById(videoItem);
-        }
-    }
-
-
-    private JSONObject creativeParams(CtopOauthToken token,Long unitId,KuaiShouVideoGet videoItem,AiKuaishouAccountTargetTemplate targetTemplate){
-        JSONObject creativeParams = new JSONObject();
-        creativeParams.put("advertiser_id",token.getAccountId());
-        creativeParams.put("unit_id",unitId);
-        creativeParams.put("photo_id",videoItem.getPhotoId());
-        creativeParams.put("creative_material_type",videoItem.getMaterialType());
-        creativeParams.put("action_bar_text",targetTemplate.getActionBarText());
-        creativeParams.put("description",targetTemplate.getCreativeDescription());
-        // 安卓下载中间页ID
-        JSONArray siteIdArray = JSONArray.parseArray(targetTemplate.getSiteId());
-        if(null == siteIdArray||!siteIdArray.isEmpty()){
-            JSONObject siteObject = siteIdArray.getJSONObject(0);
-            Long siteId = siteObject.getLong("siteId");
-            if(null!=siteId){
-                creativeParams.put("site_id",siteId);
-            }
-        }
-        if(null != targetTemplate.getClickTrackUrl()&&!"".equals(targetTemplate.getClickTrackUrl())){
-            creativeParams.put("click_track_url",targetTemplate.getClickTrackUrl());
-        }
-        if(null != targetTemplate.getImpressionUrl()&&!"".equals(targetTemplate.getImpressionUrl())){
-            creativeParams.put("impression_url",targetTemplate.getImpressionUrl());
-        }
-        if(null != targetTemplate.getActionbarClickUrl()&&!"".equals(targetTemplate.getActionbarClickUrl())){
-            creativeParams.put("actionbar_click_url",targetTemplate.getActionbarClickUrl());
-        }
-        return creativeParams;
-    }
-
-
-    private void createCreative(CtopOauthToken token,JSONObject creativeParams,Long campaignId,Long unitId,
-                                int creativeCnt,KuaiShouVideoGet videoGet){
-        creativeParams.put("creative_name","自定义创意_竖版视频_"+creativeCnt);
-        Map<String, Object> creativeCreateResult = kuaishouInterfaceService.creativeCreate
-                (token.getAccessToken(), token.getAccountId(), creativeParams,1);
-        Integer creativeCode = (Integer) creativeCreateResult.get("code");
-        String creativeMessage = (String) creativeCreateResult.get("message");
-        if(creativeCode != 0 ){
-            log.info("创意创建失败=>message:{}",creativeMessage);
-            return;
-        }
-        Long creativeId = (Long) creativeCreateResult.get("creativeId");
-        AiKuaishouStrategyMapCreative mapCreative = new AiKuaishouStrategyMapCreative();
-        mapCreative.setAccountId(token.getAccountId());
-        mapCreative.setCampaignId(campaignId);
-        mapCreative.setUnitId(unitId);
-        mapCreative.setVideoSignature(videoGet.getSignature());
-        mapCreative.setCreativeId(creativeId);
-        mapCreativeService.save(mapCreative);
-    }
-
-
-    private JSONObject createUnitParams(CtopOauthToken token, Long campaignId,  AiKuaishouAccountTargetTemplate targetTemplate,
-                                        String unitName) {
-        // 拼装创建组的入参 json
-        JSONObject unitParams = new JSONObject();
-        unitParams.put("advertiser_id",token.getAccountId());
-        unitParams.put("campaign_id",campaignId);
-        unitParams.put("unit_name", unitName);
-        unitParams.put("bid_type",targetTemplate.getBidType());
-        unitParams.put("ocpx_action_type",targetTemplate.getOcpxActionType());
-
-        if(null!=targetTemplate.getUseAppMarket()&&!"".equals(targetTemplate.getUseAppMarket())){
-            unitParams.put("use_app_market",Integer.parseInt(targetTemplate.getUseAppMarket()));
-        }
-        if(null!=targetTemplate.getAppStore()&&!"".equals(targetTemplate.getAppStore())){
-            unitParams.put("app_store",JSONArray.parseArray(targetTemplate.getAppStore()));
-        }
-
-        // 在本策略中,都是 OCPM 的出价方式
-        unitParams.put("cpa_bid",targetTemplate.getCpaBid());
-        unitParams.put("scene_id",JSONArray.parseArray(targetTemplate.getSceneId()));
-        unitParams.put("unit_type",4);
-
-        // 格式为yyyy-MM-dd,需大于等于当前时间
-        unitParams.put("begin_time",DateUtils.formatDate(new Date()));
-
-        JSONArray appIds = JSONArray.parseArray(targetTemplate.getAppIds());
-        if(null!=appIds&&!appIds.isEmpty()){
-            unitParams.put("app_id",appIds.getLong(0));
-        }
-        unitParams.put("show_mode",2);
-        unitParams.put("speed",1);
-
-        // 设置定向内容
-        JSONObject targetJsonObject = new JSONObject();
-        targetJsonObject.put("region",JSONArray.parseArray(targetTemplate.getRegion()));
-        targetJsonObject.put("ages_range",JSONArray.parseArray(targetTemplate.getAgesRange()));
-        targetJsonObject.put("gender",targetTemplate.getGender());
-        targetJsonObject.put("platform_os",targetTemplate.getPlatformOs());
-        JSONArray population = JSONArray.parseArray(targetTemplate.getPopulation());
-        if(null!=population&&!population.isEmpty()){
-            targetJsonObject.put("population",population);
-        }
-        if(null!=targetTemplate.getFilterConvertedLevel()&&targetTemplate.getFilterConvertedLevel()!=0){
-            targetJsonObject.put("filter_converted_level",targetTemplate.getFilterConvertedLevel());
-        }
-        JSONArray excludePopulation = JSONArray.parseArray(targetTemplate.getExcludePopulation());
-        if(null!=excludePopulation&&!excludePopulation.isEmpty()){
-            targetJsonObject.put("exclude_population",excludePopulation);
-        }
-        unitParams.put("target",targetJsonObject);
-        return unitParams;
-    }
-
-
-    private void createCreativeByImage(List<MaterialCutFrame> cutFrameList, List<MaterialImageInfo> orgFrameList,
-                                       CtopOauthToken token, JSONObject creativeParams,
-                                       Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
-                                       int imageNumber){
-        int creativeCnt  = 1;
-        if (null!=orgFrameList&&!orgFrameList.isEmpty()) {
-            for (int i = 0; i < orgFrameList.size(); i++) {
-                String imageCode = orgFrameList.get(i).getCode();
-                String imageUrl = orgFrameList.get(i).getUrl();
-                String imageToken = getImageToken(imageUrl,imageCode,token.getAccountId(),token.getAccessToken());
-                creativeParams.put("image_token",imageToken);
-                createCreative(token, creativeParams, campaignId, unitId, creativeCnt,videoItem);
-                creativeCnt++;
-                if (creativeCnt > imageNumber) {
-                    break;
-                }
-            }
-        }
-
-        if ((null!=cutFrameList&&!cutFrameList.isEmpty()) && (creativeCnt<=15)){
-            for (int i = 0; i < cutFrameList.size(); i++) {
-                String imageCode = cutFrameList.get(i).getSignature();
-                String imageUrl = cutFrameList.get(i).getUrl();
-                String imageToken = getImageToken(imageUrl,imageCode,token.getAccountId(),token.getAccessToken());
-                creativeParams.put("image_token",imageToken);
-                createCreative(token, creativeParams, campaignId, unitId, creativeCnt,videoItem);
-                creativeCnt ++;
-                if (creativeCnt > imageNumber) {
-                    break;
-                }
-            }
-        }
-    }
-
-    private String getImageToken(String imageUrl, String imageCode, Long accountId,String token){
-        // 根据imageUrl 和 imageCode,获取 imageToken (创建创意用)
-        KuaiShouImageGet imageGet = imageGetService.getOneByParams(null,imageCode);
-        if ((null == imageGet) || ("".equals(imageGet.getImageToken()))){
-            // 如果取不到image_token
-            // 则调用上传url的方法 kuauiShouImageUpload(url, signature, accountId, oauthToken.getAccessToken());
-            return materialUploadService.kuauiShouImageUpload(imageUrl,imageCode,accountId,token);
-        }
-        return imageGet.getImageToken();
-    }
-}

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProgramCreativeLevelOperationRecordServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouProgramCreativeLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouProgramCreativeLevelOperationRecordMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouProgramCreativeLevelOperationRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 程序换创意创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Service
+public class AiKuaishouProgramCreativeLevelOperationRecordServiceImpl extends ServiceImpl<AiKuaishouProgramCreativeLevelOperationRecordMapper, AiKuaishouProgramCreativeLevelOperationRecord> implements IAiKuaishouProgramCreativeLevelOperationRecordService {
+
+}

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouUnitLevelOperationRecordServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
+import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouUnitLevelOperationRecordMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouUnitLevelOperationRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 组创建记录
+ * @author jeecg-boot
+ * @date   2021-04-12
+ * @version V1.0
+ */
+@Service
+public class AiKuaishouUnitLevelOperationRecordServiceImpl extends ServiceImpl<AiKuaishouUnitLevelOperationRecordMapper, AiKuaishouUnitLevelOperationRecord> implements IAiKuaishouUnitLevelOperationRecordService {
+
+}

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiStrategyServiceImpl.java

@@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -56,7 +57,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
     private IKuaiShouImageGetService imageGetService;
     @Autowired
     private IKuaiShouMaterialUploadService materialUploadService;
-    @Autowired
+    @Resource
     private KuaiShouVideoGetMapper videoGetMapper;
 
     /**

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouVideoLastTimeServiceImpl.java

@@ -5,9 +5,9 @@ import cn.com.ctop.kuaishou.modules.ai.mapper.KuaiShouVideoLastTimeMapper;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouVideoLastTimeService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -19,7 +19,7 @@ import java.util.List;
  */
 @Service
 public class KuaiShouVideoLastTimeServiceImpl extends ServiceImpl<KuaiShouVideoLastTimeMapper, KuaiShouVideoLastTime> implements IKuaiShouVideoLastTimeService {
-    @Autowired
+    @Resource
     private KuaiShouVideoLastTimeMapper videoLastTimeMapper;
 
     @Override

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/Enums/CampaignTypeEnum.java

@@ -20,7 +20,7 @@ public enum CampaignTypeEnum {
     public static String getNameByType(Integer type) {
         for (CampaignTypeEnum campaignType : CampaignTypeEnum.values()) {
 
-            if (campaignType.getType() == type) {
+            if (campaignType.getType().equals(type)) {
                 return campaignType.getValue();
             }
         }

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

@@ -120,7 +120,7 @@ public class KuaishouBatchCampaignPreviewController {
     /**
      * 添加
      *
-     * @param kuaishouBatchCampaignPreview
+     * @param data
      * @return
      */
     @AutoLog(value = "添加预览数据")

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

@@ -40,4 +40,8 @@ public interface KuaiShouVideoGetMapper extends BaseMapper<KuaiShouVideoGet> {
     Integer getEffectiveCountByAccountId(Long accountId);
 
     Integer getHotMoneyCountByAccountId(Long accountId);
+
+    List<KuaiShouVideoGet> getZeroVideoByParams(@Param("accountId")Long accountId, @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("videoCnt")Long videoCnt,@Param("appVersion")String appVersion,@Param("channelType")Integer channelType,@Param("relativeCnt")Integer relativeCnt);
+
+    List<KuaiShouVideoGet> getHistoryTopVideoByParams(@Param("accountId")Long accountId, @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("videoCnt")Long videoCnt,@Param("appVersion")String appVersion,@Param("channelType")Integer channelType);
 }

+ 70 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml

@@ -202,6 +202,40 @@
         AND t2.effect_day_num &lt;= 7
 
     </select>
+    <select id="getZeroVideoByParams" resultType="cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet">
+        select
+        video.*
+        from
+        ctop_kuaishou_video_get video left join ctop_kuaishou_video_relate_creatives creative on video.photo_id = creative.photo_id and video.account_id = creative.account_id
+        where
+              1=1
+        <if test="relativeCnt!=null">
+           and creative.creative_count &lt;= #{relativeCnt}
+        </if>
+
+        <if test="accountId!=null">
+            and video.account_id = #{accountId}
+        </if>
+        <if test="startTime!=null">
+            and video.stat_date &gt;= #{startTime}
+        </if>
+        <if test="endTime!=null">
+            and video.stat_date &lt;= #{endTime}
+        </if>
+        <if test="channelType != null and channelType != '' ">
+            and video.channel_type = #{channelType}
+        </if>
+        <if test="appVersion != null and appVersion != '' ">
+            and video.photo_name like concat(#{appVersion},'%')
+        </if>
+        and video.status = 0
+        group by video.signature
+        order by video.stat_date desc
+        <if test="videoCnt!=null">
+            limit #{videoCnt}
+        </if>
+    </select>
+
     <select id="getHotMoneyCountByAccountId" resultType="java.lang.Integer">
         SELECT
         count(1)
@@ -221,4 +255,40 @@
         t2.faddish_date is not null
         and faddish_day_num &lt;=14
     </select>
+    <select id="getHistoryTopVideoByParams"
+            resultType="cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet">
+        select
+            video.*
+        from
+            ctop_kuaishou_report_daily_material report
+        left join (select * from ctop_kuaishou_video_get
+                where
+                    status = 0
+                and signature is not null
+        <if test="accountId!=null">
+                 and account_id = #{accountId}
+        </if>
+        <if test="channelType!=null">
+            and channel_type = #{channelType}
+        </if>
+        <if test="startTime!=null">
+            and stat_date &gt;= #{startTime}
+        </if>
+        <if test="endTime!=null">
+            and stat_date &lt;= #{endTime}
+        </if>
+        <if test="appVersion != null and appVersion != '' ">
+            and photo_name like concat(#{appVersion},'%')
+        </if>
+        group by signature) video
+                  on video.signature = report.signature
+        left join (SELECT id, photo_id from ctop_ai_creative_limit WHERE account_id = #{accountId}) t2
+            on video.photo_id = t2.photo_id
+            where video.id is not null
+            group by video.signature
+        order by sum(report.charge) desc
+        <if test="videoCnt!=null">
+            limit #{videoCnt}
+        </if>
+    </select>
 </mapper>

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

@@ -27,7 +27,7 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
 
     List<KuaiShouVideoGet> getNewVideoDescDate(Long accountId, Integer newVideoCnt);
 
-    List<KuaiShouVideoGet> getNewVideoBetweenTime(Long accountId, String startTime, String endTime);
+    List<KuaiShouVideoGet> getNewVideoBetweenTime(Long accountId, String startTime, String endTime,Integer channelType,String appVersion,Integer videoCnt);
 
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
 
@@ -48,4 +48,8 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
     Integer getEffectiveCountByAccountId(Long accountId);
 
     Integer getHotMoneyCountByAccountId(Long accountId);
+
+    List<KuaiShouVideoGet> getZeroVideoByParams(Long accountId, String startTime, String endTime, Long videoCnt,String appVersion,Integer channelType,Integer relativeCnt);
+
+    List<KuaiShouVideoGet> getHistoryTopVideoByParams(Long accountId, String startTime, String endTime, Long videoCnt, String appVersion, Integer channelType);
 }

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

@@ -193,6 +193,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
             return;
         }
         addGroupV2(accountId, details);
+        log.info("组数据入库成功=》id:{}",unitId);
     }
 
 

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

@@ -548,8 +548,6 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
             Map<String, String> headers = new HashMap<>();
             headers.put("Access-Token", accessToken);
             headers.put("Content-Type", "application/json");
-
-
             String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
             JSONObject resultJson = JSONObject.parseObject(result);
             if (!Check.isNull(resultJson)) {
@@ -579,8 +577,6 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
             returnJson.put("code", -1);
             returnJson.put("message", e.getMessage());
         }
-
-
         return returnJson;
     }
 
@@ -615,7 +611,6 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
                         } catch (InterruptedException e) {
                             e.printStackTrace();
                         }
-
                         returnJson.put("code", 0);
                     } else {
                         returnJson.put("code", -1);

+ 25 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java

@@ -151,8 +151,9 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
 
 
     @Override
-    public List<KuaiShouVideoGet> getNewVideoBetweenTime(Long accountId, String startTime, String endTime) {
+    public List<KuaiShouVideoGet> getNewVideoBetweenTime(Long accountId, String startTime, String endTime,Integer channelType,String appVersion,Integer videoCnt) {
         QueryWrapper<KuaiShouVideoGet> queryWrapper = new QueryWrapper<>();
+        queryWrapper.isNotNull("signature");
         if (null != accountId && accountId != 0) {
             queryWrapper.eq("account_id", accountId);
         }
@@ -160,6 +161,16 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
             queryWrapper.le("stat_date", endTime);
             queryWrapper.gt("stat_date", startTime);
         }
+        if(null!=channelType&&channelType!=2){
+            queryWrapper.eq("channel_type",channelType);
+        }
+
+        if(null!=appVersion&&!appVersion.trim().equals("")){
+            queryWrapper.likeRight("photo_name",appVersion);
+        }
+        if(null!=videoCnt&&videoCnt!=0){
+            queryWrapper.last("limit "+videoCnt);
+        }
         return this.list(queryWrapper);
     }
 
@@ -174,12 +185,11 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
     }
 
     @Override
-    public KuaiShouVideoGet getVideoByPhotoId(Long photo_id) {
+    public KuaiShouVideoGet getVideoByPhotoId(Long photoId) {
         QueryWrapper<KuaiShouVideoGet> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("photo_id", photo_id);
+        queryWrapper.eq("photo_id", photoId);
         queryWrapper.last("limit 1");
-        KuaiShouVideoGet videoGet = videoGetMapper.selectOne(queryWrapper);
-        return videoGet;
+        return this.getOne(queryWrapper);
     }
 
     @Override
@@ -265,4 +275,14 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
     public Integer getHotMoneyCountByAccountId(Long accountId) {
         return videoGetMapper.getHotMoneyCountByAccountId(accountId);
     }
+
+    @Override
+    public List<KuaiShouVideoGet> getZeroVideoByParams(Long accountId, String startTime, String endTime, Long videoCnt,String appVersion,Integer channelType,Integer relativeCnt) {
+        return videoGetMapper.getZeroVideoByParams(accountId,startTime,endTime,videoCnt,appVersion,channelType,relativeCnt);
+    }
+
+    @Override
+    public List<KuaiShouVideoGet> getHistoryTopVideoByParams(Long accountId, String startTime, String endTime, Long videoCnt, String appVersion, Integer channelType) {
+        return videoGetMapper.getHistoryTopVideoByParams(accountId,startTime,endTime,videoCnt,appVersion,channelType);
+    }
 }

+ 5 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouBatchCampaignPreviewServiceImpl.java

@@ -25,6 +25,7 @@ import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -41,19 +42,17 @@ import java.util.regex.Pattern;
  */
 @Service
 public class KuaishouBatchCampaignPreviewServiceImpl extends ServiceImpl<KuaishouBatchCampaignPreviewMapper, KuaishouBatchCampaignPreview> implements IKuaishouBatchCampaignPreviewService {
-
-
-    @Autowired
+    @Resource
     KuaishouBatchCampaignPreviewMapper campaignPreviewMapper;
-    @Autowired
+    @Resource
     KuaishouBatchGroupPreviewMapper groupPreviewMapper;
-    @Autowired
+    @Resource
     KuaishouBatchCreativePreviewMapper creativePreviewMapper;
     @Autowired
     private IKuaishouTemplateService kuaishouTemplateService;
     @Autowired
     private IKuaiShouAppListService kuaiShouAppListService;
-    @Autowired
+    @Resource
     private KuaiShouCampaignMapper kuaiShouCampaignMapper;
 
     @Override

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

@@ -467,7 +467,7 @@ public class KuaishouCampaignCopyDataServiceImpl extends ServiceImpl<KuaishouCam
                 try {
                     log.info("开始多线程执行创建创意,accountId:{},新组:{},老组:{}", token.getAccountId(), unitId, copyUnitId);
                     kuaiShouGroupService.getCreativeByUnit(token.getAccessToken(), token.getAccountId(), copyUnitId);
-                    Thread.sleep(200l);
+                    Thread.sleep(200L);
                     batchService.copyCreative(token.getAccountId(), unitId, copyUnitId, null);
                 } catch (Exception e) {
                     e.printStackTrace();

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

@@ -122,6 +122,7 @@ public class KuaishouStrategyServiceImpl extends ServiceImpl<KuaishouStrategyMap
      * @throws
      * @author ZHAOXA
      */
+    @Override
     public Map<String, Object> createPlanLevelStrategy(CtopOauthToken oauthToken, JSONObject data) {
         JSONObject planJson = new JSONObject();
         /**计划类型

+ 2 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/EtlKuaishouVideoInfoServiceImpl.java

@@ -82,11 +82,8 @@ public class EtlKuaishouVideoInfoServiceImpl extends ServiceImpl<EtlKuaishouVide
                                 //根据id查询剪辑所属的设计负责人
                                 SysUser user = sysUserService.getById(clipId);
                                 if(null!=user){
-                                    SysUser designTeamLeader = sysUserService.getDesignerTeamLeaderBy(user.getOrgCode());
-                                    if(null!=designTeamLeader){
-                                        etlKuaishouVideoInfo.setDesignTeamLeaderId(designTeamLeader.getId());
-                                        etlKuaishouVideoInfo.setDesignTeamLeaderName(designTeamLeader.getRealname());
-                                    }
+                                    etlKuaishouVideoInfo.setDesignTeamLeaderId(user.getLeaderId());
+                                    etlKuaishouVideoInfo.setDesignTeamLeaderName(user.getLeaderName());
                                 }
                             }
                             String clipName = ascription.getString("clipName");

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

@@ -156,6 +156,7 @@ public class EtlKuaiShouGroupDailyReport {
     @Excel(name = "3s播放数", width = 15)
     @ApiModelProperty(value = "3s播放数")
     private Long play3sCount;
+    private Long eventAppInvoked;
     /**
      * 时间
      */

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

@@ -28,76 +28,58 @@ public class KuaishouAgentAccount {
 
 	/**id*/
 	@TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
 	@JsonProperty("accountId")
 	private Long id;
 	/**accountId*/
 	@Excel(name = "userId", width = 15)
-    @ApiModelProperty(value = "userId")
 	private Long userId;
 	/**accountName*/
 	@Excel(name = "accountName", width = 15)
-    @ApiModelProperty(value = "accountName")
 	private String accountName;
 	/**balance*/
 	@Excel(name = "balance", width = 15)
-    @ApiModelProperty(value = "balance")
 	private java.math.BigDecimal balance;
 	/**creditBalance*/
 	@Excel(name = "creditBalance", width = 15)
-    @ApiModelProperty(value = "creditBalance")
 	private java.math.BigDecimal creditBalance;
 	/**extendedBalance*/
 	@Excel(name = "extendedBalance", width = 15)
-    @ApiModelProperty(value = "extendedBalance")
 	private java.math.BigDecimal extendedBalance;
 	/**rebate*/
 	@Excel(name = "rebate", width = 15)
-    @ApiModelProperty(value = "rebate")
 	private java.math.BigDecimal rebate;
 	/**preRebate*/
 	@Excel(name = "preRebate", width = 15)
-    @ApiModelProperty(value = "preRebate")
 	private java.math.BigDecimal preRebate;
 	/**contractRebate*/
 	@Excel(name = "contractRebate", width = 15)
-    @ApiModelProperty(value = "contractRebate")
 	private java.math.BigDecimal contractRebate;
 	/**directRebate*/
 	@Excel(name = "directRebate", width = 15)
-    @ApiModelProperty(value = "directRebate")
 	private java.math.BigDecimal directRebate;
 	/**totalBalance*/
 	@Excel(name = "totalBalance", width = 15)
-    @ApiModelProperty(value = "totalBalance")
 	private java.math.BigDecimal totalBalance;
 	/**kuaibiBalance*/
 	@Excel(name = "kuaibiBalance", width = 15)
-    @ApiModelProperty(value = "kuaibiBalance")
 	private java.math.BigDecimal kuaibiBalance;
 	/**pushBalance*/
 	@Excel(name = "pushBalance", width = 15)
-    @ApiModelProperty(value = "pushBalance")
 	private java.math.BigDecimal pushBalance;
 	/**recharged*/
 	@Excel(name = "recharged", width = 15)
-    @ApiModelProperty(value = "recharged")
 	private Boolean recharged;
 	/**corporationName*/
 	@Excel(name = "corporationName", width = 15)
-    @ApiModelProperty(value = "corporationName")
 	private String corporationName;
 	/**reviewStatus*/
 	@Excel(name = "reviewStatus", width = 15)
-    @ApiModelProperty(value = "reviewStatus")
 	private Integer reviewStatus;
 	/**frozenStatus*/
 	@Excel(name = "frozenStatus", width = 15)
-    @ApiModelProperty(value = "frozenStatus")
 	private Integer frozenStatus;
 	/**transferAccountStatus*/
 	@Excel(name = "transferAccountStatus", width = 15)
-    @ApiModelProperty(value = "transferAccountStatus")
 	private Boolean transferAccountStatus;
 	/**createTime*/
     @Excel(name = "transferAccountStatus", width = 15)

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

@@ -176,6 +176,8 @@ public class KuaishouReportDailyAccount implements Serializable {
 
     @JsonProperty("play_3s_ratio")
     private Double play3sRatio;
+    @JsonProperty("event_app_invoked")
+    private Long eventAppInvoked;
 
     private Date createTime;
 

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

@@ -139,4 +139,5 @@ public class KuaishouReportDailyGroup implements Serializable {
     private Date updateTime;
 
     private String channelCode;
+    private Long eventAppInvoked;
 }

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

@@ -124,6 +124,8 @@ public class KuaishouReportHourlyAccount implements Serializable {
     private Long block;
     @JsonProperty
     private Long negative;
+    @JsonProperty
+    private Long eventAppInvoked;
 
     @JsonProperty
     private Date createTime;

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

@@ -26,6 +26,7 @@
         event_order_paid,
         event_next_day_stay,
         play_3s_count,
+        event_app_invoked,
         stat_date
         )
         values
@@ -53,6 +54,7 @@
             #{addList.eventOrderPaid},
             #{addList.eventNextDayStay},
             #{addList.play3sCount},
+            #{addList.eventAppInvoked},
             #{addList.statDate}
             )
         </foreach>

+ 1 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml

@@ -106,8 +106,7 @@ group by m.account_id,m.signature
         play_3s_count)
         values
         <foreach collection="records" item="record" separator=",">
-            (
-            #{record.companyId} ,
+            (#{record.companyId} ,
             #{record.companyName} ,
             #{record.projectId} ,
             #{record.projectName} ,

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


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä