Ver código fonte

修改代码层级结构

syh 4 anos atrás
pai
commit
481c22d697
85 arquivos alterados com 4848 adições e 63 exclusões
  1. 22 53
      pom.xml
  2. 10 10
      xxl-job-admin/src/main/resources/application.properties
  3. 118 0
      xxl-job-kuaishou/.mvn/wrapper/MavenWrapperDownloader.java
  4. BIN
      xxl-job-kuaishou/.mvn/wrapper/maven-wrapper.jar
  5. 2 0
      xxl-job-kuaishou/.mvn/wrapper/maven-wrapper.properties
  6. 156 0
      xxl-job-kuaishou/pom.xml
  7. 23 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/XxlJobExecutorApplication.java
  8. 56 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouAdvertiserBaseInfo.java
  9. 65 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouCampaign.java
  10. 53 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouCampaignDayBudget.java
  11. 158 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouCreative.java
  12. 82 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouDailyFlows.java
  13. 59 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouDailyReportTask.java
  14. 129 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouGroup.java
  15. 136 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouGroupTarget.java
  16. 61 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouHistoryReportTask.java
  17. 66 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouImageGet.java
  18. 51 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouVideoGet.java
  19. 43 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaishouOperationRecord.java
  20. 113 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaishouProgramCreative.java
  21. 33 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/vo/SpendVo.java
  22. 54 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CampaignTypeEnum.java
  23. 272 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CommonConstant.java
  24. 20 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CosConstant.java
  25. 5 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CtopRoleCodeConstant.java
  26. 313 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/KuaishouInterfaceConstant.java
  27. 108 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/MaterialEnum.java
  28. 71 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/MaterialSupplierEnum.java
  29. 22 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/entity/JobDistributeInfo.java
  30. 7 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/mapper/JobDistributeInfoMapper.java
  31. 4 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/mapper/xml/JobDistributeInfoMapper.xml
  32. 10 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/service/IJobDistributeInfoService.java
  33. 26 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/service/impl/JobDistributeInfoServiceImpl.java
  34. 54 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/BytedanceDistributeJob.java
  35. 42 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouCampaignJob.java
  36. 40 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouCreativeJob.java
  37. 45 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyAccountReportLoadJob.java
  38. 43 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyCampaignReportLoadJob.java
  39. 43 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyCreativeReportLoadJob.java
  40. 36 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyFlowsJob.java
  41. 42 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyGroupReportLoadJob.java
  42. 42 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouGroupJob.java
  43. 50 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyAccountReportLoadJob.java
  44. 50 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyCampaignReportLoadJob.java
  45. 48 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyCreativeReportLoadJob.java
  46. 49 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyGroupReportLoadJob.java
  47. 43 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouMatDailyReportJob.java
  48. 44 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouMaterialsLoadJob.java
  49. 45 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouOperationRecordJob.java
  50. 40 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouSuZaoLoadJob.java
  51. 28 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouAccessToken.java
  52. 17 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouResult.java
  53. 16 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouResultData.java
  54. 17 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouResultToken.java
  55. 7 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/mapper/KuaishouAccessTokenMapper.java
  56. 7 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/service/IKuaishouAccessTokenService.java
  57. 11 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/service/impl/KuaishouAccessTokenServiceImpl.java
  58. 616 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/mapper/xml/KuaishouReportDailyGroupMapper.xml
  59. 222 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/mapper/xml/KuaishouReportDailyImageMapper.xml
  60. 110 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/mapper/xml/KuaishouReportHourlyCampaignMapper.xml
  61. 10 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyCampaignService.java
  62. 12 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyCreativeService.java
  63. 8 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyGroupService.java
  64. 14 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyImageService.java
  65. 10 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyAccountService.java
  66. 10 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyCampaignService.java
  67. 10 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyCreativeService.java
  68. 9 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyGroupService.java
  69. 23 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyAccountServiceImpl.java
  70. 20 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyCampaignServiceImpl.java
  71. 26 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyCreativeServiceImpl.java
  72. 19 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyGroupServiceImpl.java
  73. 18 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyImageServiceImpl.java
  74. 20 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyAccountServiceImpl.java
  75. 21 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyCampaignServiceImpl.java
  76. 21 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyCreativeServiceImpl.java
  77. 20 0
      xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyGroupServiceImpl.java
  78. 128 0
      xxl-job-kuaishou/src/main/resources/application.yml
  79. 42 0
      xxl-job-kuaishou/src/main/resources/bytedance_config.properties
  80. 16 0
      xxl-job-kuaishou/src/main/resources/config.properties
  81. 36 0
      xxl-job-kuaishou/src/main/resources/kuaishou_config.properties
  82. 57 0
      xxl-job-kuaishou/src/main/resources/logback-dev.xml
  83. 57 0
      xxl-job-kuaishou/src/main/resources/logback-prod.xml
  84. 57 0
      xxl-job-kuaishou/src/main/resources/logback-test.xml
  85. 29 0
      xxl-job-kuaishou/src/main/resources/logback.xml

+ 22 - 53
pom.xml

@@ -13,7 +13,7 @@
 	<modules>
 		<module>xxl-job-core</module>
 		<module>xxl-job-admin</module>
-		<module>xxl-job-executor-samples</module>
+		<module>xxl-job-kuaishou</module>
     </modules>
 	<repositories>
 		<repository>
@@ -63,6 +63,27 @@
 
 	<build>
 		<plugins>
+			<plugin>
+				<groupId>org.mybatis.generator</groupId>
+				<artifactId>mybatis-generator-maven-plugin</artifactId>
+				<version>1.3.6</version>
+				<configuration>
+					<!-- 是否覆盖,true表示会替换生成的JAVA文件,false则不覆盖 -->
+					<overwrite>true</overwrite>
+				</configuration>
+				<dependencies>
+					<!--mysql驱动包-->
+					<dependency>
+						<groupId>mysql</groupId>
+						<artifactId>mysql-connector-java</artifactId>
+						<version>5.1.45</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
 		</plugins>
 	</build>
 
@@ -85,58 +106,6 @@
 
 		<profile>
 			<id>release</id>
-			<build>
-				<plugins>
-					<!-- Source -->
-					<plugin>
-						<groupId>org.apache.maven.plugins</groupId>
-						<artifactId>maven-source-plugin</artifactId>
-						<version>${maven-source-plugin.version}</version>
-						<executions>
-							<execution>
-								<phase>package</phase>
-								<goals>
-									<goal>jar-no-fork</goal>
-								</goals>
-							</execution>
-						</executions>
-					</plugin>
-					<!-- Javadoc -->
-					<plugin>
-						<groupId>org.apache.maven.plugins</groupId>
-						<artifactId>maven-javadoc-plugin</artifactId>
-						<version>${maven-javadoc-plugin.version}</version>
-						<executions>
-							<execution>
-								<phase>package</phase>
-								<goals>
-									<goal>jar</goal>
-								</goals>
-								<configuration>
-									<doclint>none</doclint>
-								</configuration>
-							</execution>
-						</executions>
-					</plugin>
-					<!-- GPG -->
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-gpg-plugin</artifactId>
-                        <version>${maven-gpg-plugin.version}</version>
-						<configuration>
-							<useAgent>false</useAgent>
-						</configuration>
-                        <executions>
-                            <execution>
-                                <phase>verify</phase>
-                                <goals>
-                                    <goal>sign</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-				</plugins>
-			</build>
 			<distributionManagement>
 				<snapshotRepository>
 					<id>oss</id>

+ 10 - 10
xxl-job-admin/src/main/resources/application.properties

@@ -22,23 +22,23 @@ spring.freemarker.settings.number_format=0.##########
 mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
 #mybatis.type-aliases-package=com.xxl.job.admin.core.model
 
-### xxl-job, master
-#spring.datasource.url=jdbc:mysql://139.186.27.96:4000/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
-#spring.datasource.username=hcst
-#spring.datasource.password=hcst@2020
+## xxl-job, master
+spring.datasource.url=jdbc:mysql://172.30.0.4:4000/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
+spring.datasource.username=hcst
+spring.datasource.password=hcst@2020
 ### xxl-job, jiaoyang
-#spring.datasource.url=jdbc:mysql://139.186.27.96:4000/jiaoyang-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
+#spring.datasource.url=jdbc:mysql://172.30.0.4:4000/jiaoyang-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
 #spring.datasource.username=hcst
 #spring.datasource.password=hcst@2020
 #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 ### xxl-job-datapull
-#spring.datasource.url=jdbc:mysql://139.186.27.96:4000/datapull-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
+#spring.datasource.url=jdbc:mysql://172.30.0.4:4000/datapull-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
 #spring.datasource.username=hcst
 #spring.datasource.password=hcst@2020
-
-spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
-spring.datasource.username=root
-spring.datasource.password=root
+### local
+#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
+#spring.datasource.username=root
+#spring.datasource.password=root
 
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 

+ 118 - 0
xxl-job-kuaishou/.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
xxl-job-kuaishou/.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
xxl-job-kuaishou/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 156 - 0
xxl-job-kuaishou/pom.xml

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.4.1</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.xxl.job.kuaishou</groupId>
+    <artifactId>xxl-job-kuaishou</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>demo</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <mybatis-plus.version>3.1.2</mybatis-plus.version>
+        <druid.version>1.1.10</druid.version>
+    </properties>
+
+    <dependencies>
+        <!-- spring-boot-starter-web (spring-webmvc + tomcat) -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <!--mysql-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.47</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- mybatis-plus -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-annotation</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+        <!-- druid -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+
+        <!-- 动态数据源 -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+        <!-- fastjson-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.56</version>
+        </dependency>
+        <!-- Lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <!-- httpclient-->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.retrofit2</groupId>
+            <artifactId>retrofit</artifactId>
+            <version>2.6.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+
+        <!-- xxl-job-core -->
+        <dependency>
+            <groupId>com.xuxueli</groupId>
+            <artifactId>xxl-job-core</artifactId>
+            <version>2.3.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.tencentcloudapi</groupId>
+            <artifactId>tencentcloud-sdk-java</artifactId>
+            <version>3.1.62</version><!-- 注:这里只是示例版本号,请获取并替换为 最新的版本号 -->
+        </dependency>
+        <dependency>
+            <groupId>com.qcloud</groupId>
+            <artifactId>cos_api</artifactId>
+            <version>5.6.25</version>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <!-- xml放在java目录下-->
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+            <!--指定资源的位置(xml放在resources下,可以不用指定)-->
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <!-- spring-boot-maven-plugin (提供了直接运行项目的插件:如果是通过parent方式继承spring-boot-starter-parent则不用此插件) -->
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+

+ 23 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/XxlJobExecutorApplication.java

@@ -0,0 +1,23 @@
+package com.xxl.job.executor;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author xuxueli 2018-10-28 00:38:13
+ */
+@SpringBootApplication
+@ComponentScan("com.xxl")
+public class XxlJobExecutorApplication {
+	public static void main(String[] args) {
+        SpringApplication.run(XxlJobExecutorApplication.class, args);
+	}
+	@Bean
+	public RestTemplate restTemplate() {
+		return new RestTemplate();
+	}
+
+}

+ 56 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouAdvertiserBaseInfo.java

@@ -0,0 +1,56 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手-广告主基本信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-09-18
+ */
+@Data
+@TableName("ctop_kuaishou_advertiser_base_info")
+public class KuaiShouAdvertiserBaseInfo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 账号快手id
+     */
+    private String userId;
+    /**
+     * 公司名称
+     */
+    private String corporationName;
+    /**
+     * 快手昵称
+     */
+    private String userName;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+}

+ 65 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouCampaign.java

@@ -0,0 +1,65 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description: 快手-获取广告计划信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_campaign")
+public class KuaiShouCampaign {
+
+    /**
+     * id
+     */
+    @TableId
+    private String id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    private Long campaignId;
+    /**
+     * 计划名称
+     */
+    private String campaignName;
+    /**
+     * 状态
+     */
+    private Integer status;
+
+
+    /**
+     * 广告计划类型
+     */
+    private Integer campaignType;
+
+    /**
+     * 创建渠道
+     */
+    private Integer createChannel;
+
+    /**
+     * 投放状态
+     */
+    private Integer putStatus;
+    /**
+     * 每日预算
+     */
+    private Long dayBudget;
+    private String dayBudgetSchedule;
+    private String putCreateTime;
+    private String putUpdateTime;
+    private Date createTime;
+    private Date updateTime;
+}

+ 53 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouCampaignDayBudget.java

@@ -0,0 +1,53 @@
+package com.xxl.job.executor.batch.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;
+
+/**
+ * @Description: 快手-修改广告计划记录表
+ * @Author: jeecg-boot
+ * @Date: 2019-09-11
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_campaign_day_budget")
+public class KuaiShouCampaignDayBudget {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    private Long campaignId;
+    /**
+     * 修改前预算
+     */
+    private Long dayBudget;
+    /**
+     * 修改后预算
+     */
+    private Long updateDayBudget;
+    /**
+     * 操作人id
+     */
+    private String userId;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 158 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouCreative.java

@@ -0,0 +1,158 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description: 快手-创意信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_creative")
+public class KuaiShouCreative {
+
+    /**
+     * id
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 广告计划ID
+     */
+    private Long campaignId;
+    /**
+     * 广告组ID
+     */
+    private Long unitId;
+    /**
+     * 广告创意ID
+     */
+    private Long creativeId;
+
+    /**
+     * 素材类型
+     */
+    private Integer creativeMaterialType;
+
+    /**
+     * 广告创意名称
+     */
+    private String creativeName;
+    /**
+     * 单图创意ur
+     */
+    private String materialUrl;
+    /**
+     * 单图创意image_token
+     */
+    private String imageTokens;
+    /**
+     * 视频作品ID
+     */
+    private String photoId;
+    /**
+     * 广告创意状态
+     */
+    private Integer status;
+    /**
+     * 投放状态 1:投放中;2:暂停
+     */
+    private Integer putStatus;
+    /**
+     * 创建渠道  0:投放后台创建;1:Marketing API创建
+     */
+    private Integer createChannel;
+    /**
+     * 审核拒绝理由
+     */
+    private String reviewDetail;
+    /**
+     * 封面URL
+     */
+    private String coverUrl;
+    /**
+     * 视频封面token  若创意使用系统自动生成的首帧图片作为封面,该token无法复用
+     */
+    private String imageToken;
+    /**
+     * 封面图宽度
+     */
+    private String coverWidth;
+    /**
+     * 封面图高度
+     */
+    private String coverHeight;
+    /**
+     * 动态词包原始封面图片URL
+     */
+    private String overlayBgUrl;
+    /**
+     * 动态词包原始封面图片token
+     */
+    private String overlayBgImageToken;
+    /**
+     * stickerTitle
+     */
+    private String stickerTitle;
+    /**
+     * 贴纸样式类型
+     */
+    private String overlayType;
+    /**
+     * 广告语
+     */
+    private String description;
+    /**
+     * 行动号召按钮文案
+     */
+    private String actionBarText;
+    /**
+     * 点击测试链接
+     */
+    private String clickTrackUrl;
+    /**
+     * 第三方开始播放监测链接
+     */
+    private String impressionUrl;
+    /**
+     * 第三方有效播放监测链接
+     */
+    private String adPhotoPlayedT3sUrl; // 第三方有效播放监测链接
+    private String shortSlogan;
+    private String actionbarClickUrl; // 第三方点击按钮监测链接
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private Integer firstFrameType;
+
+    private Date creativeCreateTime;
+
+    private Date creativeUpdateTime;
+
+    private Long siteId;
+
+    private String programmedCreativeMaterial;
+
+
+    private String photoIds;
+
+    private Integer creativeCategory;
+    private String creativeTag;
+
+}

+ 82 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouDailyFlows.java

@@ -0,0 +1,82 @@
+package com.xxl.job.executor.batch.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
+ * @version V1.0
+ * @date 2019-12-05
+ */
+@Data
+@TableName("ctop_kuaishou_daily_flows")
+public class KuaiShouDailyFlows {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 账户ID
+     */
+    private String date;
+    /**
+     * 总花费(元)
+     */
+    private java.math.BigDecimal dailyCharge;
+    /**
+     * 充值话费(元)
+     */
+    private java.math.BigDecimal realCharged;
+    /**
+     * 框返花费(元)
+     */
+    private java.math.BigDecimal contractRebateRealCharged;
+    /**
+     * 激励花费(元)
+     */
+    private java.math.BigDecimal directRebateRealCharged;
+    /**
+     * 转入(元)
+     */
+    private java.math.BigDecimal dailyTransferIn;
+    /**
+     * 转出(元)
+     */
+    private java.math.BigDecimal dailyTransferOut;
+    /**
+     * 日终结余(元)
+     */
+    private java.math.BigDecimal balance;
+    /**
+     * 充值转入(元)
+     */
+    private java.math.BigDecimal realRecharged;
+    /**
+     * 框返转入(元)
+     */
+    private java.math.BigDecimal contractRebateRealRecharged;
+    /**
+     * 激励转入(元)
+     */
+    private java.math.BigDecimal directRebateRealRecharged;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 59 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouDailyReportTask.java

@@ -0,0 +1,59 @@
+package com.xxl.job.executor.batch.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
+ * @version V1.0
+ * @date 2020-03-12
+ */
+@Data
+@TableName("ctop_kuaishou_daily_report_task")
+public class KuaiShouDailyReportTask {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 广告账户ID(相当于头条返回的access_token数据中的advertiser_id)
+     */
+    private Long accountId;
+    /**
+     * 任务id
+     */
+    private String taskId;
+    /**
+     * 任务名称
+     */
+    private String taskName;
+    /**
+     * 0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载 5:文件生成 本地下载失败
+     */
+    private Integer taskStatus;
+    /**
+     * 1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询
+     */
+    private Integer viewType;
+    /**
+     * 任务查询数据起始时间
+     */
+    private String statDate;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 129 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouGroup.java

@@ -0,0 +1,129 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description: 广告组信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_group")
+public class KuaiShouGroup {
+
+    /**
+     * id
+     */
+    @TableId
+    private String id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 广告活动ID
+     */
+    private Long campaignId;
+
+    @TableField(exist = false)
+    private String campaignName;
+    /**
+     * 广告组ID
+     */
+    private Long unitId;
+    /**
+     * 广告组名称
+     */
+    private String unitName;
+    /**
+     * 广告组状态
+     */
+    private Integer status;
+    private Integer putStatus;
+    private Integer createChannel;
+    /**
+     * 审核拒绝理由
+     */
+    private String reviewDetail;
+    /**
+     * 出价类型
+     */
+    private Integer bidType;
+    /**
+     * 出价
+     */
+    private Long bid;
+    /**
+     * OCPC出价
+     */
+    private Long cpaBid;
+
+    private Integer deepConversionType;
+    private Long deepConversionBid;
+
+    /**
+     * OCPX行为类型   1: CPM, 2: CPC,
+     */
+    private Integer ocpxActionType;
+    /**
+     * 单日预算
+     */
+    private Long dayBudget;
+    /**
+     * 投放方式  0:未知, 1:正常投
+     */
+    private Integer speed;
+    /**
+     * 投放开始时间
+     */
+    private String beginTime;
+    /**
+     * 投放结束时间
+     */
+    private String endTime;
+    private String scheduleTime;
+    private String sceneId;
+
+    /**
+     * 创意展现方式  0:未知, 1:轮播,
+     */
+    private Integer showMode;
+    private Integer unitType;
+    /**
+     * url类型
+     */
+    private Integer urlType;
+    /**
+     * 落地页链接
+     */
+    private Object url;
+    /**
+     * APP ID
+     */
+    private Long appId;
+    /**
+     * APP图标存储地址
+     */
+    private String appIconUrl;
+    private Long convertId; // 转化目标
+    private Integer useAppMarket; // 转化目标
+    private String groupCreateTime;
+    private String groupUpdateTime;
+
+    // 应用商店列表
+    private String appStore;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 136 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouGroupTarget.java

@@ -0,0 +1,136 @@
+package com.xxl.job.executor.batch.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
+ * @version V1.0
+ * @date 2019-12-17
+ */
+@Data
+@TableName("ctop_kuaishou_group_target")
+public class KuaiShouGroupTarget {
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 广告组ID
+     */
+    private Long unitId;
+    /**
+     * 地域
+     */
+    private String region;
+    /**
+     * 年龄最小限制
+     */
+    private Integer ageMin;
+    /**
+     * 年龄最大限制
+     */
+    private Integer ageMax;
+    /**
+     * 固定年龄段 【0:表示0-11岁】【12:表示12-17岁】【18:表示18-23岁】【24:表示24-30岁】【31:表示31-40岁】【41:表示41-49岁】【50:表示50-100岁】
+     */
+    private String agesRange;
+    /**
+     * 性别 1:女性, 2:男性, 0:不限
+     */
+    private Integer gender;
+    /**
+     * 操作系统 1: Android, 2: iOS, 0:不限
+     */
+    private Integer platformOs;
+    /**
+     * 安卓版本  3:不限, 4: 4.x+, 5: 5.x+, 6: 6.x+, 7: 7.x+;
+     */
+    private Integer androidOsv;
+    /**
+     * ios版本  6:不限, 7: 7.x+, 8: 8.x+,9: 9.x+, 10: 10.x+
+     */
+    private Integer iosOsv;
+    /**
+     * 网络环境 1: Wi-Fi, 2:移动网络,0:表示不限
+     */
+    private Integer network;
+    /**
+     * 设备品牌 1: OPPO, 2: VIVO,3:华为, 4:小米,5:荣耀, 6:三星,7:金立, 8:魅族,9:乐视, 10:其他,11 : 苹 果
+     */
+    private String deviceBrand;
+    /**
+     * 设备价格 1: 1500 元以下,2: 1501~2000,3: 2001~2500,4: 2501~3000,5: 3001~3500,6: 3501~4000,7: 4001~4500,8: 4501~5000,9: 5001~5500,10: 5500 元以上
+     */
+    private String devicePrice;
+    /**
+     * 商业兴趣类型 0:不限,2:按照兴趣标签
+     */
+    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;
+    private String thirdPlatformCode;
+    /**
+     * 0:关闭智能扩量,1:打开智能扩量
+     */
+    private Integer isOpen;
+    /**
+     * 不可突破年龄 0:可突破/无需控制,1:不可突破
+     */
+    private Integer noAgeBreak;
+    /**
+     * 不可突破性别 0:可突破/无需控制,1:不可突破
+     */
+    private Integer noGenderBreak;
+    /**
+     * 不可突破地域 0:可突破/无需控制,1:不可突破
+     */
+    private Integer noAreaBreak;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 61 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouHistoryReportTask.java

@@ -0,0 +1,61 @@
+package com.xxl.job.executor.batch.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
+ * @version V1.0
+ * @date 2020-03-09
+ */
+@Data
+@TableName("ctop_kuaishou_history_report_task")
+public class KuaiShouHistoryReportTask {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 广告账户ID(相当于头条返回的access_token数据中的advertiser_id)
+     */
+    private Long accountId;
+    /**
+     * 任务id
+     */
+    private String taskId;
+    /**
+     * 任务名称
+     */
+    private String taskName;
+    /**
+     * 0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载
+     */
+    private Integer taskStatus;
+    /**
+     * 1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询
+     */
+    private Integer viewType;
+    /**
+     * 任务查询数据起始时间
+     */
+    private String startDate;
+    /**
+     * 任务查询数据结束时间
+     */
+    private String endDate;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 66 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouImageGet.java

@@ -0,0 +1,66 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description: 快手-获取图片接口
+ * @Author: jeecg-boot
+ * @Date: 2019-07-25
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_image_get")
+public class KuaiShouImageGet {
+    /**
+     * id
+     */
+    @TableId
+    private String id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 视频预览链接
+     */
+    private Object url;
+    /**
+     * 宽
+     */
+    private Integer width;
+    /**
+     * 高
+     */
+    private Integer height;
+    /**
+     * 图片大小
+     */
+    private Integer size;
+    /**
+     * 图片格式
+     */
+    private String format;
+    private Integer materialType;
+
+    /**
+     * 图片 token
+     */
+    private String imageToken;
+    /**
+     * 图片 md5
+     */
+    private String signature;
+    private Date statDate;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+}

+ 51 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaiShouVideoGet.java

@@ -0,0 +1,51 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description: 快手-获取视频接口
+ * @Author: jeecg-boot
+ * @Date: 2019-07-25
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_video_get")
+public class KuaiShouVideoGet {
+
+    @TableId
+    private String id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 视频id
+     */
+    private String photoId;
+    private Integer width;
+    private Integer height;
+    /**
+     * 视频预览链接
+     */
+    private String url;
+    /**
+     * 视频首帧图片链接
+     */
+    private String coverUrl;
+    /**
+     * 视频首帧图片链接
+     */
+    private String signature;
+    private Date statDate;
+    private Integer materialType;
+    private String materialId;
+    private Date createTime;
+    private Date updateTime;
+    private Integer channelType;
+    private Integer status;
+    private Long userId;
+}

+ 43 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaishouOperationRecord.java

@@ -0,0 +1,43 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 操作记录
+ * @author jeecg-boot
+ * @date   2020-04-26
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_operation_record")
+public class KuaishouOperationRecord {
+
+	private Long id;
+
+	private Long accountId;
+
+	private Date operationTime;
+
+	private Integer operationType;
+
+	private Integer roleType;
+
+	private String objectName;
+
+	private Integer operationTarget;
+
+	private String objectId;
+
+	private String fieldName;
+
+	private String originalData;
+
+	private String updateData;
+
+	private String statDate;
+
+	private String log;
+}

+ 113 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/KuaishouProgramCreative.java

@@ -0,0 +1,113 @@
+package com.xxl.job.executor.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 快手-程序化创意
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-22
+ */
+@Data
+@TableName("ctop_kuaishou_program_creative")
+public class KuaishouProgramCreative {
+
+    /**
+     * id
+     */
+    @TableId
+    private String id;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 广告组ID
+     */
+    private Long unitId;
+    /**
+     * 程序化创意包名称
+     */
+    private String packageName;
+    /**
+     * 横版视频 id list
+     */
+    private String horizontalPhotoIds;
+    /**
+     * 竖版视频 id list
+     */
+    private String verticalPhotoIds;
+    /**
+     * 封面imageToken
+     */
+    private String coverImageTokens;
+    /**
+     * 封面链接地址
+     */
+    private String coverImageUrls;
+    /**
+     * 建站id
+     */
+    private Long siteId;
+    /**
+     * 封面贴纸
+     */
+    private String stickerStyles;
+    /**
+     * 封面广告语
+     */
+    private String coverSlogans;
+    /**
+     * 行动号召按钮
+     */
+    private String actionBar;
+    /**
+     * 作品广告语
+     */
+    private String captions;
+    /**
+     * 第三方监测链接
+     */
+    private String clickUrl;
+    /**
+     * 第三方ActionBar点击监控链接
+     */
+    private String actionbarClickUrl;
+    /**
+     * 程序化创意操作状态,1:投放,2:暂停,3:删除
+     */
+    private Integer putStatus;
+    /**
+     * 程序化创意状态 -1:不限,1:计划已暂停,3:计划超预算,6:余额不足,11:组审核中,12:组审核未通过,14:已结束,15:组已暂停,17:组超预算,19:未达投放时间,40:创意已删除,41:审核中,42:审核未通过,46:已暂停,52:投放中,53:作品异常,55:部分素材审核通过
+     */
+    private Integer viewStatus;
+    /**
+     * 程序化创意状态描述
+     */
+    private String viewStatusReason;
+
+    private Integer creativeCategory;
+    private String creativeTag;
+
+    /**
+     * 创意创建时间
+     */
+    private Date creativeCreateTime;
+    /**
+     * 创意最后修改时间
+     */
+    private Date creativeUpdateTime;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    private Date updateTime;
+}

+ 33 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/batch/entity/vo/SpendVo.java

@@ -0,0 +1,33 @@
+package com.xxl.job.executor.batch.entity.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+/**
+ * @Description: 快手-视频上传
+ * @Author: jeecg-boot
+ * @Date: 2019-07-26
+ * @Version: V1.0
+ */
+@Data
+
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SpendVo {
+
+    /**
+     * 总花费
+     */
+    private BigDecimal cost;
+    /**
+     * 预算
+     */
+    private BigDecimal budget;
+    /**
+     * 余额
+     */
+    private BigDecimal balance;
+}

+ 54 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CampaignTypeEnum.java

@@ -0,0 +1,54 @@
+package com.xxl.job.executor.constant;
+
+public enum CampaignTypeEnum {
+
+    TYPE2(2, "提升应用安装"),
+    TYPE3(3, "获取电商下单"),
+    TYPE4(4, "推广品牌活动"),
+    TYPE5(5, "收集销售线索"),
+    TYPE7(7, "提高应用活跃");
+
+
+    private Integer type;
+    private String value;
+
+    CampaignTypeEnum(Integer type, String value) {
+        this.type = type;
+        this.value = value;
+    }
+
+    public static String getNameByType(Integer type) {
+        for (CampaignTypeEnum campaignType : CampaignTypeEnum.values()) {
+
+            if (campaignType.getType() == type) {
+                return campaignType.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;
+    }
+
+    @Override
+    public String toString() {
+        return "CampaignTypeEnum{" +
+                "type=" + type +
+                ", value='" + value + '\'' +
+                '}';
+    }
+}

+ 272 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CommonConstant.java

@@ -0,0 +1,272 @@
+package com.xxl.job.executor.constant;
+
+public interface CommonConstant {
+
+	/**
+	 * 正常状态
+	 */
+	public static final Integer STATUS_NORMAL = 0;
+
+	/**
+	 * 禁用状态
+	 */
+	public static final Integer STATUS_DISABLE = -1;
+
+	/**
+	 * 删除标志
+	 */
+	public static final Integer DEL_FLAG_1 = 1;
+
+	/**
+	 * 未删除
+	 */
+	public static final Integer DEL_FLAG_0 = 0;
+
+	/**
+	 * 系统日志类型: 登录
+	 */
+	public static final int LOG_TYPE_1 = 1;
+
+
+	/**
+	 * 系统日志类型: 操作
+	 */
+	public static final int LOG_TYPE_2 = 2;
+
+	/**
+	 * 操作日志类型: 查询
+	 */
+	public static final int OPERATE_TYPE_1 = 1;
+
+	/**
+	 * 操作日志类型: 添加
+	 */
+	public static final int OPERATE_TYPE_2 = 2;
+
+	/**
+	 * 操作日志类型: 更新
+	 */
+	public static final int OPERATE_TYPE_3 = 3;
+
+	/**
+	 * 操作日志类型: 删除
+	 */
+	public static final int OPERATE_TYPE_4 = 4;
+
+	/**
+	 * 操作日志类型: 倒入
+	 */
+	public static final int OPERATE_TYPE_5 = 5;
+
+	/**
+	 * 操作日志类型: 导出
+	 */
+	public static final int OPERATE_TYPE_6 = 6;
+
+
+	/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
+    public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
+    /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
+    public static final Integer SC_OK_200 = 200;
+
+    /**访问权限认证未通过 510*/
+    public static final Integer SC_JEECG_NO_AUTHZ=510;
+
+    /** 登录用户Shiro权限缓存KEY前缀 */
+    public static String PREFIX_USER_SHIRO_CACHE  = "shiro:cache:org.jeecg.modules.shiro.authc.ShiroRealm.authorizationCache:";
+    /** 登录用户Token令牌缓存KEY前缀 */
+    public static final String PREFIX_USER_TOKEN  = "prefix_user_token_";
+    /** Token缓存时间:3600秒即一小时 */
+    public static final int  TOKEN_EXPIRE_TIME  = 3600;
+
+
+    /** 登录用户拥有角色缓存KEY前缀 */
+    public static String LOGIN_USER_CACHERULES_ROLE = "loginUser_cacheRules::Roles_";
+    /** 登录用户拥有权限缓存KEY前缀 */
+    public static String LOGIN_USER_CACHERULES_PERMISSION  = "loginUser_cacheRules::Permissions_";
+    /** 登录用户令牌缓存KEY前缀 */
+
+    /**
+     *  0:一级菜单
+     */
+    public static final Integer MENU_TYPE_0  = 0;
+   /**
+    *  1:子菜单
+    */
+    public static final Integer MENU_TYPE_1  = 1;
+    /**
+     *  2:按钮权限
+     */
+    public static final Integer MENU_TYPE_2  = 2;
+
+    /**通告对象类型(USER:指定用户,ALL:全体用户)*/
+    public static final String MSG_TYPE_UESR  = "USER";
+    public static final String MSG_TYPE_ALL  = "ALL";
+
+    /**发布状态(0未发布,1已发布,2已撤销)*/
+    public static final String NO_SEND  = "0";
+    public static final String HAS_SEND  = "1";
+    public static final String HAS_CANCLE  = "2";
+
+    /**阅读状态(0未读,1已读)*/
+    public static final String HAS_READ_FLAG  = "1";
+    public static final String NO_READ_FLAG  = "0";
+
+    /**优先级(L低,M中,H高)*/
+    public static final String PRIORITY_L  = "L";
+    public static final String PRIORITY_M  = "M";
+    public static final String PRIORITY_H  = "H";
+
+    /**
+     * 短信模板方式  0 .登录模板、1.注册模板、2.忘记密码模板
+     */
+    public static final String SMS_TPL_TYPE_0  = "0";
+    public static final String SMS_TPL_TYPE_1  = "1";
+    public static final String SMS_TPL_TYPE_2  = "2";
+
+    /**
+     * 状态(0无效1有效)
+     */
+    public static final String STATUS_0 = "0";
+    public static final String STATUS_1 = "1";
+
+    /**
+     * 同步工作流引擎1同步0不同步
+     */
+    public static final Integer ACT_SYNC_1 = 1;
+    public static final Integer ACT_SYNC_0 = 0;
+
+    /**
+     * 消息类型1:通知公告2:系统消息
+     */
+    public static final String MSG_CATEGORY_1 = "1";
+    public static final String MSG_CATEGORY_2 = "2";
+
+    /**
+     * 是否配置菜单的数据权限 1是0否
+     */
+    public static final Integer RULE_FLAG_0 = 0;
+    public static final Integer RULE_FLAG_1 = 1;
+
+    /**
+     * 是否用户已被冻结 1正常(解冻) 2冻结
+     */
+    public static final Integer USER_UNFREEZE = 1;
+    public static final Integer USER_FREEZE = 2;
+
+    /**字典翻译文本后缀*/
+    public static final String DICT_TEXT_SUFFIX = "_dictText";
+
+    /**
+     * 表单设计器主表类型
+     */
+    public static final Integer DESIGN_FORM_TYPE_MAIN = 1;
+
+    /**
+     * 表单设计器子表表类型
+     */
+    public static final Integer DESIGN_FORM_TYPE_SUB = 2;
+
+    /**
+     * 表单设计器URL授权通过
+     */
+    public static final Integer DESIGN_FORM_URL_STATUS_PASSED = 1;
+
+    /**
+     * 表单设计器URL授权未通过
+     */
+    public static final Integer DESIGN_FORM_URL_STATUS_NOT_PASSED = 2;
+
+    /**
+     * 表单设计器新增 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_ADD = "add";
+    /**
+     * 表单设计器修改 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_EDIT = "edit";
+    /**
+     * 表单设计器详情 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_DETAIL = "detail";
+    /**
+     * 表单设计器复用数据 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_REUSE = "reuse";
+    /**
+     * 表单设计器编辑 Flag (已弃用)
+     */
+    public static final String DESIGN_FORM_URL_TYPE_VIEW = "view";
+
+    /**
+     * online参数值设置(是:Y, 否:N)
+     */
+    public static final String ONLINE_PARAM_VAL_IS_TURE = "Y";
+    public static final String ONLINE_PARAM_VAL_IS_FALSE = "N";
+
+    /**
+     * 文件上传类型(本地:local,Minio:minio,阿里云:alioss)
+     */
+    public static final String UPLOAD_TYPE_LOCAL = "local";
+    public static final String UPLOAD_TYPE_MINIO = "minio";
+    public static final String UPLOAD_TYPE_OSS = "alioss";
+
+    /**
+     * 文档上传自定义桶名称
+     */
+    public static final String UPLOAD_CUSTOM_BUCKET = "eoafile";
+    /**
+     * 文档上传自定义路径
+     */
+    public static final String UPLOAD_CUSTOM_PATH = "eoafile";
+    /**
+     * 文件外链接有效天数
+     */
+    public static final Integer UPLOAD_EFFECTIVE_DAYS = 1;
+
+    /**
+     * 员工身份 (1:普通员工  2:上级)
+     */
+    public static final Integer USER_IDENTITY_1 = 1;
+    public static final Integer USER_IDENTITY_2 = 2;
+
+    /** sys_user 表 username 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_USERNAME = "uniq_sys_user_username";
+    /** sys_user 表 work_no 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_WORK_NO = "uniq_sys_user_work_no";
+    /** sys_user 表 phone 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_PHONE = "uniq_sys_user_phone";
+    /** sys_user 表 email 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_EMAIL = "uniq_sys_user_email";
+    /** sys_quartz_job 表 job_class_name 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_JOB_CLASS_NAME = "uniq_job_class_name";
+    /** sys_position 表 code 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_CODE = "uniq_code";
+    /** sys_role 表 code 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_ROLE_CODE = "uniq_sys_role_role_code";
+    /** sys_depart 表 code 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_DEPART_ORG_CODE = "uniq_depart_org_code";
+    /**
+     * 在线聊天 是否为默认分组
+     */
+    public static final String IM_DEFAULT_GROUP = "1";
+    /**
+     * 在线聊天 图片文件保存路径
+     */
+    public static final String IM_UPLOAD_CUSTOM_PATH = "imfile";
+    /**
+     * 在线聊天 用户状态
+     */
+    public static final String IM_STATUS_ONLINE = "online";
+
+    /**
+     * 在线聊天 SOCKET消息类型
+     */
+    public static final String IM_SOCKET_TYPE = "chatMessage";
+
+    /**
+     * 考勤补卡业务状态 (1:同意  2:不同意)
+     */
+    public static final String SIGN_PATCH_BIZ_STATUS_1 = "1";
+    public static final String SIGN_PATCH_BIZ_STATUS_2 = "2";
+}

+ 20 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CosConstant.java

@@ -0,0 +1,20 @@
+package com.xxl.job.executor.constant;
+
+public class CosConstant {
+
+    //数据万象URL
+    public static final String URL="https://media-1301855440.ci.ap-chongqing.myqcloud.com/";
+    //COS地址前缀
+    public static final String COS_MEDIA_URL_PREFIX ="https://media-1301855440.cos.ap-chongqing.myqcloud.com";
+    //jobs接口URL
+    public static final String URL_JOBS=URL+"jobs";
+    //snapshot接口URL
+    public static final String URL_SNAPSHOT=URL+"snapshot";
+    //截帧模板ID
+    public static final String TEMPLATE_ID="t11931b0daf5bf4776b612b4136ad67d00";
+    //数据万象队列ID
+    public static final String QUEUE_ID="p91b206a0462d46cda49b02063c5c42c8";
+    //COS首帧地址
+    public static final String URL_COS_ADDRESS="https://media-1301855440.cos.ap-chongqing.myqcloud.com/";
+
+}

+ 5 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/CtopRoleCodeConstant.java

@@ -0,0 +1,5 @@
+package com.xxl.job.executor.constant;
+
+public class CtopRoleCodeConstant {
+    public static final String COMMON_ROLE_CODE_ADMIN = "admin";
+}

+ 313 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/KuaishouInterfaceConstant.java

@@ -0,0 +1,313 @@
+package com.xxl.job.executor.constant;
+
+/**
+ * 2019年9月9日13:21:39
+ */
+public class KuaishouInterfaceConstant {
+    public static final String AUTH_PATH = "/openapi/oauth";
+    public static final String AUTH_TOKEN = "/rest/openapi/oauth2/authorize/access_token";
+    public static final String REFRESH_TOKEN = "/rest/openapi/oauth2/authorize/refresh_token";
+    /**
+     * 广告主报表数据
+     */
+    public static final String ACCOUNT_REPORT = "/rest/openapi/v1/report/account_report";
+    /**
+     * 广告主报表数据
+     */
+    public static final String VIDEO_LIST = "/rest/openapi/v1/file/ad/video/list";
+    /**
+     * 广告计划报表数据
+     */
+    public static final String CAMPAIGN_REPORT = "/rest/openapi/v1/report/campaign_report";
+    /**
+     * 程序化2.0创意
+     */
+    public static final String PROGRAM_LIST = "/rest/openapi/v2/creative/advanced/program/list";
+    /**
+     * 广告组报表数据
+     */
+    public static final String GTOUP_REPORT = "/rest/openapi/v1/report/unit_report";
+    /**
+     * 广告创意报表数据
+     */
+    public static final String CREATIVE_REPORT = "/rest/openapi/v1/report/creative_report";
+    /**
+     * 广告计划信息
+     */
+    public static final String CAMPAIGN_LIST = "/rest/openapi/v1/campaign/list";
+    /**
+     * 广告组信息
+     */
+    public static final String GROUP_LIST = "/rest/openapi/v1/ad_unit/list";
+    /**
+     * 创意信息
+     */
+    public static final String CREATIVE_LIST = "/rest/openapi/v1/creative/list";
+    /**
+     * 创建广告计划
+     */
+    public static final String CAMPAIGN_CREATE = "/rest/openapi/v2/campaign/create";
+    /**
+     * 创建广告组
+     */
+    public static final String AD_UNIT_CREATE = "/rest/openapi/v2/ad_unit/create";
+    /**
+     * 创建广告创意
+     */
+    public static final String AD_CREATIVE_CREATE = "/rest/openapi/v2/creative/create";
+    /**
+     * 程序化创意 2.0
+     */
+    public static final String PROGRAM_CREATE = "/rest/openapi/v2/creative/advanced/program/create";
+    /**
+     * 获取可选的深度转化类型
+     */
+    public static final String DEEP_CONVERSION_INFOS = "/rest/openapi/v1/ad_unit/ocpc/conversion_infos";
+    /**
+     * 视频文件上传
+     */
+    public static final String VIDEO_UPLOAD = "/rest/openapi/v2/file/ad/video/upload";
+    /**
+     * 视频文件获取
+     */
+    public static final String VIDEO_GET = "/rest/openapi/v1/file/ad/video/get";
+    /**
+     * 图片文件获取
+     */
+    public static final String IMAGE_GET = "/rest/openapi/v1/file/ad/image/get";
+    /**
+     * 获取慕模列表
+     */
+    public static final String TEMPLATE_LIST = "/rest/openapi/v1/target/template/list";
+    /**
+     * 创建定向模板
+     */
+    public static final String TEMPLATE_CREATE = "/rest/openapi/v1/target/template/create";
+    /**
+     * 获取地域信息
+     */
+    public static final String REGION_LIST = "/rest/openapi/v1/region/list";
+    /**
+     * 图片文件上传
+     */
+    public static final String IMAGE_UPLOAD = "/rest/openapi/v2/file/ad/image/upload";
+    /**
+     * 创建应用
+     */
+    public static final String APP_CREATE = "/rest/openapi/v1/file/ad/app/create";
+    /**
+     * 创建广告获取应用列表
+     */
+    public static final String APP_LIST = "/rest/openapi/v1/file/ad/app/list";
+    /**
+     * 创建广告获取应用列表(新版本)
+     */
+    public static final String APP_LIST_v2 = "/rest/openapi/v2/file/ad/app/list";
+
+    /**
+     * 账户日预算查询
+     */
+    public static final String ACCOUNT_BUDGET = "/rest/openapi/v1/advertiser/budget/get";
+
+
+    /**
+     * 获取账户余额
+     */
+    public static final String FUND_GET = "/rest/openapi/v1/advertiser/fund/get";
+
+    /**
+     * 获取账户流水数据
+     */
+    public static final String DAILY_FLOWS = "/rest/openapi/v1/advertiser/fund/daily_flows";
+
+    /**
+     * 上传人群接口
+     */
+    public static final String POPULATION_UPLOAD = "/rest/openapi/v1/dmp/population/upload";
+    /**
+     * 获取人群包接口
+     */
+    public static final String POPULATION_LIST = "/rest/openapi/v2/dmp/population/list";
+
+    /**
+     * 删除人群包接口
+     */
+    public static final String POPULATION_DELETE = "/rest/openapi/v1/dmp/population/delete";
+
+    /**
+     * 推送人群包接口
+     */
+    public static final String POPULATION_PUSH = "/rest/openapi/v1/dmp/population/push";
+
+    /**
+     * 跨账户人群包推送接口
+     */
+    public static final String POPULATION_PUSH_ACCOUNTS = "/rest/openapi/v1/dmp/population/accounts/push";
+
+    /**
+     * 游戏精选标签创建
+     * 获取游戏精选标签所有接口类型
+     */
+    public static final String POPULATION_GAME_TAG_LIST = "https://ad.e.kuaishou.com/rest/openapi/v1/dmp/population/paid/game_select_type/list";
+
+    /**
+     * 游戏精选标签人群包
+     * 游戏精选标签创建
+     */
+    public static final String POPULATION_GAME_TAG_CREATE = "/rest/openapi/v1/dmp/population/paid/game_select_tag/create";
+
+    /**
+     * DMP更新人群包接口
+     */
+    public static final String POPULATION_UPDATE = "/rest/openapi/v1/dmp/population/update";
+
+    /**
+     * 获取人群预估数量
+     */
+    public static final String POPULATION_PREDICTION = "/rest/openapi/v1/tool/audience/prediction";
+
+    /**
+     * 获取可选的应用定向
+     */
+    public static final String APP_SEARCH = "/rest/openapi/v1/tool/app/search";
+
+    /**
+     * 获取可选的应用定向
+     */
+    public static final String CONVERT_LIST = "/rest/openapi/v1/tool/convert/list";
+
+    /**
+     * 获取可选的动态词包
+     */
+    public static final String CREATIVE_WORD = "/rest/openapi/v1/tool/creative_word/list";
+    public static final String ACTION_BAR_TEXT_LIST = "/rest/openapi/v1/creative/action_bar_text/list";
+
+
+    /**
+     * 获取定向标签
+     */
+    public static final String TARGETING_TAGS = "/rest/openapi/v1/tool/targeting_tags/list";
+
+
+    /**
+     * 修改广告计划预算
+     */
+    public static final String UPDATE_CAMPAIGN_BUDGET = "/rest/openapi/v2/campaign/update";
+
+    /**
+     * 修改广告组预算
+     */
+    public static final String UPDATE_UNIT_BUDGET = "/rest/openapi/v1/ad_unit/update/day_budget";
+
+
+    /**
+     * 修改广告组出价
+     */
+    public static final String UPDATE_UNIT_BID = "/rest/openapi/v1/ad_unit/update/bid";
+
+
+    /**
+     * 修改广告计划状态
+     */
+    public static final String UPDATE_CAMPAIGN_STATUS = "/rest/openapi/v1/campaign/update/status";
+
+    /**
+     * 修改广告计划
+     */
+    public static final String UPDATE_CAMPAIGN = "/rest/openapi/v2/campaign/update";
+
+
+    /**
+     * 修改广告组
+     */
+    public static final String UPDATE_UNIT = "/rest/openapi/v2/ad_unit/update";
+
+    /**
+     * 修改广告组状态
+     */
+    public static final String UPDATE_UNIT_STATUS = "/rest/openapi/v1/ad_unit/update/status";
+
+    /**
+     * 修改广告创意状态
+     */
+    public static final String UPDATE_CREATIVE_STATUS = "/rest/openapi/v1/creative/update/status";
+    /**
+     * 快手-广告主信息
+     */
+    public static final String ADVERTISER_INFO = "/rest/openapi/v1/advertiser/info";
+
+
+    /**
+     * 修改广告创意
+     */
+    public static final String UPDATE_CREATIVE = "/rest/openapi/v2/creative/update";
+
+    /**
+     * 快手-查询图片列表
+     */
+    public static final String IMAGE_LIST = "/rest/openapi/v1/file/ad/image/list";
+
+
+    /**
+     * 历史数据查询任务
+     */
+    public static final String ASYNC_TASK_CREAT = "/rest/openapi/v1/async_task/create";
+    /**
+     * 获取任务列表
+     */
+    public static final String ASYNC_TASK_LIST = "/rest/openapi/v1/async_task/list";
+
+    /**
+     * 下载数据
+     */
+    public static final String ASYNC_TASK_DOWNLOAD = "/rest/openapi/v1/async_task/download";
+
+    /**
+     * 落地页查询
+     */
+    public static final String PAGE_LIST = "/rest/openapi/v2/lp/page/list";
+
+    /**
+     * 获取操作记录
+     */
+    public static final String OPERATION_RECORD = "/rest/openapi/v1/tool/operation_record/list";
+
+
+    /**
+     * 登录
+     */
+    public static final String TYPE_LOGIN = "login";
+    /**
+     * 授权
+     */
+    public static final String TYPE_AUTHORIZATION = "authorization";
+    /**
+     * 登录方式-快手
+     */
+    public static final String LOGIN_TYPE_KUAISHOU = "kuaishou";
+    /**
+     * 登录方式-快手
+     */
+    public static final String LOGIN_TYPE_BYTEDANCE = "bytedance";
+    /**
+     * 请求前缀
+     */
+    public static final String HTTPS_PREFIX = "https:";
+    /**
+     * 评论列表数据查询接口
+     */
+    public static final String COMMENT_LIST = "/rest/openapi/v1/comment/list";
+    /**
+     * 批量回复评论接口
+     */
+    public static final String COMMENT_REPLY = "/rest/openapi/v1/comment/reply";
+    /**
+     * 回复评论接口
+     */
+    public static final String COMMENT_TREE = "/rest/openapi/v1/comment/tree";
+    /**
+     * 屏蔽评论接口
+     */
+    public static final String COMMENT_SHIELD = "/rest/openapi/v1/comment/shield";
+
+}

+ 108 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/MaterialEnum.java

@@ -0,0 +1,108 @@
+package com.xxl.job.executor.constant;
+
+/**
+ * 素材类型
+ */
+public enum MaterialEnum {
+
+
+    VerticalVideoSmall(1, 720, 1280),
+    VerticalVideo787Small(1, 787, 1280),
+    VerticalVideo846Small(1, 846, 1536),
+    VerticalVideo1080mall(1, 1080, 2200),
+    VerticalVideoBig(1, 1080, 1920),
+    VerticalVideo360(1, 360, 640),
+    VerticalVideo362(1, 362, 640),
+    VerticalVideo368(1, 368, 490),
+    VerticalVideo363(1, 363, 640),
+    VerticalVideo438(1, 438, 640),
+    VerticalVideo480(1, 480, 640),
+    VerticalVideo525(1, 525, 640),
+    VerticalVideo540(1, 540, 960),
+    VerticalVideo544(1, 544, 726),
+    VerticalVideo590(1, 590, 1280),
+    VerticalVideo694(1, 694, 1236),
+    VerticalVideo704(1, 704, 1252),
+    VerticalVideo710(1, 710, 1264),
+    VerticalVideo714(1, 714, 1270),
+    VerticalVideo716(1, 716, 1276),
+    VerticalVideo718(1, 718, 1278),
+    VerticalVideo719(1, 719, 1170),
+    VerticalVideo720(1, 720, 960),
+    VerticalVideo750(1, 750, 1334),
+    VerticalVideo787(1, 787, 1280),
+    VerticalVideo864(1, 864, 1536),
+    VerticalVideo1088(1, 1088, 1920),
+    VerticalVideo1181(1, 1181, 1920),
+    VerticalVideo1216(1, 1216, 2160),
+    VerticalVideo1296(1, 1296, 2304),
+    VerticalVideo1440(1, 1440, 2560),
+    VerticalVideo2160(1, 2160, 3840),
+    HorizontalVideoSmall(2, 1280, 720),
+    HorizontalVideoBig(2, 1920, 1080),
+    HorizontalVideo640(2, 640, 368),
+    HorizontalVideo1281(2, 1281, 720),
+    HorizontalVideo1400(2, 1400, 720),
+    HorizontalVideo1700(2, 1700, 1080),
+    HorizontalVideo1902(2, 1902, 1080),
+    HorizontalVideo1920(2, 1920, 1080),
+    BianlitieImageBig(4, 540, 540),
+    BianLitieImageSmall(4, 450, 450);
+
+    private Integer type;
+    private Integer width;
+    private Integer height;
+
+
+    private MaterialEnum(Integer type, Integer width, Integer height) {
+        this.type = type;
+        this.width = width;
+        this.height = height;
+    }
+
+    public static Integer getTypeBySize(Integer widthStr, Integer heightStr) {
+        for (MaterialEnum material : MaterialEnum.values()) {
+            Integer width = material.getWidth();
+            Integer height = material.getHeight();
+            if (widthStr.equals(width) && heightStr.equals(height)) {
+                return material.getType();
+            }
+        }
+
+        return 1;
+    }
+
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getWidth() {
+        return width;
+    }
+
+    public void setWidth(Integer width) {
+        this.width = width;
+    }
+
+    public Integer getHeight() {
+        return height;
+    }
+
+    public void setHeight(Integer height) {
+        this.height = height;
+    }
+
+    @Override
+    public String toString() {
+        return "MaterialEnum{" +
+                "type=" + type +
+                ", width=" + width +
+                ", height=" + height +
+                '}';
+    }
+}

+ 71 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/constant/MaterialSupplierEnum.java

@@ -0,0 +1,71 @@
+package com.xxl.job.executor.constant;
+
+/**
+ * 素材类型
+ */
+public enum MaterialSupplierEnum {
+
+
+    VerticalVideoSmall(559368L, 720, 1280),
+    VerticalVideoBig(560827L, 1080, 1920),
+    HorizontalVideoSmall(560828L, 1280, 720),
+    HorizontalVideoBig(560829L, 1920, 1080);
+
+
+    private Long templateId;
+    private Integer width;
+    private Integer height;
+
+
+    private MaterialSupplierEnum(Long templateId, Integer width, Integer height) {
+        this.templateId = templateId;
+        this.width = width;
+        this.height = height;
+    }
+
+    public static Long getTemplateIdBySize(Integer widthStr, Integer heightStr) {
+        for (MaterialSupplierEnum material : MaterialSupplierEnum.values()) {
+            Integer width = material.getWidth();
+            Integer height = material.getHeight();
+            if (widthStr.equals(width)  && heightStr.equals(height)) {
+                return material.getTemplateId();
+            }
+        }
+
+        return 0L;
+    }
+
+
+    public Long getTemplateId() {
+        return templateId;
+    }
+
+    public void setTemplateId(Long templateId) {
+        this.templateId = templateId;
+    }
+
+    public Integer getWidth() {
+        return width;
+    }
+
+    public void setWidth(Integer width) {
+        this.width = width;
+    }
+
+    public Integer getHeight() {
+        return height;
+    }
+
+    public void setHeight(Integer height) {
+        this.height = height;
+    }
+
+    @Override
+    public String toString() {
+        return "MaterialSupplierEnum{" +
+                "templateId=" + templateId +
+                ", width=" + width +
+                ", height=" + height +
+                '}';
+    }
+}

+ 22 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/entity/JobDistributeInfo.java

@@ -0,0 +1,22 @@
+package com.xxl.job.executor.job.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("ctop_job_distribute_info")
+public class JobDistributeInfo implements Serializable {
+    private Long id;
+    private Long jobId;
+    private String jobType;
+    private String jobName;
+    private String mediaType;
+    private Integer status;
+    private Date createTime;
+    private Date updateTime;
+}

+ 7 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/mapper/JobDistributeInfoMapper.java

@@ -0,0 +1,7 @@
+package com.xxl.job.executor.job.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xxl.job.executor.job.entity.JobDistributeInfo;
+
+public interface JobDistributeInfoMapper extends BaseMapper<JobDistributeInfo> {
+}

+ 4 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/mapper/xml/JobDistributeInfoMapper.xml

@@ -0,0 +1,4 @@
+<?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="com.xxl.job.executor.job.mapper.JobDistributeInfoMapper">
+</mapper>

+ 10 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/service/IJobDistributeInfoService.java

@@ -0,0 +1,10 @@
+package com.xxl.job.executor.job.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.job.entity.JobDistributeInfo;
+
+import java.util.List;
+
+public interface IJobDistributeInfoService extends IService<JobDistributeInfo> {
+    List<JobDistributeInfo> selectByParams(String jobType, String mediaType);
+}

+ 26 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/job/service/impl/JobDistributeInfoServiceImpl.java

@@ -0,0 +1,26 @@
+package com.xxl.job.executor.job.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.job.entity.JobDistributeInfo;
+import com.xxl.job.executor.job.mapper.JobDistributeInfoMapper;
+import com.xxl.job.executor.job.service.IJobDistributeInfoService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class JobDistributeInfoServiceImpl extends ServiceImpl<JobDistributeInfoMapper, JobDistributeInfo> implements IJobDistributeInfoService {
+    @Override
+    public List<JobDistributeInfo> selectByParams(String jobType, String mediaType) {
+        QueryWrapper<JobDistributeInfo>queryWrapper = new QueryWrapper<>();
+        if(null!=jobType&&!"".equals(jobType.trim())){
+            queryWrapper.eq("job_type",jobType);
+        }
+        if(null!=mediaType&&!"".equals(mediaType.trim())){
+            queryWrapper.eq("media_type",mediaType);
+        }
+        queryWrapper.eq("status",1);
+        return this.list(queryWrapper);
+    }
+}

+ 54 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/BytedanceDistributeJob.java

@@ -0,0 +1,54 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.job.entity.JobDistributeInfo;
+import com.xxl.job.executor.job.service.IJobDistributeInfoService;
+import com.xxl.job.executor.utils.HttpUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+
+@Component
+public class BytedanceDistributeJob {
+    @Autowired
+    private IJobDistributeInfoService jobDistributeInfoService;
+//    String URLPREFIX = "http://139.186.29.76:8090/xxl-job-admin/jobinfo/trigger?id=";
+String URLPREFIX = "http://127.0.0.1:8090/xxl-job-admin/jobinfo/trigger?id=";
+    String EXECUTORPARAM = "&executorParam=";
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @XxlJob("kuaishouDistributeDailyJob")
+    public void kuaishouDistributeDailyJob(){
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        if(null!=tokens&&!tokens.isEmpty()){
+            List<JobDistributeInfo>distributeInfos = jobDistributeInfoService.selectByParams("DAILY","KUAISHOU");
+            if(null!=distributeInfos&&!distributeInfos.isEmpty()){
+                tokens.forEach(token->
+                    distributeInfos.forEach(distributeInfo->{
+                        String url = URLPREFIX+distributeInfo.getJobId()+EXECUTORPARAM+token.getAccountId();
+                        HttpUtils.httpGet(url,new HashMap<>(),new HashMap<>());
+                    }));
+            }
+        }
+    }
+
+    @XxlJob("kuaishouDistributeHourlyJob")
+    public void kuaishouDistributeHourlyJob(){
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        if(null!=tokens&&!tokens.isEmpty()){
+            List<JobDistributeInfo>distributeInfos = jobDistributeInfoService.selectByParams("HOURLY","KUAISHOU");
+            if(null!=distributeInfos&&!distributeInfos.isEmpty()){
+                for (CtopOauthToken token:tokens) {
+                    for (JobDistributeInfo job : distributeInfos) {
+                        String url = URLPREFIX + job.getJobId() + EXECUTORPARAM + token.getAccountId();
+                        HttpUtils.httpGet(url, new HashMap<>(), new HashMap<>());
+                    }
+                }
+            }
+        }
+    }
+}

+ 42 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouCampaignJob.java

@@ -0,0 +1,42 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 快手计划物料数据
+ */
+@Component
+public class KuaishouCampaignJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouCampaignJob")
+    public void execute() {
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date endDate = new Date();
+        Date startDate = DateUtils.addDay(endDate,-1);
+        kuaishouInterfaceService.getCampaignList(token, startDate, endDate);
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+}

+ 40 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouCreativeJob.java

@@ -0,0 +1,40 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Component
+public class KuaishouCreativeJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouCreative")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date endDate = new Date();
+        Date startDate = DateUtils.addDay(endDate,-1);
+        kuaishouInterfaceService.getCreativeList(token, startDate, endDate);
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+
+}

+ 45 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyAccountReportLoadJob.java

@@ -0,0 +1,45 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 快手广告主日报
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyAccountReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @XxlJob("kuaishouDailyAccountReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+
+        Date endDate = DateUtils.addDay(new Date(), -1);
+        Date startDate = DateUtils.addDay(new Date(), -3);
+        kuaishouInterfaceService.getAdvertiserReportDaily(token, startDate,endDate);
+    }
+}

+ 43 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyCampaignReportLoadJob.java

@@ -0,0 +1,43 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 广告计划日报
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyCampaignReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @XxlJob("kuaishouDailyCampaignReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
+    }
+}

+ 43 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyCreativeReportLoadJob.java

@@ -0,0 +1,43 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 获取创意日报
+ *
+ * @author jeecg-boot
+ */
+@Component
+public class KuaishouDailyCreativeReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouDailyCreativeReport")
+    public void execute() {
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, null, null);
+    }
+
+}

+ 36 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyFlowsJob.java

@@ -0,0 +1,36 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 快手账户流水报表
+ */
+@Component
+public class KuaishouDailyFlowsJob {
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @XxlJob("kuaishouDailyFlowsJob")
+    public void execute() {
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = oauthTokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        kuaishouInterfaceService.getDailyFlows(token);
+    }
+}

+ 42 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouDailyGroupReportLoadJob.java

@@ -0,0 +1,42 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 获取广告组日报
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyGroupReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouDailyGroupReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
+    }
+}

+ 42 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouGroupJob.java

@@ -0,0 +1,42 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 快手广告组物料数据
+ */
+@Component
+public class KuaishouGroupJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouGroup")
+    public void execute() {
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date endDate = new Date();
+        Date startDate = DateUtils.addDay(endDate,-1);
+        kuaishouInterfaceService.getGroupList(token, startDate, endDate);
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+}

+ 50 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyAccountReportLoadJob.java

@@ -0,0 +1,50 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 获取广告主时报
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyAccountReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @XxlJob("kuaishouHourlyAccountReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if ("00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+        kuaishouInterfaceService.getAdvertiserReportHourly(token, getDate, getDate);
+    }
+}

+ 50 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyCampaignReportLoadJob.java

@@ -0,0 +1,50 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 获取广告计划分时报表
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyCampaignReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @XxlJob("kuaishouHourlyCampaignReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if ("00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+        kuaishouInterfaceService.getAdvertiserCampaignReportHourly(token, getDate, getDate);
+    }
+}

+ 48 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyCreativeReportLoadJob.java

@@ -0,0 +1,48 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 获取 广告创意时报
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyCreativeReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouHourlyCreativeReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if ("00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+        kuaishouInterfaceService.getAdvertiserCreativeReportHourly(token, getDate,getDate);
+    }
+}

+ 49 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouHourlyGroupReportLoadJob.java

@@ -0,0 +1,49 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 获取 广告组时报
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyGroupReportLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @XxlJob("kuaishouHourlyGroupReport")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if (null != hour && "00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+       kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, getDate,getDate);
+    }
+}

+ 43 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouMatDailyReportJob.java

@@ -0,0 +1,43 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaiShouReportDailyMaterialService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 快手素材日报
+ */
+@Component
+public class KuaishouMatDailyReportJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+
+    @XxlJob("kuaishouMaterialReportByStateDate")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        //增加接口的开始和结束日期
+        String endDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -1);
+        kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(),token.getAccessToken(),startDate,endDate,1);
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+
+}

+ 44 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouMaterialsLoadJob.java

@@ -0,0 +1,44 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 快手物料数据
+ */
+@Component
+public class KuaishouMaterialsLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouMaterials")
+    public void execute() {
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        //增加接口的开始和结束日期
+        String endDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -1);
+        //获取全量视频素材数据
+//        kuaishouInterfaceService.getVideoList(token, startDate, endDate);
+        // 获取图片信息数据
+        kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+}

+ 45 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouOperationRecordJob.java

@@ -0,0 +1,45 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Component
+public class KuaishouOperationRecordJob {
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @XxlJob("kuaishouOperationRecord")
+    public void execute(){
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        String date = DateUtils.formatDate(getDate);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(), token.getAccessToken(), 1, date, date);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(),token.getAccessToken(),2, date, date);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(),token.getAccessToken(),3, date, date);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(),token.getAccessToken(),4, date, date);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(),token.getAccessToken(),5, date, date);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(),token.getAccessToken(),6, date, date);
+        kuaishouInterfaceService.getOperationRecord(token.getAccountId(),token.getAccessToken(),7, date, date);
+    }
+
+}

+ 40 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/jobhandler/KuaishouSuZaoLoadJob.java

@@ -0,0 +1,40 @@
+package com.xxl.job.executor.jobhandler;
+
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.executor.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.executor.common.entity.CtopOauthToken;
+import com.xxl.job.executor.common.service.ICtopOauthTokenService;
+import com.xxl.job.executor.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaishouSuZaoLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @XxlJob("kuaishouSuZao")
+    public void execute() {
+        String param = XxlJobHelper.getJobParam();
+        if (param==null || param.trim().length()==0) {
+            XxlJobHelper.log("param["+ param +"] invalid.");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(param);
+        if (null == token) {
+            XxlJobHelper.log("获取头条token数据异常:账户{}token不存在",param);
+            XxlJobHelper.handleFail();
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, 1);
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        kuaishouInterfaceService.getSuZaoList(token.getAccessToken(), token.getAccountId(), 1, startDate, endDate);
+        XxlJobHelper.log("快手素造数据同步完成");
+    }
+
+
+}

+ 28 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouAccessToken.java

@@ -0,0 +1,28 @@
+package com.xxl.job.executor.material.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("ctop_kuaishou_token")
+public class KuaishouAccessToken implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @JsonProperty("advertiser_id")
+    @TableId
+    private Long accountId;
+    @JsonProperty("access_token")
+    private String accessToken;
+    @JsonProperty("access_token_expires_in")
+    private Integer accessTokenExpiresIn;
+    private Date accessTokenExpiresInDate;
+    @JsonProperty("refresh_token")
+    private String refreshToken;
+    @JsonProperty("refresh_token_expires_in")
+    private Integer refreshTokenExpiresIn;
+    private Date refreshTokenExpiresInDate;
+}

+ 17 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouResult.java

@@ -0,0 +1,17 @@
+package com.xxl.job.executor.material.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class KuaishouResult<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @JsonProperty
+    private Integer code;
+    @JsonProperty
+    private String message;
+    @JsonProperty
+    private KuaishouResultData<T> data;
+}

+ 16 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouResultData.java

@@ -0,0 +1,16 @@
+package com.xxl.job.executor.material.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class KuaishouResultData<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @JsonProperty("total_count")
+    private Integer totalCount;
+    @JsonProperty
+    private List<T> details;
+}

+ 17 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/entity/KuaishouResultToken.java

@@ -0,0 +1,17 @@
+package com.xxl.job.executor.material.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class KuaishouResultToken implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @JsonProperty
+    private Integer code;
+    @JsonProperty
+    private String message;
+    @JsonProperty
+    private KuaishouAccessToken data;
+}

+ 7 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/mapper/KuaishouAccessTokenMapper.java

@@ -0,0 +1,7 @@
+package com.xxl.job.executor.material.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xxl.job.executor.material.entity.KuaishouAccessToken;
+
+public interface KuaishouAccessTokenMapper extends BaseMapper<KuaishouAccessToken> {
+}

+ 7 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/service/IKuaishouAccessTokenService.java

@@ -0,0 +1,7 @@
+package com.xxl.job.executor.material.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.material.entity.KuaishouAccessToken;
+
+public interface IKuaishouAccessTokenService extends IService<KuaishouAccessToken> {
+}

+ 11 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/material/service/impl/KuaishouAccessTokenServiceImpl.java

@@ -0,0 +1,11 @@
+package com.xxl.job.executor.material.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.material.entity.KuaishouAccessToken;
+import com.xxl.job.executor.material.mapper.KuaishouAccessTokenMapper;
+import com.xxl.job.executor.material.service.IKuaishouAccessTokenService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class KuaishouAccessTokenServiceImpl extends ServiceImpl<KuaishouAccessTokenMapper, KuaishouAccessToken> implements IKuaishouAccessTokenService {
+}

+ 616 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/mapper/xml/KuaishouReportDailyGroupMapper.xml

@@ -0,0 +1,616 @@
+<?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="com.xxl.job.executor.report.mapper.KuaishouReportDailyGroupMapper">
+
+    <insert id="loadGroupDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+	    INTO TABLE ctop_kuaishou_report_daily_group
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(
+		unit_id,
+		unit_name,
+		status,
+		campaign_id,
+		campaign_name,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        @click_1k_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio,
+        @event_valid_clues,
+        @event_valid_clues_cost,
+        @ad_product_cnt,
+        @event_goods_view,
+        @merchant_reco_fans,
+        @event_order_amount_roi,
+        @event_goods_view_cost,
+        @merchant_reco_fans_cost,
+        @event_new_user_pay,
+        @event_new_user_pay_cost,
+        @event_new_user_pay_ratio,
+        @event_button_click,
+        @event_button_click_cost,
+        @event_button_click_ratio,
+        @play_5s_ratio,
+        @play_end_ratio,
+        @event_order_paid_roi,
+        @event_new_user_jinjian_app,
+        @event_new_user_jinjian_app_cost,
+        @event_new_user_jinjian_app_roi,
+        @event_new_user_credit_grant_app,
+        @event_new_user_credit_grant_app_cost,
+        @event_new_user_credit_grant_app_roi,
+        @event_new_user_jinjian_page,
+        @event_new_user_jinjian_page_cost,
+        @event_new_user_jinjian_page_roi,
+        @event_new_user_credit_grant_page,
+        @event_new_user_credit_grant_page_cost,
+        @event_new_user_credit_grant_page_roi,
+        @event_appoint_form,
+        @event_appoint_form_cost,
+        @event_appoint_form_ratio,
+        @event_appoint_jump_click,
+        @event_appoint_jump_click_cost,
+        @event_appoint_jump_click_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
+    <insert id="insertSelective" parameterType="com.xxl.job.executor.report.entity.KuaishouReportDailyGroup" >
+        replace into ctop_kuaishou_report_daily_group
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="id != null" >
+                id,
+            </if>
+            <if test="accountId != null" >
+                account_id,
+            </if>
+            <if test="unitId != null" >
+                unit_id,
+            </if>
+            <if test="campaignId != null" >
+                campaign_id,
+            </if>
+            <if test="status != null" >
+                status,
+            </if>
+            <if test="charge != null" >
+                charge,
+            </if>
+            <if test="photoShow != null" >
+                photo_show,
+            </if>
+            <if test="aclick != null" >
+                aclick,
+            </if>
+            <if test="bclick != null" >
+                bclick,
+            </if>
+            <if test="photoShare != null" >
+                photo_share,
+            </if>
+            <if test="photoComment != null" >
+                photo_comment,
+            </if>
+            <if test="photoLike != null" >
+                photo_like,
+            </if>
+            <if test="follow != null" >
+                follow,
+            </if>
+            <if test="cancelFollow != null" >
+                cancel_follow,
+            </if>
+            <if test="report != null" >
+                report,
+            </if>
+            <if test="block != null" >
+                block,
+            </if>
+            <if test="negative != null" >
+                negative,
+            </if>
+            <if test="downloadStarted != null" >
+                download_started,
+            </if>
+            <if test="downloadCompleted != null" >
+                download_completed,
+            </if>
+            <if test="activation != null" >
+                activation,
+            </if>
+            <if test="submit != null" >
+                submit,
+            </if>
+            <if test="statDate != null" >
+                stat_date,
+            </if>
+            <if test="photoClick != null" >
+                photo_click,
+            </if>
+            <if test="photoClickRatio != null" >
+                photo_click_ratio,
+            </if>
+            <if test="actionRatio != null" >
+                action_ratio,
+            </if>
+            <if test="impression1kCost != null" >
+                impression_1k_cost,
+            </if>
+            <if test="photoClickCost != null" >
+                photo_click_cost,
+            </if>
+            <if test="actionCost != null" >
+                action_cost,
+            </if>
+            <if test="eventPayFirstDay != null" >
+                event_pay_first_day,
+            </if>
+            <if test="eventPayPurchaseAmountFirstDay != null" >
+                event_pay_purchase_amount_first_day,
+            </if>
+            <if test="eventPayFirstDayRoi != null" >
+                event_pay_first_day_roi,
+            </if>
+            <if test="eventPay != null" >
+                event_pay,
+            </if>
+            <if test="eventPayPurchaseAmount != null" >
+                event_pay_purchase_amount,
+            </if>
+            <if test="eventPayRoi != null" >
+                event_pay_roi,
+            </if>
+            <if test="eventRegister != null" >
+                event_register,
+            </if>
+            <if test="eventRegisterCost != null" >
+                event_register_cost,
+            </if>
+            <if test="eventRegisterRatio != null" >
+                event_register_ratio,
+            </if>
+            <if test="eventJinJianApp != null" >
+                event_jin_jian_app,
+            </if>
+            <if test="eventJinJianAppCost != null" >
+                event_jin_jian_app_cost,
+            </if>
+            <if test="eventCreditGrantApp != null" >
+                event_credit_grant_app,
+            </if>
+            <if test="eventCreditGrantAppCost != null" >
+                event_credit_grant_app_cost,
+            </if>
+            <if test="eventCreditGrantAppRatio != null" >
+                event_credit_grant_app_ratio,
+            </if>
+            <if test="eventOrderPaid != null" >
+                event_order_paid,
+            </if>
+            <if test="eventOrderPaidPurchaseAmount != null" >
+                event_order_paid_purchase_amount,
+            </if>
+            <if test="eventJinJianLandingPage != null" >
+                event_jin_jian_landing_page,
+            </if>
+            <if test="eventJinJianLandingPageCost != null" >
+                event_jin_jian_landing_page_cost,
+            </if>
+            <if test="eventCreditGrantLandingPage != null" >
+                event_credit_grant_landing_page,
+            </if>
+            <if test="eventCreditGrantLandingPageCost != null" >
+                event_credit_grant_landing_page_cost,
+            </if>
+            <if test="eventCreditGrantLandingRatio != null" >
+                event_credit_grant_landing_ratio,
+            </if>
+            <if test="eventNextDayStayCost != null" >
+                event_next_day_stay_cost,
+            </if>
+            <if test="eventNextDayStayRatio != null" >
+                event_next_day_stay_ratio,
+            </if>
+            <if test="formActionRatio != null" >
+                form_action_ratio,
+            </if>
+            <if test="eventOrderPaidCost != null" >
+                event_order_paid_cost,
+            </if>
+            <if test="eventNextDayStay != null" >
+                event_next_day_stay,
+            </if>
+            <if test="formCost != null" >
+                form_cost,
+            </if>
+            <if test="formCount != null" >
+                form_count,
+            </if>
+            <if test="play3sRatio != null" >
+                play_3s_ratio,
+            </if>
+            <if test="createTime != null" >
+                create_time,
+            </if>
+            <if test="updateTime != null" >
+                update_time,
+            </if>
+            <if test="channelCode != null" >
+                channel_code,
+            </if>
+            <if test="unitName != null" >
+                unit_name,
+            </if>
+            <if test="campaignName != null" >
+                campaign_name,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="id != null" >
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="accountId != null" >
+                #{accountId,jdbcType=BIGINT},
+            </if>
+            <if test="unitId != null" >
+                #{unitId,jdbcType=BIGINT},
+            </if>
+            <if test="campaignId != null" >
+                #{campaignId,jdbcType=BIGINT},
+            </if>
+            <if test="status != null" >
+                #{status,jdbcType=INTEGER},
+            </if>
+            <if test="charge != null" >
+                #{charge,jdbcType=DECIMAL},
+            </if>
+            <if test="photoShow != null" >
+                #{photoShow,jdbcType=BIGINT},
+            </if>
+            <if test="aclick != null" >
+                #{aclick,jdbcType=BIGINT},
+            </if>
+            <if test="bclick != null" >
+                #{bclick,jdbcType=BIGINT},
+            </if>
+            <if test="photoShare != null" >
+                #{photoShare,jdbcType=BIGINT},
+            </if>
+            <if test="photoComment != null" >
+                #{photoComment,jdbcType=BIGINT},
+            </if>
+            <if test="photoLike != null" >
+                #{photoLike,jdbcType=BIGINT},
+            </if>
+            <if test="follow != null" >
+                #{follow,jdbcType=BIGINT},
+            </if>
+            <if test="cancelFollow != null" >
+                #{cancelFollow,jdbcType=BIGINT},
+            </if>
+            <if test="report != null" >
+                #{report,jdbcType=BIGINT},
+            </if>
+            <if test="block != null" >
+                #{block,jdbcType=BIGINT},
+            </if>
+            <if test="negative != null" >
+                #{negative,jdbcType=BIGINT},
+            </if>
+            <if test="downloadStarted != null" >
+                #{downloadStarted,jdbcType=BIGINT},
+            </if>
+            <if test="downloadCompleted != null" >
+                #{downloadCompleted,jdbcType=BIGINT},
+            </if>
+            <if test="activation != null" >
+                #{activation,jdbcType=BIGINT},
+            </if>
+            <if test="submit != null" >
+                #{submit,jdbcType=BIGINT},
+            </if>
+            <if test="statDate != null" >
+                #{statDate,jdbcType=VARCHAR},
+            </if>
+            <if test="photoClick != null" >
+                #{photoClick,jdbcType=BIGINT},
+            </if>
+            <if test="photoClickRatio != null" >
+                #{photoClickRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="actionRatio != null" >
+                #{actionRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="impression1kCost != null" >
+                #{impression1kCost,jdbcType=DECIMAL},
+            </if>
+            <if test="photoClickCost != null" >
+                #{photoClickCost,jdbcType=DECIMAL},
+            </if>
+            <if test="actionCost != null" >
+                #{actionCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayFirstDay != null" >
+                #{eventPayFirstDay,jdbcType=BIGINT},
+            </if>
+            <if test="eventPayPurchaseAmountFirstDay != null" >
+                #{eventPayPurchaseAmountFirstDay,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayFirstDayRoi != null" >
+                #{eventPayFirstDayRoi,jdbcType=DOUBLE},
+            </if>
+            <if test="eventPay != null" >
+                #{eventPay,jdbcType=BIGINT},
+            </if>
+            <if test="eventPayPurchaseAmount != null" >
+                #{eventPayPurchaseAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayRoi != null" >
+                #{eventPayRoi,jdbcType=DOUBLE},
+            </if>
+            <if test="eventRegister != null" >
+                #{eventRegister,jdbcType=BIGINT},
+            </if>
+            <if test="eventRegisterCost != null" >
+                #{eventRegisterCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventRegisterRatio != null" >
+                #{eventRegisterRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventJinJianApp != null" >
+                #{eventJinJianApp,jdbcType=BIGINT},
+            </if>
+            <if test="eventJinJianAppCost != null" >
+                #{eventJinJianAppCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantApp != null" >
+                #{eventCreditGrantApp,jdbcType=BIGINT},
+            </if>
+            <if test="eventCreditGrantAppCost != null" >
+                #{eventCreditGrantAppCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantAppRatio != null" >
+                #{eventCreditGrantAppRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventOrderPaid != null" >
+                #{eventOrderPaid,jdbcType=BIGINT},
+            </if>
+            <if test="eventOrderPaidPurchaseAmount != null" >
+                #{eventOrderPaidPurchaseAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="eventJinJianLandingPage != null" >
+                #{eventJinJianLandingPage,jdbcType=BIGINT},
+            </if>
+            <if test="eventJinJianLandingPageCost != null" >
+                #{eventJinJianLandingPageCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantLandingPage != null" >
+                #{eventCreditGrantLandingPage,jdbcType=BIGINT},
+            </if>
+            <if test="eventCreditGrantLandingPageCost != null" >
+                #{eventCreditGrantLandingPageCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantLandingRatio != null" >
+                #{eventCreditGrantLandingRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventNextDayStayCost != null" >
+                #{eventNextDayStayCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventNextDayStayRatio != null" >
+                #{eventNextDayStayRatio,jdbcType=BIGINT},
+            </if>
+            <if test="formActionRatio != null" >
+                #{formActionRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventOrderPaidCost != null" >
+                #{eventOrderPaidCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventNextDayStay != null" >
+                #{eventNextDayStay,jdbcType=BIGINT},
+            </if>
+            <if test="formCost != null" >
+                #{formCost,jdbcType=DECIMAL},
+            </if>
+            <if test="formCount != null" >
+                #{formCount,jdbcType=BIGINT},
+            </if>
+            <if test="play3sRatio != null" >
+                #{play3sRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateTime != null" >
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="channelCode != null" >
+                #{channelCode,jdbcType=VARCHAR},
+            </if>
+            <if test="unitName != null" >
+                #{unitName,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="campaignName != null" >
+                #{campaignName,jdbcType=LONGVARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <insert id="replaceBatch">
+        replace into ctop_kuaishou_report_daily_group(
+        account_id,
+        unit_id,
+        unit_name,
+        campaign_id,
+        status,
+        campaign_name,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        form_action_ratio,
+        event_order_paid_cost,
+        event_next_day_stay,
+        form_cost,
+        form_count,
+        play_3s_ratio
+        )
+        values
+        <foreach collection="records" item="record" separator=",">
+            (
+            #{record.accountId},
+            #{record.unitId},
+            #{record.unitName},
+            #{record.campaignId},
+            #{record.status},
+            #{record.campaignName},
+            #{record.charge},
+            #{record.photoShow},
+            #{record.aclick},
+            #{record.bclick},
+            #{record.photoShare},
+            #{record.photoComment},
+            #{record.photoLike},
+            #{record.follow},
+            #{record.cancelFollow},
+            #{record.report},
+            #{record.block},
+            #{record.negative},
+            #{record.downloadStarted},
+            #{record.downloadCompleted},
+            #{record.activation},
+            #{record.submit},
+            #{record.statDate},
+            #{record.photoClick},
+            #{record.photoClickRatio},
+            #{record.actionRatio},
+            #{record.impression1kCost},
+            #{record.photoClickCost},
+            #{record.actionCost},
+            #{record.eventPayFirstDay},
+            #{record.eventPayPurchaseAmountFirstDay},
+            #{record.eventPayFirstDayRoi},
+            #{record.eventPay},
+            #{record.eventPayPurchaseAmount},
+            #{record.eventPayRoi},
+            #{record.eventRegister},
+            #{record.eventRegisterCost},
+            #{record.eventRegisterRatio},
+            #{record.eventJinJianApp},
+            #{record.eventJinJianAppCost},
+            #{record.eventCreditGrantApp},
+            #{record.eventCreditGrantAppCost},
+            #{record.eventCreditGrantAppRatio},
+            #{record.eventOrderPaid},
+            #{record.eventOrderPaidPurchaseAmount},
+            #{record.eventJinJianLandingPage},
+            #{record.eventJinJianLandingPageCost},
+            #{record.eventCreditGrantLandingPage},
+            #{record.eventCreditGrantLandingPageCost},
+            #{record.eventCreditGrantLandingRatio},
+            #{record.eventNextDayStayCost},
+            #{record.eventNextDayStayRatio},
+            #{record.formActionRatio},
+            #{record.eventOrderPaidCost},
+            #{record.eventNextDayStay},
+            #{record.formCost},
+            #{record.formCount},
+            #{record.play3sRatio}
+            )
+        </foreach>
+    </insert>
+
+
+</mapper>

+ 222 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/mapper/xml/KuaishouReportDailyImageMapper.xml

@@ -0,0 +1,222 @@
+<?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="com.xxl.job.executor.report.mapper.KuaishouReportDailyImageMapper">
+
+    <insert id="loadImageDailyReport">
+        LOAD DATA local INFILE  #{localPath}
+	     INTO TABLE ctop_kuaishou_report_daily_image
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(
+		cover_id,
+        image_token,
+        cover_url,
+        ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        click_1k_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio,
+        @event_valid_clues,
+        @event_valid_clues_cost,
+        @ad_product_cnt,
+        @event_goods_view,
+        @merchant_reco_fans,
+        @event_order_amount_roi,
+        @event_goods_view_cost,
+        @merchant_reco_fans_cost,
+        @event_new_user_pay,
+        @event_new_user_pay_cost,
+        @event_new_user_pay_ratio,
+        @event_button_click,
+        @event_button_click_cost,
+        @event_button_click_ratio,
+        @play_5s_ratio,
+        @play_end_ratio,
+        @event_order_paid_roi,
+        @event_new_user_jinjian_app,
+        @event_new_user_jinjian_app_cost,
+        @event_new_user_jinjian_app_roi,
+        @event_new_user_credit_grant_app,
+        @event_new_user_credit_grant_app_cost,
+        @event_new_user_credit_grant_app_roi,
+        @event_new_user_jinjian_page,
+        @event_new_user_jinjian_page_cost,
+        @event_new_user_jinjian_page_roi,
+        @event_new_user_credit_grant_page,
+        @event_new_user_credit_grant_page_cost,
+        @event_new_user_credit_grant_page_roi,
+        @event_appoint_form,
+        @event_appoint_form_cost,
+        @event_appoint_form_ratio,
+        @event_appoint_jump_click,
+        @event_appoint_jump_click_cost,
+        @event_appoint_jump_click_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+    <select id="imageCost" resultType="com.xxl.job.executor.entity.vo.KuaishouImageCostVO">
+        select * from (select
+        report.cover_url as 'imageUrl' ,
+        report.cover_id as 'signature',
+        group_concat(distinct p.project_name) AS 'projectName',
+        sum(report.charge) AS 'cost',
+        sum(report.photo_click) AS 'photoClick',
+        (case when sum(report.photo_show)!=0 and sum(report.photo_click)!=0
+        then round(sum(photo_click)/sum(photo_show)*100,2)
+        else 0 end)as 'photoClickRate',
+        sum(report.photo_show) AS 'photoShow',
+        (case when sum(report.charge)!=0 and sum(report.photo_show)!=0
+        then round(sum(charge)/sum(photo_show)*1000,2)
+        else 0 end)as 'photoShowCost',
+        sum(report.aclick) as 'aclick',
+        sum(report.bclick) as 'bclick',
+        (case when sum(report.bclick)!=0 and sum(report.aclick)!=0
+        then round(sum(bclick)/sum(aclick)*100,2)
+        else 0 end)as 'bclickRate',
+        (case when sum(report.charge)!=0 and sum(report.aclick)!=0
+        then round(sum(charge)/sum(aclick)*1000,2)
+        else 0 end)as 'aclickCost',
+        sum(report.activation) AS 'activation',
+        sum(report.event_register) AS 'eventRegister',
+        sum(report.event_pay) AS 'eventPay',
+        sum(report.form_count) AS 'formCount',
+        sum(report.event_jin_jian_app) AS 'eventJinJianApp',
+        sum(report.event_credit_grant_app) AS 'eventCreditGrantApp'
+        from ctop_kuaishou_report_daily_image report
+        left join ctop_user_allocation allocation on allocation.account_id = report.account_id
+        left join ctop_project p on p.id = allocation.project_id
+        where
+            1=1
+        and
+            report.cover_id is not null
+        <if test="startDate!=null">
+            and report.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and report.stat_date &lt;= #{endDate}
+        </if>
+        <if test="accountList!=null">
+            and report.account_id in
+            <foreach item="accountId" collection="accountList" open="(" separator="," close=")">
+                #{accountId}
+            </foreach>
+        </if>
+        <if test="code!=null">
+            and report.cover_id = #{code}
+        </if>
+        group by report.cover_id)a
+        order by a.${target} ${order}
+    </select>
+
+    <select id="imageCostTotal" resultType="com.xxl.job.executor.entity.vo.KuaishouImageCostVO">
+        select
+        sum(report.charge) AS 'cost',
+        sum(report.photo_click) AS 'photoClick',
+        (case when sum(report.photo_show)!=0 and sum(report.photo_click)!=0
+        then round(sum(photo_click)/sum(photo_show)*100,2)
+        else 0 end)as 'photoClickRate',
+        sum(report.photo_show) AS 'photoShow',
+        (case when sum(report.charge)!=0 and sum(report.photo_show)!=0
+        then round(sum(charge)/sum(photo_show)*1000,2)
+        else 0 end)as 'photoShowCost',
+        sum(report.aclick) as 'aclick',
+        sum(report.bclick) as 'bclick',
+        (case when sum(report.bclick)!=0 and sum(report.aclick)!=0
+        then round(sum(bclick)/sum(aclick)*100,2)
+        else 0 end)as 'bclickRate',
+        (case when sum(report.charge)!=0 and sum(report.aclick)!=0
+        then round(sum(charge)/sum(aclick)*1000,2)
+        else 0 end)as 'aclickCost',
+        sum(report.activation) AS 'activation',
+        sum(report.event_register) AS 'eventRegister',
+        sum(report.event_pay) AS 'eventPay',
+        sum(report.form_count) AS 'formCount',
+        sum(report.event_jin_jian_app) AS 'eventJinJianApp',
+        sum(report.event_credit_grant_app) AS 'eventCreditGrantApp'
+        from ctop_kuaishou_report_daily_image report
+        left join ctop_user_allocation allocation on allocation.account_id = report.account_id
+        left join ctop_project p on p.id = allocation.project_id
+        where
+        1=1
+        and
+        report.cover_id is not null
+        <if test="startDate!=null">
+            and report.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and report.stat_date &lt;= #{endDate}
+        </if>
+        <if test="accountList!=null">
+            and report.account_id in
+            <foreach item="accountId" collection="accountList" open="(" separator="," close=")">
+                #{accountId}
+            </foreach>
+        </if>
+        <if test="code!=null">
+            and report.cover_id = #{code}
+        </if>
+    </select>
+
+    <update id="updateImageReportCode">
+        update ctop_kuaishou_report_daily_image a inner join  ctop_kuaishou_image_get  image on image.image_token =a.image_token  set a.code = image.signature
+        where a.code is null
+    </update>
+    <update id="updateImageReportUserId">
+        update ctop_kuaishou_report_daily_image a inner join  ctop_material_image_info  image on image.code =a.code  set a.user_id = image.user_id
+        where a.code is not null and a.user_id is null
+    </update>
+    <update id="updateImageReportRealname">
+        update ctop_kuaishou_report_daily_image a inner join  sys_user  user on user.id =a.user_id  set a.realname = user.realname
+        where a.user_id is not null and a.realname is null
+    </update>
+</mapper>

+ 110 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/mapper/xml/KuaishouReportHourlyCampaignMapper.xml

@@ -0,0 +1,110 @@
+<?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="com.xxl.job.executor.report.mapper.KuaishouReportHourlyCampaignMapper">
+    <insert id="replaceBatch">
+        replace into ctop_kuaishou_report_hourly_campaign(
+        id,
+        account_id,
+        campaign_id,
+        stat_date,
+        stat_hour,
+        charge,
+        photo_click,
+        photo_show,
+        aclick,
+        bclick,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        event_credit_grant_landing_page_cost ,
+        event_credit_grant_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_jin_jian_landing_page,
+        form_action_ratio,
+        form_cost,
+        form_count,
+        event_order_paid_cost,
+        event_order_paid_purchase_amount,
+        event_order_paid,
+        event_credit_grant_app_ratio,
+        event_credit_grant_app_cost,
+        event_credit_grant_app,
+        event_pay_purchase_amount_first_day,
+        event_jin_jian_app_cost,
+        event_jin_jian_app,
+        event_register_cost,
+        event_register,
+        event_pay_roi,
+        event_pay_purchase_amount,
+        event_pay,
+        event_pay_first_day_roi,
+        event_pay_first_day,
+        photo_click_cost,
+        action_cost,
+        share ,
+        comment ,
+        photo_like ,
+        follow,
+        report,
+        block,
+        negative,
+        activation,
+        submit,
+        cancel_follow,
+        download_started,
+        download_completed)
+        values
+        <foreach collection="campaigns" item="campaign" separator=",">
+            (#{campaign.id},
+            #{campaign.accountId},
+            #{campaign.campaignId},
+            #{campaign.statDate},
+            #{campaign.statHour},
+            #{campaign.charge},
+            #{campaign.photoClick},
+            #{campaign.photoShow},
+            #{campaign.aclick},
+            #{campaign.bclick},
+            #{campaign.photoClickRatio},
+            #{campaign.actionRatio},
+            #{campaign.impression1kCost},
+            #{campaign.eventCreditGrantLandingPageCost},
+            #{campaign.eventCreditGrantLandingPage},
+            #{campaign.eventJinJianLandingPageCost},
+            #{campaign.eventJinJianLandingPage},
+            #{campaign.formActionRatio},
+            #{campaign.formCost},
+            #{campaign.formCount},
+            #{campaign.eventOrderPaidCost},
+            #{campaign.eventOrderPaidPurchaseAmount},
+            #{campaign.eventOrderPaid},
+            #{campaign.eventCreditGrantAppRatio},
+            #{campaign.eventCreditGrantAppCost},
+            #{campaign.eventCreditGrantApp},
+            #{campaign.eventPayPurchaseAmountFirstDay},
+            #{campaign.eventJinJianAppCost},
+            #{campaign.eventJinJianApp},
+            #{campaign.eventRegisterCost},
+            #{campaign.eventRegister},
+            #{campaign.eventPayRoi},
+            #{campaign.eventPayPurchaseAmount},
+            #{campaign.eventPay},
+            #{campaign.eventPayFirstDayRoi},
+            #{campaign.eventPayFirstDay},
+            #{campaign.photoClickCost},
+            #{campaign.actionCost},
+            #{campaign.share},
+            #{campaign.comment},
+            #{campaign.photoLike},
+            #{campaign.follow},
+            #{campaign.report},
+            #{campaign.block},
+            #{campaign.negative},
+            #{campaign.activation},
+            #{campaign.submit},
+            #{campaign.cancelFollow},
+            #{campaign.downloadStarted},
+            #{campaign.downloadCompleted})
+        </foreach>
+    </insert>
+</mapper>

+ 10 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyCampaignService.java

@@ -0,0 +1,10 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyCampaign;
+
+import java.util.List;
+
+public interface IKuaishouReportDailyCampaignService extends IService<KuaishouReportDailyCampaign> {
+    void replaceBatch(List<KuaishouReportDailyCampaign> campaigns);
+}

+ 12 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyCreativeService.java

@@ -0,0 +1,12 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyCreative;
+
+import java.util.List;
+
+public interface IKuaishouReportDailyCreativeService extends IService<KuaishouReportDailyCreative> {
+    List<String> getSignature();
+
+    void replaceBatch(List<KuaishouReportDailyCreative> creatives);
+}

+ 8 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyGroupService.java

@@ -0,0 +1,8 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyGroup;
+
+public interface IKuaishouReportDailyGroupService extends IService<KuaishouReportDailyGroup> {
+    void formatChannelCode(String date);
+}

+ 14 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportDailyImageService.java

@@ -0,0 +1,14 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyImage;
+
+/**
+ * @Description: 快手图片报表
+ * @Author: jeecg-boot
+ * @Date:   2020-09-28
+ * @Version: V1.0
+ */
+public interface IKuaishouReportDailyImageService extends IService<KuaishouReportDailyImage> {
+
+}

+ 10 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyAccountService.java

@@ -0,0 +1,10 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyAccount;
+
+import java.util.List;
+
+public interface IKuaishouReportHourlyAccountService extends IService<KuaishouReportHourlyAccount> {
+    void replaceBatch(List<KuaishouReportHourlyAccount> accounts);
+}

+ 10 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyCampaignService.java

@@ -0,0 +1,10 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyCampaign;
+
+import java.util.List;
+
+public interface IKuaishouReportHourlyCampaignService extends IService<KuaishouReportHourlyCampaign> {
+    void replaceBatch(List<KuaishouReportHourlyCampaign> campaigns);
+}

+ 10 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyCreativeService.java

@@ -0,0 +1,10 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyCreative;
+
+import java.util.List;
+
+public interface IKuaishouReportHourlyCreativeService extends IService<KuaishouReportHourlyCreative> {
+    void replaceBatch(List<KuaishouReportHourlyCreative> creatives);
+}

+ 9 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/IKuaishouReportHourlyGroupService.java

@@ -0,0 +1,9 @@
+package com.xxl.job.executor.report.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyGroup;
+import java.util.List;
+
+public interface IKuaishouReportHourlyGroupService extends IService<KuaishouReportHourlyGroup> {
+    void replaceBatch(List<KuaishouReportHourlyGroup> groups);
+}

+ 23 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyAccountServiceImpl.java

@@ -0,0 +1,23 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyAccount;
+import com.xxl.job.executor.report.mapper.KuaishouReportDailyAccountMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportDailyAccountService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouReportDailyAccountMapper, KuaishouReportDailyAccount> implements IKuaishouReportDailyAccountService {
+
+    @Autowired
+    private KuaishouReportDailyAccountMapper dailyAccountMapper;
+
+    @Override
+    public List<JSONObject> selectCost(Long accountId, String startDate, String endDate) {
+        return dailyAccountMapper.selectCost(accountId, startDate, endDate);
+    }
+}

+ 20 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyCampaignServiceImpl.java

@@ -0,0 +1,20 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyCampaign;
+import com.xxl.job.executor.report.mapper.KuaishouReportDailyCampaignMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportDailyCampaignService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportDailyCampaignServiceImpl extends ServiceImpl<KuaishouReportDailyCampaignMapper, KuaishouReportDailyCampaign> implements IKuaishouReportDailyCampaignService {
+    @Autowired
+    private KuaishouReportDailyCampaignMapper kuaishouReportDailyCampaignMapper;
+    @Override
+    public void replaceBatch(List<KuaishouReportDailyCampaign> campaigns) {
+        kuaishouReportDailyCampaignMapper.replaceBatch(campaigns);
+    }
+}

+ 26 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyCreativeServiceImpl.java

@@ -0,0 +1,26 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyCreative;
+import com.xxl.job.executor.report.mapper.KuaishouReportDailyCreativeMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportDailyCreativeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportDailyCreativeServiceImpl extends ServiceImpl<KuaishouReportDailyCreativeMapper, KuaishouReportDailyCreative> implements IKuaishouReportDailyCreativeService {
+    @Autowired
+    private KuaishouReportDailyCreativeMapper kuaishouReportDailyCreativeMapper;
+    @Override
+    public List<String> getSignature() {
+        return kuaishouReportDailyCreativeMapper.getSignatureList();
+    }
+
+    @Override
+    public void replaceBatch(List<KuaishouReportDailyCreative> creatives) {
+        kuaishouReportDailyCreativeMapper.replaceBatch(creatives);
+    }
+
+}

+ 19 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyGroupServiceImpl.java

@@ -0,0 +1,19 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyGroup;
+import com.xxl.job.executor.report.mapper.KuaishouReportDailyGroupMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportDailyGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class KuaishouReportDailyGroupServiceImpl extends ServiceImpl<KuaishouReportDailyGroupMapper, KuaishouReportDailyGroup> implements IKuaishouReportDailyGroupService {
+    @Autowired
+    private KuaishouReportDailyGroupMapper groupMapper;
+
+    @Override
+    public void formatChannelCode(String date) {
+        groupMapper.formatChannelCode(date);
+    }
+}

+ 18 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportDailyImageServiceImpl.java

@@ -0,0 +1,18 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportDailyImage;
+import com.xxl.job.executor.report.mapper.KuaishouReportDailyImageMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportDailyImageService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手图片报表
+ * @author jeecg-boot
+ * @date   2020-09-28
+ * @version V1.0
+ */
+@Service
+public class KuaishouReportDailyImageServiceImpl extends ServiceImpl<KuaishouReportDailyImageMapper, KuaishouReportDailyImage> implements IKuaishouReportDailyImageService {
+
+}

+ 20 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyAccountServiceImpl.java

@@ -0,0 +1,20 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyAccount;
+import com.xxl.job.executor.report.mapper.KuaishouReportHourlyAccountMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportHourlyAccountService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportHourlyAccountServiceImpl extends ServiceImpl<KuaishouReportHourlyAccountMapper, KuaishouReportHourlyAccount> implements IKuaishouReportHourlyAccountService {
+    @Autowired
+    private KuaishouReportHourlyAccountMapper kuaishouReportHourlyAccountMapper;
+    @Override
+    public void replaceBatch(List<KuaishouReportHourlyAccount> accounts) {
+        kuaishouReportHourlyAccountMapper.replaceBatch(accounts);
+    }
+}

+ 21 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyCampaignServiceImpl.java

@@ -0,0 +1,21 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyCampaign;
+import com.xxl.job.executor.report.mapper.KuaishouReportHourlyCampaignMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportHourlyCampaignService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportHourlyCampaignServiceImpl extends ServiceImpl<KuaishouReportHourlyCampaignMapper, KuaishouReportHourlyCampaign> implements IKuaishouReportHourlyCampaignService {
+    @Autowired
+    private KuaishouReportHourlyCampaignMapper campaignMapper;
+
+    @Override
+    public void replaceBatch(List<KuaishouReportHourlyCampaign> campaigns) {
+        campaignMapper.replaceBatch(campaigns);
+    }
+}

+ 21 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyCreativeServiceImpl.java

@@ -0,0 +1,21 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyCreative;
+import com.xxl.job.executor.report.mapper.KuaishouReportHourlyCreativeMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportHourlyCreativeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportHourlyCreativeServiceImpl extends ServiceImpl<KuaishouReportHourlyCreativeMapper, KuaishouReportHourlyCreative> implements IKuaishouReportHourlyCreativeService {
+    @Autowired
+    private KuaishouReportHourlyCreativeMapper hourlyCreativeMapper;
+
+    @Override
+    public void replaceBatch(List<KuaishouReportHourlyCreative> creatives) {
+        hourlyCreativeMapper.replaceBatch(creatives);
+    }
+}

+ 20 - 0
xxl-job-kuaishou/src/main/java/com/xxl/job/executor/report/service/impl/KuaishouReportHourlyGroupServiceImpl.java

@@ -0,0 +1,20 @@
+package com.xxl.job.executor.report.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.executor.report.entity.KuaishouReportHourlyGroup;
+import com.xxl.job.executor.report.mapper.KuaishouReportHourlyGroupMapper;
+import com.xxl.job.executor.report.service.IKuaishouReportHourlyGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KuaishouReportHourlyGroupServiceImpl extends ServiceImpl<KuaishouReportHourlyGroupMapper, KuaishouReportHourlyGroup> implements IKuaishouReportHourlyGroupService {
+    @Autowired
+    private KuaishouReportHourlyGroupMapper groupMapper;
+    @Override
+    public void replaceBatch(List<KuaishouReportHourlyGroup> groups) {
+        groupMapper.replaceBatch(groups);
+    }
+}

+ 128 - 0
xxl-job-kuaishou/src/main/resources/application.yml

@@ -0,0 +1,128 @@
+management:
+  endpoints:
+    web:
+      exposure:
+        include: metrics,httptrace
+server:
+  port: 8092
+spring:
+  application:
+    name: system-web
+  servlet:
+    multipart:
+      max-file-size: -1
+      max-request-size: -1
+  mail:
+    host: smtp.163.com
+    username: jeecgos@163.com
+    password: ??
+    properties:
+      mail:
+        smtp:
+          auth: true
+          starttls:
+            enable: true
+            required: true
+  #json 时间戳统一转换
+  jackson:
+    date-format:   yyyy-MM-dd HH:mm:ss
+    time-zone:   GMT+8
+  aop:
+    proxy-target-class: true
+  # 设置静态文件路径,js,css等
+  mvc:
+    static-path-pattern: /**
+  resource:
+    static-locations: classpath:/static/,classpath:/public/
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  datasource:
+    druid:
+      removeAbandoned: true
+      removeAbandonedTimeout: 300
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+      web-stat-filter:
+        enabled: true
+    dynamic:
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        connection-init-sql: set names utf8mb4
+
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+#          url: jdbc:mysql://172.30.0.4:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          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
+xxl:
+  job:
+    accessToken:
+    executor:
+      appname: datapull-job-bytedance
+      port: 9988
+      ip:
+      logpath: /data/applogs/xxl-job/jobhandler
+      logretentiondays: 30
+      address:
+    admin:
+#      addresses: http://139.186.29.76:8090/xxl-job-admin/
+      addresses: http://127.0.0.1:8090/xxl-job-admin
+#mybatis plus 设置
+mybatis-plus:
+  mapper-locations: classpath*:com/xxl/job/executor/**/*.xml
+  global-config:
+    # 关闭MP3.0自带的banner
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
+      id-type: 4
+      # 默认数据库表下划线命名
+      table-underline: true
+    configuration:
+      # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+jeecg:
+  path:
+    #文件上传根目录 设置
+    upload: /mnt/upload
+    #webapp文件路径
+    webapp: /mnt/webapp
+    video-upload: /mnt/upload/video/
+    image-upload: D://data//image//
+    kuaishou-agent-image: D://temp.png
+    kuaishou-account-captcha-image: D://captcha.png
+    chrome-driver: D://chromedriver.exe
+    csv-upload: /mnt/upload/csv/
+    bak-database-file: /mnt/data/bak/
+    report-history: D://mnt//reportKs//
+    report-daily: D://mnt//reportKs//
+oss:
+  replace:
+    replace-value: oss-cn-beijing
+    replace-old-value: oss-cn-beijing
+    download: /data/file/video/

+ 42 - 0
xxl-job-kuaishou/src/main/resources/bytedance_config.properties

@@ -0,0 +1,42 @@
+#release
+bytedance_appid=1635316529903624
+# bytedance_appid=1634953881401358
+bytedance_secret=0c51523e90d6166418fc8421a4896808e90e26f4
+# bytedance_secret=34bc59f53955c66871ce111a1f15a6051cfa3f12
+#release
+bytedance_api_url=https://ad.oceanengine.com/open_api
+bytedance_auth_url=https://ad.oceanengine.com/openapi
+
+#sandbox
+#bytedance_api_url=https://test-ad.toutiao.com/open_api
+#bytedance_auth_url=https://test-ad.toutiao.com/open_api
+#bytedance_callback_url=http://callback.c-top.com.cn/bytedance
+bytedance_callback_url=http://adsp.c-top.com.cn:8080/jeecg-boot/bytedance
+bytedance_v2_advertiser_info=/2/advertiser/public_info/
+bytedance_v2_ad_get=/2/ad/get/
+bytedance_v2_advertiser_fund_daily_stat=/2/advertiser/fund/daily_stat/
+bytedance_v2_ad_create=/2/ad/create/
+bytedance_v2_ad_update=/2/ad/update/
+bytedance_v2_ad_update_status=/2/ad/update/status/
+bytedance_v2_ad_update_bid=/2/ad/update/bid/
+bytedance_v2_ad_update_budget=/2/ad/update/budget/
+bytedance_v2_ad_update_reject_reason=2/ad/reject_reason/
+bytedance_v2_campaign_get=/2/campaign/get/
+bytedance_v2_campaign_create=/2/campaign/create/
+bytedance_v2_campaign_update_status=/2/campaign/update/status/
+bytedance_v2_campaign_update=/2/campaign/update/
+bytedance_v2_dmp_custom_audience_select=/2/dmp/custom_audience/select/
+bytedance_v2_file_video_ad=/2/file/video/ad/
+bytedance_v2_file_image_ad=/2/file/image/ad/
+bytedance_v2_creative_update_status=/2/creative/update/status/
+bytedance_v2_creative_material_get=/2/creative/material/read/
+bytedance_v2_creative_create_v2=/2/creative/create_v2/
+bytedance_v2_creative_get=/2/creative/get/
+bytedance_v2_creative_read=/2/creative/read_v2/
+bytedance_v2_creative_update=/2/creative/update_v2/
+bytedance_v2_creative_reject_reason=/2/creative/reject_reason/
+##报表相关
+bytedance_v2_advertiser_report_get=/2/report/advertiser/get/
+bytedance_v2_campaign_report_get=/2/report/campaign/get/
+bytedance_v2_ad_report_get=/2/report/ad/get/
+bytedance_v2_ad_creative_get=/2/report/creative/get/

+ 16 - 0
xxl-job-kuaishou/src/main/resources/config.properties

@@ -0,0 +1,16 @@
+# Aliyun config
+aliyun.accessKeyId=LTAIbNbqWzSOklQV
+aliyun.accessKeySecret=1rkPz7JNoXk8sJevPaeYHWqfkQXBGh
+# Aliyun OSS config
+aliyun.oss.endpoint=http://oss-cn-beijing.aliyuncs.com
+aliyun.oss.bucketName=ctop-media
+aliyun.oss.folder=model/video/
+
+#Tencent config
+qcloud.accessKeyId=AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets
+qcloud.accessKeySecret=1rkPz7JNoXk8sJevPaeYHWqfkQXBGh
+
+#Tencent COS config
+qcloud.cos.endpoint=https://cos.ap-chongqing.myqcloud.com
+qcloud.cos.bucketName=media-1301855440
+qcloud.cos.folder=model/video/

+ 36 - 0
xxl-job-kuaishou/src/main/resources/kuaishou_config.properties

@@ -0,0 +1,36 @@
+kuaishou_api_url=https://ad.e.kuaishou.com
+kuaishou_auth_url=https://ad.e.kuaishou.com
+kuaishou_appid=27
+kuaishou_third_appid=328
+oauth_type=agent
+kuaishou_secret=QovprB1tNhXptgDc
+kuaishou_third_secret=1iFTBiMdohkyEQQs
+kuaishou_callback_url=http://adsp.c-top.com.cn:8080/jeecg-boot/kuaishou
+kuaishou_third_callback_url=http://callback.shyouteng.com.cn/kuaishou
+apk_sava_path=/mnt/file/apk
+image_sava_path=/mnt/file/image
+video_sava_path=/mnt/file/video
+## 模板视频存放路径
+model_video_src_path=/mnt/data/src/
+## 片段合成视频存放路径
+model_video_fill_path=/mnt/data/fill/
+##
+model_video_final_path=/mnt/data/final/
+
+
+## jiaoyang
+#kuaishou_api_url=https://ad.e.kuaishou.com
+#kuaishou_auth_url=https://ad.e.kuaishou.com
+#kuaishou_appid=328
+#oauth_type=agent
+#kuaishou_secret=1iFTBiMdohkyEQQs
+#kuaishou_callback_url=http://callback.shyouteng.com.cn/kuaishou
+#apk_sava_path=/mnt/file/apk
+#image_sava_path=/mnt/file/image
+#video_sava_path=/mnt/file/video
+### 模板视频存放路径
+#model_video_src_path=/mnt/data/src/
+### 片段合成视频存放路径
+#model_video_fill_path=/mnt/data/fill/
+###
+#model_video_final_path=/mnt/data/final/

+ 57 - 0
xxl-job-kuaishou/src/main/resources/logback-dev.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+
+
+    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
+
+    <!-- 定义日志存储的路径,不要配置相对路径 -->
+    <property name="FILE_PATH" value="D:/Desktop/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+    <!-- 控制台输出日志 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- 日志级别过滤INFO以下 -->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+        <encoder>
+            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
+    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+
+            <fileNamePattern>${FILE_PATH}</fileNamePattern>
+
+            <!-- keep 15 days' worth of history -->
+            <maxHistory>30</maxHistory>
+
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 日志文件的最大大小 -->
+                <maxFileSize>2MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+
+            <!-- 超出删除老文件 -->
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+
+        <encoder>
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- project default level -->
+    <logger name="net.sh.rgface.serive" level="ERROR"/>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="rollingFile"/>
+    </root>
+</configuration>

+ 57 - 0
xxl-job-kuaishou/src/main/resources/logback-prod.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+
+
+    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
+
+    <!-- 定义日志存储的路径,不要配置相对路径 -->
+    <property name="FILE_PATH" value="/mnt/webapps/logs/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+    <!-- 控制台输出日志 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- 日志级别过滤INFO以下 -->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+        <encoder>
+            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
+    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+
+            <fileNamePattern>${FILE_PATH}</fileNamePattern>
+
+            <!-- keep 15 days' worth of history -->
+            <maxHistory>30</maxHistory>
+
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 日志文件的最大大小 -->
+                <maxFileSize>2MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+
+            <!-- 超出删除老文件 -->
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+
+        <encoder>
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- project default level -->
+    <logger name="net.sh.rgface.serive" level="ERROR"/>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="rollingFile"/>
+    </root>
+</configuration>

+ 57 - 0
xxl-job-kuaishou/src/main/resources/logback-test.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+
+
+    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
+
+    <!-- 定义日志存储的路径,不要配置相对路径 -->
+    <property name="FILE_PATH" value="/data/webapp/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+    <!-- 控制台输出日志 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- 日志级别过滤INFO以下 -->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+        <encoder>
+            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
+    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+
+            <fileNamePattern>${FILE_PATH}</fileNamePattern>
+
+            <!-- keep 15 days' worth of history -->
+            <maxHistory>30</maxHistory>
+
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 日志文件的最大大小 -->
+                <maxFileSize>2MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+
+            <!-- 超出删除老文件 -->
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+
+        <encoder>
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- project default level -->
+    <logger name="net.sh.rgface.serive" level="ERROR"/>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="rollingFile"/>
+    </root>
+</configuration>

+ 29 - 0
xxl-job-kuaishou/src/main/resources/logback.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="false" scan="true" scanPeriod="1 seconds">
+
+    <contextName>logback</contextName>
+    <property name="log.path" value="/data/applogs/xxl-job/xxl-job-executor-sample-springboot.log"/>
+
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
+            </pattern>
+        </encoder>
+    </appender>
+
+    <root level="info">
+        <appender-ref ref="console"/>
+        <appender-ref ref="file"/>
+    </root>
+
+</configuration>