Browse Source

refactor and add ad

wangyunpeng 1 week ago
parent
commit
7c4524f7a0
100 changed files with 7216 additions and 40 deletions
  1. 1 1
      core/pom.xml
  2. 11 0
      core/src/main/java/com/tzld/ad/annotation/JwtIgnore.java
  3. 1 1
      core/src/main/java/com/tzld/ad/annotation/NoRequestLog.java
  4. 2 2
      core/src/main/java/com/tzld/ad/client/RtaManageClient.java
  5. 5 5
      core/src/main/java/com/tzld/ad/codec/RtaProtobufCodec.java
  6. 28 0
      core/src/main/java/com/tzld/ad/common/CustomException.java
  7. 1 1
      core/src/main/java/com/tzld/ad/common/LoghubAppender.java
  8. 1 1
      core/src/main/java/com/tzld/ad/common/LoghubAppenderCallback.java
  9. 4 4
      core/src/main/java/com/tzld/ad/common/base/CommonResponse.java
  10. 1 1
      core/src/main/java/com/tzld/ad/common/constant/ResponseConstant.java
  11. 2 2
      core/src/main/java/com/tzld/ad/common/exception/CommonException.java
  12. 96 0
      core/src/main/java/com/tzld/ad/config/AdplatformMongoConfig.java
  13. 15 0
      core/src/main/java/com/tzld/ad/config/AppConfig.java
  14. 79 0
      core/src/main/java/com/tzld/ad/config/MqConfig.java
  15. 151 0
      core/src/main/java/com/tzld/ad/config/RedisTemplateConfig.java
  16. 1 1
      core/src/main/java/com/tzld/ad/config/RtaConfig.java
  17. 1 1
      core/src/main/java/com/tzld/ad/config/SchedulingConfig.java
  18. 2 2
      core/src/main/java/com/tzld/ad/config/SwaggerConfig.java
  19. 1 1
      core/src/main/java/com/tzld/ad/config/XxlJobConfig.java
  20. 64 0
      core/src/main/java/com/tzld/ad/config/db/AdPutDBConfig.java
  21. 2 2
      core/src/main/java/com/tzld/ad/config/db/RtaDBConfig.java
  22. 19 0
      core/src/main/java/com/tzld/ad/config/mybatis/AdPutMybatisConfig.java
  23. 2 2
      core/src/main/java/com/tzld/ad/config/mybatis/RtaMybatisConfig.java
  24. 3 2
      core/src/main/java/com/tzld/ad/dao/generator/MybatisGeneratorMain.java
  25. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutOfficialOpenIdCardIdMappingMapper.java
  26. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutOfficialOpenIdClickIdMappingMapper.java
  27. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAccountMapper.java
  28. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAdDataMapper.java
  29. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAdMapper.java
  30. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAdPackageMappingMapper.java
  31. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentBehaviorLogMapper.java
  32. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCallbackDataMapper.java
  33. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentComponentDataMapper.java
  34. 120 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentComponentMapper.java
  35. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeAnalysisMapper.java
  36. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeComponentsMapper.java
  37. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeDataMapper.java
  38. 120 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeMapper.java
  39. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentDynamicBidMapper.java
  40. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentMaterialUploadHandleMapper.java
  41. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentPackageAdMappingMapper.java
  42. 96 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentPackageMapper.java
  43. 97 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/DailyCategoryVideoMapper.java
  44. 41 0
      core/src/main/java/com/tzld/ad/dao/mapper/adPut/ext/AdPutTencentExtMapper.java
  45. 39 0
      core/src/main/java/com/tzld/ad/enums/AdOwnTypeEnum.java
  46. 27 0
      core/src/main/java/com/tzld/ad/enums/AdStructureTypeEnum.java
  47. 388 0
      core/src/main/java/com/tzld/ad/enums/EnumRedisPrefix.java
  48. 1 1
      core/src/main/java/com/tzld/ad/enums/EnumUploadFileType.java
  49. 6 0
      core/src/main/java/com/tzld/ad/enums/ErrcodeNamespace.java
  50. 177 0
      core/src/main/java/com/tzld/ad/enums/ExceptionCodeEnum.java
  51. 1 1
      core/src/main/java/com/tzld/ad/enums/ExceptionEnum.java
  52. 28 0
      core/src/main/java/com/tzld/ad/enums/FieshuTableColumnDataTypeEnum.java
  53. 34 0
      core/src/main/java/com/tzld/ad/enums/adPut/ActionTypeEnum.java
  54. 28 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPackageStatus.java
  55. 25 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutDynamicBidDtStatus.java
  56. 18 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutLogBehaviorTypeEnum.java
  57. 19 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutSenceEnum.java
  58. 16 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentAdSystemStatusEnum.java
  59. 19 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentBehaviorBusinessTypeEnum.java
  60. 41 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentPackageKeyEnum.java
  61. 20 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentPackageUserIdTypeEnum.java
  62. 20 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdTencentAccountTypeEnum.java
  63. 28 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdTencentDynamicBidStatus.java
  64. 33 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdTencentFields.java
  65. 16 0
      core/src/main/java/com/tzld/ad/enums/adPut/AdTencentUserActionOptimizationGoalEnum.java
  66. 30 0
      core/src/main/java/com/tzld/ad/enums/adPut/DynamicBidStatus.java
  67. 20 0
      core/src/main/java/com/tzld/ad/enums/adPut/MarketingTargetTypeEnum.java
  68. 20 0
      core/src/main/java/com/tzld/ad/enums/adPut/UserActionSetTypeEnum.java
  69. 19 0
      core/src/main/java/com/tzld/ad/enums/adPut/UserActionSetUsagesEnum.java
  70. 4 4
      core/src/main/java/com/tzld/ad/handle/GlobalExceptionHandle.java
  71. 1 1
      core/src/main/java/com/tzld/ad/interceptor/CrosDomainAllowInterceptor.java
  72. 441 0
      core/src/main/java/com/tzld/ad/job/adPut/AdPutTencentAlarmJob.java
  73. 1014 0
      core/src/main/java/com/tzld/ad/job/adPut/AdPutTencentDataJob.java
  74. 1028 0
      core/src/main/java/com/tzld/ad/job/adPut/AdPutTencentJobHandler.java
  75. 1 1
      core/src/main/java/com/tzld/ad/model/DynamicContentInfoModel.java
  76. 1 1
      core/src/main/java/com/tzld/ad/model/DynamicProductInfoModel.java
  77. 1 1
      core/src/main/java/com/tzld/ad/model/RtaRequestModel.java
  78. 1 1
      core/src/main/java/com/tzld/ad/model/RtaResponseModel.java
  79. 26 0
      core/src/main/java/com/tzld/ad/model/adPut/AdAutoPackageParam.java
  80. 123 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPuTencentTargeting.java
  81. 30 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutAccount.java
  82. 14 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutCreativeComponentCostData.java
  83. 16 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutPeoplePackage.java
  84. 40 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAccountBalance.java
  85. 19 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAccountExt.java
  86. 10 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentActionTrace.java
  87. 11 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentActionUserId.java
  88. 155 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdCostData.java
  89. 57 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdDetail.java
  90. 28 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdGroupCursor.java
  91. 141 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdGroupInfo.java
  92. 143 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAudienceInfo.java
  93. 19 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentDailyData.java
  94. 41 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentDetail.java
  95. 29 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentImage.java
  96. 42 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentVideo.java
  97. 198 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeCostData.java
  98. 13 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeCostSimple.java
  99. 26 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeCursor.java
  100. 63 0
      core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeInfo.java

+ 1 - 1
core/pom.xml

@@ -5,7 +5,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>com.tzld.piaoquan</groupId>
-        <artifactId>tencent-rta-server</artifactId>
+        <artifactId>tencent-ad-server</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>
 

+ 11 - 0
core/src/main/java/com/tzld/ad/annotation/JwtIgnore.java

@@ -0,0 +1,11 @@
+package com.tzld.ad.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface JwtIgnore {
+}

+ 1 - 1
core/src/main/java/com/tzld/rta/annotation/NoRequestLog.java → core/src/main/java/com/tzld/ad/annotation/NoRequestLog.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.annotation;
+package com.tzld.ad.annotation;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;

+ 2 - 2
core/src/main/java/com/tzld/rta/client/RtaManageClient.java → core/src/main/java/com/tzld/ad/client/RtaManageClient.java

@@ -1,8 +1,8 @@
-package com.tzld.rta.client;
+package com.tzld.ad.client;
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.tzld.rta.model.dto.RtaManageDTO;
+import com.tzld.ad.model.dto.RtaManageDTO;
 import lombok.extern.slf4j.Slf4j;
 import okhttp3.*;
 import org.springframework.beans.factory.annotation.Value;

+ 5 - 5
core/src/main/java/com/tzld/rta/codec/RtaProtobufCodec.java → core/src/main/java/com/tzld/ad/codec/RtaProtobufCodec.java

@@ -1,12 +1,12 @@
-package com.tzld.rta.codec;
+package com.tzld.ad.codec;
 
 import com.google.protobuf.CodedInputStream;
 import com.google.protobuf.CodedOutputStream;
 import com.google.protobuf.WireFormat;
-import com.tzld.rta.model.DynamicContentInfoModel;
-import com.tzld.rta.model.DynamicProductInfoModel;
-import com.tzld.rta.model.RtaRequestModel;
-import com.tzld.rta.model.RtaResponseModel;
+import com.tzld.ad.model.DynamicContentInfoModel;
+import com.tzld.ad.model.DynamicProductInfoModel;
+import com.tzld.ad.model.RtaRequestModel;
+import com.tzld.ad.model.RtaResponseModel;
 import lombok.extern.slf4j.Slf4j;
 
 import java.io.ByteArrayOutputStream;

+ 28 - 0
core/src/main/java/com/tzld/ad/common/CustomException.java

@@ -0,0 +1,28 @@
+package com.tzld.ad.common;
+
+
+import com.tzld.ad.enums.ExceptionCodeEnum;
+
+public class CustomException extends RuntimeException {
+  private static final long serialVersionUID = 1L;
+  private ExceptionCodeEnum rtn;
+
+  public CustomException(ExceptionCodeEnum rtn) {
+    super(rtn.getMsg());
+    this.rtn = rtn;
+  }
+
+  public ExceptionCodeEnum getRtn() {
+    return rtn;
+  }
+
+  public void setRtn(ExceptionCodeEnum rtn) {
+    this.rtn = rtn;
+  }
+
+  public CustomException(ExceptionCodeEnum rtn, String msg ) {
+	    super(msg);
+	    // rtn.setMsg(msg);
+	    this.rtn = rtn;
+  }
+}

+ 1 - 1
core/src/main/java/com/tzld/rta/common/LoghubAppender.java → core/src/main/java/com/tzld/ad/common/LoghubAppender.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.common;
+package com.tzld.ad.common;
 
 import ch.qos.logback.classic.spi.IThrowableProxy;
 import ch.qos.logback.classic.spi.LoggingEvent;

+ 1 - 1
core/src/main/java/com/tzld/rta/common/LoghubAppenderCallback.java → core/src/main/java/com/tzld/ad/common/LoghubAppenderCallback.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.common;
+package com.tzld.ad.common;
 
 
 import com.aliyun.openservices.aliyun.log.producer.Callback;

+ 4 - 4
core/src/main/java/com/tzld/rta/common/base/CommonResponse.java → core/src/main/java/com/tzld/ad/common/base/CommonResponse.java

@@ -1,12 +1,12 @@
-package com.tzld.rta.common.base;
+package com.tzld.ad.common.base;
 
-import com.tzld.rta.common.enums.ExceptionEnum;
+import com.tzld.ad.enums.ExceptionEnum;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 
-import static com.tzld.rta.common.constant.ResponseConstant.SUCCESS_CODE;
-import static com.tzld.rta.common.constant.ResponseConstant.SUCCESS_MSG;
+import static com.tzld.ad.common.constant.ResponseConstant.SUCCESS_CODE;
+import static com.tzld.ad.common.constant.ResponseConstant.SUCCESS_MSG;
 
 
 /**

+ 1 - 1
core/src/main/java/com/tzld/rta/common/constant/ResponseConstant.java → core/src/main/java/com/tzld/ad/common/constant/ResponseConstant.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.common.constant;
+package com.tzld.ad.common.constant;
 
 /**
  * 响应常量

+ 2 - 2
core/src/main/java/com/tzld/rta/common/exception/CommonException.java → core/src/main/java/com/tzld/ad/common/exception/CommonException.java

@@ -1,6 +1,6 @@
-package com.tzld.rta.common.exception;
+package com.tzld.ad.common.exception;
 
-import com.tzld.rta.common.enums.ExceptionEnum;
+import com.tzld.ad.enums.ExceptionEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

+ 96 - 0
core/src/main/java/com/tzld/ad/config/AdplatformMongoConfig.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.config;
+
+import com.mongodb.ConnectionString;
+import com.mongodb.MongoClientSettings;
+import com.mongodb.client.MongoClient;
+import com.mongodb.client.MongoClients;
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.SimpleMongoClientDbFactory;
+import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
+import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
+
+import java.util.concurrent.TimeUnit;
+
+@Configuration
+@ConfigurationProperties(prefix = "spring.data.mongodb")
+@Data
+public class AdplatformMongoConfig {
+
+    private String adplatformUri;
+
+    /** 缓存 ConnectionString,避免在 adPlatformMongoClient 与 getMongoTemplate 中重复解析 URI(内部使用,不暴露 getter) */
+    private transient ConnectionString connectionStringCache;
+
+    /**
+     * 连接池最大连接数,默认 200
+     */
+    private int poolMaxSize = 200;
+    /**
+     * 连接池最小连接数,默认 10
+     */
+    private int poolMinSize = 10;
+    /**
+     * 获取连接最大等待时间(秒),默认 30
+     */
+    private int poolMaxWaitSeconds = 30;
+    /**
+     * 连接最大空闲时间(秒),默认 60
+     */
+    private int poolMaxConnectionIdleTimeSeconds = 60;
+    /**
+     * Socket 连接超时(秒),默认 10
+     */
+    private int socketConnectTimeoutSeconds = 10;
+    /**
+     * Socket 读超时(秒),默认 30
+     */
+    private int socketReadTimeoutSeconds = 30;
+
+    /** 复用同一 ConnectionString,避免重复解析 adplatformUri */
+    private ConnectionString getConnectionString() {
+        if (connectionStringCache == null) {
+            if (adplatformUri == null || adplatformUri.isEmpty()) {
+                throw new IllegalStateException("spring.data.mongodb.adplatform-uri must be set");
+            }
+            connectionStringCache = new ConnectionString(adplatformUri);
+        }
+        return connectionStringCache;
+    }
+
+    @Bean(name = "adPlatformMongoClient")
+    public MongoClient adPlatformMongoClient() {
+        ConnectionString connString = getConnectionString();
+        MongoClientSettings settings = MongoClientSettings.builder()
+                .applyConnectionString(connString)
+                .applyToConnectionPoolSettings(builder -> builder
+                        .maxSize(poolMaxSize)
+                        .minSize(poolMinSize)
+                        .maxWaitTime(poolMaxWaitSeconds, TimeUnit.SECONDS)
+                        .maxConnectionIdleTime(poolMaxConnectionIdleTimeSeconds, TimeUnit.SECONDS)
+                )
+                .applyToSocketSettings(builder -> builder
+                        .connectTimeout(socketConnectTimeoutSeconds, TimeUnit.SECONDS)
+                        .readTimeout(socketReadTimeoutSeconds, TimeUnit.SECONDS)
+                )
+                .build();
+        return MongoClients.create(settings);
+    }
+
+    @Bean(name = "adPlatformMongoTemplate")
+    public MongoTemplate getMongoTemplate(@Qualifier("adPlatformMongoClient") MongoClient adPlatformMongoClient,
+                                          MongoCustomConversions mongoCustomConversions) {
+        MongoTemplate mongoTemplate = new MongoTemplate(
+                new SimpleMongoClientDbFactory(adPlatformMongoClient, getConnectionString().getDatabase()));
+        //如果配置了自己的转换器,需要加下面这段代码,不然转换器会失效
+        MappingMongoConverter mongoMapping = (MappingMongoConverter) mongoTemplate.getConverter();
+        mongoMapping.setCustomConversions(mongoCustomConversions);
+        mongoMapping.afterPropertiesSet();
+        return mongoTemplate;
+    }
+
+}

+ 15 - 0
core/src/main/java/com/tzld/ad/config/AppConfig.java

@@ -0,0 +1,15 @@
+package com.tzld.ad.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+@Configuration
+public class AppConfig {  
+  
+    @Bean
+    public RestTemplate restTemplate() {
+        return new RestTemplate();  
+    }
+
+}

+ 79 - 0
core/src/main/java/com/tzld/ad/config/MqConfig.java

@@ -0,0 +1,79 @@
+package com.tzld.ad.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.Properties;
+
+@Configuration
+public class MqConfig {
+
+    @Value("${rocketmq.accessKey}")
+    private String accessKey;
+    @Value("${rocketmq.secretKey}")
+    private String secretKey;
+    @Value("${rocketmq.nameSrvAddr}")
+    private String nameSrvAddr;
+    @Value("${rocketmq.topic}")
+    private String topic;
+    @Value("${rocketmq.groupId}")
+    private String groupId;
+    @Value("${rocketmq.tag}")
+    private String tag;
+
+    public Properties getMqPropertie() {
+        Properties properties = new Properties();
+        properties.setProperty("AccessKey", this.accessKey);
+        properties.setProperty("SecretKey", this.secretKey);
+        properties.setProperty("NAMESRV_ADDR", this.nameSrvAddr);
+        return properties;
+    }
+
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    public void setAccessKey(String accessKey) {
+        this.accessKey = accessKey;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    public String getNameSrvAddr() {
+        return nameSrvAddr;
+    }
+
+    public void setNameSrvAddr(String nameSrvAddr) {
+        this.nameSrvAddr = nameSrvAddr;
+    }
+
+    public String getTopic() {
+        return topic;
+    }
+
+    public void setTopic(String topic) {
+        this.topic = topic;
+    }
+
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+}

+ 151 - 0
core/src/main/java/com/tzld/ad/config/RedisTemplateConfig.java

@@ -0,0 +1,151 @@
+package com.tzld.ad.config;
+
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+import com.tzld.ad.util.FastJson2JsonRedisSerializer;
+import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * @author ehlxr
+ */
+@Configuration
+public class RedisTemplateConfig {
+
+    @Bean
+    @ConfigurationProperties(prefix = "spring.redis.lettuce.pool")
+    public GenericObjectPoolConfig<LettucePoolingClientConfiguration> redisPool() {
+        return new GenericObjectPoolConfig<>();
+    }
+
+    @Bean
+    @ConfigurationProperties(prefix = "spring.redis")
+    public RedisStandaloneConfiguration redisConfig() {
+        return new RedisStandaloneConfiguration();
+    }
+
+    @Bean("factory")
+    @Primary
+    public LettuceConnectionFactory factory(GenericObjectPoolConfig<LettucePoolingClientConfiguration> config, RedisStandaloneConfiguration redisConfig) {
+        LettuceClientConfiguration lettuceClientConfiguration = LettucePoolingClientConfiguration.builder().poolConfig(config).build();
+        return new LettuceConnectionFactory(redisConfig, lettuceClientConfiguration);
+    }
+
+    @Bean(name = "redisTemplate")
+    public RedisTemplate<String, String> getRedisTemplate(@Qualifier("factory") RedisConnectionFactory factory) {
+        return buildRedisTemplateByString(factory);
+    }
+
+    @Bean
+    @ConfigurationProperties(prefix = "spring.redis-ad")
+    public RedisStandaloneConfiguration adOwnRedisConfig() {
+        return new RedisStandaloneConfiguration();
+    }
+
+    @Bean("adOwnFactory")
+    public LettuceConnectionFactory pushCenterFactory(GenericObjectPoolConfig<LettucePoolingClientConfiguration> config, RedisStandaloneConfiguration adOwnRedisConfig) {
+        LettuceClientConfiguration lettuceClientConfiguration = LettucePoolingClientConfiguration.builder().poolConfig(config).build();
+        return new LettuceConnectionFactory(adOwnRedisConfig, lettuceClientConfiguration);
+    }
+
+    @Bean(name = "adOwnRedisTemplate")
+    public RedisTemplate<String, String> getPushCenterRedisTemplate(@Qualifier("adOwnFactory") RedisConnectionFactory pushCenterFactory) {
+        return buildRedisTemplateByString(pushCenterFactory);
+    }
+
+
+    /**
+     * 构建redisTemplate 使用string序列化
+     *
+     * @param factory
+     * @return
+     */
+    public RedisTemplate<String, String> buildRedisTemplateByString(RedisConnectionFactory factory) {
+        RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(factory);
+        // key的序列化类型 保证可读性
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        redisTemplate.setValueSerializer(new StringRedisSerializer());
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.afterPropertiesSet();
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+    /**
+     * 构建redisTemplate value使用fastjson序列化
+     *
+     * @param factory
+     * @return
+     */
+    public RedisTemplate<String, Object> buildRedisTemplateByFastJson(RedisConnectionFactory factory) {
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(factory);
+        // key的序列化类型 保证可读性
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        // value的序列化类型 fastjson 保证效率
+        FastJson2JsonRedisSerializer fastJson2JsonRedisSerializer = fastJson2JsonRedisSerializer();
+        redisTemplate.setValueSerializer(fastJson2JsonRedisSerializer);
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.setHashValueSerializer(fastJson2JsonRedisSerializer);
+        return redisTemplate;
+    }
+
+    /**
+     * 构建redisTemplate value使用jackson序列化
+     *
+     * @param factory
+     * @return
+     */
+    public RedisTemplate<String, Object> buildRedisTemplateByJackson(RedisConnectionFactory factory) {
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(factory);
+        // key的序列化类型 保证可读性
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        // value的序列化类型 jackson 保证效率
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = jackson2JsonRedisSerializer();
+        redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
+        return redisTemplate;
+    }
+
+    /**
+     * Jackson 序列化
+     *
+     * @return
+     */
+    public Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer() {
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
+        jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
+        return jackson2JsonRedisSerializer;
+    }
+
+    /**
+     * FastJson 序列化
+     *
+     * @return
+     */
+    public FastJson2JsonRedisSerializer<Object> fastJson2JsonRedisSerializer() {
+        return new FastJson2JsonRedisSerializer(Object.class);
+    }
+}

+ 1 - 1
core/src/main/java/com/tzld/rta/config/RtaConfig.java → core/src/main/java/com/tzld/ad/config/RtaConfig.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.config;
+package com.tzld.ad.config;
 
 import com.github.benmanes.caffeine.cache.Cache;
 import com.github.benmanes.caffeine.cache.Caffeine;

+ 1 - 1
core/src/main/java/com/tzld/rta/config/SchedulingConfig.java → core/src/main/java/com/tzld/ad/config/SchedulingConfig.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.config;
+package com.tzld.ad.config;
 
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Profile;

+ 2 - 2
core/src/main/java/com/tzld/rta/config/SwaggerConfig.java → core/src/main/java/com/tzld/ad/config/SwaggerConfig.java

@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package com.tzld.rta.config;
+package com.tzld.ad.config;
 
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -41,7 +41,7 @@ public class SwaggerConfig {
         return new Docket(DocumentationType.SWAGGER_2)
                 .apiInfo(apiInfo())
                 .select()
-                .apis(RequestHandlerSelectors.basePackage("com.tzld.rta.controller"))
+                .apis(RequestHandlerSelectors.basePackage("com.tzld.ad.controller"))
                 .paths(PathSelectors.any())
                 .build();
     }

+ 1 - 1
core/src/main/java/com/tzld/rta/config/XxlJobConfig.java → core/src/main/java/com/tzld/ad/config/XxlJobConfig.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.config;
+package com.tzld.ad.config;
 
 import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
 import org.springframework.beans.factory.annotation.Value;

+ 64 - 0
core/src/main/java/com/tzld/ad/config/db/AdPutDBConfig.java

@@ -0,0 +1,64 @@
+package com.tzld.ad.config.db;
+
+import com.zaxxer.hikari.HikariDataSource;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import javax.sql.DataSource;
+
+@Configuration
+@EnableTransactionManagement
+@MapperScan(basePackages = "com.tzld.ad.dao.mapper.adPut",
+        sqlSessionFactoryRef = "adPutSqlSessionFactory")
+public class AdPutDBConfig {
+
+    // 1. 配置 adPut 数据源(连接 adplatform 库)
+    @Bean(name = "adPutDataSource")
+    @ConfigurationProperties(prefix = "spring.datasource.adput")
+    public DataSource adPutDataSource() {
+        return new HikariDataSource();
+    }
+
+    // 2. 配置 adPut 专属 SqlSessionFactory
+    @Bean(name = "adPutSqlSessionFactory")
+    public SqlSessionFactory adPutSqlSessionFactory(
+            @Qualifier("adPutDataSource") DataSource adPutDataSource) throws Exception {
+        SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+        sessionFactory.setDataSource(adPutDataSource);
+
+        org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
+        configuration.setMapUnderscoreToCamelCase(true);
+        configuration.setUseGeneratedKeys(true);
+        sessionFactory.setConfiguration(configuration);
+
+        try {
+            org.springframework.core.io.Resource[] mapperResources =
+                    new PathMatchingResourcePatternResolver().getResources("classpath:mapper/adPut/**/*.xml");
+            if (mapperResources != null && mapperResources.length > 0) {
+                sessionFactory.setMapperLocations(mapperResources);
+            }
+        } catch (Exception e) {
+            // 如果目录不存在或为空,不设置 mapperLocations,应用仍可正常启动
+        }
+
+        sessionFactory.setTypeAliasesPackage("com.tzld.ad.model.po.adPut");
+        return sessionFactory.getObject();
+    }
+
+    // 3. 配置 adPut 事务管理器
+    @Bean(name = "adPutTransactionManager")
+    public PlatformTransactionManager adPutTransactionManager(
+            @Qualifier("adPutDataSource") DataSource adPutDataSource) {
+        return new DataSourceTransactionManager(adPutDataSource);
+    }
+}
+

+ 2 - 2
core/src/main/java/com/tzld/rta/config/db/RtaDBConfig.java → core/src/main/java/com/tzld/ad/config/db/RtaDBConfig.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.config.db;
+package com.tzld.ad.config.db;
 
 import com.zaxxer.hikari.HikariDataSource;
 import org.apache.ibatis.session.SqlSessionFactory;
@@ -50,7 +50,7 @@ public class RtaDBConfig {
             // 后续添加 mapper 文件后重启即可生效
         }
         
-        sessionFactory.setTypeAliasesPackage("com.tzld.rta");
+        sessionFactory.setTypeAliasesPackage("com.tzld.ad");
         sessionFactory.setConfiguration(properties.getConfiguration());
         return sessionFactory.getObject();
     }

+ 19 - 0
core/src/main/java/com/tzld/ad/config/mybatis/AdPutMybatisConfig.java

@@ -0,0 +1,19 @@
+package com.tzld.ad.config.mybatis;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@MapperScan(basePackages = "com.tzld.ad.dao.mapper.adPut",
+        sqlSessionFactoryRef = "adPutSqlSessionFactory")
+public class AdPutMybatisConfig {
+
+    @Bean(name = "adPutSqlSessionTemplate")
+    public SqlSessionTemplate adPutSqlSessionTemplate(@Qualifier("adPutSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
+        return new SqlSessionTemplate(sqlSessionFactory);
+    }
+}

+ 2 - 2
core/src/main/java/com/tzld/rta/config/mybatis/RtaMybatisConfig.java → core/src/main/java/com/tzld/ad/config/mybatis/RtaMybatisConfig.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.config.mybatis;
+package com.tzld.ad.config.mybatis;
 
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.mybatis.spring.SqlSessionTemplate;
@@ -8,7 +8,7 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
-@MapperScan(basePackages = "com.tzld.rta.dao.mapper.rta",
+@MapperScan(basePackages = "com.tzld.ad.dao.mapper.rta",
         sqlSessionFactoryRef = "tencentRtaSqlSessionFactory")
 public class RtaMybatisConfig {
 

+ 3 - 2
core/src/main/java/com/tzld/rta/dao/generator/MybatisGeneratorMain.java → core/src/main/java/com/tzld/ad/dao/generator/MybatisGeneratorMain.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.dao.generator;
+package com.tzld.ad.dao.generator;
 
 import org.mybatis.generator.api.MyBatisGenerator;
 import org.mybatis.generator.config.Configuration;
@@ -19,7 +19,8 @@ public class MybatisGeneratorMain {
 			throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
 		List<String> warnings = new ArrayList<String>();
 		boolean overwrite = true;
-		File configFile = new File(MybatisGeneratorMain.class.getResource("/generator/mybatis-rta-generator-config.xml").getFile());
+		//File configFile = new File(MybatisGeneratorMain.class.getResource("/generator/mybatis-rta-generator-config.xml").getFile());
+		File configFile = new File(MybatisGeneratorMain.class.getResource("/generator/mybatis-adput-generator-config.xml").getFile());
 
 		ConfigurationParser cp = new ConfigurationParser(warnings);
 		Configuration config = cp.parseConfiguration(configFile);

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutOfficialOpenIdCardIdMappingMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutOfficialOpenIdCardIdMapping;
+import com.tzld.ad.model.po.adput.AdPutOfficialOpenIdCardIdMappingExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutOfficialOpenIdCardIdMappingMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutOfficialOpenIdCardIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutOfficialOpenIdCardIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutOfficialOpenIdCardIdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutOfficialOpenIdCardIdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    List<AdPutOfficialOpenIdCardIdMapping> selectByExample(AdPutOfficialOpenIdCardIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    AdPutOfficialOpenIdCardIdMapping selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutOfficialOpenIdCardIdMapping record, @Param("example") AdPutOfficialOpenIdCardIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutOfficialOpenIdCardIdMapping record, @Param("example") AdPutOfficialOpenIdCardIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutOfficialOpenIdCardIdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_cardid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutOfficialOpenIdCardIdMapping record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutOfficialOpenIdClickIdMappingMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutOfficialOpenIdClickIdMapping;
+import com.tzld.ad.model.po.adput.AdPutOfficialOpenIdClickIdMappingExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutOfficialOpenIdClickIdMappingMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutOfficialOpenIdClickIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutOfficialOpenIdClickIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutOfficialOpenIdClickIdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutOfficialOpenIdClickIdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    List<AdPutOfficialOpenIdClickIdMapping> selectByExample(AdPutOfficialOpenIdClickIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    AdPutOfficialOpenIdClickIdMapping selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutOfficialOpenIdClickIdMapping record, @Param("example") AdPutOfficialOpenIdClickIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutOfficialOpenIdClickIdMapping record, @Param("example") AdPutOfficialOpenIdClickIdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutOfficialOpenIdClickIdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_official_openid_clickid_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutOfficialOpenIdClickIdMapping record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAccountMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentAccount;
+import com.tzld.ad.model.po.adput.AdPutTencentAccountExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentAccountMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentAccountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentAccountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentAccount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentAccount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentAccount> selectByExample(AdPutTencentAccountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    AdPutTencentAccount selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentAccount record, @Param("example") AdPutTencentAccountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentAccount record, @Param("example") AdPutTencentAccountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentAccount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_account
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentAccount record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAdDataMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentAdData;
+import com.tzld.ad.model.po.adput.AdPutTencentAdDataExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentAdDataMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentAdDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentAdDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentAdData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentAdData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentAdData> selectByExample(AdPutTencentAdDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    AdPutTencentAdData selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentAdData record, @Param("example") AdPutTencentAdDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentAdData record, @Param("example") AdPutTencentAdDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentAdData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentAdData record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAdMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentAd;
+import com.tzld.ad.model.po.adput.AdPutTencentAdExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentAdMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentAdExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentAdExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentAd record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentAd record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentAd> selectByExample(AdPutTencentAdExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    AdPutTencentAd selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentAd record, @Param("example") AdPutTencentAdExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentAd record, @Param("example") AdPutTencentAdExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentAd record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentAd record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentAdPackageMappingMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentAdPackageMapping;
+import com.tzld.ad.model.po.adput.AdPutTencentAdPackageMappingExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentAdPackageMappingMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentAdPackageMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentAdPackageMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentAdPackageMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentAdPackageMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentAdPackageMapping> selectByExample(AdPutTencentAdPackageMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    AdPutTencentAdPackageMapping selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentAdPackageMapping record, @Param("example") AdPutTencentAdPackageMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentAdPackageMapping record, @Param("example") AdPutTencentAdPackageMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentAdPackageMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_ad_package_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentAdPackageMapping record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentBehaviorLogMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentBehaviorLog;
+import com.tzld.ad.model.po.adput.AdPutTencentBehaviorLogExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentBehaviorLogMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentBehaviorLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentBehaviorLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentBehaviorLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentBehaviorLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentBehaviorLog> selectByExample(AdPutTencentBehaviorLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    AdPutTencentBehaviorLog selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentBehaviorLog record, @Param("example") AdPutTencentBehaviorLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentBehaviorLog record, @Param("example") AdPutTencentBehaviorLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentBehaviorLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_behavior_log
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentBehaviorLog record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCallbackDataMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentCallbackData;
+import com.tzld.ad.model.po.adput.AdPutTencentCallbackDataExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentCallbackDataMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentCallbackDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentCallbackDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentCallbackData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentCallbackData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentCallbackData> selectByExample(AdPutTencentCallbackDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    AdPutTencentCallbackData selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentCallbackData record, @Param("example") AdPutTencentCallbackDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentCallbackData record, @Param("example") AdPutTencentCallbackDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentCallbackData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_callback_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentCallbackData record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentComponentDataMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentComponentData;
+import com.tzld.ad.model.po.adput.AdPutTencentComponentDataExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentComponentDataMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentComponentDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentComponentDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentComponentData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentComponentData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentComponentData> selectByExample(AdPutTencentComponentDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    AdPutTencentComponentData selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentComponentData record, @Param("example") AdPutTencentComponentDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentComponentData record, @Param("example") AdPutTencentComponentDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentComponentData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentComponentData record);
+}

+ 120 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentComponentMapper.java

@@ -0,0 +1,120 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentComponent;
+import com.tzld.ad.model.po.adput.AdPutTencentComponentExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentComponentMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentComponent record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentComponent record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentComponent> selectByExampleWithBLOBs(AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentComponent> selectByExample(AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    AdPutTencentComponent selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentComponent record, @Param("example") AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int updateByExampleWithBLOBs(@Param("record") AdPutTencentComponent record, @Param("example") AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentComponent record, @Param("example") AdPutTencentComponentExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentComponent record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeyWithBLOBs(AdPutTencentComponent record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_component
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentComponent record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeAnalysisMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeAnalysis;
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeAnalysisExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentCreativeAnalysisMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentCreativeAnalysisExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentCreativeAnalysisExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentCreativeAnalysis record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentCreativeAnalysis record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentCreativeAnalysis> selectByExample(AdPutTencentCreativeAnalysisExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    AdPutTencentCreativeAnalysis selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentCreativeAnalysis record, @Param("example") AdPutTencentCreativeAnalysisExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentCreativeAnalysis record, @Param("example") AdPutTencentCreativeAnalysisExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentCreativeAnalysis record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_analysis
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentCreativeAnalysis record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeComponentsMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeComponents;
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeComponentsExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentCreativeComponentsMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentCreativeComponentsExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentCreativeComponentsExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentCreativeComponents record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentCreativeComponents record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentCreativeComponents> selectByExample(AdPutTencentCreativeComponentsExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    AdPutTencentCreativeComponents selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentCreativeComponents record, @Param("example") AdPutTencentCreativeComponentsExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentCreativeComponents record, @Param("example") AdPutTencentCreativeComponentsExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentCreativeComponents record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_components
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentCreativeComponents record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeDataMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeData;
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeDataExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentCreativeDataMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentCreativeDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentCreativeDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentCreativeData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentCreativeData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentCreativeData> selectByExample(AdPutTencentCreativeDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    AdPutTencentCreativeData selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentCreativeData record, @Param("example") AdPutTencentCreativeDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentCreativeData record, @Param("example") AdPutTencentCreativeDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentCreativeData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative_data
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentCreativeData record);
+}

+ 120 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentCreativeMapper.java

@@ -0,0 +1,120 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentCreative;
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentCreativeMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentCreative record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentCreative record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentCreative> selectByExampleWithBLOBs(AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentCreative> selectByExample(AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    AdPutTencentCreative selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentCreative record, @Param("example") AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int updateByExampleWithBLOBs(@Param("record") AdPutTencentCreative record, @Param("example") AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentCreative record, @Param("example") AdPutTencentCreativeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentCreative record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeyWithBLOBs(AdPutTencentCreative record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_creative
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentCreative record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentDynamicBidMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentDynamicBid;
+import com.tzld.ad.model.po.adput.AdPutTencentDynamicBidExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentDynamicBidMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentDynamicBidExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentDynamicBidExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentDynamicBid record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentDynamicBid record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentDynamicBid> selectByExample(AdPutTencentDynamicBidExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    AdPutTencentDynamicBid selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentDynamicBid record, @Param("example") AdPutTencentDynamicBidExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentDynamicBid record, @Param("example") AdPutTencentDynamicBidExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentDynamicBid record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_dynamic_bid
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentDynamicBid record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentMaterialUploadHandleMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentMaterialUploadHandle;
+import com.tzld.ad.model.po.adput.AdPutTencentMaterialUploadHandleExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentMaterialUploadHandleMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentMaterialUploadHandleExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentMaterialUploadHandleExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentMaterialUploadHandle record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentMaterialUploadHandle record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentMaterialUploadHandle> selectByExample(AdPutTencentMaterialUploadHandleExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    AdPutTencentMaterialUploadHandle selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentMaterialUploadHandle record, @Param("example") AdPutTencentMaterialUploadHandleExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentMaterialUploadHandle record, @Param("example") AdPutTencentMaterialUploadHandleExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentMaterialUploadHandle record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_material_upload_handle
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentMaterialUploadHandle record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentPackageAdMappingMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentPackageAdMapping;
+import com.tzld.ad.model.po.adput.AdPutTencentPackageAdMappingExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentPackageAdMappingMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentPackageAdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentPackageAdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentPackageAdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentPackageAdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentPackageAdMapping> selectByExample(AdPutTencentPackageAdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    AdPutTencentPackageAdMapping selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentPackageAdMapping record, @Param("example") AdPutTencentPackageAdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentPackageAdMapping record, @Param("example") AdPutTencentPackageAdMappingExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentPackageAdMapping record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package_ad_mapping
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentPackageAdMapping record);
+}

+ 96 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/AdPutTencentPackageMapper.java

@@ -0,0 +1,96 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentPackage;
+import com.tzld.ad.model.po.adput.AdPutTencentPackageExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AdPutTencentPackageMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    long countByExample(AdPutTencentPackageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AdPutTencentPackageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int insert(AdPutTencentPackage record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int insertSelective(AdPutTencentPackage record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    List<AdPutTencentPackage> selectByExample(AdPutTencentPackageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    AdPutTencentPackage selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") AdPutTencentPackage record, @Param("example") AdPutTencentPackageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") AdPutTencentPackage record, @Param("example") AdPutTencentPackageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(AdPutTencentPackage record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ad_put_tencent_package
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(AdPutTencentPackage record);
+}

+ 97 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/DailyCategoryVideoMapper.java

@@ -0,0 +1,97 @@
+package com.tzld.ad.dao.mapper.adPut;
+
+import com.tzld.ad.model.po.adput.DailyCategoryVideo;
+import com.tzld.ad.model.po.adput.DailyCategoryVideoExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface DailyCategoryVideoMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    long countByExample(DailyCategoryVideoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(DailyCategoryVideoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int insert(DailyCategoryVideo record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int insertSelective(DailyCategoryVideo record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    List<DailyCategoryVideo> selectByExample(DailyCategoryVideoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    DailyCategoryVideo selectByPrimaryKey(Long id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") DailyCategoryVideo record, @Param("example") DailyCategoryVideoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") DailyCategoryVideo record, @Param("example") DailyCategoryVideoExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(DailyCategoryVideo record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table daily_category_video
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(DailyCategoryVideo record);
+}

+ 41 - 0
core/src/main/java/com/tzld/ad/dao/mapper/adPut/ext/AdPutTencentExtMapper.java

@@ -0,0 +1,41 @@
+package com.tzld.ad.dao.mapper.adPut.ext;
+
+import com.tzld.ad.model.adPut.AdPutCreativeComponentCostData;
+import com.tzld.ad.model.adPut.AdPutTencentCreativeCostSimple;
+import com.tzld.ad.model.po.adput.AdPutTencentAd;
+import com.tzld.ad.model.po.adput.AdPutTencentComponentData;
+import com.tzld.ad.model.po.adput.AdPutTencentCreativeAnalysis;
+import com.tzld.ad.model.po.adput.DailyCategoryVideo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+public interface AdPutTencentExtMapper {
+
+    int batchInsertComponentData(@Param("list") List<AdPutTencentComponentData> saveList);
+
+    List<AdPutCreativeComponentCostData> getCreativeComponentsCost(@Param("dt") String dt);
+
+    List<AdPutTencentAd> getAdPackageUpdateRecord(@Param("dt") String dt);
+
+    List<Long> getNotSyncPackageAccount();
+
+    void batchInsertDailyCategoryVideo(@Param("list") List<DailyCategoryVideo> saveList);
+
+    void deleteDailyCategoryVideo(@Param("dt") String dt);
+
+    List<DailyCategoryVideo> getMaxDailyCategoryVideoList();
+
+    List<AdPutTencentCreativeAnalysis> getReAnalysisCreativeList(Date startTime);
+
+    /**
+     * 查询指定合作方当日有消耗的创意列表(账户+广告+创意+创意消耗四表关联查询)
+     *
+     * @param partnerName 合作方名称(模糊匹配)
+     * @param dt          日期,yyyy-MM-dd
+     * @return 当日有消耗创意列表
+     */
+    List<AdPutTencentCreativeCostSimple> getPartnerDayCostCreativeList(@Param("partnerName") String partnerName,
+                                                                       @Param("dt") String dt);
+}

+ 39 - 0
core/src/main/java/com/tzld/ad/enums/AdOwnTypeEnum.java

@@ -0,0 +1,39 @@
+package com.tzld.ad.enums;
+
+public enum AdOwnTypeEnum {
+
+    WEIXIN("weixin", "微信广告"),
+    OWN("own", "自营广告-旧广告系统"),
+    OWN_PLATFORM("ownPlatform", "自营广告-投放平台"),
+    OWN_ALLIANCE("ownPlatform", "投放平台-广告联盟"),
+    AD_AFFILIATION("adAffiliation", "三方联盟广告"),
+
+    AD_STIMULATE("adStimulate","激励广告"),
+    NULL("noAd", "无广告"),
+    ;
+
+    private final String adType;
+    private final String desc;
+
+    AdOwnTypeEnum(String adType, String desc) {
+        this.adType = adType;
+        this.desc = desc;
+    }
+
+    public String getAdType() {
+        return adType;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public static AdOwnTypeEnum getByKey(String key){
+        for (AdOwnTypeEnum constants : values()) {
+            if (constants.getAdType().equalsIgnoreCase(key)) {
+                return constants;
+            }
+        }
+        return null;
+    }
+}

+ 27 - 0
core/src/main/java/com/tzld/ad/enums/AdStructureTypeEnum.java

@@ -0,0 +1,27 @@
+package com.tzld.ad.enums;
+
+public enum AdStructureTypeEnum {
+    CAMPAIGN("campaign"),
+    AD("ad"),
+    CREATIVE("creative");
+
+    private String name;
+
+    AdStructureTypeEnum(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+
+    public static AdStructureTypeEnum getByName(String name){
+        for (AdStructureTypeEnum constants : values()) {
+            if (constants.getName().equalsIgnoreCase(name)) {
+                return constants;
+            }
+        }
+        return null;
+    }
+}

+ 388 - 0
core/src/main/java/com/tzld/ad/enums/EnumRedisPrefix.java

@@ -0,0 +1,388 @@
+package com.tzld.ad.enums;
+
+public enum EnumRedisPrefix {
+    /**
+     * 广告
+     */
+    // AD_WECHAR_UNITID_CONFIG("ad.wechar.unitid.config.v2", "广告-微信广告位配置"),
+    // AD_WECHAR_SHAREPAGE_SCHEDULE("ad.wechar.sharepage.schedule", "广告-微信广告分享页投放计划"),
+    // AD_HUB_SWITCH("ad.hub.switch", "平台广告-功能开关"),
+    // AD_HUB_ALL_UNITS("ad.hub.allunits.{appType}", "平台广告-所有广告位"),
+    // AD_HUB_UNIT_VIEW_LIMIT_EVERYDAY_FORONEPERSON("ad.hub.unit.view.limit.everyday.foroneperson", "平台广告-用户对广告位的曝光限流配置"),
+    // AD_HUB_UNIT_VIEW_COUNT_EVERYDAY_FORONEPERSON("ad.hub.unit.view.count.everyday.foroneperson.{mid}.{adUnitId}.{yyyymmdd}", "平台广告-广告位每天对某个用户曝光的次数"),
+    // AD_HUB_ITEM_VIEW_LIMIT_EVERYDAY_FORONEPERSON("ad.hub.item.view.limit.everyday.foroneperson", "平台广告-用户对广告的曝光限流配置"),
+    // AD_HUB_ITEM_VIEW_COUNT_EVERYDAY_FORONEPERSON("ad.hub.item.view.count.everyday.foroneperson.{mid}.{adItemId}.{yyyymmdd}", "平台广告-每个广告每天对某个用户曝光的次数"),
+    // AD_HUB_ALL_RUNNING_PLANS("ad.hub.allrunningplans", "平台广告-所有广告计划"),
+    // AD_HUB_SINGLE_PLAN("ad.hub.single.plan.{adPlanId}", "平台广告-单个广告计划"),
+    // AD_HUB_PLAN_REMAIN_QUOTA("ad.hub.plan.remain.quota.{adPlanId}", "平台广告-广告计划剩余配额"),
+    // AD_HUB_UNIT_POSITION("ad.hub.unit.position.{adUnitId}", "平台广告-广告位位置"),
+    // AD_HUB_ITEM_VO("ad.hub.item.vo.{adItemId}", "平台广告-广告ItemVO"),
+    // AD_APP_SPLASHSCREEN_PANGLE_OPENFLAG("ad.app.splashscreen.pangle.openflag.{installChannel}", "app广告-穿山甲闪屏广告开关"),
+
+    AD_FLOW_CONTROL_BASE_SOURCE("ad:flow:controlBaseSource", "广告流量控制基数集合"),
+    AD_FLOW_CONTROL_COUNT("ad:flow:count:{flowId}", "广告流量控制计数器"),
+    WATCHED_INSPIRE_AD_KEY("have_watched_inspire_ad_video_set.{uid}", "用户已观看激励广告视频集合"),
+    // AD_BL_MID_KEY("ad:bl:mid:{adType}", "不显示广告用户名单"),
+    // AD_BL_VIDEO_KEY("ad:bl:video:{adType}", "不显示广告视频名单"),
+    // AD_BL_UID_KEY("ad:bl:uid:{adType}", "不显示广告视频主名单"),
+    // AD_CONFIG_SHOW_KEY("ad:config:show", "特殊广告显示控制信息"),
+    ADPAY_UIDS("adpay:uids", "支付去广告用户名单"),
+    AD_POSITION("ad:position:", "广告位信息"),
+    AD_CONFIG("ad:config:", "广告配置信息"),
+    VIDEO_CREATOR("videoCreator:", "视频创作者"),
+
+    // @Deprecated
+    // RETURN_CNT_30("returnCnt30:", "30 天有回流用户"),
+    // @Deprecated
+    // RETURN_CNT("returnCnt%d:", "N 天回流大于 X 的用户"),
+    // @Deprecated
+    // SHARE_CNT_Gt10("shareCntGt10:", "30 天内无回流分享大于 10 的用户"),
+    // @Deprecated
+    // SHARE_CNT("sharecnt:%d_%d:", "N 天内无回流分享大于 X 的用户"),
+    // @Deprecated
+    // CNT_KEY("returncnt:%d_%d-%d:", "N 天回流数 >=X&&<=Y 的用户"),
+
+    RTN_DAY_MID("rtn:%d:%s", "X 天内 mid 的回流数据"),
+    NEW_USER_2DAY("2d:new:", "2日新用户人群 mid 集合"),
+    RTN_MID("rtn:%s", "昨日 mid 的回流数据"),
+    AD_OWN_VIEW_COUNT_ALL("ad:plan:view:all:%s", "自营广告曝光数(all)"),
+    AD_OWN_VIEW_COUNT_TODAY("ad:plan:day:view:all:%s:%s", "自营广告曝光数(当日)"),
+    AD_OWN_CLICK_COUNT_ALL("ad:plan:click:all:%s", "自营广告点击数(all)"),
+    AD_OWN_CLICK_COUNT_TODAY("ad:plan:day:click:all:%s:%s", "自营广告点击数(当日)"),
+    AD_OWN_VIEW_COUNT_ALL_MAX_LIMIT("ad:own:view:all:max:%s", "自营广告曝光数(all)max limit"),
+    AD_OWN_DETAIL_INFO("ad:own:detail:%s", "自营广告详细信息"),
+
+    AD_OWN_PLAN_VIEW_ALL_LIMIT_COUNT("ad:plan:view:all:max:{planId}", "view总量限制"),
+    AD_OWN_PLAN_VIEW_DAY_LIMIT_COUNT("ad:plan:day:view:all:max:{planId}", "view当日总量限制"),
+
+    AD_OWN_PLAN_VIEW_ALL_NOW_COUNT("ad:plan:view:all:{planId}", "view累计总量"),
+    AD_OWN_PLAN_VIEW_DAY_NOW_COUNT("ad:plan:day:view:all:{planId}:{yyyymmdd}", "view当日累计总量"),
+
+    AD_OWN_PLAN_CLICK_ALL_LIMIT_COUNT("ad:plan:click:all:max:{planId}", "click总量限制"),
+    AD_OWN_PLAN_CLICK_DAY_LIMIT_COUNT("ad:plan:day:click:all:max:{planId}", "click当日总量限制"),
+
+    AD_OWN_PLAN_CLICK_ALL_NOW_COUNT("ad:plan:click:all:{planId}", "click累计总量"),
+    AD_OWN_PLAN_CLICK_DAY_NOW_COUNT("ad:plan:day:click:all:{planId}:{yyyymmdd}", "click当日累计总量"),
+
+    AD_OWN_PLAN_RELEASE_POLICY_LIST("ad:own:view:releasePolicy:list", "正在进行的投放计划"),
+
+    AD_FILTER_DELAY_QUEUE_PREFIX("ad:own:user:delayQueue:", "延时队列过滤key"),
+    AD_OWN_FILTER_PLAN_CLICK("ad:own:user:behavior:%s:%s:plan:%s:clickTime", "点击计划"),
+    AD_OWN_FILTER_AD_CLICK("ad:own:user:behavior:%s:%s:ad:%s:clickTime", "点击广告"),
+    AD_OWN_FILTER_ADR_CLICK("ad:own:user:behavior:%s:%s:adr:%s:clickTime", "点击广告主"),
+    AD_OWN_FILTER_PLAN_VIEWNOTCLICK("ad:own:user:behavior:%s:%s:plan:%s:viewNotClick", "计划曝光无点击"),
+    AD_OWN_FILTER_AD_VIEWNOTCLICK("ad:own:user:behavior:%s:%s:ad:%s:viewNotClick", "广告曝光无点击"),
+    AD_OWN_FILTER_ADR_VIEWNOTCLICK("ad:own:user:behavior:%s:%s:adr:%s:viewNotClick", "广告主曝光无点击"),
+    AD_OWN_USER_BEHAVIOR("ad:own:user:behavior:", "用户行为"),
+
+    AD_OWN_POSITION_CONFIG("ad.own.position.config", "广告位配置"),
+    AD_PLATFORM_POSITION_CONFIG("ad.platform.position.config", "广告位配置-投放平台"),
+
+    REDIS_WHITE_ROOT_SHARE_ID_SET("ad:own:white:rootShareId", "自营-微信买量rootShareId白名单(出广告)"),
+
+    REDIS_PLATFORM_USER_STATUS("ad:own:platform.user.status.{id}", "投放平台-账号状态0正常 1关闭"),
+
+    AD_OWN_PLAN_HAS_TAG("ad:own:plan:hasTag:{planId}", "计划-是否存在定向标签"),
+
+    AD_OWN_PLAN_LOGIN_TOKEN("ad.own.platform.{token}", "投放平台-登录token"),
+    AD_OWN_PLAN_LOGIN_UID("ad.own.platform.uid.{uid}", "投放平台-登录uid"),
+    AD_OWN_PLAN_LOGIN_VERIFICATION_CODE("ad.own.platform.verificationCode.{phone}", "投放平台-登录验证码"),
+    AD_OWN_EXCLUDE_CONV("ad.own.conv.{type}.{id}.{mid}.{days}.{eventType}", "排除人群-转化"),
+    AD_PLATFORM_CREATIVE_DETAIL("ad:platform:creative:detail:%s", "广告平台的创意详情"),
+    AD_SKU_TAGS("ad:platform:sku:tags:{adCode}", "广告sku信息"),
+    AD_PLATFORM_VIEW_RELEASEPOLICY_LIST("ad:platform:view:releasePolicy:list", "在投广告列表(小程序广告池)"),
+    AD_PLATFORM_CHECK_T_AB("ad:platform:check:t:ab", "在投广告策略实验配置"),
+    AD_BLACK_AD_CODE_LIST("ad.black.ad.code.list", "广告代码黑名单(Set类型)"),
+    AD_PLATFORM_VIEW_ALLIABCE_RELEASEPOLICY_LIST("ad:platform:view:alliance:releasePolicy:list", "在投广告列表(联盟流量广告池)"),
+    AD_PLATFORM_VIEW_COLD_START_RELEASE_POLICY_LIST("ad:platform:view:coldStart:releasePolicy:list", "在投广告列表(广告冷启池)"),
+    AD_PLATFORM_CREATIVE_REMOVE_COLD_START_POOL_FLAG("ad:platform:creative:remove:cold:start:pool:flag:{creativeCode}", "创意移除冷启池标记(算法用)"),
+
+    AD_OWN_PLATFORM_CREATIVE("ad:platform:creative:detail:{creativeCode}", "投放平台-创意详细信息"),
+    AD_OWN_PLATFORM_MAX_CLICK_DAY_COUNT("ad:platform:day:ad:max:click:all:{adCode}:{yyyymmdd}", "投放平台-当日点击最大量"),
+    AD_OWN_PLATFORM_MAX_COST_DAY_COUNT("ad:platform:day:ad:max:cost:all:{adCode}:{yyyymmdd}", "投放平台-当日花费最大量"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_CREATIVE_LIST("ad:platform:day:advertising:creative:list", "投放平台-当天最后投放的创意列表"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_AD_LIST("ad:platform:day:advertising:ad:list", "投放平台-当天最后投放的广告列表"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_CAMPAIGN_LIST("ad:platform:day:advertising:campaign:list", "投放平台-当天最后投放的计划列表"),
+    AD_OWN_PLATFORM_NOW_CLICK_DAY_COUNT("ad:platform:day:ad:click:all:{adCode}:{yyyymmdd}", "投放平台-当日点击累计量"),
+    AD_OWN_PLATFORM_NOW_COST_DAY_COUNT("ad:platform:day:ad:cost:all:{adCode}:{yyyyMMdd}", "投放平台-当日花费累计量"),
+    AD_OWN_PLATFORM_DAY_EXPEND("ad:platform:day:ad:expend:{adCode}:{yyyyMMdd}", "投放平台-广告当日消耗完毕标识"),
+    AD_OWN_PLATFORM_ADVERTISER_EXPEND("ad:platform:day:ad:expend:{advertiserId}", "投放平台-广告主余额消耗完毕标识"),
+
+    AD_OWN_PLATFORM_AD_DAY_LIMIT_STATUS_LOCK("ad:platform:day:ad:limit:lock:{adCode}", "投放平台-当日点击累计量"),
+
+    AD_OWN_PLATFORM_EXCLUDE_CONV("ad.platform.conv.{type}.{code}.{mid}.{days}.{eventType}", "投放平台-排除人群-转化"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_STOP_CREATIVE_LIST("ad:platform:day:advertising:stop:creative:list", "投放平台-当天投放结构创意停投列表"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_STOP_LAST_CREATIVE_LIST("ad:platform:day:advertising:stop:last:creative:list", "投放平台-当天投放结构创意停投列表(最后一次计算)"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_STOP_AD_LIST("ad:platform:day:advertising:stop:ad:list", "投放平台-当天投放结构广告停投列表"),
+    AD_OWN_PLATFORM_DAY_ADVERTISING_STOP_CAMPAIGN_LIST("ad:platform:day:advertising:stop:campaign:list", "投放平台-当天投放结构计划停投列表"),
+
+    ADPLATFORM_OWN_VIEW_COUNT_ALL("adplatform:campaign:view:all:%s", "自营广告曝光数(all)"),
+    ADPLATFORM_OWN_VIEW_COUNT_TODAY("adplatform:campaign:day:view:all:%s:%s", "自营广告曝光数(当日)"),
+    ADPLATFORM_OWN_AD_VIEW_COUNT_TODAY("adplatform:ad:day:view:all:%s:%s", "自营广告曝光数(广告)(当日)"),
+    ADPLATFORM_OWN_CLICK_COUNT_ALL("adplatform:campaign:click:all:%s", "自营广告点击数(all)"),
+    ADPLATFORM_OWN_CLICK_COUNT_TODAY("adplatform:campaign:day:click:all:%s:%s", "自营广告点击数(当日)"),
+    ADPLATFORM_OWN_USER_BEHAVIOR("ad:platform:user:behavior:", "用户行为"),
+    ADPLATFORM_FILTER_DELAY_QUEUE_PREFIX("ad:platform:user:delayQueue:", "延时队列过滤key"),
+    ADPLATFORM_FILTER_CAMPAIGN_CLICK("ad:platform:user:behavior:%s:%s:campaign:%s:clickTime", "点击计划"),
+    ADPLATFORM_FILTER_AD_CLICK("ad:platform:user:behavior:%s:%s:ad:%s:clickTime", "点击广告"),
+    ADPLATFORM_FILTER_CREATIVE_CLICK("ad:platform:user:behavior:%s:%s:creative:%s:clickTime", "点击广告主"),
+    ADPLATFORM_FILTER_ADR_CLICK("ad:platform:user:behavior:%s:%s:adr:%s:clickTime", "点击广告主"),
+    ADPLATFORM_FILTER_SKU_CLICK("ad:platform:user:behavior:%s:%s:sku:%s:clickTime", "点击广告主"),
+    ADPLATFORM_FILTER_CAMPAIGN_VIEWNOTCLICK("ad:platform:user:behavior:%s:%s:campaign:%s:viewNotClick", "计划曝光无点击"),
+    ADPLATFORM_FILTER_AD_VIEWNOTCLICK("ad:platform:user:behavior:%s:%s:ad:%s:viewNotClick", "广告曝光无点击"),
+    ADPLATFORM_FILTER_CREATIVE_VIEWNOTCLICK("ad:platform:user:behavior:%s:%s:creative:%s:viewNotClick", "广告主曝光无点击"),
+    ADPLATFORM_FILTER_ADR_VIEWNOTCLICK("ad:platform:user:behavior:%s:%s:adr:%s:viewNotClick", "广告主曝光无点击"),
+    ADPLATFORM_FILTER_SKU_VIEWNOTCLICK("ad:platform:user:behavior:%s:%s:sku:%s:viewNotClick", "广告主曝光无点击"),
+    ADPLATFORM_DAY_AD_EXPEND("ad:platform:day:ad:expend:{adCode}:{yyyyMMdd}", "广告消耗完暂停标识"),
+    ADPLATFORM_OWN_VIEW_EXTRACT_STRATEGY_TODAY("ad:platform:creative:view:{extractStrategy}:{creativeCode}:{date}", "自营广告区分不同的extractStrategy曝光数"),
+
+    ADPLATFORM_OWN_CLICK_EXTRACT_STRATEGY_TODAY("ad:platform:creative:click:{extractStrategy}:{creativeCode}:{date}", "自营广告区分不同的extractStrategy点击数"),
+
+
+    AD_PLATFORM_OWN_VIEW_MID_LAYER_TODAY("ad:platform:creative:view:{layer}:{creativeCode}:{date}", "自营广告区分不同分群的创意曝光数"),
+
+    AD_PLATFORM_OWN_CLICK_MID_LAYER_TODAY("ad:platform:creative:click:{layer}:{creativeCode}:{date}", "自营广告区分不同分群的创意点击数"),
+
+    AD_PLATFORM_OEN_COST_MID_LAYER_TODAY("ad:platform:creative:cost:{layer}:{creativeCode}:{date}", "自营广告区分不同分群的创意消耗"),
+
+    AD_PLATFORM_OEN_CONV_MID_LAYER_TODAY("ad:platform:creative:conv:{layer}:{creativeCode}:{date}", "自营广告区分不同分群的创意转化数"),
+
+    AD_PLATFORM_CREATIVE_COEFFICIENT("ad:platform:day:package:coefficient:{creativeCode}:{yyyyMMdd}", "投放平台-2min创意包装系数"),
+
+    AD_PLATFORM_CREATIVE_CROWD_COEFFICIENT("ad:platform:day:package:coefficient:{creativeCode}:{crowd}:{yyyyMMdd}", "投放平台-2min创意包装系数"),
+
+    AD_PLATFORM_CREATIVE_PACKAGE_CLICK("ad:platform:day:package:click:{creativeCode}:{yyyyMMdd}", "投放平台-创意当日累计包装点击数"),
+    AD_PLATFORM_CREATIVE_PACKAGE_COST("ad:platform:day:package:cost:{creativeCode}:{yyyyMMdd}", "投放平台-创意当日累计包装消费"),
+    AD_PLATFORM_CREATIVE_WEIGHT("ad:platform:creative:weight:{creativeCode}", "投放平台-创意权重"),
+    AD_PLATFORM_CREATIVE_COLD_START_WEIGHT("ad:platform:creative:algorithm:weight:{creativeCode}", "投放平台-算法创意权重"),
+    AD_PLATFORM_CREATIVE_PACKAGE_CPA("ad:platform:package:cpa:{creativeId}", "投放平台-创意包装CPA"),
+    AD_PLATFORM_CREATIVE_PACKAGE_TARGET_CPM("ad:platform:package:target:cpm:{creativeId}", "投放平台-目标CPM"),
+    AD_PLATFORM_CREATIVE_BASE_COEFFICIENT("ad:platform:package:base:coefficient:{creativeCode}", "投放平台-创意基础包装系数"),
+
+    AD_PLATFORM_AD_BID_CONFIG("ad:platform:ad:bid:config:{adCode}", "投放平台-竞价广告配置"),
+
+    AD_PLATFORM_AD_BID_DAYLIMITAMOUNT("ad:platform:ad:bid:day:amount:{adCode}", "投放平台-竞价广告日预算"),
+
+    AD_PLATFORM_AD_BID_CODE_LIST("ad:platform:ad:bid:code:set", "投放平台-竞价广告列表"),
+
+    AD_PLATFORM_CREATIVE_BID_DAY_COST("ad:platform:creative:bid:day:cost:{code}:{yyyyMMdd}", "投放平台-竞价创意当日累计消费"),
+
+    AD_PLATFORM_AD_BID_DAY_COST("ad:platform:ad:bid:day:cost:{code}:{yyyyMMdd}", "投放平台-竞价广告当日累计消费"),
+
+    AD_PLATFORM_AD_BID_DAY_VIEW_COUNT("ad:platform:ad:bid:day:view:{code}:{yyyyMMdd}", "投放平台-竞价广告当日累计消费"),
+
+    AD_PLATFORM_AD_BID_DAY_CLICK_COUNT("ad:platform:ad:bid:day:click:{code}:{yyyyMMdd}", "投放平台-竞价广告当日累计消费"),
+    AD_PLATFORM_ADVERTISER_AMOUNT("ad:platform:advertiser:{advertiserId}:amount", "广告主余额-定时更新"),
+    AD_PLATFORM_ADVERTISER_AMOUNT_REFRESH_LOCK("ad:platform:advertiser:{advertiserId}:amount:refresh:lock", "刷新广告主余额--分布式锁key"),
+
+    AD_PLATFORM_ADVERTISER_APPTYPE_DATA_SUMMARY("ad:platform:hour:{keyType}:{advertiserId}:{appType}:{yyyyMMddHH}", "广告平台广告主-产品-每天-小时级数据"),
+
+    AD_UNION_LOGIN_TOKEN("ad:union:login:{token}", "广告联盟-登录Token"),
+    AD_UNION_LOGIN_UID("ad:union:login:{uid}", "广告联盟-登录UID"),
+
+    AD_UNION_USER_STATUS("ad:union:user:status:{id}", "广告联盟-账号状态0正常 1关闭"),
+
+    AD_UNION_INFO_ADP_ID("ad:alliance:account:ad:info:mapping:{unionAdId}", "广告ID与流量主映射缓存"),
+
+    AD_STIMULATE_MEDIUM("ad:stimulate:medium:{sceneValue}:{rootShareId}", "激励广告-媒体配置"),
+
+    AD_UNION_H5_ADCODE_MAPPING("ad:flow:master:adCode:mapping:{adpId}", "流量主广告Id----广告code映射"),
+
+    AD_UNION_H5_URL_TYPE_MAPPING("ad:flow:master:type:mapping:{adpId}", "流量主广告Id----流量类型映射"),
+
+    AD_UNION_H5_URL_POSITION_MAPPING("ad:flow:master:position:mapping:{adpId}", "流量主广告Id----广告位类型映射"),
+
+    AD_UNION_CACHE_CLICK_LOG("ad.flow.master.request.{logId}", "流量主广告Id----【广告类型】的日志上报缓存"),
+
+    AD_NOT_IN_FLOW_POOL_C_CONFIG_WEIGHT("ad:flow:no:weight:config", "流量主广告Id----流量类型映射"),
+
+    AD_UNION_APPLICATION_TYPE_MAPPING("ad:flow:master:application.type:mapping:{adpId}", "流量主广告Id----应用类型"),
+
+    AD_PUT_TENCENT_ACCESS_TOKEN("ad:put:tencent:accessToken:{clientId}:{accountId}", "投流-accessToken"),
+
+    AD_PUT_TENCENT_REFRESH_TOKEN("ad:put:tencent:refreshToken:{clientId}:{accountId}", "投流-refreshToken"),
+
+    AD_TEST002_CACHE("ad:platform:ab:info:{typeValue}:{appType}:{group}", "abTest002实验缓存"),
+    AD_ADVERTISER_NEW_BID_TYPE_SWITCH("ad:advertiser:new:bidType:switch:{yyyyMMdd}:{advertiserCode}", "广告主是否切换新计费方式"),
+    AD_ADVERTISER_CACHE("ad:advertiser:cache:{advertiserId}", "广告主缓存"),
+
+    ADVANCE_SHOW_AD_FLAG("ad:advance:show:ad:flag:%s", "是否提前出广告标识,0-否;1-是"),
+
+    ADVER_IS_API_EQ_0_IDS("ad:adver:isapi:0", "未回传广告主ID集合"),
+
+    ADVER_BID_TYPE("ad:advertiser:type:{adrId}", "getAdAdvertiserBidTypeCacheKey"),
+
+    ADVER_GUARANTEE_ORG_DATA("ad:platform:guarantee:data:{yyyyMMdd}:{adrId}", "广告主保量原始数据(from大数据)"),
+
+    ADVER_GUARANTEE_RATE("ad:platform:guarantee:rate:{yyyyMMdd}:{adrId}", "广告主保量比例(from任务)"),
+
+    AD_WECHAT_TICKET("ad:open:wechat:ticket:{suiteId}", "企微-三方应用凭证"),
+
+    AD_WECHAT_SUITE_ACCESS_TOKEN("ad:open:wechat:suite:token:{suiteId}", "企微-三方应用凭证"),
+
+    AD_WECHAT_PRE_AUTH_CODE("ad:open:wechat:pre:auth:{suiteId}", "企微-三方应用凭证"),
+
+    AD_WECHAT_AUTH_TOKEN("ad:open:wechat:auth:cop:accessToken:{authCorpId}", "授权accessToken"),
+
+    AD_WECHAT_CORP_CHAT("ad:open:wechat:chat:info:{corpId}:{chatId}", "企微-客户群信息"),
+
+    AD_WECHAT_CORP_USER("ad:open:wechat:chat:info:{corpId}:{externalUserId}", "企微-客户信息"),
+
+    AD_WECHAT_CORP_MEMBER("ad:open:wechat:member:info:{corpId}:{userId}", "企微-企业成员信息"),
+
+    AD_BLACK_UID_CONFIG("ad.black.intercept.uid.config", "不出广告uid最低值"),
+
+    AD_BLACK_USER("ad.black.user.v2.{uid}", "黑名单用户"),
+
+    AD_BLACK_USER_SERVER("ad.black.user.server.{uid}", "服务端黑名单用户"),
+
+    AD_BLACK_MID_IN_TIME("mid:generate:timestamp:{mid}", "用户首次mid时间"),
+
+    AD_BLACK_SCREEN_TIME("ad.black.screening.strategy.screen.{id}", "截屏黑名单用户"),
+
+    AD_PLATFORM_CREATIVE_TARGET_CHANGE("ad:platform:target:change:{dt}:{creativeId}", "慕白哦cpa、cpm发生变化"),
+
+    AD_SELF_LANDING_PATTERN("ad:self:landing:pattern:{landingCode}", "自建站落地页样式配置"),
+
+    AD_ROV_WEIGHT("ad.platform.rov.creative.weight.{yyyyMMdd}.{creativeCode}", "自营广告融合rov动态权重"),
+
+    AD_SELF_LANDING_QR("ad.self.landing.qr.{landingCode}", "自建站-生效二维码地址"),
+    AD_SELF_LANDING_QR_V2("ad.self.landing.qr.v2.{landingCode}", "自建站-生效二维码信息"),
+    AD_SELF_LANDING_QR_INFO_MAPPING("ad.self.landing.qr.info.mapping.{landingCode}", "自建站-二维码信息集合映射"),
+
+    AD_PLATFORM_LOW_CPM_WEIXIN_CPM("ad.platform.cpm.weixin.{appType}.{yyyyMMdd}", "微信产品CPM值"),
+
+    AD_PLATFORM_LOW_CPM_OWN_CPM("ad.platform.cpm.{adCode}.{appType}.{yyyyMMdd}", "自营广告CPM值"),
+
+    AD_WEIXIN_VIEW_COUNT("ad.platform.weixin.view.count.{yyyyMMdd}", "微信单日曝光分发量"),
+
+    AD_FUND_ADUIT_NP("ad.platform.aduit.fund.{no}", "审核单号细节"),
+
+
+    AD_TENCENT_FISSION_DONE_ONE_HOUR_HOUR("ad.tencent.fission.done.one.hour.{rootSessionId}.{day}", "腾讯用户裂变-一小时内-已处理小时"),
+
+    AD_TENCENT_FISSION_DONE_ONE_DAY_HOUR("ad.tencent.fission.done.one.day.{rootSessionId}.{day}", "腾讯用户裂变-一天内-已处理小时"),
+
+    AD_TENCENT_BEHAVIOR_FISSION_COUNT_ONE_HOUR("ad.tencent.fission.one.hour.{rootSessionId}.{day}", "获取单行为点击数-一小时内"),
+
+    AD_TENCENT_BEHAVIOR_FISSION_COUNT_ALL_DAY("ad.tencent.fission.one.day.{rootSessionId}.{day}", "获取单行为点击数-24小时 获取的时候按照单个小时获取"),
+
+    AD_TENCENT_BEHAVIOR_OFFICIAL_FISSION_COUNT_ONE_HOUR("ad.tencent.official.fission.one.hour.{rootSessionId}.{day}", "腾讯用户分享裂变-公众号-一小时"),
+
+    AD_TENCENT_BEHAVIOR_OFFICIAL_FISSION_COUNT_ALL_DAY("ad.tencent.official.fission.one.day.{rootSessionId}.{day}", "腾讯用户分享裂变-公众号-一天"),
+
+    AD_PROFESSION_GUARANTEED_BASE_DATA("ad:platform:profession:guaranteed:baseData:{profession}:{yyyyMMdd}", "行业保量-大数据base数据"),
+
+    AD_PROFESSION_GUARANTEED_CAL("ad:platform:profession:guaranteed:{profession}:{yyyyMMdd}", "行业保量值"),
+
+    AD_PROFESSION_GUARANTEED_CACHE("ad:platform:profession:guaranteed:cache:{yyyyMMdd}", "行业保量缓存"),
+
+    AD_CHAT_PRE_PENDING_ID("ad:chat:pre:pendingId:{pendingId}", "三方应用,查询pendingId"),
+
+    AD_CHAT_PRE_EXTERNAL_USER_ID("ad:chat:pre:externalUserId:{externalUserId}", "三方应用,查询externalUserId"),
+
+    AD_USER_UNION_ID("ad:user:unionId:{openId}", "用户unionId openId"),
+
+
+    AD_ADR_BIND_CORP_MAPPING("ad:adr:bind:corp:{adrCode}", "异常检测-广告主授权企业绑定关系"),
+
+    FEI_SHU_APP_TOKEN("ad:feishu:app:token", "飞书应用token(炸群)"),
+
+    AD_CHAT_IS_QUERY("ad:chat:pre:{corpId}:{unionId}:{openId}", "三方应用,是否查询过标识"),
+
+    AD_PRE_ERROR_NUM("ad:chat:pre:error:num", "三方应用,是否查询过标识"),
+
+    AD_PREDICT_DAY_LIMIT_VIEW_COUNT("ad:prediction:dayLimit:view:count:{adCode}:{yyyyMMdd}", "预估曝光量限制"),
+
+    AD_PREVIEW_QR("ad:platform:preview:qr:{creativeCode}", "创意预览二维码"),
+
+    AD_PREVIEW_KEY("ad:platform:preview:{key}", "创意预览key映射"),
+
+    AD_PLATFORM_CUSTOMER_ADVERTISER_CACHE("ad:platform:customer:advertiser:cache:{advertiserId}", "客户广告主id映射"),
+    AD_PLATFORM_CUSTOMER_PQTID("ad:platform:customer:pqtId:{pqtId}", "客户用户id映射"),
+    AD_OWN_PLATFORM_EXCLUDE_CUSTOMER_USER("ad:platform:exclude:customer:user:{customerId}", "同客户用户排除bitMap"),
+    AD_TARGETING_CONVERSION("ad:platform:targeting:conversion:{adCode}", "广告目标转化值"),
+    AD_LENGQI_CONVERSION_COUNT("ad:platform:lengqi:targeting:conversion:{creativeCode}", "冷启池展示广告目标转化信息"),
+    AD_LENGQI_CONVERSION_COUNT_SEVEN_DAYS("ad:platform:lengqi:targeting:conversion:seven:days:{creativeCode}", "冷启池近7天展示广告目标转化信息"),
+    AD_LENGQI_CONVERSION_PQT_ID("ad:platform:lengqi:targeting:conversion:{pqtId}", "冷启池展示广告目标转化pqtid"),
+
+    AD_BID_REVISE_AMOUNT("ad:platform:bid:{pqtId}","广告曝光计费"),
+    AD_BID_COLD_START_BASE_DATA("ad:platform:bid:base:coldStart:data:{adCode}","广告曝光计费"),
+    AD_IP_SPIDER_BLACK_HOUR_TIME("ad:ip:spider:black:hour:times:{ip}", "广告ip一小时内访问广告次数"),
+    AD_REPEAT_USER_BLACK_HOUR_TIME("ad:repeat:user:black:hour:times:{uid}", "广告用户一小时内访问广告次数"),
+    AD_IP_SPIDER_BLACK_LIST("ad:ip:spider:black:list:{ip}", "广告ip黑名单"),
+    DID_TO_MID_SET("did:to:mid:{yyyyMMdd}:{did}", "did映射mid"),
+    MID_TO_DID_SET("mid:to:did:{yyyyMMdd}:{mid}", "mid映射did"),
+    DID_BLACK_LIST("ad.black.did.v1.{did}", "did黑名单"),
+
+    AD_LANDING_CODE_MAPPING("ad:landing:pqtid:code:mapping:{pqtId}", "落地页landingCode映射缓存"),
+    AD_WHITE_LANDING_PQTID("ad:white:landing:pqtid:{pqtId}", "白名单落地页pqtId与loginUid映射"),
+    AD_LANDING_CODE_QR_INFO_NAPPING("ad:landing:code:qr:info:mapping:{pqtId}", "广告pqtId与二维码信息映射"),
+
+    AD_VIDEO_TAG_ADCODE_SET("ad:video:tag:adcode:set:{videoId}", "视频ID对应的广告code集合"),
+    AD_VIDEO_TAG_ALL_ADCODE_SET("ad:video:tag:all:adcode:set", "所有配置的广告code集合"),
+    AD_VIDEO_TAG_SET("ad:video:tag:set:{videoId}", "视频id对应的标签集合"),
+
+    AD_BOMB_GROUP_TAG_SET("ad:bomb:abnormal:user:info:{id}", "炸群异常用户标签"),
+    AD_BOMB_ABNORMAL_USER_FLAG("ad:bomb:abnormal:user:flag:{id}", "广告炸群异常用户标识"),
+
+    AD_HOU_ZHUAN_STRATEGY("hou:zhuan:strategy:{mid}", "后转策略-行业和分类配置"),
+
+    AD_ADVERTISER_CATEGORY("ad:advertiser:category:{advertiserId}", "广告主品类缓存"),
+
+    AD_DISTRIBUTE_NUM("ad.distribution:num:{adId}:{yyyyMMddHHmm}", "广告分钟级分发数量"),
+    AD_DAY_LIMIT_LIST("ad.day:limit:less:than:threshold", "日预算小于某个阈值的广告列表"),
+
+    AD_TENCENT_GZH_WELCOM_CALLBACK("ad.tencent.gzh.welcom.callback:{gzhWXId}.{openId}", "腾讯广告公众号欢迎语回调"),
+    AD_TENCENT_CREATIVE_ANALYSIS("ad.tencent.creative.analysis.{creativeId}", "腾讯广告创意理解"),
+    AD_TENCENT_CREATIVE_ANALYSIS_LOCK("ad.tencent.creative.analysis.lock.{creativeId}", "腾讯广告创意理解锁"),
+    AD_TENCENT_USER_TOKEN("ad.put.tencent.usertoken", "腾讯广告用户实名认证token"),
+    AD_TENCENT_CREATIVE_CALLBACK("ad.tencent.creative.callback:{dt}:{creativeId}", "腾讯广告创意回调"),
+
+    // 客户异常率相关缓存
+    AD_CUSTOMER_DAILY_ABNORMAL_RATE("ad:customer:daily:abnormal:rate:{customerId}:{yyyyMMdd}", "客户当前异常率(大数据写入)"),
+    AD_USER_ABNORMAL_CUSTOMER_MAPPING("ad:user:abnormal:customer:mapping:{mid}:{yyyyMMdd}", "异常用户所属客户名单(大数据写入)"),
+    AD_CUSTOMER_OVER_ABNORMAL_RATE("ad:customer:over:abnormal:rate:{yyyyMMdd}", "异常率到达阈值的客户缓存(服务端写入)"),
+
+    // 广告主与客户映射缓存
+    AD_ADVERTISER_TO_CUSTOMER_MAPPING("ad:advertiser:to:customer:mapping:{advertiserId}", "广告主与客户ID映射(服务端写入)"),
+
+    // 冷启创意分层映射关系
+    AD_COLD_START_CREATIVE_LAYER_MAPPING("ad:cold:start:creative:layer:mapping:{creativeCode}", "冷启创意分层映射关系"),
+
+    AD_COEFFICIENT_RATE_PQTID("ad:coefficient:rate:{pqtId}", "pqtId对应的包装系数权重"),
+
+    AD_BUSINESS_PRICE_DIFFERENCE("ad:business:price:difference:v3:{creativeCode}:{yyyyMMdd}", "业务收入比效率收入低的差价"),
+
+    AD_TENCENT_DECONSTRUCT_TASK_ID("ad.tencent.deconstruct.taskId.{creativeId}", "腾讯广告创意解构任务ID缓存"),
+
+    AD_TENCENT_CREATIVE_REPLACE_LOCK("ad.tencent.creative.replace.lock.{creativeId}", "腾讯广告创意12小时内不重复替换标记"),
+
+    AD_BUSINESS_PRICE_DIFFERENCE_FLAG("ad:business:price:difference:flag:{pqtId}", "用户是否需要参与补差价"),
+
+    AD_CREATIVE_TARGET_COST("ad:creative:target:cost:{creativeId}:{yyyyMMdd}", "创意当日累计效率收入"),
+    ;
+    private String prefix;
+    private String descr;
+
+    EnumRedisPrefix(String prefix, String descr) {
+        this.prefix = prefix;
+        this.descr = descr;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    public String getDescr() {
+        return descr;
+    }
+
+    public void setDescr(String descr) {
+        this.descr = descr;
+    }
+}

+ 1 - 1
core/src/main/java/com/tzld/rta/common/enums/EnumUploadFileType.java → core/src/main/java/com/tzld/ad/enums/EnumUploadFileType.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.common.enums;
+package com.tzld.ad.enums;
 
 public enum EnumUploadFileType {
 	PICTURE(1,"1"),

+ 6 - 0
core/src/main/java/com/tzld/ad/enums/ErrcodeNamespace.java

@@ -0,0 +1,6 @@
+package com.tzld.ad.enums;
+
+public interface ErrcodeNamespace {
+
+  public final static String NS_GENERAL = "manager";
+}

+ 177 - 0
core/src/main/java/com/tzld/ad/enums/ExceptionCodeEnum.java

@@ -0,0 +1,177 @@
+package com.tzld.ad.enums;
+
+
+import static com.tzld.ad.enums.ErrcodeNamespace.NS_GENERAL;
+
+public enum ExceptionCodeEnum {
+
+  AD_PUT_TENCENT_REMOTE_ERROR(NS_GENERAL, 20001, "请求腾讯广告远程异常"),
+
+  LOGIN_ERROR(NS_GENERAL, -999, "用户未登录"),
+  ACCOUNT_FREEZE(NS_GENERAL, -888, "账户被锁定"),
+  SYS_ERROR(NS_GENERAL, -111, "系统异常"),
+  PARAM_ERROR(NS_GENERAL, -990, "参数错误"),
+  WX_GET_ACCESS_TOKEN(NS_GENERAL, -995, "获取线上的微信accessToken失败"),
+  WX_GET_OPENID_ERROR(NS_GENERAL,-992,"微信用户获取OPENID出错"),
+
+  VIDEO_NOTEXIST(NS_GENERAL, 1, "视频不存在"),
+  DATA_ERROR(NS_GENERAL, 2, "数据不匹配"),
+  USER_NOTEXIST(NS_GENERAL, 3, "用户不存在"),
+  PAPAM_ERROR(NS_GENERAL, 4, "参数不对"),
+  ACCOUNT_EXIST(NS_GENERAL, 5, "账号已被占用"),
+  PASSWORD_ERROR(NS_GENERAL, 6, "密码不准确"),
+  DATA_NOTEXIST(NS_GENERAL, 7, "数据不匹配"),
+  MENU_EXIST(NS_GENERAL, 8, "菜单标示已存在"),
+  MENU_NOTEXIST(NS_GENERAL, 9, "菜单不存在"),
+  NOT_lOGIN(NS_GENERAL, 10, "未登录"),
+  KAIYAN_VIDEO_SEND(NS_GENERAL, 11, "开眼视频已经发过"),
+
+  MONITORING_ALARM_CONFIG_NOT_EXIST(NS_GENERAL, 12, "数据库容量告警手机号码未配置"),
+
+  OPERAATION_FAIL(NS_GENERAL, 13, "操作失败"),
+
+  PUSH_MSG_CANNT_UPDATE(NS_GENERAL,14,"立即推送的信息不能修改"),
+  PUSH_MSG_CANNT_DELETE(NS_GENERAL,15,"立即推送的信息不能撤销"),
+  SEND_PUSH_MSG_CANNT_UPDATE(NS_GENERAL,16,"已推送的信息不能修改"),
+  PUSH_TARGET_NOTEXIST(NS_GENERAL,17,"没有找到推送目标的绑定设备"),
+  PUSH_PLATFORM_ERROR(NS_GENERAL,18,"推送平台错误"),
+  PUSH_SCHEDULE_ERROR(NS_GENERAL,19,"定时推送时间必须大于当前时间"),
+
+  DATA_REPORT_TYPE_NOT_EXISTS(NS_GENERAL,20,"对应的报表不存在"),
+  DATA_REPORT_PARAM_NOT_EXISTS(NS_GENERAL,21,"报表扩展参数有缺失"),
+  NOTEXAMINEVIDEO_CONFIG_NOT_EXIST(NS_GENERAL, 23, "未审核的视频数手机号码未配置"),
+  SENSITIVE_WORD_EXISTS(NS_GENERAL,22,"该词已存在"),
+  USERPROHIBITION_NOTEXIST(NS_GENERAL, 24, "封禁类型或者标示不存在"),
+
+  VERSION_CONTROLLER_DEFAULT_CONFIG(NS_GENERAL, 25, "没有默认配置,请联系管理员直接添加。"),
+  CONFIG_EXIST(NS_GENERAL, 26, "该版本配置已存在,不能重复添加。"),
+
+  BARRAGE_UP_VSIBILITY(NS_GENERAL, 27, "不能操作弹幕UP主删除"),
+  BARRAGE_TIME_ERROR(NS_GENERAL, 28, "视频时间不能为0"),
+  VIDEO_AUDITTRANSCATIONID_NOT_NEW(NS_GENERAL, 29, "视频审核ID不是最新"),
+  VIDEO_IS_DELETE(NS_GENERAL, 30, "视频已被用户删除"),
+  VIDEO_NOT_NOAML(NS_GENERAL, 29, "视频不是正常可见的"),
+  VIDEO_SHOULD_UNFREEZE(NS_GENERAL, 31, "请先解冻视频"),
+
+  AD_ALGO_THRESHOLD_PUSH_UPDATE_ERROR(NS_GENERAL, 32, "更新远程广告算法阈值失败"),
+
+  DATA_EXIST(NS_GENERAL, 33, "数据已存在"),
+  CUSTOMER_NOT_EXIST(NS_GENERAL, 34, "客户不存在"),
+
+  VIDEO_CONTENT_SENSITIVE_MATCH(NS_GENERAL,1015,"输入内容包含违禁词汇,请修改"),
+  VIDEO_TITLE_SENSITIVE_MATCH(NS_GENERAL,1016,"输入标题包含违禁词汇,请修改"),
+  VIDEO_RECOMMEND_TITLE_SENSITIVE_MATCH(NS_GENERAL,1017,"输入分发标题包含违禁词汇,请修改"),
+
+  CANNOT_GET_LOCK(NS_GENERAL, 3001,"已有相同操作在进行"),
+  COMMENT_NOT_EXIST(NS_GENERAL, 3002,"评论不存在"),
+  COMMENT_IS_DELETE(NS_GENERAL, 3003,"评论已经删除存在"),
+
+  VIDEO_MEASURE_PROCEEDING(NS_GENERAL, 4000,"此视频正在曝光池中"),
+  VIDEO_NOT_TAG(NS_GENERAL, 4001, "视频没有标签"),
+  RECOMMENT_PARAM_INDEX_ERROR(NS_GENERAL, 4002, "推荐配置的限制个数和位置个数对应不上"),
+  RECOMMENT_PARAM_SCORE_ERROR(NS_GENERAL, 4003, "分数设置不对"),
+  VIDEO_UNRECOMMEND(NS_GENERAL, 4002, "待推荐视频不能加入曝光池"),
+
+  TAG_NAME_IS_UNUSED(NS_GENERAL, 5001,"同名视频标签%s不存在"),
+  MAJIAHAO_IS_ALL_USED(NS_GENERAL, 5001,"马甲号已全部用完"),
+
+  SECOND_CATEGORY_IS_NULL(NS_GENERAL, 6002,"二级分类不能为空"),
+  PARENT_CATEGORY_IS_NULL(NS_GENERAL, 6001,"一级分类不能为空"),
+
+  CANNOT_REVOCER_UNDELETED_VIDEO(NS_GENERAL, 7001, "不能恢复未删除的视频"),
+  CANNOT_REVOCER_DELETED_FILENOTFIND_VIDEO(NS_GENERAL, 7002, "视频文件已经被迁移,请先恢复文件后再恢复视频"),
+
+  VIDEO_AUDIT_PERMISSION_DENIED(NS_GENERAL, 8001, "你没有修改视频审核状态的权限"),
+  CAN_NOT_FETCHTASK_FOR_NOT_ONDUTY(NS_GENERAL, 8002, "你已经下班了,无法分配审核任务"),
+
+  DELOGO_VIDEO_NOT_EXISTS(NS_GENERAL, 8003, "去视频视频不存在"),
+  DELOGO_VIDEO_AUDIT_ERROR(NS_GENERAL, 8004, "已转码成功的视频不能改成审核不通过"),
+  DELOGO_VIDEO_AUDIT_WRONG(NS_GENERAL, 8004, "已审核通过且已发起转码的视频不能改成审核不通过"),
+  VIDEO_NOT_SLICE(NS_GENERAL, 8005, "不可搜视频不能分剪"),
+  VIDEO_SLICE_EXISTS(NS_GENERAL, 8006, "视频分剪已存在"),
+  MUSIC_NOT_EXISTS(NS_GENERAL, 8007, "音乐素材不存在"),
+  MUSIC_CATE_EXISTS(NS_GENERAL, 8008, "音乐素材分类已存在"),
+  MUSIC_CRAWER_NOT_EDIT(NS_GENERAL, 8009, "音乐爬取素材不能编辑"),
+  MUSIC_HOT_NOT_DELETE(NS_GENERAL, 8010, "热门音乐不能被删除"),
+
+  VIDEO_CROP_PROCESSING(NS_GENERAL, 9001, "该视频有正在处理中的剪切任务"),
+
+
+  AD_POSITION_FLOW_CONTROL_OVERFLOW(NS_GENERAL, 1001, "该广告位下流量控制不能大于 100%"),
+  INVOKE_VIDEO_API_WEAPP_URLLINK_ERROR(NS_GENERAL, 1002, "调用 video api 获取小程序 URL Link 失败"),
+  INVOKE_INCENTIVE_API_ERROR(NS_GENERAL, 1003, "调用激励服务失败"),
+  ADCAMPAIGN_REPEAT_ERROR(NS_GENERAL, -1, "名称重复,请修改"),
+  ADCAMPAIGN_RUNNING_DELETE_ERROR(NS_GENERAL, -1, "计划启用中,不能删除"),
+  ADAD_RUNNING_DELETE_ERROR(NS_GENERAL, -1, "广告启用中,不能删除"),
+  ADAD_HAS_CREATIVE_DELETE_ERROR(NS_GENERAL, -1, "广告下存在绑定创意,请删除对应创意后操作删除广告"),
+  ADCREATIVE_RUNNING_DELETE_ERROR(NS_GENERAL, -1, "创意启用中,不能删除"),
+  GET_AGENT_ERROR(NS_GENERAL, -1, "获取agent错误"),
+  DELETE_ADVERTISER_ERROR(NS_GENERAL, -1, "该广告主下绑定有计划,不能删除"),
+  OPERATE_ADVERTISER_ERROR(NS_GENERAL, -1, "该代理商下没有该广告主,不能操作"),
+  DELETE_CAMPAIGN_ERROR(NS_GENERAL, -1, "该计划下绑定广告投放中,不能删除"),
+  ADCAMPAIGN_HAS_AD_DELETE_ERROR(NS_GENERAL, -1, "该计划下存在绑定广告,请删除对应广告后操作删除计划"),
+  PHONE_EXIST(NS_GENERAL, 10001, "手机号已存在"),
+
+  NO_AD(NS_GENERAL, 11001, "无分发激励广告"),
+
+  AD_QR_STATUS(NS_GENERAL,11002,"无开启状态二维码"),
+
+  AD_LANDING_AUDIT_STATUS_ERROR(NS_GENERAL,11003,"审核状态异常"),
+
+  AD_PROFESSION_DEL_STATUS_ERROR(NS_GENERAL,11004,"行业已绑定广告主,无法删除!"),
+
+  FUND_RULE_AUTH_ERROR(NS_GENERAL,11004,"不具有财务权限"),
+
+  FUND_AGENT_NOT_ENOUGH(NS_GENERAL,11005,"代理商账户余额不足"),
+
+  MANAGER_ORDER_ERROR(NS_GENERAL,11006,"退款失败"),
+
+  PREVIEW_QR_EXPIRE(NS_GENERAL,11007,"预览二维码已失效"),
+
+  DATA_NOT_FOUND(NS_GENERAL,11008,"数据不存在"),
+
+  BUSINESS_ERROR(NS_GENERAL,11009,"业务异常"),
+
+  LANDING_DELETE_CHECK(NS_GENERAL,11010,"该落地页绑定的创意正在投放中,不能删除"),
+  ;
+
+
+  ExceptionCodeEnum(String namespace, int code, String msg) {
+    this.code = code;
+    this.msg = msg;
+    this.namespace = namespace;
+  }
+  private int code;
+  private String msg;
+  private String namespace;
+
+  public int getCode() {
+    return code;
+  }
+
+  public void setCode(int code) {
+    this.code = code;
+  }
+
+  public String getMsg() {
+    return msg;
+  }
+
+  public void setMsg(String msg) {
+    this.msg = msg;
+  }
+
+  public String getNamespace() {
+    return namespace;
+  }
+
+  public void setNamespace(String namespace) {
+    this.namespace = namespace;
+  }
+
+  @Override
+  public String toString() {
+    return String.format("[code=%s, msg=%s]", this.code, this.msg);
+  }
+
+}

+ 1 - 1
core/src/main/java/com/tzld/rta/common/enums/ExceptionEnum.java → core/src/main/java/com/tzld/ad/enums/ExceptionEnum.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.common.enums;
+package com.tzld.ad.enums;
 
 /**
  * 异常枚举

+ 28 - 0
core/src/main/java/com/tzld/ad/enums/FieshuTableColumnDataTypeEnum.java

@@ -0,0 +1,28 @@
+package com.tzld.ad.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum FieshuTableColumnDataTypeEnum {
+    TEXT("text"),
+    LARK_MD("lark_md"),
+    NUMBER("number"),
+    DATE("date"),
+    OPTIONS("options"),
+    ;
+
+    private String type;
+
+    FieshuTableColumnDataTypeEnum(String type) {
+        this.type = type;
+    }
+
+    public static FieshuTableColumnDataTypeEnum from(String type) {
+        for (FieshuTableColumnDataTypeEnum typeEnum : FieshuTableColumnDataTypeEnum.values()) {
+            if (typeEnum.getType().equals(type)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 34 - 0
core/src/main/java/com/tzld/ad/enums/adPut/ActionTypeEnum.java

@@ -0,0 +1,34 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+/**
+ * 标准行为类型
+ */
+@Getter
+public enum ActionTypeEnum {
+    VIEW_CONTENT("VIEW_CONTENT","关键页面访问",1),
+    SHARE("SHARE","分享",2),
+    REGISTER("REGISTER","注册",3),
+    PURCHASE("PURCHASE","付费",4),
+    CARD_CLICK("CARD_CLICK","卡片点击",5),
+
+    ;
+    private final String value;
+    private final String description;
+    private final int localCode;
+
+    ActionTypeEnum(String value, String description, int localCode) {
+        this.value = value;
+        this.description = description;
+        this.localCode = localCode;
+    }
+    public static ActionTypeEnum getActionTypeByCode(int code) {
+        for (ActionTypeEnum actionTypeEnum : ActionTypeEnum.values()) {
+            if (actionTypeEnum.getLocalCode() == code) {
+                return actionTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 28 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPackageStatus.java

@@ -0,0 +1,28 @@
+package com.tzld.ad.enums.adPut;
+
+public enum AdPackageStatus {
+
+    WAIT_UPDATE(0, "待更新"),
+    OSS_UPDATE(1, "已更新人群oss文件"),
+    WAIT_UPLOAD(2,"待上传腾讯人群包"),
+    UPLOAD_TENCENT_PACKAGE(3, "已上传腾讯人群包(状态待可用)"),
+
+    TENCENT_SUCCESS(4, "腾讯已解析完毕");
+
+    private Integer code;
+    private String desc;
+
+    AdPackageStatus(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+}

+ 25 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutDynamicBidDtStatus.java

@@ -0,0 +1,25 @@
+package com.tzld.ad.enums.adPut;
+
+public enum AdPutDynamicBidDtStatus {
+    NO_DAT(-1, "无数据"),
+    UNDER_CONSUMPTION(0, "消耗未达标舍弃"),
+    PARTICIPATE_CAL(1, "正常统计");
+
+    private Integer code;
+    private String desc;
+
+    AdPutDynamicBidDtStatus(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+}

+ 18 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutLogBehaviorTypeEnum.java

@@ -0,0 +1,18 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+@Getter
+public enum AdPutLogBehaviorTypeEnum {
+    SHARE("SHARE", "分享行为记录日志"),
+    OFFICIAL_SHARE("OFFICIAL_SHARE","公众号分享日志"),
+
+    ;
+    private final String value;
+    private final String description;
+
+    AdPutLogBehaviorTypeEnum(String value, String description) {
+        this.value = value;
+        this.description = description;
+    }
+}

+ 19 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutSenceEnum.java

@@ -0,0 +1,19 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+/**
+ * to see <a href="https://developers.weixin.qq.com/miniprogram/dev/reference/scene-list.html">...</a>
+ */
+@Getter
+public enum AdPutSenceEnum {
+    WEIXIN_OFFICIAL_ACCOUNTS_CARD_SHARE(1074L, "公众号会话下发的小程序消息卡片")
+    ;
+    private Long code;
+    private String desc;
+    AdPutSenceEnum(Long code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+}

+ 16 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentAdSystemStatusEnum.java

@@ -0,0 +1,16 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+@Getter
+public enum AdPutTencentAdSystemStatusEnum {
+    ADGROUP_STATUS_DELETED("ADGROUP_STATUS_DELETED","已删除"),
+    ADGROUP_STATUS_WECHAT_CHANNELS_STOP("ADGROUP_STATUS_WECHAT_CHANNELS_STOP","投放结束(超过 14 天广告未上线)"),
+    ;
+    private String code;
+    private String desc;
+    AdPutTencentAdSystemStatusEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+}

+ 19 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentBehaviorBusinessTypeEnum.java

@@ -0,0 +1,19 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+@Getter
+public enum AdPutTencentBehaviorBusinessTypeEnum {
+    FISSION_HOUR("FISSION_HOUR", "裂变近一小时"),
+    FISSION_DAY("FISSION_DAY","裂变二十四小时内"),
+    OFFICIAL_FISSION_HOUR("OFFICIAL_FISSION_HOUR", "公众号分享裂变-一小时"),
+    OFFICIAL_FISSION_DAY("OFFICIAL_FISSION_DAY", "公众号分享裂变-二十四小时内"),
+        ;
+    private final String value;
+    private final String description;
+
+    AdPutTencentBehaviorBusinessTypeEnum(String value, String description) {
+        this.value = value;
+        this.description = description;
+    }
+}

+ 41 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentPackageKeyEnum.java

@@ -0,0 +1,41 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.List;
+
+@Getter
+public enum AdPutTencentPackageKeyEnum {
+    R_2_10("R_2_10", "回流2-10人群", 2),
+    R_10_50("R_10_50", "回流10-50人群", 10),
+    R_50_100("R_50_100", "回流50-100人群", 50),
+    R_100_180("R_100_180", "回流100-180人群", 100),
+    R_180_330("R_180_330", "回流180-330人群", 180),
+    R_330_ADD("R_330+", "回流330以上人群", 330),
+    S_ALL("S_ALL", "有分享行为人群", 500),
+
+    other("other", "其他人群", 50),
+    ;
+
+    private String packageKey;
+    private String packageName;
+    private Integer minPeople;
+
+    AdPutTencentPackageKeyEnum(String packageKey, String packageName, Integer minPeople) {
+        this.packageKey = packageKey;
+        this.packageName = packageName;
+        this.minPeople = minPeople;
+    }
+
+    public static List<String> getPackageKeys() {
+        return Arrays.asList(AdPutTencentPackageKeyEnum.R_2_10.getPackageKey(),
+                        AdPutTencentPackageKeyEnum.R_10_50.getPackageKey(),
+                        AdPutTencentPackageKeyEnum.R_50_100.getPackageKey(),
+                        AdPutTencentPackageKeyEnum.R_100_180.getPackageKey(),
+                        AdPutTencentPackageKeyEnum.R_180_330.getPackageKey(),
+                        AdPutTencentPackageKeyEnum.R_330_ADD.getPackageKey(),
+                        AdPutTencentPackageKeyEnum.S_ALL.getPackageKey());
+    }
+
+}

+ 20 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdPutTencentPackageUserIdTypeEnum.java

@@ -0,0 +1,20 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+@Getter
+public enum AdPutTencentPackageUserIdTypeEnum {
+    WX_OPENID("WX_OPENID", "微信用户的 openid"),
+    WX_UNIONID("WX_UNIONID", "微信 UnionID"),
+    ;
+
+    private String key;
+    private String desc;
+
+    AdPutTencentPackageUserIdTypeEnum(String key, String desc) {
+        this.key = key;
+        this.desc = desc;
+    }
+
+
+}

+ 20 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdTencentAccountTypeEnum.java

@@ -0,0 +1,20 @@
+package com.tzld.ad.enums.adPut;
+
+public enum AdTencentAccountTypeEnum {
+
+    YEWU("业务单元账户"),
+    ZHUTI("主体账户"),
+    ZI("子广告账户");
+
+    private String desc;
+
+    AdTencentAccountTypeEnum(String desc) {
+        this.desc = desc;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+
+}

+ 28 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdTencentDynamicBidStatus.java

@@ -0,0 +1,28 @@
+package com.tzld.ad.enums.adPut;
+
+public enum AdTencentDynamicBidStatus {
+    NO_ENOUGH_OST(-2, "不值信不调价"),
+    NO_DATA(-1, "数据为空不调价"),
+    LOW_BID(0, "roi过低 调整绝对低价"),
+    LOW_EXCESSIVE(1, "roi较低 稍微减价过度"),
+    TARGET(2,"roi在目标roi一定范围  不做出价调整"),
+    HIGH_ADD_BID(3, "roi较高调整出价进行加价");
+
+    private Integer code;
+    private String desc;
+
+    AdTencentDynamicBidStatus(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+}

+ 33 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdTencentFields.java

@@ -0,0 +1,33 @@
+package com.tzld.ad.enums.adPut;
+
+import java.util.Arrays;
+import java.util.List;
+
+public interface AdTencentFields {
+
+    List<String> AD_GROUP_INFO = Arrays.asList(
+            "adgroup_id", "daily_budget", "targeting", "configured_status", "system_status", "adgroup_name", "marketing_goal", "marketing_sub_goal",
+            "marketing_carrier_type", "marketing_carrier_detail", "bid_amount", "optimization_goal", "marketing_asset_outer_spec");
+
+    List<String> CREATIVE_INFO = Arrays.asList(
+            "adgroup_id", "dynamic_creative_id", "dynamic_creative_name", "configured_status", "creative_components", "is_deleted");
+
+    List<String> CREATIVE_COST_DAY = Arrays.asList(
+            "date", "dynamic_creative_id", "adgroup_id", "account_id", "dynamic_creative_name", "view_count", "view_user_count"
+            , "avg_view_per_user", "valid_click_count", "click_user_count", "cpc", "ctr"
+            , "cost", "conversions_count", "from_follow_uv", "key_page_view_count", "register_by_click_count", "from_follow_by_click_uv", "biz_follow_uv", "reg_pv");
+
+    List<String> AD_COST_DAY = Arrays.asList("account_id", "date", "view_count", "view_user_count", "valid_click_count",
+            "click_user_count", "cost", "cpc"
+            , "conversions_count", "from_follow_uv", "key_page_view_count", "register_by_click_count", "from_follow_by_click_uv", "biz_follow_uv", "reg_pv");
+
+    List<String> COMPONENT = Arrays.asList("date", "dynamic_creative_id", "adgroup_id", "component_id",
+            "account_id", "site_set", "image_ids", "video_ids", "view_count", "view_user_count"
+            , "avg_view_per_user", "valid_click_count", "click_user_count", "cpc", "ctr"
+            , "cost", "conversions_count", "from_follow_uv");
+
+    List<String> COMPONENT_DETAIL = Arrays.asList("account_id", "component_id", "component_sub_type",
+            "component_custom_name", "generation_type", "component_value", "created_time", "last_modified_time",
+            "is_deleted");
+
+}

+ 16 - 0
core/src/main/java/com/tzld/ad/enums/adPut/AdTencentUserActionOptimizationGoalEnum.java

@@ -0,0 +1,16 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+@Getter
+public enum AdTencentUserActionOptimizationGoalEnum {
+    OPTIMIZATIONGOAL_PROMOTION_VIEW_KEY_PAGE("OPTIMIZATIONGOAL_PROMOTION_VIEW_KEY_PAGE", "关键页面访问次数")
+    ;
+    private final String value;
+    private final String description;
+
+    AdTencentUserActionOptimizationGoalEnum(String value, String description) {
+        this.value = value;
+        this.description = description;
+    }
+}

+ 30 - 0
core/src/main/java/com/tzld/ad/enums/adPut/DynamicBidStatus.java

@@ -0,0 +1,30 @@
+package com.tzld.ad.enums.adPut;
+
+public enum DynamicBidStatus {
+
+    NO_ONE(-1,"不调整"),
+    ZERO(0, "后端初始化"),
+    ONE(1, "大数据1-4总收益"),
+
+    TWO(2, "后端计算出价格"),
+    THREE(3, "更新腾讯广告出价"),
+    ;
+
+    private Integer code;
+    private String desc;
+
+    DynamicBidStatus(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+}

+ 20 - 0
core/src/main/java/com/tzld/ad/enums/adPut/MarketingTargetTypeEnum.java

@@ -0,0 +1,20 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+@Getter
+/**
+ * 腾讯广告推广产品类型
+ * @see https://developers.e.qq.com/v3.0/docs/enums#api_marketing_target_type
+ */
+public enum MarketingTargetTypeEnum {
+    MARKETING_TARGET_TYPE_MINI_PROGRAM_WECHAT("MARKETING_TARGET_TYPE_MINI_PROGRAM_WECHAT","微信小程序"),
+    ;
+    private final String value;
+    private final String description;
+
+    MarketingTargetTypeEnum(String value, String description) {
+        this.value = value;
+        this.description = description;
+    }
+}

+ 20 - 0
core/src/main/java/com/tzld/ad/enums/adPut/UserActionSetTypeEnum.java

@@ -0,0 +1,20 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+/**
+ * 用户行为源类型
+ */
+@Getter
+public enum UserActionSetTypeEnum {
+    WECHAT_MINI_PROGRAM("WECHAT_MINI_PROGRAM", "微信小程序行为数据源"),
+    WECHAT("WECHAT", "微信公众号行为数据源"),
+    ;
+    private final String value;
+    private final String description;
+
+    UserActionSetTypeEnum(String value, String description) {
+        this.value = value;
+        this.description = description;
+    }
+}

+ 19 - 0
core/src/main/java/com/tzld/ad/enums/adPut/UserActionSetUsagesEnum.java

@@ -0,0 +1,19 @@
+package com.tzld.ad.enums.adPut;
+
+import lombok.Getter;
+
+/**
+ * 接入用途类型
+ */
+@Getter
+public enum UserActionSetUsagesEnum {
+    DEEP_DATA_COOPERATION("DEEP_DATA_COOPERATION", "DMP 平台外的深度数据合作")
+    ;
+    private final String value;
+    private final String description;
+
+    UserActionSetUsagesEnum(String value, String description) {
+        this.value = value;
+        this.description = description;
+    }
+}

+ 4 - 4
core/src/main/java/com/tzld/rta/handle/GlobalExceptionHandle.java → core/src/main/java/com/tzld/ad/handle/GlobalExceptionHandle.java

@@ -1,8 +1,8 @@
-package com.tzld.rta.handle;
+package com.tzld.ad.handle;
 
-import com.tzld.rta.common.base.CommonResponse;
-import com.tzld.rta.common.enums.ExceptionEnum;
-import com.tzld.rta.common.exception.CommonException;
+import com.tzld.ad.common.base.CommonResponse;
+import com.tzld.ad.enums.ExceptionEnum;
+import com.tzld.ad.common.exception.CommonException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.CollectionUtils;

+ 1 - 1
core/src/main/java/com/tzld/rta/interceptor/CrosDomainAllowInterceptor.java → core/src/main/java/com/tzld/ad/interceptor/CrosDomainAllowInterceptor.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.interceptor;
+package com.tzld.ad.interceptor;
 
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Component;

+ 441 - 0
core/src/main/java/com/tzld/ad/job/adPut/AdPutTencentAlarmJob.java

@@ -0,0 +1,441 @@
+package com.tzld.ad.job.adPut;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.aliyun.odps.data.Record;
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.tzld.ad.dao.mapper.adPut.AdPutTencentAccountMapper;
+import com.tzld.ad.dao.mapper.adPut.AdPutTencentAdMapper;
+import com.tzld.ad.dao.mapper.adPut.AdPutTencentCreativeMapper;
+import com.tzld.ad.dao.mapper.adPut.ext.AdPutTencentExtMapper;
+import com.tzld.ad.enums.EnumRedisPrefix;
+import com.tzld.ad.enums.FieshuTableColumnDataTypeEnum;
+import com.tzld.ad.model.adPut.AdPutTencentCreativeCostSimple;
+import com.tzld.ad.model.feishu.FeishuTableDTO;
+import com.tzld.ad.model.po.*;
+import com.tzld.ad.model.po.adput.*;
+import com.tzld.ad.service.AdOwnRedisUtils;
+import com.tzld.ad.util.DateUtil;
+import com.tzld.ad.util.OdpsUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.client.RestTemplate;
+
+import java.math.BigDecimal;
+import java.math.MathContext;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Component
+public class AdPutTencentAlarmJob {
+
+    @Autowired
+    private AdPutTencentAccountMapper adPutTencentAccountMapper;
+    @Autowired
+    private AdPutTencentAdMapper adPutTencentAdMapper;
+    @Autowired
+    private AdPutTencentCreativeMapper adPutTencentCreativeMapper;
+    @Autowired
+    private AdPutTencentExtMapper adPutTencentExtMapper;
+    @Autowired
+    private AdOwnRedisUtils adOwnRedisUtils;
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @ApolloJsonValue("${partner.creative.rootSourceId.robot.config:{\"棱镜\":\"https://open.feishu.cn/open-apis/bot/v2/hook/b55e2b97-84d4-4b77-9bd6-c3a62f23b986\",\"鲸禾\":\"https://open.feishu.cn/open-apis/bot/v2/hook/d467841e-1ea4-458a-acbd-577d8c1692c0\",\"像素\":\"https://open.feishu.cn/open-apis/bot/v2/hook/1fe05cc1-4b20-48e5-bc72-2781952e1aa5\"}}")
+    private Map<String, String> creativeCheckPartnerRobotConfig;
+
+    private final static String CHECK_COOPERATE_AUTO_REPLY_COST_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/c4890b1b-796b-40b3-beba-9402c19f2ec7";
+
+    @XxlJob("hoursCheckCooperateAutoReplyCostJob")
+    public ReturnT<String> hoursCheckCooperateAutoReplyCostJob(String param) {
+        Map<String, String> alarmMap = new HashMap<>();
+        alarmMap.put("公众号即时回复", "合作即转业务报警");
+        alarmMap.put("企微外部", "企微外部报警");
+        Integer lastHour = DateUtil.getHourOfDay() - 1;
+        String hourStr = String.format("%02d", lastHour);
+        String dateStr = DateUtil.getCurrentDateStr("yyyyMMdd");
+        for (Map.Entry<String, String> entry : alarmMap.entrySet()) {
+            String channelName = entry.getKey();
+            String title = entry.getValue();
+
+            // 缓存判断报警
+            String lockKey = String.format("hoursCheckCooperateAutoReplyCostJob:%s:%s:%d", channelName, dateStr, lastHour);
+            String lockValue = adOwnRedisUtils.get(lockKey);
+            if (StringUtils.isNotEmpty(lockValue)) {
+                continue;
+            }
+            String sql = String.format(
+                    "SELECT 小时,数据类型,渠道名称,合作方,首层uv,昨日首层uv,首层uv变化率,昨日裂变数,昨日裂变率,预估成本,dt \n" +
+                            "FROM loghubods.dws_channel_first_uv_monit " +
+                            "where dt = '%s' and 小时 = '%s' and 渠道名称 = '%s' order by 首层uv desc;",
+                    dateStr, hourStr, channelName);
+            List<Record> dataList = OdpsUtil.getOdpsData(sql);
+            if (CollectionUtils.isEmpty(dataList)) {
+                continue;
+            }
+            List<FeishuTableDTO.Column> columns = buildCheckCooperateAutoReplyCostColumns();
+            List<JSONObject> rows = new ArrayList<>();
+
+            for (Record record : dataList) {
+                String channel = record.getString("合作方");
+                Integer firstUv = Integer.valueOf(record.getString("首层uv"));
+                String lastDayFirstUvStr = record.getString("昨日首层uv");
+                Integer lastDayFirstUv = 0;
+                if (!lastDayFirstUvStr.equals("\\N")) {
+                    lastDayFirstUv = Integer.valueOf(lastDayFirstUvStr);
+                }
+                String firstUvChangeRate = record.getString("首层uv变化率");
+                String lastDayFissionRateStr = record.getString("昨日裂变率");
+                BigDecimal lastDayFissionRate = new BigDecimal(0);
+                if (!lastDayFissionRateStr.equals("\\N")) {
+                    lastDayFissionRate = new BigDecimal(lastDayFissionRateStr);
+                }
+                BigDecimal cost = new BigDecimal(record.getString("预估成本"));
+                JSONObject row = new JSONObject();
+                row.put("hour", lastHour);
+                row.put("firstUV", firstUv);
+                row.put("channel", channel);
+                row.put("lastFirstUV", lastDayFirstUv);
+                row.put("firstUVChangeRate", firstUvChangeRate);
+                row.put("lastFissionRate", lastDayFissionRate.round(new MathContext(4)).doubleValue());
+                row.put("cost", cost.doubleValue());
+
+                rows.add(row);
+            }
+            String time = DateUtil.getCurrentDateStr("yyyy-MM-dd HH:mm:ss");
+            FeishuTableDTO tableDTO = FeishuTableDTO.createTable(title + " " + time, columns, rows, false);
+            JSONObject content = JSONObject.parseObject(JSONObject.toJSONString(tableDTO));
+            JSONObject bodyParam = new JSONObject();
+            bodyParam.put("msg_type", "interactive");
+            bodyParam.put("card", content);
+            sendMsg(CHECK_COOPERATE_AUTO_REPLY_COST_URL, bodyParam.toJSONString());
+            adOwnRedisUtils.set(lockKey, "1", 60 * 60);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private List<FeishuTableDTO.Column> buildCheckCooperateAutoReplyCostColumns() {
+        List<FeishuTableDTO.Column> columns = new ArrayList<>();
+        FeishuTableDTO.Column hourColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "hour", "小时", null);
+        columns.add(hourColumn);
+        FeishuTableDTO.Column channelColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "channel", "合作方", null);
+        columns.add(channelColumn);
+        FeishuTableDTO.Column firstUVColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "firstUV", "首层UV", null);
+        columns.add(firstUVColumn);
+        FeishuTableDTO.Column firstUVChangeRateColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "firstUVChangeRate", "首层UV变化率", null);
+        columns.add(firstUVChangeRateColumn);
+        FeishuTableDTO.Column lastFirstUVColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "lastFirstUV", "昨日首层UV", null);
+        columns.add(lastFirstUVColumn);
+        FeishuTableDTO.Column lastFissionRateColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "lastFissionRate", "昨日裂变率", null);
+        columns.add(lastFissionRateColumn);
+        FeishuTableDTO.Column costColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "cost", "预估成本", null);
+        columns.add(costColumn);
+        return columns;
+    }
+
+    private String sendMsg(String url, String jsonString) {
+        // 创建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+
+        // 创建HttpEntity
+        HttpEntity<String> request = new HttpEntity<>(jsonString, headers);
+
+        // 发送POST请求
+        ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class);
+
+        // 返回响应体
+        return response.getBody();
+    }
+
+
+    @XxlJob("hoursCheckTencentCostJob")
+    public ReturnT<String> hoursCheckTencentCostJob(String param) {
+        Integer lastHour = DateUtil.getHourOfDay() - 1;
+        String hourStr = String.format("%02d", lastHour);
+        String dt = DateUtil.getCurrentDateStr("yyyyMMdd") + hourStr;
+
+        // 缓存判断报警
+        String lockKey = String.format("hoursCheckTencentCostJob:%s", dt);
+        String lockValue = adOwnRedisUtils.get(lockKey);
+        if (StringUtils.isNotEmpty(lockValue)) {
+            return ReturnT.SUCCESS;
+        }
+        String sql = String.format(
+                "SELECT 日期,小时,渠道类型,消耗,昨日同时段消耗,消耗变化率,dt\n" +
+                        "FROM loghubods.dws_channel_cost_monit\n" +
+                        "WHERE dt = '%s';", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        if (CollectionUtils.isEmpty(dataList)) {
+            return ReturnT.SUCCESS;
+        }
+        List<FeishuTableDTO.Column> columns = buildCheckTencentCostColumns();
+        List<JSONObject> rows = new ArrayList<>();
+
+        for (Record record : dataList) {
+            String hour = record.getString("小时");
+            String channel = record.getString("渠道类型");
+            String cost = record.getString("消耗");
+            String lastCost = record.getString("昨日同时段消耗");
+            String costChangeRate = record.getString("消耗变化率");
+
+            JSONObject row = new JSONObject();
+            row.put("hour", hour);
+            row.put("channel", channel);
+            row.put("cost", cost);
+            row.put("lastCost", lastCost);
+            row.put("costChangeRate", costChangeRate);
+
+            rows.add(row);
+        }
+        String time = DateUtil.getCurrentDateStr("yyyy-MM-dd HH:mm:ss");
+        FeishuTableDTO tableDTO = FeishuTableDTO.createTable("腾讯广告投放平台消耗报警 " + time, columns, rows, false);
+        JSONObject content = JSONObject.parseObject(JSONObject.toJSONString(tableDTO));
+        JSONObject bodyParam = new JSONObject();
+        bodyParam.put("msg_type", "interactive");
+        bodyParam.put("card", content);
+        sendMsg(CHECK_COOPERATE_AUTO_REPLY_COST_URL, bodyParam.toJSONString());
+        adOwnRedisUtils.set(lockKey, "1", 60 * 60);
+        return ReturnT.SUCCESS;
+    }
+
+    private List<FeishuTableDTO.Column> buildCheckTencentCostColumns() {
+        List<FeishuTableDTO.Column> columns = new ArrayList<>();
+        FeishuTableDTO.Column hourColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "hour", "小时", null);
+        columns.add(hourColumn);
+        FeishuTableDTO.Column channelColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "channel", "渠道", null);
+        columns.add(channelColumn);
+        FeishuTableDTO.Column costColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "cost", "消耗", null);
+        columns.add(costColumn);
+        FeishuTableDTO.Column lastCostColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "lastCost", "昨日同时段消耗", null);
+        columns.add(lastCostColumn);
+        FeishuTableDTO.Column costChangeRateColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "costChangeRate", "消耗变化率", null);
+        columns.add(costChangeRateColumn);
+        return columns;
+    }
+
+
+    @XxlJob("hoursCheckDuplicateCreativeRootSourceIdJob")
+    public ReturnT<String> hoursCheckDuplicateCreativeRootSourceIdJob(String param) {
+        if (CollectionUtils.isEmpty(creativeCheckPartnerRobotConfig)) {
+            return ReturnT.SUCCESS;
+        }
+        for (Map.Entry<String, String> entry : creativeCheckPartnerRobotConfig.entrySet()) {
+            String partner = entry.getKey();
+            String robotUrl = entry.getValue();
+            // 查询合作方账户
+            AdPutTencentAccountExample accountExample = new AdPutTencentAccountExample();
+            accountExample.createCriteria().andAgentNameLike("%" + partner + "%").andIsDeleteEqualTo(0);
+            List<AdPutTencentAccount> accountList = adPutTencentAccountMapper.selectByExample(accountExample);
+            List<Long> accountIds = accountList.stream().map(o -> Long.valueOf(o.getAccountId())).collect(Collectors.toList());
+            // 查询账户广告
+            AdPutTencentAdExample adExample = new AdPutTencentAdExample();
+            adExample.createCriteria().andAccountIdIn(accountIds).andMarketingTargetTypeEqualTo("MARKETING_TARGET_TYPE_MINI_PROGRAM_WECHAT");
+            List<AdPutTencentAd> adList = adPutTencentAdMapper.selectByExample(adExample);
+            List<Long> adIds = adList.stream().map(AdPutTencentAd::getAdId).collect(Collectors.toList());
+            // 查询广告创意
+            AdPutTencentCreativeExample adPutTencentCreativeExample = new AdPutTencentCreativeExample();
+            adPutTencentCreativeExample.createCriteria().andAdIdIn(adIds).andCreativeStatusEqualTo("AD_STATUS_NORMAL").andIsDeleteEqualTo(0);
+            List<AdPutTencentCreative> creativeList = adPutTencentCreativeMapper.selectByExampleWithBLOBs(adPutTencentCreativeExample);
+            Map<String, List<AdPutTencentCreative>> creativeMap = new HashMap<>();
+            for (AdPutTencentCreative creative : creativeList) {
+                String rootSourceId = extractRootSourceIdFromCreativeComponents(creative.getCreativeComponents());
+                if (StringUtils.isEmpty(rootSourceId)) {
+                    continue;
+                }
+                creativeMap.computeIfAbsent(rootSourceId, k -> new ArrayList<>()).add(creative);
+            }
+
+            // 过滤出重复的rootSourceId
+            Map<String, List<AdPutTencentCreative>> duplicateMap = creativeMap.entrySet().stream()
+                    .filter(e -> e.getValue().size() > 1)
+                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
+
+            if (CollectionUtils.isEmpty(duplicateMap)) {
+                continue;
+            }
+
+            // 构建飞书通知消息
+            String msgText = "";
+            msgText += "**【重复链接报警】合作方: " + partner + "** \n";
+            for (Map.Entry<String, List<AdPutTencentCreative>> duplicateEntry : duplicateMap.entrySet()) {
+                msgText += "**链接: " + duplicateEntry.getKey() + ",  重复创意数: " + duplicateEntry.getValue().size() + "** \n";
+                for (AdPutTencentCreative creative : duplicateEntry.getValue()) {
+                    msgText += "  - 账户Id: " + creative.getAccountId()
+                            + ", 广告Id: " + creative.getAdId()
+                            + ", 创意Id: " + creative.getCreativeId()
+                            + "\n";
+                }
+            }
+            JSONObject atAll = new JSONObject();
+            atAll.put("tag", "div");
+            JSONObject atAllElementText = new JSONObject();
+            atAllElementText.put("content", "<at id=all></at>");
+            atAllElementText.put("tag", "lark_md");
+            atAll.put("text", atAllElementText);
+
+            JSONObject textObj = new JSONObject();
+            JSONObject contentObj = new JSONObject();
+            JSONObject cardObj = new JSONObject();
+            JSONObject bodyParam = new JSONObject();
+            bodyParam.put("msg_type", "interactive");
+            bodyParam.put("card", cardObj);
+            cardObj.put("elements", Arrays.asList(contentObj, atAll));
+            contentObj.put("text", textObj);
+            contentObj.put("tag", "div");
+            textObj.put("content", msgText);
+            textObj.put("tag", "lark_md");
+
+            sendMsg(robotUrl, bodyParam.toJSONString());
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private String extractRootSourceIdFromCreativeComponents(String creativeComponents) {
+        if (StringUtils.isEmpty(creativeComponents)) {
+            return null;
+        }
+        try {
+            JSONObject components = JSONObject.parseObject(creativeComponents);
+            JSONArray mainJumpInfoArray = components.getJSONArray("main_jump_info");
+            if (mainJumpInfoArray != null && !mainJumpInfoArray.isEmpty()) {
+                JSONObject jumpInfo = mainJumpInfoArray.getJSONObject(0);
+                JSONObject value = jumpInfo.getJSONObject("value");
+                if (value != null) {
+                    JSONObject pageSpec = value.getJSONObject("page_spec");
+                    if (pageSpec != null) {
+                        JSONObject wechatSpec = pageSpec.getJSONObject("wechat_mini_program_spec");
+                        if (wechatSpec != null) {
+                            String miniProgramPath = wechatSpec.getString("mini_program_path");
+                            if (StringUtils.isNotEmpty(miniProgramPath)) {
+                                return extractRootSourceIdFromPath(miniProgramPath);
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("解析creativeComponents失败, creativeComponents={}", creativeComponents, e);
+        }
+        return null;
+    }
+
+    private String extractRootSourceIdFromPath(String path) {
+        try {
+            String decodedPath = URLDecoder.decode(path, StandardCharsets.UTF_8.name());
+            String[] parts = decodedPath.split("[?&]");
+            for (String part : parts) {
+                if (part.startsWith("rootSourceId=")) {
+                    return part.substring("rootSourceId=".length());
+                }
+            }
+        } catch (Exception e) {
+            log.error("解析mini_program_path失败, path={}", path, e);
+        }
+        return null;
+    }
+
+
+    @XxlJob("hoursCheckNoCallbackCreativeJob")
+    public ReturnT<String> hoursCheckNoCallbackCreativeJob(String param) {
+        if (CollectionUtils.isEmpty(creativeCheckPartnerRobotConfig)) {
+            return ReturnT.SUCCESS;
+        }
+        // 获取当日日期字符串,格式:yyyy-MM-dd
+        String todayStr = DateUtil.getDayStr();
+
+        for (Map.Entry<String, String> entry : creativeCheckPartnerRobotConfig.entrySet()) {
+            String partner = entry.getKey();
+            String robotUrl = entry.getValue();
+
+            // 四表关联一次查询当日有消耗的创意
+            List<AdPutTencentCreativeCostSimple> costCreativeList =
+                    adPutTencentExtMapper.getPartnerDayCostCreativeList(partner, todayStr);
+            if (CollectionUtils.isEmpty(costCreativeList)) {
+                continue;
+            }
+
+            // 按 adId 分组所有有消耗的创意
+            Map<Long, List<AdPutTencentCreativeCostSimple>> adCreativeGroupMap = new LinkedHashMap<>();
+            for (AdPutTencentCreativeCostSimple creative : costCreativeList) {
+                adCreativeGroupMap.computeIfAbsent(creative.getAdId(), k -> new ArrayList<>()).add(creative);
+            }
+
+            // 只有广告下所有 creative 都没有回调,才将该广告加入告警
+            Map<Long, Long> adMap = new LinkedHashMap<>();
+            for (Map.Entry<Long, List<AdPutTencentCreativeCostSimple>> adEntry : adCreativeGroupMap.entrySet()) {
+                List<AdPutTencentCreativeCostSimple> creatives = adEntry.getValue();
+                boolean allNoCallback = creatives.stream().allMatch(creative -> {
+                    String callbackKey = EnumRedisPrefix.AD_TENCENT_CREATIVE_CALLBACK.getPrefix()
+                            .replace("{dt}", todayStr)
+                            .replace("{creativeId}", String.valueOf(creative.getCreativeId()));
+                    return StringUtils.isEmpty(adOwnRedisUtils.get(callbackKey));
+                });
+                if (allNoCallback) {
+                    adMap.put(adEntry.getKey(), creatives.get(0).getAccountId());
+                }
+            }
+
+            if (CollectionUtils.isEmpty(adMap)) {
+                continue;
+            }
+
+            // 构建飞书通知消息(广告粒度)
+            StringBuilder msgTextBuilder = new StringBuilder();
+            msgTextBuilder.append("**【无回调报警】合作方: ").append(partner).append("** \n");
+            msgTextBuilder.append("**日期: ").append(todayStr).append(",  无回调广告数: ").append(adMap.size()).append("** \n");
+            for (Map.Entry<Long, Long> adEntry : adMap.entrySet()) {
+                msgTextBuilder.append("  - 账户Id: ").append(adEntry.getValue())
+                        .append(", 广告Id: ").append(adEntry.getKey())
+                        .append("\n");
+            }
+
+            JSONObject atAll = new JSONObject();
+            atAll.put("tag", "div");
+            JSONObject atAllElementText = new JSONObject();
+            atAllElementText.put("content", "<at id=all></at>");
+            atAllElementText.put("tag", "lark_md");
+            atAll.put("text", atAllElementText);
+
+            JSONObject textObj = new JSONObject();
+            JSONObject contentObj = new JSONObject();
+            JSONObject cardObj = new JSONObject();
+            JSONObject bodyParam = new JSONObject();
+            bodyParam.put("msg_type", "interactive");
+            bodyParam.put("card", cardObj);
+            cardObj.put("elements", Arrays.asList(contentObj, atAll));
+            contentObj.put("text", textObj);
+            contentObj.put("tag", "div");
+            textObj.put("content", msgTextBuilder.toString());
+            textObj.put("tag", "lark_md");
+
+            sendMsg(robotUrl, bodyParam.toJSONString());
+        }
+        return ReturnT.SUCCESS;
+    }
+}

+ 1014 - 0
core/src/main/java/com/tzld/ad/job/adPut/AdPutTencentDataJob.java

@@ -0,0 +1,1014 @@
+package com.tzld.ad.job.adPut;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.aliyun.odps.data.Record;
+import com.google.common.collect.Lists;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.tzld.ad.dao.mapper.adPut.*;
+import com.tzld.ad.dao.mapper.adPut.ext.AdPutTencentExtMapper;
+import com.tzld.ad.enums.EnumRedisPrefix;
+import com.tzld.ad.model.adPut.*;
+import com.tzld.ad.model.aigc.GoogleLLMResult;
+import com.tzld.ad.model.po.adput.*;
+import com.tzld.ad.service.AdOwnRedisUtils;
+import com.tzld.ad.service.adput.AdPutTencentCommonService;
+import com.tzld.ad.service.aigc.AigcApiService;
+import com.tzld.ad.service.aigc.VideoSearchApiService;
+import com.tzld.ad.service.mongo.AdplatformMongoService;
+import com.tzld.ad.util.AliOssFileTool;
+import com.tzld.ad.util.CollectionUtil;
+import com.tzld.ad.util.DateUtils;
+import com.tzld.ad.util.OdpsUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+
+@Component
+public class AdPutTencentDataJob {
+
+    private final static Logger log = LoggerFactory.getLogger(AdPutTencentDataJob.class);
+
+    ThreadPoolExecutor adPutTencentDataJobExecutor = new ThreadPoolExecutor(128, 128, 10L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(100000),
+            new ThreadFactoryBuilder().setNameFormat("ad-put-tencent-data-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy());
+
+    @Autowired
+    private AdPutTencentCommonService adPutTencentCommonService;
+    @Autowired
+    private AdPutTencentAccountMapper adPutTencentAccountMapper;
+    @Autowired
+    private AdPutTencentAdMapper adPutTencentAdMapper;
+    @Autowired
+    private AdPutTencentCreativeMapper adPutTencentCreativeMapper;
+    @Autowired
+    private AdPutTencentCreativeDataMapper adPutTencentCreativeDataMapper;
+    @Autowired
+    private AdPutTencentComponentMapper adPutTencentComponentMapper;
+    @Autowired
+    private AdPutTencentComponentDataMapper adPutTencentComponentDataMapper;
+    @Autowired
+    private AdPutTencentExtMapper adPutTencentExtMapper;
+    @Resource
+    private AdPutTencentBehaviorLogMapper adPutTencentBehaviorLogMapper;
+    @Resource
+    private AdOwnRedisUtils adOwnRedisUtils;
+    @Resource
+    private AigcApiService aigcApiService;
+    @Resource
+    private AdPutTencentCreativeAnalysisMapper adPutTencentCreativeAnalysisMapper;
+    @Resource
+    private AdPutTencentAdPackageMappingMapper adPutTencentAdPackageMappingMapper;
+    @Resource
+    private DailyCategoryVideoMapper dailyCategoryVideoMapper;
+
+    @Resource
+    private VideoSearchApiService videoSearchApiService;
+
+
+    @Resource
+    private AdplatformMongoService adplatformMongoService;
+
+    public static final ThreadPoolExecutor DATA_EXECUTOR = new ThreadPoolExecutor(
+            5, 5, 10L, TimeUnit.MINUTES,
+            new LinkedBlockingQueue<>(),
+            new ThreadFactoryBuilder().setNameFormat("ad-put-tencent-data-pool-%d").build(),
+            new ThreadPoolExecutor.CallerRunsPolicy()
+    );
+
+    @Value("${analysis.title.category.prompt:}")
+    private String analysisTitleCategoryPrompt;
+
+    @Value("${daily.refresh.creative.analysis.video.min.cost:10000}")
+    private Long dailyRefreshCreativeAnalysisVideoMinCost;
+    @Value("${daily.refresh.creative.analysis.video.start.date:1}")
+    private Integer dailyRefreshCreativeAnalysisVideoStartDate;
+
+    /**
+     * 账号获取广告内容
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("getAdDataByAccountJob")
+    public ReturnT<String> getAdDataByAccountJob(String param) {
+        // 查询所有已授权的账户
+        AdPutTencentAccountExample adPutTencentAccountExample = new AdPutTencentAccountExample();
+        adPutTencentAccountExample.createCriteria().andIsDeleteEqualTo(0).andStatusEqualTo(1);
+        List<AdPutTencentAccount> adPutTencentAccounts = adPutTencentAccountMapper.selectByExample(adPutTencentAccountExample);
+        for (AdPutTencentAccount adPutTencentAccount : adPutTencentAccounts) {
+            List<AdPutTencentAdGroupInfo> adGroupInfoByAccounts = adPutTencentCommonService.getAllAdGroupInfoByAccount(adPutTencentAccount.getAccountId());
+            if (CollectionUtil.isEmpty(adGroupInfoByAccounts)) {
+                continue;
+            }
+            List<Long> adIds = adGroupInfoByAccounts.stream().map(AdPutTencentAdGroupInfo::getAdgroup_id).collect(Collectors.toList());
+            AdPutTencentAdPackageMappingExample adPutTencentAdPackageMappingExample = new AdPutTencentAdPackageMappingExample();
+            adPutTencentAdPackageMappingExample.createCriteria().andAdIdIn(adIds);
+            List<AdPutTencentAdPackageMapping> adPackageMappingList = adPutTencentAdPackageMappingMapper.selectByExample(adPutTencentAdPackageMappingExample);
+            Map<Long, Map<Long, AdPutTencentAdPackageMapping>> adIdToPackageMappingMap = adPackageMappingList.stream()
+                    .collect(Collectors.groupingBy(AdPutTencentAdPackageMapping::getAdId,
+                            Collectors.toMap(AdPutTencentAdPackageMapping::getPackageId, Function.identity())));
+            // 更新广告信息
+            for (AdPutTencentAdGroupInfo adGroupInfoByAccount : adGroupInfoByAccounts) {
+                try {
+                    AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+                    adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andAdIdEqualTo(adGroupInfoByAccount.getAdgroup_id());
+                    List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+                    if (CollectionUtil.isEmpty(adPutTencentAds)) {
+                        // 插入
+                        AdPutTencentAd adPutTencentAd = new AdPutTencentAd();
+                        setAdGroupInfoVo(adGroupInfoByAccount, adPutTencentAd, adPutTencentAccount.getAccountId());
+                        adPutTencentAdMapper.insertSelective(adPutTencentAd);
+                    } else {
+                        // 更新
+                        AdPutTencentAd adPutTencentAd = adPutTencentAds.get(0);
+                        setAdGroupInfoVo(adGroupInfoByAccount, adPutTencentAd, adPutTencentAccount.getAccountId());
+                        adPutTencentAd.setUpdateTime(new Date());
+                        adPutTencentAdMapper.updateByPrimaryKey(adPutTencentAd);
+                    }
+                    Map<Long, AdPutTencentAdPackageMapping> packageMappingMap = adIdToPackageMappingMap.getOrDefault(adGroupInfoByAccount.getAdgroup_id(), Collections.emptyMap());
+                    // 更新广告人群包关系
+                    if (Objects.nonNull(adGroupInfoByAccount.getTargeting())
+                            && !CollectionUtil.isEmpty(adGroupInfoByAccount.getTargeting().getCustom_audience())) {
+                        List<Long> customAudienceIds = adGroupInfoByAccount.getTargeting().getCustom_audience();
+                        for (Long customAudienceId : customAudienceIds) {
+                            if (packageMappingMap.containsKey(customAudienceId)) {
+                                continue;
+                            }
+                            AdPutTencentAdPackageMapping adPackageMapping = new AdPutTencentAdPackageMapping();
+                            adPackageMapping.setAdId(adGroupInfoByAccount.getAdgroup_id());
+                            adPackageMapping.setPackageId(customAudienceId);
+                            adPackageMapping.setIsDelete(0);
+                            adPackageMapping.setCreateTime(new Date());
+                            adPackageMapping.setUpdateTime(new Date());
+                            adPutTencentAdPackageMappingMapper.insertSelective(adPackageMapping);
+                        }
+                        for (Map.Entry<Long, AdPutTencentAdPackageMapping> entry : packageMappingMap.entrySet()) {
+                            Long packageId = entry.getKey();
+                            AdPutTencentAdPackageMapping adPackageMapping = entry.getValue();
+                            if (customAudienceIds.contains(packageId) || adPackageMapping.getIsDelete() == 1) {
+                                continue;
+                            }
+                            adPackageMapping.setIsDelete(1);
+                            adPackageMapping.setUpdateTime(new Date());
+                            adPutTencentAdPackageMappingMapper.updateByPrimaryKey(adPackageMapping);
+                        }
+                    }
+                } catch (Exception e) {
+                    log.error("getAdDataByAccountJob update ad package mapping error, adGroupInfoByAccount:{}",
+                            JSONObject.toJSONString(adGroupInfoByAccount));
+                }
+            }
+            //清理查不到的数据
+            try {
+                List<Long> adGroupIdList = adGroupInfoByAccounts.stream().map(AdPutTencentAdGroupInfo::getAdgroup_id).collect(Collectors.toList());
+                AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+                adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andAccountIdEqualTo(Long.valueOf(adPutTencentAccount.getAccountId())).andAdIdNotIn(adGroupIdList);
+                List<AdPutTencentAd> needRemoveList = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+                if (!CollectionUtils.isEmpty(needRemoveList)) {
+                    List<Long> needRemoveAdId = needRemoveList.stream().map(AdPutTencentAd::getAdId).collect(Collectors.toList());
+                    log.info("getAdDataByAccountJob, need remove ad, needRemoveAdId:{}, accountId:{}", JSONObject.toJSONString(needRemoveAdId), adPutTencentAccount.getAccountId());
+                }
+            } catch (Exception e) {
+                log.error("getAdDataByAccountJob clear data error");
+            }
+
+        }
+        // 同步创意数据
+        getCreativeDataByAdJob(param);
+        return ReturnT.SUCCESS;
+    }
+
+
+    /**
+     * 广告获取创意内容
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("getCreativeDataByAdJob")
+    public ReturnT<String> getCreativeDataByAdJob(String param) {
+        // 查询所有广告
+        AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+        adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0);
+        List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+        if (!CollectionUtil.isEmpty(adPutTencentAds)) {
+            Set<Long> accountIds = adPutTencentAds.parallelStream().map(AdPutTencentAd::getAccountId).collect(Collectors.toSet());
+            for (Long accountId : accountIds) {
+                List<String> adIds = adPutTencentAds.stream().filter(x -> x.getAccountId().equals(accountId)).map(x -> x.getAdId() + "").collect(Collectors.toList());
+                List<AdPutTencentCreativeInfo> adTencentCreativeInfos = adPutTencentCommonService.getAllCreativeByAds(accountId, adIds);
+                if (CollectionUtil.isEmpty(adTencentCreativeInfos)) {
+                    log.error("getCreativeDataByAdJob is null accountId:" + accountId + ",adIds:" + JSON.toJSONString(adIds));
+                    continue;
+                }
+                log.info("AdPutTencentDataJob.getCreativeDataByAdJob, adTencentCreativeInfos:{}", JSONObject.toJSONString(adTencentCreativeInfos));
+                for (AdPutTencentCreativeInfo adTencentCreativeInfo : adTencentCreativeInfos) {
+                    AdPutTencentCreativeExample adPutTencentCreativeExample = new AdPutTencentCreativeExample();
+                    adPutTencentCreativeExample.createCriteria().andIsDeleteEqualTo(0).andCreativeIdEqualTo(adTencentCreativeInfo.getDynamic_creative_id());
+                    List<AdPutTencentCreative> adPutTencentCreatives = adPutTencentCreativeMapper.selectByExampleWithBLOBs(adPutTencentCreativeExample);
+                    log.info("AdPutTencentDataJob.getCreativeDataByAdJob.getLocalCreatives, creative_id:{}, creatives:{}", adTencentCreativeInfo.getDynamic_creative_id(), JSONObject.toJSONString(adPutTencentCreatives));
+                    if (CollectionUtil.isEmpty(adPutTencentCreatives)) {
+                        // 插入
+                        AdPutTencentCreative adPutTencentCreative = new AdPutTencentCreative();
+                        setCreativeVo(adTencentCreativeInfo, adPutTencentCreative, adTencentCreativeInfo.getAdgroup_id(), accountId);
+                        adPutTencentCreativeMapper.insertSelective(adPutTencentCreative);
+                        // 处理 落地页内容
+                        adPutTencentCommonService.handleCreativeComponents(adPutTencentCreative.getCreativeId(), adTencentCreativeInfo.getCreative_components());
+                    } else {
+                        // 更新
+                        AdPutTencentCreative adPutTencentCreative = adPutTencentCreatives.get(0);
+                        setCreativeVo(adTencentCreativeInfo, adPutTencentCreative, adTencentCreativeInfo.getAdgroup_id(), accountId);
+                        adPutTencentCreative.setUpdateTime(new Date());
+                        adPutTencentCreativeMapper.updateByPrimaryKeySelective(adPutTencentCreative);
+                        // 处理 落地页内容
+                        adPutTencentCommonService.handleCreativeComponents(adPutTencentCreative.getCreativeId(), adTencentCreativeInfo.getCreative_components());
+                    }
+                }
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 广告获取创意内容
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("checkCreativeDeletedJob")
+    public ReturnT<String> checkCreativeDeletedJob(String param) {
+        // 查询所有创意
+        AdPutTencentCreativeExample adPutTencentCreativeExample = new AdPutTencentCreativeExample();
+        adPutTencentCreativeExample.createCriteria().andIsDeleteEqualTo(0);
+        List<AdPutTencentCreative> adPutTencentCreatives = adPutTencentCreativeMapper.selectByExample(adPutTencentCreativeExample);
+        if (!CollectionUtil.isEmpty(adPutTencentCreatives)) {
+            Set<Long> accountIds = adPutTencentCreatives.parallelStream().map(AdPutTencentCreative::getAccountId).collect(Collectors.toSet());
+            Map<Long, AdPutTencentCreative> creativeMap = adPutTencentCreatives.stream().collect(Collectors.toMap(AdPutTencentCreative::getCreativeId, x -> x));
+            for (Long accountId : accountIds) {
+                List<AdPutTencentCreative> creativeList = adPutTencentCreatives.stream().filter(x -> x.getAccountId().equals(accountId)).collect(Collectors.toList());
+                List<String> creativeIds = creativeList.stream().map(x -> x.getCreativeId() + "").collect(Collectors.toList());
+                List<AdPutTencentCreativeInfo> adTencentCreativeInfos = adPutTencentCommonService.getAllCreativeByCreatives(accountId, creativeIds);
+                if (CollectionUtil.isEmpty(adTencentCreativeInfos)) {
+                    log.error("getCreativeDataByAdJob is null accountId:" + accountId + ",creativeIds:" + JSON.toJSONString(creativeIds));
+                    continue;
+                }
+                log.info("AdPutTencentDataJob.checkCreativeDeletedJob, adTencentCreativeInfos:{}", JSONObject.toJSONString(adTencentCreativeInfos));
+                for (AdPutTencentCreativeInfo adTencentCreativeInfo : adTencentCreativeInfos) {
+                    // 更新
+                    AdPutTencentCreative adPutTencentCreative = creativeMap.get(adTencentCreativeInfo.getDynamic_creative_id());
+                    if (adPutTencentCreative == null) {
+                        continue;
+                    }
+                    setCreativeVo(adTencentCreativeInfo, adPutTencentCreative, adTencentCreativeInfo.getAdgroup_id(), accountId);
+                    adPutTencentCreative.setUpdateTime(new Date());
+                    adPutTencentCreativeMapper.updateByPrimaryKeySelective(adPutTencentCreative);
+                    // 处理 落地页内容
+                    adPutTencentCommonService.handleCreativeComponents(adPutTencentCreative.getCreativeId(), adTencentCreativeInfo.getCreative_components());
+                }
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+    /**
+     * 更新当日创意数据
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("updateDayTencentCreativeData")
+    public ReturnT<String> updateDayTencentCreativeData(String param) {
+        String dayStr = getDayStr();
+        if (StringUtils.isNotBlank(param)) {
+            dayStr = param;
+        }
+        AdPutTencentCreativeExample adPutTencentCreativeExample = new AdPutTencentCreativeExample();
+        adPutTencentCreativeExample.createCriteria().andIsDeleteEqualTo(0).andIsGetDataEqualTo(1).andCreativeStatusEqualTo("AD_STATUS_NORMAL");
+        adPutTencentCreativeExample.setOrderByClause("id desc");
+        List<AdPutTencentCreative> adPutTencentCreatives = adPutTencentCreativeMapper.selectByExample(adPutTencentCreativeExample);
+        CountDownLatch cdl = new CountDownLatch(adPutTencentCreatives.size());
+        for (AdPutTencentCreative adPutTencentCreative : adPutTencentCreatives) {
+            String finalDayStr = dayStr;
+            DATA_EXECUTOR.submit(() -> {
+                try {
+                    List<AdPutTencentCreativeCostData> creativeCostData = adPutTencentCommonService
+                            .getCreativeCostData(adPutTencentCreative.getAccountId() + "", adPutTencentCreative.getCreativeId() + "",
+                                    finalDayStr, finalDayStr, null, null);
+                    if (CollectionUtil.isEmpty(creativeCostData)) {
+                        log.warn("getCreativeData is null accountId:" + adPutTencentCreative.getAccountId() + ",creativeId:" + adPutTencentCreative.getCreativeId());
+                        return;
+                    }
+//                  log.info("updateDayTencentCreativeData.creativeCostData, creativeCostData:{}", JSONObject.toJSONString(creativeCostData));
+                    AdPutTencentCreativeData adPutTencentCreativeData = getAdPutTencentCreativeData(adPutTencentCreative, creativeCostData);
+                    // 插入还是更新
+                    AdPutTencentCreativeDataExample adPutTencentCreativeDataExample = new AdPutTencentCreativeDataExample();
+                    adPutTencentCreativeDataExample.createCriteria().andCreativeIdEqualTo(adPutTencentCreative.getCreativeId()).andDtEqualTo(finalDayStr);
+                    List<AdPutTencentCreativeData> adPutTencentCreativeDataExist = adPutTencentCreativeDataMapper.selectByExample(adPutTencentCreativeDataExample);
+                    if (!CollectionUtil.isEmpty(adPutTencentCreativeDataExist)) {
+                        AdPutTencentCreativeData adPutTencentCreativeData1 = adPutTencentCreativeDataExist.get(0);
+                        adPutTencentCreativeData.setId(adPutTencentCreativeData1.getId());
+                        adPutTencentCreativeData.setCreateTime(adPutTencentCreativeData1.getCreateTime());
+                        adPutTencentCreativeData.setUpdateTime(new Date());
+                        adPutTencentCreativeDataMapper.updateByPrimaryKeySelective(adPutTencentCreativeData);
+                    } else {
+                        adPutTencentCreativeDataMapper.insertSelective(adPutTencentCreativeData);
+                    }
+                } finally {
+                    cdl.countDown();
+                }
+            });
+        }
+        try {
+            cdl.await();
+        } catch (Exception e) {
+            log.error("updateDayTencentCreativeData cdl await error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+    /**
+     * 更新昨日消耗数据
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("updateLastDayTencentCreativeData")
+    public ReturnT<String> updateLastDayTencentCreativeData(String param) {
+        String lastDayStr = getLastDayStr();
+        if (StringUtils.isNotBlank(param)) {
+            lastDayStr = param;
+        }
+        AdPutTencentCreativeExample adPutTencentCreativeExample = new AdPutTencentCreativeExample();
+        adPutTencentCreativeExample.createCriteria().andIsDeleteEqualTo(0).andIsGetDataEqualTo(1).andCreativeStatusEqualTo("AD_STATUS_NORMAL");
+        adPutTencentCreativeExample.setOrderByClause("id desc");
+        List<AdPutTencentCreative> adPutTencentCreatives = adPutTencentCreativeMapper.selectByExample(adPutTencentCreativeExample);
+        CountDownLatch cdl = new CountDownLatch(adPutTencentCreatives.size());
+        for (AdPutTencentCreative adPutTencentCreative : adPutTencentCreatives) {
+            String finalLastDayStr = lastDayStr;
+            DATA_EXECUTOR.submit(() -> {
+                try {
+                    List<AdPutTencentCreativeCostData> creativeCostData = adPutTencentCommonService.getCreativeCostData(
+                            String.valueOf(adPutTencentCreative.getAccountId()), String.valueOf(adPutTencentCreative.getCreativeId()),
+                            finalLastDayStr, finalLastDayStr, null, null);
+                    if (CollectionUtil.isEmpty(creativeCostData)) {
+                        log.warn("getCreativeData is null accountId:" + adPutTencentCreative.getAccountId() + ",creativeId:" + adPutTencentCreative.getCreativeId());
+                        return;
+                    }
+                    // 删除昨日数据
+                    AdPutTencentCreativeDataExample deleteExample = new AdPutTencentCreativeDataExample();
+                    deleteExample.createCriteria().andDtEqualTo(finalLastDayStr).andCreativeIdEqualTo(adPutTencentCreative.getCreativeId());
+                    adPutTencentCreativeDataMapper.deleteByExample(deleteExample);
+                    AdPutTencentCreativeData adPutTencentCreativeData = getAdPutTencentCreativeData(adPutTencentCreative, creativeCostData);
+                    adPutTencentCreativeDataMapper.insertSelective(adPutTencentCreativeData);
+
+                } finally {
+                    cdl.countDown();
+                }
+            });
+        }
+        try {
+            cdl.await();
+        } catch (Exception e) {
+            log.error("updateLastDayTencentCreativeData cdl await error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private AdPutTencentCreativeData getAdPutTencentCreativeData(AdPutTencentCreative adPutTencentCreative, List<AdPutTencentCreativeCostData> creativeCostData) {
+        AdPutTencentCreativeCostData adPutTencentCreativeCostData = creativeCostData.get(0);
+        AdPutTencentCreativeData adPutTencentCreativeData = new AdPutTencentCreativeData();
+        adPutTencentCreativeData.setCreativeId(adPutTencentCreative.getCreativeId());
+        adPutTencentCreativeData.setValidClickCount(adPutTencentCreativeCostData.getValid_click_count());
+        adPutTencentCreativeData.setClickUserCount(adPutTencentCreativeCostData.getClick_user_count());
+        adPutTencentCreativeData.setViewCount(adPutTencentCreativeCostData.getView_count());
+        adPutTencentCreativeData.setViewUserCount(adPutTencentCreativeCostData.getView_user_count());
+        adPutTencentCreativeData.setAvgViewPerUser(adPutTencentCreativeCostData.getAvg_view_per_user());
+        adPutTencentCreativeData.setCost(adPutTencentCreativeCostData.getCost());
+        adPutTencentCreativeData.setCpc(adPutTencentCreativeCostData.getCpc());
+        adPutTencentCreativeData.setCtr(adPutTencentCreativeCostData.getCtr());
+        adPutTencentCreativeData.setConversionsCount(adPutTencentCreativeCostData.getConversions_count());
+        adPutTencentCreativeData.setDt(adPutTencentCreativeCostData.getDate());
+        adPutTencentCreativeData.setFromFollowUv(adPutTencentCreativeCostData.getFrom_follow_uv());
+        adPutTencentCreativeData.setKeyPageViewCount(adPutTencentCreativeCostData.getKey_page_view_count());
+        adPutTencentCreativeData.setRegisterByClickCount(adPutTencentCreativeCostData.getRegister_by_click_count());
+        adPutTencentCreativeData.setFromFollowByClickUv(adPutTencentCreativeCostData.getFrom_follow_by_click_uv());
+        adPutTencentCreativeData.setBizFollowUv(adPutTencentCreativeCostData.getBiz_follow_uv());
+        adPutTencentCreativeData.setRegPv(adPutTencentCreativeCostData.getReg_pv());
+        return adPutTencentCreativeData;
+    }
+
+    /**
+     * 更新昨日组件数据
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("updateLastDayTencentComponent")
+    public ReturnT<String> updateLastDayTencentComponent(String param) {
+        String lastDayStr = getLastDayStr();
+        if (StringUtils.isNotBlank(param)) {
+            lastDayStr = param;
+        }
+        updateTencentComponent(lastDayStr);
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 更新今日组件数据
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("updateTodayTencentComponent")
+    public ReturnT<String> updateTodayTencentComponent(String param) {
+        String todayStr = getDayStr();
+        if (StringUtils.isNotBlank(param)) {
+            todayStr = param;
+        }
+        updateTencentComponent(todayStr);
+        return ReturnT.SUCCESS;
+    }
+
+    private void updateTencentComponent(String dateStr) {
+        // 查询所有已授权的账户
+        AdPutTencentAccountExample adPutTencentAccountExample = new AdPutTencentAccountExample();
+        adPutTencentAccountExample.createCriteria().andIsDeleteEqualTo(0).andStatusEqualTo(1);
+        List<AdPutTencentAccount> adPutTencentAccounts = adPutTencentAccountMapper.selectByExample(adPutTencentAccountExample);
+        for (AdPutTencentAccount adPutTencentAccount : adPutTencentAccounts) {
+            try {
+                List<AdPutTencentComponentDailyData> creativeComponentDataList = adPutTencentCommonService.getComponentData(
+                        adPutTencentAccount.getAccountId(), dateStr, dateStr, null, null);
+                if (CollectionUtil.isEmpty(creativeComponentDataList)) {
+                    log.warn("getCreativeComponentData is null accountId:" + adPutTencentAccount.getAccountId());
+                    continue;
+                }
+                // 统计数据save
+                List<AdPutTencentComponentData> saveList = new ArrayList<>();
+                for (AdPutTencentComponentDailyData creativeComponentData : creativeComponentDataList) {
+                    AdPutTencentComponentData adPutTencentComponentData = getAdPutTencentComponentData(dateStr, creativeComponentData);
+                    saveList.add(adPutTencentComponentData);
+                }
+                // 删除历史
+                List<Long> creativeIds = saveList.stream().map(AdPutTencentComponentData::getCreativeId).collect(Collectors.toList());
+                AdPutTencentComponentDataExample deleteExample = new AdPutTencentComponentDataExample();
+                deleteExample.createCriteria().andDtEqualTo(dateStr).andCreativeIdIn(creativeIds);
+                adPutTencentComponentDataMapper.deleteByExample(deleteExample);
+                // save
+                adPutTencentExtMapper.batchInsertComponentData(saveList);
+                // 获取素材详情
+                List<String> componentIds = creativeComponentDataList.stream()
+                        .filter(o -> o.getComponentID() > 0)
+                        .map(x -> String.valueOf(x.getComponentID()))
+                        .distinct()
+                        .collect(Collectors.toList());
+                List<AdPutTencentComponentDetail> detailList = new ArrayList<>();
+                for (List<String> partition : Lists.partition(componentIds, 100)) {
+                    detailList.addAll(adPutTencentCommonService.getComponentDetail(
+                            adPutTencentAccount.getAccountId(), partition, null, null));
+                }
+                for (AdPutTencentComponentDetail detail : detailList) {
+                    AdPutTencentComponentDetail.ComponentValue componentValue = detail.getComponentValue();
+                    List<AdPutTencentComponentVideo> componentVideoList = new ArrayList<>();
+                    List<AdPutTencentComponentImage> componentImageList = new ArrayList<>();
+                    // videoUrl get
+                    if (Objects.nonNull(componentValue) && Objects.nonNull(componentValue.getVideo())) {
+                        List<String> videoIds = Collections.singletonList(detail.getComponentValue().getVideo().getValue().getVideoID());
+                        componentVideoList.addAll(adPutTencentCommonService.getComponentVideo(
+                                adPutTencentAccount.getAccountId(), videoIds, null, null));
+                    }
+                    // imageUrl get
+                    if (Objects.nonNull(componentValue) && Objects.nonNull(componentValue.getImage())) {
+                        List<String> imageIds = Collections.singletonList(detail.getComponentValue().getImage().getValue().getImageID());
+                        componentImageList.addAll(adPutTencentCommonService.getComponentImage(
+                                adPutTencentAccount.getAccountId(), imageIds, null, null));
+                    }
+                    // 非图片视频组件过滤
+                    if (CollectionUtil.isEmpty(componentVideoList) && CollectionUtil.isEmpty(componentImageList)) {
+                        continue;
+                    }
+                    // save
+                    AdPutTencentComponent adPutTencentComponent = getAdPutTencentComponent(detail, componentVideoList, componentImageList);
+                    AdPutTencentComponentExample example = new AdPutTencentComponentExample();
+                    example.createCriteria().andAccountIdEqualTo(adPutTencentComponent.getAccountId())
+                            .andComponentIdEqualTo(adPutTencentComponent.getComponentId());
+                    long exists = adPutTencentComponentMapper.countByExample(example);
+                    if (exists == 0) {
+                        adPutTencentComponentMapper.insertSelective(adPutTencentComponent);
+                    } else {
+                        adPutTencentComponent.setUpdateTime(new Date());
+                        adPutTencentComponentMapper.updateByExampleSelective(adPutTencentComponent, example);
+                    }
+                }
+            } catch (Exception e) {
+                log.error("updateLastDayTencentComponent Error AccountId:{}", adPutTencentAccount.getAccountId(), e);
+            }
+        }
+    }
+
+    private AdPutTencentComponentData getAdPutTencentComponentData(String lastDayStr, AdPutTencentComponentDailyData data) {
+        AdPutTencentComponentData item = new AdPutTencentComponentData();
+        item.setDt(lastDayStr);
+        item.setComponentId(data.getComponentID());
+        item.setCreativeId(data.getDynamicCreativeId());
+        item.setValidClickCount(data.getValidClickCount());
+        item.setViewCount(data.getViewCount());
+        item.setCtr(data.getCtr());
+        item.setCpc(data.getCpc());
+        item.setCost(data.getCost());
+        item.setConversionsCount(data.getConversionsCount());
+        item.setFromFollowUv(data.getFromFollowUv());
+        return item;
+    }
+
+    private AdPutTencentComponent getAdPutTencentComponent(AdPutTencentComponentDetail componentDetail,
+                                                           List<AdPutTencentComponentVideo> componentVideoList,
+                                                           List<AdPutTencentComponentImage> componentImageList) {
+        AdPutTencentComponent component = new AdPutTencentComponent();
+        component.setComponentId(componentDetail.getComponentID());
+        component.setAccountId(componentDetail.getAccountID());
+        component.setComponentCustomName(componentDetail.getComponentCustomName());
+        component.setComponentSubType(componentDetail.getComponentSubType());
+        component.setGenerationType(componentDetail.getGenerationType());
+        component.setIsDeleted((byte) (componentDetail.isDeleted() ? 1 : 0));
+        if (!CollectionUtil.isEmpty(componentImageList)) {
+            component.setImageId(Long.valueOf(componentImageList.get(0).getImageID()));
+            component.setImageUrl(componentImageList.get(0).getPreviewURL());
+        }
+        if (!CollectionUtil.isEmpty(componentVideoList)) {
+            component.setVideoId(componentVideoList.get(0).getVideoID());
+            component.setVideoCoverUrl(componentVideoList.get(0).getKeyFrameImageURL());
+            component.setVideoUrl(componentVideoList.get(0).getPreviewURL());
+        }
+        return component;
+    }
+
+    private void setCreativeVo(AdPutTencentCreativeInfo source, AdPutTencentCreative target, Long adId, Long accountId) {
+        target.setAdId(adId);
+        target.setAccountId(accountId);
+        target.setCreativeId(source.getDynamic_creative_id());
+        target.setCreativeName(source.getDynamic_creative_name());
+        target.setCreativeStatus(source.getConfigured_status());
+        target.setCreativeComponents(source.getCreative_components());
+        target.setIsGetData(1);
+        target.setIsDelete(source.getIs_deleted() ? 1 : 0);
+    }
+
+    private void setAdGroupInfoVo(AdPutTencentAdGroupInfo source, AdPutTencentAd target, String accountId) {
+        target.setAdId(source.getAdgroup_id());
+        target.setDayAmount(source.getDaily_budget());
+        target.setAdStatus(source.getConfigured_status());
+        target.setSystemStatus(source.getSystem_status());
+        target.setAdName(source.getAdgroup_name());
+        target.setMarketingGoal(source.getMarketing_goal());
+        target.setMarketingSubGoal(source.getMarketing_sub_goal());
+        target.setMarketingCarrierType(source.getMarketing_carrier_type());
+        target.setMarketingCarrierDetail(source.getMarketing_carrier_detail());
+        target.setBidAmount(source.getBid_amount());
+        target.setAccountId(Long.valueOf(accountId.trim()));
+        target.setOptimizationGoal(source.getOptimization_goal());
+        if (source.getMarketing_asset_outer_spec() != null) {
+            target.setMarketingTargetType(source.getMarketing_asset_outer_spec().getMarketingTargetType());
+            target.setMarketingAssetOuterId(source.getMarketing_asset_outer_spec().getMarketingAssetOuterId());
+        }
+    }
+
+    private String getLastDayStr() {
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+
+        // 获取前一日的日期
+        LocalDate yesterday = today.minusDays(1);
+
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        // 将前一日的日期格式化为字符串
+        return yesterday.format(formatter);
+    }
+
+    private String getDayStr() {
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+
+        // 获取前一日的日期
+//        LocalDate yesterday = today.minusDays(1);
+
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        // 将前一日的日期格式化为字符串
+        return today.format(formatter);
+    }
+
+    private String getNowDayTimeStr() {
+        // 获取当前日期
+        LocalDateTime today = LocalDateTime.now();
+
+        // 获取前一日的日期
+//        LocalDate yesterday = today.minusDays(1);
+
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        // 将前一日的日期格式化为字符串
+        return today.format(formatter);
+    }
+
+    @XxlJob("adPutTencentCreativeAnalysisJob")
+    public ReturnT<String> adPutTencentCreativeAnalysisJob(String param) {
+        Date startTime = DateUtils.getBeforeDateOfTime(new Date(), 7);
+        AdPutTencentCreativeAnalysisExample example = new AdPutTencentCreativeAnalysisExample();
+        example.createCriteria().andStatusEqualTo(0).andCreateTimeGreaterThan(startTime);
+        List<AdPutTencentCreativeAnalysis> analysisList = adPutTencentCreativeAnalysisMapper.selectByExample(example);
+        if (CollectionUtil.isEmpty(analysisList)) {
+            return ReturnT.SUCCESS;
+        }
+        List<Long> creativeIds = analysisList.stream().map(AdPutTencentCreativeAnalysis::getCreativeId).collect(Collectors.toList());
+        AdPutTencentComponentDataExample componentDataExample = new AdPutTencentComponentDataExample();
+        componentDataExample.createCriteria().andCreativeIdIn(creativeIds).andCreateTimeGreaterThanOrEqualTo(startTime);
+        List<AdPutTencentComponentData> componentsDataList = adPutTencentComponentDataMapper.selectByExample(componentDataExample);
+        Map<Long, List<AdPutTencentComponentData>> componentsDataMap = componentsDataList.stream().collect(Collectors.groupingBy(AdPutTencentComponentData::getCreativeId));
+
+        List<DailyCategoryVideo> dailyCategoryVideoList = adPutTencentExtMapper.getMaxDailyCategoryVideoList();
+        Map<String, Long> categoryVideoMap = dailyCategoryVideoList.stream().collect(Collectors.toMap(DailyCategoryVideo::getCategory, DailyCategoryVideo::getVideoId));
+        for (AdPutTencentCreativeAnalysis creativeAnalysis : analysisList) {
+            AdPutTencentComponent component = getMaxCostComponent(componentsDataMap, creativeAnalysis.getCreativeId());
+            if (Objects.isNull(component)) {
+                continue;
+            }
+            try {
+                String componentId = component.getComponentId().toString();
+                if (StringUtils.isBlank(creativeAnalysis.getTitle())) {
+                    // download & upload to oss
+                    String fileName = String.format("adPutTencent/image/%s_%s_%d.jpg", creativeAnalysis.getCreativeId(),
+                            componentId, System.currentTimeMillis());
+                    String ossImageUrl = AliOssFileTool.downloadAndSaveInOSS(fileName, component.getImageUrl(), "image/jpeg");
+                    // 调用gemini模型提取图片中的文字
+                    String prompt = "识别图片里的文字,直接输出图片里的文字标题,但是不要输出图片里右下角的字,比如“点开看看”“看这里”等,仅输出标题,不要有多余的文字输出";
+                    GoogleLLMResult result = aigcApiService.gemini("gemini-2.0-flash", prompt, Arrays.asList(ossImageUrl));
+                    String text = result.getResult();
+                    if (StringUtils.isEmpty(text)) {
+                        // 增加redis计数,超过3次失败即为失败
+                        String failTimeKey = "adPutTencent:creativeAnalysis:failTime:" + creativeAnalysis.getCreativeId();
+                        adOwnRedisUtils.setIncrementIntValue(failTimeKey, 1, 60 * 60L);
+                        if (adOwnRedisUtils.getInteger(failTimeKey) > 3) {
+                            creativeAnalysis.setStatus(-1);
+                            adPutTencentCreativeAnalysisMapper.updateByPrimaryKeySelective(creativeAnalysis);
+                        }
+                        continue;
+                    }
+                    text = text.replaceAll("\\n", "");
+                    creativeAnalysis.setTitle(text);
+                    creativeAnalysis.setImageUrl(ossImageUrl);
+                }
+                if (StringUtils.isNotBlank(creativeAnalysis.getTitle()) && StringUtils.isBlank(creativeAnalysis.getCategory())) {
+                    // 调用gemini模型提取图片中的文字
+                    String prompt = analysisTitleCategoryPrompt.replace("{标题}", creativeAnalysis.getTitle());
+                    String result = aigcApiService.gpt("gpt-4o-mini", prompt, null, null);
+                    if (StringUtils.isNotEmpty(result)) {
+                        String category = result.replaceAll("\\n", "");
+                        creativeAnalysis.setCategory(category);
+                    }
+                }
+                if (StringUtils.isNotBlank(creativeAnalysis.getCategory()) && Objects.isNull(creativeAnalysis.getMatchVideoId())) {
+                    Long videoId = categoryVideoMap.get(creativeAnalysis.getCategory());
+                    if (Objects.nonNull(videoId)) {
+                        creativeAnalysis.setMatchVideoId(videoId);
+                    }
+                }
+                creativeAnalysis.setStatus(1);
+                creativeAnalysis.setVideoSource("category");
+                creativeAnalysis.setUpdateTime(new Date());
+                adPutTencentCreativeAnalysisMapper.updateByPrimaryKeySelective(creativeAnalysis);
+            } catch (Exception e) {
+                log.error("adPutTencentCreativeAnalysisJob error", e);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private AdPutTencentComponent getMaxCostComponent(Map<Long, List<AdPutTencentComponentData>> componentsDataMap, Long creativeId) {
+        List<AdPutTencentComponentData> creativeComponentsList = componentsDataMap.get(creativeId);
+        if (CollectionUtil.isEmpty(creativeComponentsList)) {
+            return null;
+        }
+        List<Long> componentIds = creativeComponentsList.stream().map(AdPutTencentComponentData::getComponentId).collect(Collectors.toList());
+        AdPutTencentComponentExample componentExample = new AdPutTencentComponentExample();
+        componentExample.createCriteria().andComponentIdIn(componentIds);
+        List<AdPutTencentComponent> componentList = adPutTencentComponentMapper.selectByExampleWithBLOBs(componentExample);
+        if (CollectionUtil.isEmpty(componentList)) {
+            return null;
+        }
+        if (componentList.size() == 1) {
+            return componentList.get(0);
+        }
+        Map<Long, AdPutTencentComponent> componentIdToComponentMap = componentList.stream().collect(Collectors.toMap(AdPutTencentComponent::getComponentId, Function.identity()));
+        Map<Long, Long> componentIdToCostMap = new HashMap<>();
+        for (AdPutTencentComponentData componentData : creativeComponentsList) {
+            AdPutTencentComponent component = componentIdToComponentMap.get(componentData.getComponentId());
+            if (Objects.isNull(component) || Objects.isNull(component.getImageId())) {
+                continue;
+            }
+            Long cost = componentIdToCostMap.getOrDefault(componentData.getComponentId(), 0L);
+            cost += componentData.getCost();
+            componentIdToCostMap.put(componentData.getComponentId(), cost);
+        }
+        Long componentId = null;
+        Long maxCost = 0L;
+        for (Map.Entry<Long, Long> longLongEntry : componentIdToCostMap.entrySet()) {
+            if (longLongEntry.getValue() > maxCost) {
+                maxCost = longLongEntry.getValue();
+                componentId = longLongEntry.getKey();
+            }
+        }
+        if (Objects.isNull(componentId)) {
+            return null;
+        }
+        AdPutTencentComponent component = componentIdToComponentMap.get(componentId);
+        if (Objects.isNull(component)) {
+            return null;
+        }
+        return component;
+    }
+
+    @XxlJob("syncDailyCategoryVideoJob")
+    public ReturnT<String> syncDailyCategoryVideoJob(String param) {
+        String dt = DateUtils.dateToString(new Date(), "yyyy-MM-dd");
+        String sql = "SELECT merge_leve2, head_videoid, head_exposure_cnt, click_cnt, ror, dt\n" +
+                "FROM loghubods.merge_videoid_data_20260226\n" +
+                "WHERE dt = MAX_PT('loghubods.merge_videoid_data_20260226');";
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        if (CollectionUtil.isEmpty(dataList)) {
+            return ReturnT.SUCCESS;
+        }
+        List<DailyCategoryVideo> saveList = new ArrayList<>();
+        for (Record record : dataList) {
+            Long videoId = Long.valueOf(record.getString("head_videoid"));
+            String category = record.getString("merge_leve2");
+            if (StringUtils.isBlank(category) || "\\N".equals(category)) {
+                continue;
+            }
+            DailyCategoryVideo dailyCategoryVideo = new DailyCategoryVideo();
+            dailyCategoryVideo.setVideoId(videoId);
+            dailyCategoryVideo.setCategory(category);
+            dailyCategoryVideo.setDt(dt);
+            dailyCategoryVideo.setCreateTimestamp(System.currentTimeMillis());
+            saveList.add(dailyCategoryVideo);
+        }
+        if (CollectionUtil.isEmpty(saveList)) {
+            return ReturnT.SUCCESS;
+        }
+        adPutTencentExtMapper.deleteDailyCategoryVideo(dt);
+        adPutTencentExtMapper.batchInsertDailyCategoryVideo(saveList);
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("reAnalysisCreativeVideoJob")
+    public ReturnT<String> reAnalysisCreativeVideoJob(String param) {
+        Integer day = 7;
+        if (StringUtils.isNotBlank(param)) {
+            day = Integer.parseInt(param);
+        }
+        Date startTime = DateUtils.getBeforeDateOfTime(new Date(), day);
+        List<AdPutTencentCreativeAnalysis> analysisList = adPutTencentExtMapper.getReAnalysisCreativeList(startTime);
+        if (CollectionUtil.isEmpty(analysisList)) {
+            return ReturnT.SUCCESS;
+        }
+        List<Long> creativeIds = analysisList.stream().map(AdPutTencentCreativeAnalysis::getCreativeId).collect(Collectors.toList());
+        AdPutTencentComponentDataExample componentDataExample = new AdPutTencentComponentDataExample();
+        componentDataExample.createCriteria().andCreativeIdIn(creativeIds).andCreateTimeGreaterThanOrEqualTo(startTime);
+        List<AdPutTencentComponentData> componentsDataList = adPutTencentComponentDataMapper.selectByExample(componentDataExample);
+        Map<Long, List<AdPutTencentComponentData>> componentsDataMap = componentsDataList.stream().collect(Collectors.groupingBy(AdPutTencentComponentData::getCreativeId));
+
+        List<DailyCategoryVideo> dailyCategoryVideoList = adPutTencentExtMapper.getMaxDailyCategoryVideoList();
+        Map<String, Long> categoryVideoMap = dailyCategoryVideoList.stream().collect(Collectors.toMap(DailyCategoryVideo::getCategory, DailyCategoryVideo::getVideoId));
+        for (AdPutTencentCreativeAnalysis creativeAnalysis : analysisList) {
+            AdPutTencentComponent component = getMaxCostComponent(componentsDataMap, creativeAnalysis.getCreativeId());
+            if (Objects.isNull(component)) {
+                continue;
+            }
+            try {
+                String componentId = component.getComponentId().toString();
+                if (StringUtils.isBlank(creativeAnalysis.getTitle())) {
+                    // download & upload to oss
+                    String fileName = String.format("adPutTencent/image/%s_%s_%d.jpg", creativeAnalysis.getCreativeId(),
+                            componentId, System.currentTimeMillis());
+                    String ossImageUrl = AliOssFileTool.downloadAndSaveInOSS(fileName, component.getImageUrl(), "image/jpeg");
+                    // 调用gemini模型提取图片中的文字
+                    String prompt = "识别图片里的文字,直接输出图片里的文字标题,但是不要输出图片里右下角的字,比如“点开看看”“看这里”等,仅输出标题,不要有多余的文字输出";
+                    GoogleLLMResult result = aigcApiService.gemini("gemini-2.0-flash", prompt, Arrays.asList(ossImageUrl));
+                    String text = result.getResult();
+                    if (StringUtils.isEmpty(text)) {
+                        continue;
+                    }
+                    text = text.replaceAll("\\n", "");
+                    creativeAnalysis.setTitle(text);
+                    creativeAnalysis.setImageUrl(ossImageUrl);
+                }
+                if (StringUtils.isNotBlank(creativeAnalysis.getTitle()) && StringUtils.isBlank(creativeAnalysis.getCategory())) {
+                    // 调用gemini模型提取图片中的文字
+                    String prompt = analysisTitleCategoryPrompt.replace("{标题}", creativeAnalysis.getTitle());
+                    String result = aigcApiService.gpt("gpt-4o-mini", prompt, null, null);
+                    if (StringUtils.isNotEmpty(result)) {
+                        String category = result.replaceAll("\\n", "");
+                        creativeAnalysis.setCategory(category);
+                    }
+                }
+                if (StringUtils.isNotBlank(creativeAnalysis.getCategory()) && Objects.isNull(creativeAnalysis.getMatchVideoId())) {
+                    Long videoId = categoryVideoMap.get(creativeAnalysis.getCategory());
+                    if (Objects.nonNull(videoId)) {
+                        creativeAnalysis.setMatchVideoId(videoId);
+                    }
+                }
+                creativeAnalysis.setStatus(1);
+                creativeAnalysis.setVideoSource("category");
+                creativeAnalysis.setUpdateTime(new Date());
+                adPutTencentCreativeAnalysisMapper.updateByPrimaryKeySelective(creativeAnalysis);
+            } catch (Exception e) {
+                log.error("adPutTencentCreativeAnalysisJob error", e);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("dailyRefreshCreativeVideoJob")
+    public ReturnT<String> dailyRefreshCreativeVideoJob(String param) {
+        // param 可配置视频源: "vector" 使用向量搜索接口, 其他/空 使用原有品类视频源
+        boolean useVectorSource = "vector".equalsIgnoreCase(param);
+
+        AdPutTencentCreativeAnalysisExample example = new AdPutTencentCreativeAnalysisExample();
+        example.createCriteria().andStatusEqualTo(1);
+        List<AdPutTencentCreativeAnalysis> analysisList = adPutTencentCreativeAnalysisMapper.selectByExample(example);
+        if (CollectionUtil.isEmpty(analysisList)) {
+            return ReturnT.SUCCESS;
+        }
+        Date startTime = DateUtils.getBeforeDateOfTime(new Date(), dailyRefreshCreativeAnalysisVideoStartDate);
+        List<Long> creativeIds = analysisList.stream().map(AdPutTencentCreativeAnalysis::getCreativeId).collect(Collectors.toList());
+        AdPutTencentComponentDataExample componentDataExample = new AdPutTencentComponentDataExample();
+        componentDataExample.createCriteria().andCreativeIdIn(creativeIds).andCreateTimeGreaterThanOrEqualTo(startTime)
+                .andCostGreaterThan(dailyRefreshCreativeAnalysisVideoMinCost);
+        List<AdPutTencentComponentData> componentsDataList = adPutTencentComponentDataMapper.selectByExample(componentDataExample);
+        Map<Long, List<AdPutTencentComponentData>> componentsDataMap = componentsDataList.stream().collect(Collectors.groupingBy(AdPutTencentComponentData::getCreativeId));
+
+        if (!useVectorSource) {
+            // 原有视频源:按品类匹配每日最优视频
+            List<DailyCategoryVideo> dailyCategoryVideoList = adPutTencentExtMapper.getMaxDailyCategoryVideoList();
+            Map<String, Long> categoryVideoMap = dailyCategoryVideoList.stream().collect(Collectors.toMap(DailyCategoryVideo::getCategory, DailyCategoryVideo::getVideoId));
+            for (AdPutTencentCreativeAnalysis creativeAnalysis : analysisList) {
+                AdPutTencentComponent component = getMaxCostComponent(componentsDataMap, creativeAnalysis.getCreativeId());
+                if (Objects.isNull(component) || StringUtils.isBlank(component.getImageUrl())) {
+                    continue;
+                }
+                if (StringUtils.isNotEmpty(creativeAnalysis.getCategory())) {
+                    Long videoId = categoryVideoMap.get(creativeAnalysis.getCategory());
+                    if (Objects.nonNull(videoId)) {
+                        creativeAnalysis.setMatchVideoId(videoId);
+                    }
+                }
+                creativeAnalysis.setStatus(1);
+                creativeAnalysis.setVideoSource("category");
+                creativeAnalysis.setUpdateTime(new Date());
+                adPutTencentCreativeAnalysisMapper.updateByPrimaryKeySelective(creativeAnalysis);
+            }
+        } else {
+            // 向量视频源:提交解构任务,redis缓存taskId,最近12小时已提交的创意跳过
+            for (AdPutTencentCreativeAnalysis creativeAnalysis : analysisList) {
+                AdPutTencentComponent component = getMaxCostComponent(componentsDataMap, creativeAnalysis.getCreativeId());
+                if (Objects.isNull(component) || StringUtils.isBlank(component.getImageUrl())) {
+                    continue;
+                }
+                Long creativeId = creativeAnalysis.getCreativeId();
+                // 检查x小时内是否已提交过(替换锁)
+                String replaceLockKey = EnumRedisPrefix.AD_TENCENT_CREATIVE_REPLACE_LOCK.getPrefix()
+                        .replace("{creativeId}", creativeId.toString());
+                if (adOwnRedisUtils.contantinsKey(replaceLockKey)) {
+                    log.info("dailyRefreshCreativeVideoJob skip, creativeId:{} in 12h lock", creativeId);
+                    continue;
+                }
+                // 检查是否已有处理中的任务
+                String taskIdKey = EnumRedisPrefix.AD_TENCENT_DECONSTRUCT_TASK_ID.getPrefix()
+                        .replace("{creativeId}", creativeId.toString());
+                if (adOwnRedisUtils.contantinsKey(taskIdKey)) {
+                    log.info("dailyRefreshCreativeVideoJob skip, creativeId:{} already has pending task", creativeId);
+                    continue;
+                }
+                if (StringUtils.isBlank(creativeAnalysis.getTitle())) {
+                    log.info("dailyRefreshCreativeVideoJob skip, creativeId:{} title is blank", creativeId);
+                    continue;
+                }
+                // 构建图片列表
+                List<String> imageList = new ArrayList<>();
+                if (StringUtils.isNotBlank(creativeAnalysis.getImageUrl())) {
+                    imageList.add(creativeAnalysis.getImageUrl());
+                } else {
+                    // 从component获取图片
+                    if (StringUtils.isNotBlank(component.getImageUrl())) {
+                        imageList.add(component.getImageUrl());
+                    }
+                }
+                try {
+                    String taskId = videoSearchApiService.submitDeconstruct(
+                            creativeId.toString(),
+                            creativeAnalysis.getTitle(),
+                            imageList
+                    );
+                    if (StringUtils.isNotBlank(taskId)) {
+                        // 缓存taskId,保留24小时
+                        adOwnRedisUtils.set(taskIdKey, taskId, 24 * 60 * 60L);
+                        log.info("dailyRefreshCreativeVideoJob submit deconstruct task, creativeId:{}, taskId:{}", creativeId, taskId);
+                    }
+                } catch (Exception e) {
+                    log.error("dailyRefreshCreativeVideoJob submit deconstruct error, creativeId:{}", creativeId, e);
+                }
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 扫描处理中的解构任务,获取结果并匹配视频更新 matchVideoId
+     * 建议频率:每5分钟执行一次
+     */
+    @XxlJob("scanDeconstructTaskJob")
+    public ReturnT<String> scanDeconstructTaskJob(String param) {
+        AdPutTencentCreativeAnalysisExample example = new AdPutTencentCreativeAnalysisExample();
+        example.createCriteria().andStatusEqualTo(1);
+        List<AdPutTencentCreativeAnalysis> analysisList = adPutTencentCreativeAnalysisMapper.selectByExample(example);
+        if (CollectionUtil.isEmpty(analysisList)) {
+            return ReturnT.SUCCESS;
+        }
+        for (AdPutTencentCreativeAnalysis creativeAnalysis : analysisList) {
+            Long creativeId = creativeAnalysis.getCreativeId();
+            String taskIdKey = EnumRedisPrefix.AD_TENCENT_DECONSTRUCT_TASK_ID.getPrefix()
+                    .replace("{creativeId}", creativeId.toString());
+            String taskId = adOwnRedisUtils.get(taskIdKey);
+            if (StringUtils.isBlank(taskId)) {
+                continue;
+            }
+            try {
+                JSONObject resultData = videoSearchApiService.getDeconstructResult(taskId);
+                if (resultData == null) {
+                    continue;
+                }
+                Boolean finished = resultData.getBoolean("finished");
+                Boolean success = resultData.getBoolean("success");
+                if (!Boolean.TRUE.equals(finished)) {
+                    // 任务未完成,继续等待
+                    continue;
+                }
+                // 任务已完成,无论成功失败都从缓存中移除taskId
+                adOwnRedisUtils.del(taskIdKey);
+                if (!Boolean.TRUE.equals(success)) {
+                    log.warn("scanDeconstructTaskJob task failed, creativeId:{}, taskId:{}", creativeId, taskId);
+                    continue;
+                }
+                // 提取选题
+                String topic = videoSearchApiService.extractTopicFromResult(resultData);
+                if (StringUtils.isBlank(topic)) {
+                    log.warn("scanDeconstructTaskJob extract topic failed, creativeId:{}, taskId:{}", creativeId, taskId);
+                    continue;
+                }
+                // 匹配视频
+                List<Long> videoIds = videoSearchApiService.matchTopNVideo(topic, 1);
+                if (CollectionUtil.isEmpty(videoIds)) {
+                    log.warn("scanDeconstructTaskJob matchTopNVideo empty, creativeId:{}, topic:{}", creativeId, topic);
+                    continue;
+                }
+                Long matchedVideoId = videoIds.get(0);
+                creativeAnalysis.setMatchVideoId(matchedVideoId);
+                creativeAnalysis.setStatus(1);
+                creativeAnalysis.setVideoSource("vector");
+                creativeAnalysis.setUpdateTime(new Date());
+                adPutTencentCreativeAnalysisMapper.updateByPrimaryKeySelective(creativeAnalysis);
+                // 24小时内不再重复替换
+                String replaceLockKey = EnumRedisPrefix.AD_TENCENT_CREATIVE_REPLACE_LOCK.getPrefix()
+                        .replace("{creativeId}", creativeId.toString());
+                adOwnRedisUtils.set(replaceLockKey, "1", 24 * 60 * 60L);
+                log.info("scanDeconstructTaskJob success, creativeId:{}, matchedVideoId:{}, topic:{}", creativeId, matchedVideoId, topic);
+            } catch (Exception e) {
+                log.error("scanDeconstructTaskJob error, creativeId:{}, taskId:{}", creativeId, taskId, e);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+}

+ 1028 - 0
core/src/main/java/com/tzld/ad/job/adPut/AdPutTencentJobHandler.java

@@ -0,0 +1,1028 @@
+package com.tzld.ad.job.adPut;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.tzld.ad.dao.mapper.adPut.*;
+import com.tzld.ad.dao.mapper.adPut.ext.AdPutTencentExtMapper;
+import com.tzld.ad.enums.EnumRedisPrefix;
+import com.tzld.ad.enums.adPut.*;
+import com.tzld.ad.model.adPut.*;
+import com.tzld.ad.model.open.BaseLogInfoDTO;
+import com.tzld.ad.model.open.CommonLogRequest;
+import com.tzld.ad.model.open.LogDetailInfo;
+import com.tzld.ad.model.po.adput.*;
+import com.tzld.ad.service.AdOwnRedisUtils;
+import com.tzld.ad.service.adput.AdPutTencentCommonService;
+import com.tzld.ad.service.feign.LogCenterFeign;
+import com.tzld.ad.service.feishu.FeiShuService;
+import com.tzld.ad.util.CollectionUtil;
+import com.tzld.ad.util.DateUtil;
+import com.tzld.ad.util.DateUtils;
+import com.tzld.ad.util.adPut.CalculatorUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Component
+public class AdPutTencentJobHandler {
+    private final static Logger log = LoggerFactory.getLogger(AdPutTencentJobHandler.class);
+
+    @Autowired
+    private AdPutTencentCommonService adPutTencentCommonService;
+    @Autowired
+    private AdPutTencentAdDataMapper adPutTencentAdDataMapper;
+    @Autowired
+    private AdPutTencentMaterialUploadHandleMapper adPutTencentMaterialUploadHandleMapper;
+    @Autowired
+    private AdPutTencentAccountMapper adPutTencentAccountMapper;
+    @Autowired
+    private AdPutTencentAdMapper adPutTencentAdMapper;
+    @Autowired
+    private AdPutTencentExtMapper adPutTencentExtMapper;
+    @Autowired
+    private AdPutTencentPackageMapper adPutTencentPackageMapper;
+    @Autowired
+    private AdPutTencentDynamicBidMapper adPutTencentDynamicBidMapper;
+    @Autowired
+    private AdPutTencentPackageAdMappingMapper adPutTencentPackageAdMappingMapper;
+    @Autowired
+    private AdPutTencentAdPackageMappingMapper adPutTencentAdPackageMappingMapper;
+    @Autowired
+    private LogCenterFeign logCenterFeign;
+    @Autowired
+    private AdOwnRedisUtils adOwnRedisUtils;
+    @Autowired
+    private FeiShuService feiShuService;
+
+    @Value("${ad.put.tencent.clientId:}")
+    private String clientId;
+    @Value("${ad.put.tencent.package.master.accountId:44789718}")
+    private String packageMasterAccountId;
+    @Value("${ad.put.tencent.dynamic.bid.config:}")
+    private String dynamicConfigStr;
+    @Value("${ad.put.tencent.package.accountId:55615440}")
+    private String packageAccountId;
+    @Value("${user.token.expire.robot.url:https://open.feishu.cn/open-apis/bot/v2/hook/84f15a9c-64f5-4dfa-b12f-d11574cfff92}")
+    private String userTokenExpireRobotUrl;
+    @ApolloJsonValue("${ad.put.tencent.package.replace.account.list:[]}")
+    private List<Long> packageReplaceAccountList;
+
+
+    private final static String DYNAMIC_BID_LOG_KEY = "DYNAMIC_BID_LOG_KEY";
+
+    public static final ThreadPoolExecutor AD_PACKAGE_REPLACE_EXECUTOR = new ThreadPoolExecutor(
+            10, 10, 10L, TimeUnit.MINUTES,
+            new LinkedBlockingQueue<>(10000),
+            new ThreadFactoryBuilder().setNameFormat("ad-package-replace-pool-%d").build(),
+            new ThreadPoolExecutor.CallerRunsPolicy());
+
+    /**
+     * 每日刷新accessToken任务
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("refreshAccessToken")
+    public ReturnT<String> refreshAccessTokenJob(String param) {
+        AdPutTencentAccountExample adPutTencentAccountExample = new AdPutTencentAccountExample();
+        adPutTencentAccountExample.createCriteria().andIsDeleteEqualTo(0).andAccountTypeIn(Arrays.asList(AdTencentAccountTypeEnum.ZHUTI.getDesc(), AdTencentAccountTypeEnum.YEWU.getDesc()));
+        List<AdPutTencentAccount> adPutTencentAccounts = adPutTencentAccountMapper.selectByExample(adPutTencentAccountExample);
+        for (AdPutTencentAccount adPutTencentAccount : adPutTencentAccounts) {
+            adPutTencentCommonService.refreshAccessToken(adPutTencentAccount.getAccountId());
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("uploadTopNVideoMaterial")
+    public ReturnT<String> uploadTopNVideoMaterial(String param) {
+        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
+        // 查询当日dt的 处理节点到 2 的数据
+        AdPutTencentMaterialUploadHandleExample adPutTencentMaterialUploadHandleExample = new AdPutTencentMaterialUploadHandleExample();
+        adPutTencentMaterialUploadHandleExample.createCriteria()
+                .andIsDeleteEqualTo(0).andProcesseNodeEqualTo(1).andMaterialTypeEqualTo(0)
+                .andDtEqualTo(df.format(new Date()));
+        List<AdPutTencentMaterialUploadHandle> adPutTencentMaterialUploadHandles =
+                adPutTencentMaterialUploadHandleMapper.selectByExample(adPutTencentMaterialUploadHandleExample);
+        adPutTencentCommonService.uploadVideoMaterial(adPutTencentMaterialUploadHandles);
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 更新昨日消耗数据
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("updateLastDayTencentAdData")
+    public ReturnT<String> updateLastDayTencentAdData(String param) {
+        String lastDayStr = getLastDayStr();
+        if (StringUtils.isNotBlank(param)) {
+            lastDayStr = param;
+        }
+        AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+        adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andIsGetDataEqualTo(1);
+        List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+
+        List<Long> adIds = adPutTencentAds.stream().map(AdPutTencentAd::getAdId).collect(Collectors.toList());
+        AdPutTencentAdPackageMappingExample adPutTencentAdPackageMappingExample = new AdPutTencentAdPackageMappingExample();
+        adPutTencentAdPackageMappingExample.createCriteria().andAdIdIn(adIds);
+        List<AdPutTencentAdPackageMapping> adPackageMappingList = adPutTencentAdPackageMappingMapper.selectByExample(adPutTencentAdPackageMappingExample);
+        Map<Long, Map<Long, AdPutTencentAdPackageMapping>> adIdToPackageMappingMap = adPackageMappingList.stream()
+                .collect(Collectors.groupingBy(AdPutTencentAdPackageMapping::getAdId,
+                        Collectors.toMap(AdPutTencentAdPackageMapping::getPackageId, Function.identity())));
+        for (AdPutTencentAd adPutTencentAd : adPutTencentAds) {
+            // 获取广告基本信息
+            AdPutTencentAdGroupInfo adGroupInfoDetail = adPutTencentCommonService.getAdGroupInfo(adPutTencentAd.getAccountId() + "", adPutTencentAd.getAdId() + "", null, null);
+            if (Objects.isNull(adGroupInfoDetail)) {
+                log.error("getAdGroupInfo is null accountId:" + adPutTencentAd.getAccountId() + ",adId:" + adPutTencentAd.getAdId());
+                continue;
+            }
+            Map<Long, AdPutTencentAdPackageMapping> packageMappingMap = adIdToPackageMappingMap.getOrDefault(adGroupInfoDetail.getAdgroup_id(), Collections.emptyMap());
+            // 更新广告人群包关系
+            if (Objects.nonNull(adGroupInfoDetail.getTargeting())
+                    && !CollectionUtil.isEmpty(adGroupInfoDetail.getTargeting().getCustom_audience())) {
+                List<Long> customAudienceIds = adGroupInfoDetail.getTargeting().getCustom_audience();
+                for (Long customAudienceId : customAudienceIds) {
+                    if (packageMappingMap.containsKey(customAudienceId)) {
+                        continue;
+                    }
+                    AdPutTencentAdPackageMapping adPackageMapping = new AdPutTencentAdPackageMapping();
+                    adPackageMapping.setAdId(adGroupInfoDetail.getAdgroup_id());
+                    adPackageMapping.setPackageId(customAudienceId);
+                    adPackageMapping.setIsDelete(0);
+                    adPackageMapping.setCreateTime(new Date());
+                    adPackageMapping.setUpdateTime(new Date());
+                    adPutTencentAdPackageMappingMapper.insertSelective(adPackageMapping);
+                }
+                for (Map.Entry<Long, AdPutTencentAdPackageMapping> entry : packageMappingMap.entrySet()) {
+                    Long packageId = entry.getKey();
+                    AdPutTencentAdPackageMapping adPackageMapping = entry.getValue();
+                    if (customAudienceIds.contains(packageId) || adPackageMapping.getIsDelete() == 1) {
+                        continue;
+                    }
+                    adPackageMapping.setIsDelete(1);
+                    adPackageMapping.setUpdateTime(new Date());
+                    adPutTencentAdPackageMappingMapper.updateByPrimaryKey(adPackageMapping);
+                }
+            }
+            Long dailyBudget = adGroupInfoDetail.getDaily_budget();
+            List<AdPutTencentAdCostData> adGroupDatas = adPutTencentCommonService.getAdGroupData(adPutTencentAd.getAccountId() + "", adPutTencentAd.getAdId() + "", lastDayStr, lastDayStr, null, null);
+            if (CollectionUtil.isEmpty(adGroupDatas)) {
+                if (!AdPutTencentAdSystemStatusEnum.ADGROUP_STATUS_DELETED.getCode().equals(adPutTencentAd.getSystemStatus()) && !AdPutTencentAdSystemStatusEnum.ADGROUP_STATUS_WECHAT_CHANNELS_STOP.getCode().equals(adPutTencentAd.getSystemStatus())) {
+                    log.error("getAdGroupData is null accountId:" + adPutTencentAd.getAccountId() + ",adId:" + adPutTencentAd.getAdId());
+                }
+                continue;
+            }
+//            log.info("updateLastDayTencentAdData.adGroupDatas, adGroupDatas:{}", JSONObject.toJSONString(adGroupDatas));
+            AdPutTencentAdData adPutTencentAdData = getAdPutTencentAdData(adPutTencentAd, adGroupDatas, dailyBudget);
+            adPutTencentAdDataMapper.insertSelective(adPutTencentAdData);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 每周一次更新 人群包
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("setWaitUpdatePackage")
+    public ReturnT<String> setWaitUpdatePackage(String param) {
+        AdPutTencentPackageExample adPutTencentPackageExample = new AdPutTencentPackageExample();
+        adPutTencentPackageExample.createCriteria().andIsDeleteEqualTo(0).andAutoUpdateEqualTo(1);
+        List<AdPutTencentPackage> adPutTencentPackages = adPutTencentPackageMapper.selectByExample(adPutTencentPackageExample);
+        // 历史 软删除
+        for (AdPutTencentPackage adPutTencentPackage : adPutTencentPackages) {
+            adPutTencentPackage.setIsDelete(1);
+            adPutTencentPackage.setUpdateTime(new Date());
+            adPutTencentPackageMapper.updateByPrimaryKeySelective(adPutTencentPackage);
+        }
+        // 新增
+        for (AdPutTencentPackage adPutTencentPackage : adPutTencentPackages) {
+            adPutTencentPackage.setId(null);
+            adPutTencentPackage.setOssPath(null);
+            adPutTencentPackage.setTencentFileId(null);
+            adPutTencentPackage.setStatus(AdPackageStatus.WAIT_UPDATE.getCode());
+            adPutTencentPackage.setIsDelete(0);
+            adPutTencentPackage.setCreateTime(new Date());
+            adPutTencentPackage.setUpdateTime(new Date());
+            adPutTencentPackageMapper.insertSelective(adPutTencentPackage);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 检查大数据更新oss 即status=1 的 上传对应账户人群包
+     * 每天扫描一次
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("uploadTencentPackage")
+    public ReturnT<String> uploadTencentPackage(String param) {
+        AdPutTencentPackageExample adPutTencentPackageExample = new AdPutTencentPackageExample();
+        adPutTencentPackageExample.createCriteria().andIsDeleteEqualTo(0)
+                .andAutoUpdateEqualTo(1).andStatusEqualTo(AdPackageStatus.OSS_UPDATE.getCode());
+        List<AdPutTencentPackage> adPutTencentPackages = adPutTencentPackageMapper.selectByExample(adPutTencentPackageExample);
+        for (AdPutTencentPackage adPutTencentPackage : adPutTencentPackages) {
+            String packageKey = adPutTencentPackage.getPackageKey();
+            // 创建人群
+            String audienceId = adPutTencentCommonService.createCrowd(String.valueOf(adPutTencentPackage.getAccountId()),
+                    packageKey + "_" + adPutTencentPackage.getUserIdType() + "_" + getNowDayTimeStr());
+            // 创建人群文件
+            List<String> customAudienceFileIds = adPutTencentCommonService.createCrowdFile(String.valueOf(adPutTencentPackage.getAccountId()),
+                    audienceId, adPutTencentPackage.getUserIdType(), adPutTencentPackage.getOssPath(), adPutTencentPackage.getAppId());
+            // 更新状态
+            adPutTencentPackage.setTencentAudienceId(Long.valueOf(audienceId));
+            adPutTencentPackage.setTencentFileId(JSON.toJSONString(customAudienceFileIds));
+            adPutTencentPackage.setStatus(AdPackageStatus.UPLOAD_TENCENT_PACKAGE.getCode());
+            adPutTencentPackage.setUpdateTime(new Date());
+            adPutTencentPackageMapper.updateByPrimaryKeySelective(adPutTencentPackage);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    /**
+     * 每小时检查
+     *
+     * @param param
+     * @return
+     */
+    @XxlJob("checkAudienceStatus")
+    public ReturnT<String> checkAudienceStatus(String param) {
+        // 检查人群包status=3的是否变更为 可用状态
+        AdPutTencentPackageExample adPutTencentPackageExample = new AdPutTencentPackageExample();
+        adPutTencentPackageExample.createCriteria().andIsDeleteEqualTo(0)
+                .andAutoUpdateEqualTo(1).andStatusEqualTo(AdPackageStatus.UPLOAD_TENCENT_PACKAGE.getCode());
+        List<AdPutTencentPackage> adPutTencentPackages = adPutTencentPackageMapper.selectByExample(adPutTencentPackageExample);
+//        List<Long> updatePackageAdIds = new ArrayList<>();
+        for (AdPutTencentPackage adPutTencentPackage : adPutTencentPackages) {
+//            String packageKey = adPutTencentPackage.getPackageKey();
+            AdPutTencentAudienceInfo crowdInfo = adPutTencentCommonService.getCrowdInfo(adPutTencentPackage.getAccountId() + "", adPutTencentPackage.getTencentAudienceId() + "");
+            if (Objects.isNull(crowdInfo)) {
+                log.error("");
+                continue;
+            }
+            if (!"SUCCESS".equals(crowdInfo.getStatus())) {
+                // 更新处理状态等待下一次扫描
+                adPutTencentPackage.setTencentStatus(crowdInfo.getStatus());
+                adPutTencentPackage.setUpdateTime(new Date());
+                adPutTencentPackageMapper.updateByPrimaryKeySelective(adPutTencentPackage);
+                continue;
+            }
+            // 查询全部该key的人群定向的广告
+//            AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+//            adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andPackageKeyEqualTo(packageKey);
+//            List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+//            if (CollectionUtil.isEmpty(adPutTencentAds)) {
+//                continue;
+//            }
+//            Set<Long> toAccountIds = adPutTencentAds.parallelStream().map(AdPutTencentAd::getAccountId).collect(Collectors.toSet());
+//            // 授权
+//            for (Long toAccountId : toAccountIds) {
+//                adPutTencentCommonService.audienceGrantRelations(adPutTencentPackage.getAccountId() + "", Collections.singletonList(adPutTencentPackage.getTencentAudienceId()), toAccountId + "");
+//            }
+//            // 更新广告定向
+//            for (AdPutTencentAd adPutTencentAd : adPutTencentAds) {
+//                adPutTencentCommonService.updateAdGroupPeoplePackage(adPutTencentAd.getAccountId() + "", adPutTencentAd.getAdId() + "", adPutTencentPackage.getTencentAudienceId().intValue());
+//                updatePackageAdIds.add(adPutTencentAd.getAdId());
+//            }
+            adPutTencentPackage.setTencentStatus(crowdInfo.getStatus());
+            adPutTencentPackage.setStatus(AdPackageStatus.TENCENT_SUCCESS.getCode());
+            adPutTencentPackage.setUpdateTime(new Date());
+            adPutTencentPackageMapper.updateByPrimaryKeySelective(adPutTencentPackage);
+        }
+//        log.info("checkAudienceStatusAndUpdateAdPackage update package ad_group_id:" + JSON.toJSONString(updatePackageAdIds));
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("addAdPackageUpdateRecordJob")
+    public ReturnT<String> addAdPackageUpdateRecordJob(String param) {
+        Date beforeDate = DateUtils.getBeforeTimeOfDay(new Date(), 7);
+        String dt = DateUtil.formatDate(beforeDate);
+        List<AdPutTencentAd> adList = adPutTencentExtMapper.getAdPackageUpdateRecord(dt);
+        if (CollectionUtil.isEmpty(adList)) {
+            return ReturnT.SUCCESS;
+        }
+        Map<Long, List<AdPutTencentAd>> adMap = adList.stream().collect(Collectors.groupingBy(AdPutTencentAd::getAccountId));
+        List<AdPutTencentPackage> adPutTencentPackageList = getPackageList();
+        if (CollectionUtil.isEmpty(adPutTencentPackageList)) {
+            return ReturnT.SUCCESS;
+        }
+        Map<String, AdPutTencentPackage> packageMap = adPutTencentPackageList.stream()
+                .collect(Collectors.toMap(AdPutTencentPackage::getPackageKey, Function.identity()));
+        Set<String> packageKeys = adPutTencentPackageList.stream().map(AdPutTencentPackage::getPackageKey).collect(Collectors.toSet());
+        Map<Long, AdPutTencentAudienceInfo> audienceMap = new HashMap<>();
+        CountDownLatch cdl = new CountDownLatch(adMap.size());
+        for (Map.Entry<Long, List<AdPutTencentAd>> entry : adMap.entrySet()) {
+            AD_PACKAGE_REPLACE_EXECUTOR.submit(() -> {
+                try {
+                    Long accountId = entry.getKey();
+                    List<AdPutTencentAd> ads = entry.getValue();
+                    if (!packageReplaceAccountList.contains(accountId) && !packageReplaceAccountList.contains(0L)) {
+                        return;
+                    }
+                    // 先看是否需要授权
+                    Long fromAccountId = adPutTencentPackageList.get(0).getAccountId();
+                    List<Long> audienceIds = adPutTencentPackageList.stream().map(AdPutTencentPackage::getTencentAudienceId).collect(Collectors.toList());
+                    if (!fromAccountId.equals(accountId)) {
+                        // 授权
+                        adPutTencentCommonService.audienceGrantRelations(String.valueOf(fromAccountId), audienceIds, String.valueOf(accountId));
+                    }
+                    List<Long> adIds = ads.stream().map(AdPutTencentAd::getAdId).collect(Collectors.toList());
+                    List<AdPutTencentAdPackageMapping> adPackageMappingList = getAdPackageMappingList(adIds);
+                    Map<Long, List<AdPutTencentAdPackageMapping>> adPackageMappingMap = adPackageMappingList.stream()
+                            .collect(Collectors.groupingBy(AdPutTencentAdPackageMapping::getAdId));
+                    syncTencentPackageByAccountId(String.valueOf(accountId));
+                    for (AdPutTencentAd ad : ads) {
+                        // 已更新排除
+                        List<AdPutTencentAdPackageMapping> existAdPackageMappingList = adPackageMappingMap.getOrDefault(ad.getAdId(), new ArrayList<>());
+                        if (!CollectionUtil.isEmpty(existAdPackageMappingList)) {
+                            boolean exist = false;
+                            for (AdPutTencentAdPackageMapping adPackageMapping : existAdPackageMappingList) {
+                                if (audienceIds.contains(adPackageMapping.getPackageId())) {
+                                    exist = true;
+                                    break;
+                                }
+                            }
+                            if (exist) {
+                                continue;
+                            }
+                        }
+                        // 获取当前广告的人群包
+                        AdPutTencentAdGroupInfo adGroupInfoDetail = adPutTencentCommonService.getAdGroupInfo(
+                                String.valueOf(ad.getAccountId()), String.valueOf(ad.getAdId()), null, null);
+                        if (Objects.isNull(adGroupInfoDetail)) {
+                            log.error("getAdGroupInfoDetail error, accountId:{}, adId:{}", ad.getAccountId(), ad.getAdId());
+                            continue;
+                        }
+                        List<Long> customAudiences = adGroupInfoDetail.getTargeting().getCustom_audience();
+                        if (CollectionUtil.isEmpty(customAudiences)) {
+                            continue;
+                        }
+                        // 获取人群包信息
+                        List<AdPutTencentAudienceInfo> audienceInfoList = new ArrayList<>();
+                        for (Long customAudience : customAudiences) {
+                            if (audienceMap.containsKey(customAudience)) {
+                                audienceInfoList.add(audienceMap.get(customAudience));
+                                continue;
+                            }
+                            AdPutTencentAudienceInfo crowdInfo = adPutTencentCommonService.getCrowdInfo(
+                                    String.valueOf(ad.getAccountId()), String.valueOf(customAudience));
+                            if (Objects.isNull(crowdInfo)) {
+                                AdPutTencentPackage itemPackage = getPackageByAudienceId(customAudience);
+                                if (Objects.isNull(itemPackage)) {
+                                    log.error("getPackageByAudienceId error, accountId:{}, customAudience:{}", ad.getAccountId(), customAudience);
+                                    continue;
+                                } else {
+                                    AdPutTencentAudienceInfo crowInfoItem = new AdPutTencentAudienceInfo();
+                                    crowInfoItem.setName(itemPackage.getPackageName());
+                                    crowInfoItem.setAudience_id(customAudience);
+                                    audienceInfoList.add(crowInfoItem);
+                                    audienceMap.put(customAudience, crowInfoItem);
+                                }
+                            }
+                            audienceInfoList.add(crowdInfo);
+                            audienceMap.put(customAudience, crowdInfo);
+                        }
+                        if (CollectionUtil.isEmpty(audienceInfoList)) {
+                            continue;
+                        }
+                        // 根据 packageKey 匹配人群包
+                        Set<Long> updateAudienceIds = new HashSet<>();
+                        Map<Long, String> audiencePackageKeyMap = new HashMap<>();
+                        for (AdPutTencentAudienceInfo audienceInfo : audienceInfoList) {
+                            for (String packageKey : packageKeys) {
+                                if (audienceInfo.getName().startsWith(packageKey)) {
+                                    AdPutTencentPackage adPutTencentPackage = packageMap.get(packageKey);
+                                    updateAudienceIds.add(adPutTencentPackage.getTencentAudienceId());
+                                    audiencePackageKeyMap.put(adPutTencentPackage.getTencentAudienceId(), packageKey);
+                                    break;
+                                }
+                            }
+                        }
+                        // 记录广告更新表
+                        for (Long updateAudienceId : updateAudienceIds) {
+                            AdPutTencentPackageAdMapping item = new AdPutTencentPackageAdMapping();
+                            item.setAdId(ad.getAdId());
+                            item.setPackageKey(audiencePackageKeyMap.get(updateAudienceId));
+                            item.setPackUpdateDt(getDayStr());
+                            item.setIsDelete(1);
+                            item.setCreateTime(new Date());
+                            item.setUpdateTime(new Date());
+                            adPutTencentPackageAdMappingMapper.insert(item);
+                        }
+                        // 更新广告定向
+                        if (CollectionUtil.notEmpty(updateAudienceIds)) {
+                            adPutTencentCommonService.updateAdGroupPeoplePackage(String.valueOf(accountId),
+                                    String.valueOf(ad.getAdId()), new ArrayList<>(updateAudienceIds));
+                        }
+                    }
+                } finally {
+                    cdl.countDown();
+                }
+            });
+        }
+        try {
+            cdl.await();
+        } catch (Exception e) {
+            log.error("addAdPackageUpdateRecordJob cdl await error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private List<AdPutTencentAdPackageMapping> getAdPackageMappingList(List<Long> adIds) {
+        AdPutTencentAdPackageMappingExample adPutTencentAdPackageMappingExample = new AdPutTencentAdPackageMappingExample();
+        adPutTencentAdPackageMappingExample.createCriteria().andIsDeleteEqualTo(0).andAdIdIn(adIds);
+        return adPutTencentAdPackageMappingMapper.selectByExample(adPutTencentAdPackageMappingExample);
+    }
+
+    @XxlJob("updateAdPackage")
+    public ReturnT<String> updateAdPackage(String param) {
+        // 获取所有存在当日没有更新人群包的 adId
+        String dayStr = getDayStr();
+        AdPutTencentPackageAdMappingExample adPutTencentPackageAdMappingExample = new AdPutTencentPackageAdMappingExample();
+        adPutTencentPackageAdMappingExample.createCriteria().andIsDeleteEqualTo(0).andPackUpdateDtNotEqualTo(dayStr);
+        List<AdPutTencentPackageAdMapping> adPutTencentPackageAdMappings = adPutTencentPackageAdMappingMapper.selectByExample(adPutTencentPackageAdMappingExample);
+        if (CollectionUtils.isEmpty(adPutTencentPackageAdMappings)) {
+            // 已全部更新完毕 或 无需更新
+            return ReturnT.SUCCESS;
+        }
+        // 全部待更新adId
+        Set<Long> adIds = adPutTencentPackageAdMappings.parallelStream().map(AdPutTencentPackageAdMapping::getAdId).collect(Collectors.toSet());
+        log.info("updateAdPackage wait update adIds:" + JSON.toJSONString(adIds));
+        // 获取全部人群包状态 status=4的
+        List<AdPutTencentPackage> adPutTencentPackages = getPackageList();
+        if (CollectionUtil.isEmpty(adPutTencentPackages)) {
+            // 人群包都没更新成功的
+            return ReturnT.SUCCESS;
+        }
+        log.info("updateAdPackage package status success:" + JSON.toJSONString(adPutTencentPackages));
+        // 开始更新广告的人群包
+        List<Long> updatePackageAdIds = new ArrayList<>();
+        for (Long adId : adIds) {
+            try {
+                // 获取待更新人群包
+                AdPutTencentPackageAdMappingExample adPutTencentPackageAdMappingExample1 = new AdPutTencentPackageAdMappingExample();
+                adPutTencentPackageAdMappingExample1.createCriteria().andIsDeleteEqualTo(0).andAdIdEqualTo(adId);
+                List<AdPutTencentPackageAdMapping> adPutTencentPackageAdMappingsByAdIds = adPutTencentPackageAdMappingMapper.selectByExample(adPutTencentPackageAdMappingExample1);
+                if (CollectionUtil.isEmpty(adPutTencentPackageAdMappingsByAdIds)) {
+                    log.error("updateAdPackage mapping is null: " + adId);
+                    continue;
+                }
+                Set<String> waitUpdatePackKeys = adPutTencentPackageAdMappingsByAdIds.parallelStream().map(AdPutTencentPackageAdMapping::getPackageKey).collect(Collectors.toSet());
+                // 检查所有人群包是否已经都更新上传到腾讯广告平台 且 分析完成
+                List<AdPutTencentPackage> packageList = adPutTencentPackages.parallelStream().filter(x -> waitUpdatePackKeys.contains(x.getPackageKey())).collect(Collectors.toList());
+                if (waitUpdatePackKeys.size() != packageList.size()) {
+                    log.info("updateAdPackage updateAd package not all success adId:" + adId + ",waitUpdatePackKeys:" + JSON.toJSONString(waitUpdatePackKeys) + ",packageList:" + JSON.toJSONString(packageList));
+                    continue;
+                }
+                // 至此说明所有人群包今天都已经更新了,开始更新广告定向人群
+                // 待更新人群Id
+                List<Long> audienceIds = packageList.parallelStream().map(AdPutTencentPackage::getTencentAudienceId).collect(Collectors.toList());
+                // 先看是否需要授权
+                Long fromAccountId = adPutTencentPackages.get(0).getAccountId();
+                AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+                adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andAdIdEqualTo(adId);
+                List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+                Long toAccountId = adPutTencentAds.get(0).getAccountId();
+                if (!fromAccountId.equals(toAccountId)) {
+                    // 授权
+                    adPutTencentCommonService.audienceGrantRelations(fromAccountId + "", audienceIds, toAccountId + "");
+                }
+                // 更新
+                adPutTencentCommonService.updateAdGroupPeoplePackage(toAccountId + "", adId + "", audienceIds);
+                // 处理已更新日期
+                for (AdPutTencentPackageAdMapping adPutTencentPackageAdMappingsByAdId : adPutTencentPackageAdMappingsByAdIds) {
+                    //adPutTencentPackageAdMappingsByAdId.setPackUpdateDt(dayStr);
+                    adPutTencentPackageAdMappingsByAdId.setIsDelete(1);
+                    adPutTencentPackageAdMappingsByAdId.setUpdateTime(new Date());
+                    adPutTencentPackageAdMappingMapper.updateByPrimaryKeySelective(adPutTencentPackageAdMappingsByAdId);
+                }
+                // 日志log
+                updatePackageAdIds.add(adId);
+                log.info("updateAdPackage ad success adId:" + adId + ",update pack key:" + JSON.toJSONString(waitUpdatePackKeys) + ",audienceIds:" + JSON.toJSONString(audienceIds));
+            } catch (Exception e) {
+                log.error("updateAdPackage update ad error adId " + adId + "," + e);
+                continue;
+            }
+        }
+        if (!CollectionUtil.isEmpty(adIds)) {
+            log.info("updateAdPackage all success updatePackageAdIds " + JSON.toJSONString(updatePackageAdIds) + ",adIds " + JSON.toJSONString(adIds));
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("syncTencentPackageJob")
+    public ReturnT<String> syncTencentPackageJob(String param) {
+        syncTencentPackageByAccountId(packageAccountId);
+        List<Long> accountIds = adPutTencentExtMapper.getNotSyncPackageAccount();
+        for (Long accountId : accountIds) {
+            syncTencentPackageByAccountId(String.valueOf(accountId));
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private void syncTencentPackageByAccountId(String accountId) {
+        List<AdPutTencentAudienceInfo> crowdInfoList = adPutTencentCommonService.getCrowdInfoListByAccountId(accountId);
+        List<Long> audienceIds = crowdInfoList.stream().map(AdPutTencentAudienceInfo::getAudience_id).collect(Collectors.toList());
+        AdPutTencentPackageExample adPutTencentPackageExample = new AdPutTencentPackageExample();
+        adPutTencentPackageExample.createCriteria().andTencentAudienceIdIn(audienceIds);
+        List<AdPutTencentPackage> packageList = adPutTencentPackageMapper.selectByExample(adPutTencentPackageExample);
+        Map<Long, AdPutTencentPackage> packageMap = packageList.stream()
+                .collect(Collectors.toMap(AdPutTencentPackage::getTencentAudienceId, Function.identity()));
+        for (AdPutTencentAudienceInfo audienceInfo : crowdInfoList) {
+            if (packageMap.containsKey(audienceInfo.getAudience_id())) {
+                continue;
+            }
+            AdPutTencentPackage adPackage = new AdPutTencentPackage();
+            for (AdPutTencentPackageKeyEnum packageKeyEnum : AdPutTencentPackageKeyEnum.values()) {
+                if (audienceInfo.getName().startsWith(packageKeyEnum.getPackageKey())) {
+                    adPackage.setPackageKey(packageKeyEnum.getPackageKey());
+                    adPackage.setPackageName(packageKeyEnum.getPackageName());
+                    adPackage.setMinPeople(packageKeyEnum.getMinPeople());
+                    break;
+                }
+            }
+            adPackage.setAccountId(Long.valueOf(accountId));
+            if (Objects.isNull(adPackage.getPackageKey())) {
+                adPackage.setPackageKey(audienceInfo.getName());
+                adPackage.setPackageName(audienceInfo.getName());
+                adPackage.setMinPeople(AdPutTencentPackageKeyEnum.other.getMinPeople());
+            }
+            adPackage.setPackageDesc(audienceInfo.getDescription());
+            adPackage.setAppId("wx89e7eb06478361d7");
+            for (AdPutTencentPackageUserIdTypeEnum userIdTypeEnum : AdPutTencentPackageUserIdTypeEnum.values()) {
+                if (audienceInfo.getName().contains(userIdTypeEnum.getKey())) {
+                    adPackage.setUserIdType(userIdTypeEnum.getKey());
+                    break;
+                }
+            }
+            if (Objects.isNull(adPackage.getUserIdType())) {
+                adPackage.setUserIdType(AdPutTencentPackageUserIdTypeEnum.WX_OPENID.getKey());
+            }
+            adPackage.setTencentAudienceId(audienceInfo.getAudience_id());
+            adPackage.setTencentStatus("SUCCESS");
+            adPackage.setStatus(4);
+            adPackage.setAutoUpdate(0);
+            adPackage.setIsDelete(1);
+            adPackage.setCreateTime(new Date());
+            adPackage.setUpdateTime(new Date());
+            adPutTencentPackageMapper.insertSelective(adPackage);
+        }
+    }
+
+    private List<AdPutTencentPackage> getPackageList() {
+        AdPutTencentPackageExample adPutTencentPackageExample = new AdPutTencentPackageExample();
+        adPutTencentPackageExample.createCriteria().andIsDeleteEqualTo(0).andStatusEqualTo(AdPackageStatus.TENCENT_SUCCESS.getCode());
+        return adPutTencentPackageMapper.selectByExample(adPutTencentPackageExample);
+    }
+
+    private AdPutTencentPackage getPackageByAudienceId(Long audienceId) {
+        AdPutTencentPackageExample adPutTencentPackageExample = new AdPutTencentPackageExample();
+        adPutTencentPackageExample.createCriteria().andTencentAudienceIdEqualTo(audienceId);
+        List<AdPutTencentPackage> packageList = adPutTencentPackageMapper.selectByExample(adPutTencentPackageExample);
+        if (CollectionUtil.isEmpty(packageList)) {
+            return null;
+        }
+        return packageList.get(0);
+    }
+
+    @XxlJob("startDynamicBidTask")
+    public ReturnT<String> startDynamicBidTask(String param) {
+        List<String> datesFromPast;
+        if (StringUtils.isNotBlank(param)) {
+            // dt
+            datesFromPast = getDatesFromPast(Integer.parseInt(param), Integer.parseInt(param));
+        } else {
+            datesFromPast = getDatesFromPast(4, 7);
+        }
+
+        String now = getDayStr();
+        // 配置
+        AdTencentDynamicConfig adTencentDynamicConfig = getDynamicConfig(dynamicConfigStr);
+        // 处理数据集
+        AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+        adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andIsDynamicBidEqualTo(1);
+        List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+        for (AdPutTencentAd adPutTencentAd : adPutTencentAds) {
+            Long adId = adPutTencentAd.getAdId();
+            // 获取基础数据
+            AdPutTencentDynamicBid adPutTencentDynamicBid = getDynamicBidVo(adPutTencentAd, datesFromPast, now, adTencentDynamicConfig);
+            // 查询时间内消耗数据
+            AdPutTencentAdDataExample adPutTencentAdDataExample = new AdPutTencentAdDataExample();
+            adPutTencentAdDataExample.createCriteria().andIsDeleteEqualTo(0).andAdIdEqualTo(adId).andDtIn(datesFromPast);
+            List<AdPutTencentAdData> adPutTencentAdData = adPutTencentAdDataMapper.selectByExample(adPutTencentAdDataExample);
+            // case1 不存在数据 不调价
+            if (CollectionUtil.isEmpty(adPutTencentAdData)) {
+                // 不调价
+                adPutTencentDynamicBid.setStatus(DynamicBidStatus.NO_ONE.getCode());
+                adPutTencentDynamicBid.setNextBid(adPutTencentAd.getBidAmount());
+                adPutTencentDynamicBid.setLastBid(adPutTencentAd.getBidAmount());
+                adPutTencentDynamicBidMapper.insertSelective(adPutTencentDynamicBid);
+                logBid(AdPutTencentDynamicBidLog.builder()
+                        .adId(adPutTencentAd.getAdId())
+                        .rooSourceIds(adPutTencentAd.getRootSourceId())
+                        .dt(now)
+                        .bidStatus(AdTencentDynamicBidStatus.NO_DATA.getCode())
+                        .build());
+                continue;
+            }
+            // 处理不满足消耗占比的数据
+            List<AdPutTencentDynamicBidDtLog> adPutTencentDynamicBidDtLogList = getEnoughCostData(adPutTencentAd, adPutTencentAdData,
+                    adTencentDynamicConfig, now);
+            // 检查是否存在消耗足够的数据
+            List<AdPutTencentDynamicBidDtLog> adPutTencentDynamicBidDtLogs = adPutTencentDynamicBidDtLogList.stream()
+                    .filter(x -> x.getStatus().equals(AdPutDynamicBidDtStatus.PARTICIPATE_CAL.getCode())).collect(Collectors.toList());
+            // case2 全部为不置信数据 固定加价
+            if (CollectionUtil.isEmpty(adPutTencentDynamicBidDtLogs)) {
+                // 存在消耗的数据集 全都消耗未达标 加价
+                addBid(adPutTencentAd, adPutTencentDynamicBidDtLogList, adPutTencentAdData, adTencentDynamicConfig, now, adPutTencentDynamicBid);
+                continue;
+            }
+            // case3 存在置信数据 计算相关数据 然后等待大数据更新收益数据给出新出价
+            // 获取置信数据dt
+            List<String> sumDts = adPutTencentDynamicBidDtLogs.stream().map(AdPutTencentDynamicBidDtLog::getClickDt).collect(Collectors.toList());
+            adPutTencentDynamicBid.setSumDts(String.join(",", sumDts));
+            // 参与计算数据
+            List<AdPutTencentAdData> adPutTencentAdDataCost = adPutTencentAdData.stream().filter(x ->
+                    sumDts.contains(x.getDt())
+            ).collect(Collectors.toList());
+            Long avgBid = calAvgBid(adPutTencentAdDataCost);
+            adPutTencentDynamicBid.setLastBid(avgBid);
+            adPutTencentDynamicBid.setOneFourCpc(avgBid);
+            adPutTencentDynamicBid.setOneFourClick(CalculatorUtil.sumOfLongs(
+                    adPutTencentAdDataCost.parallelStream().map(AdPutTencentAdData::getValidClickCount).collect(Collectors.toList())));
+            adPutTencentDynamicBid.setOneFourCost(CalculatorUtil.sumOfLongs(
+                    adPutTencentAdDataCost.parallelStream().map(AdPutTencentAdData::getCost).collect(Collectors.toList())));
+            adPutTencentDynamicBid.setTargetRoi(adTencentDynamicConfig.getIncomeMultiple().get(adPutTencentAd.getMarketingGoal()));
+            adPutTencentDynamicBid.setStatus(DynamicBidStatus.ZERO.getCode());
+            adPutTencentDynamicBidMapper.insertSelective(adPutTencentDynamicBid);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+    @XxlJob("updateDynamicBidTask")
+    public ReturnT<String> updateDynamicBidTask(String param) {
+        String now = getDayStr();
+        // 配置
+        AdTencentDynamicConfig adTencentDynamicConfig = getDynamicConfig(dynamicConfigStr);
+        AdPutTencentDynamicBidExample adPutTencentDynamicBidExample = new AdPutTencentDynamicBidExample();
+        adPutTencentDynamicBidExample.createCriteria().andIsDeleteEqualTo(0).andDtEqualTo(now).andStatusEqualTo(DynamicBidStatus.ONE.getCode());
+        List<AdPutTencentDynamicBid> adPutTencentDynamicBids = adPutTencentDynamicBidMapper.selectByExample(adPutTencentDynamicBidExample);
+        for (AdPutTencentDynamicBid adPutTencentDynamicBid : adPutTencentDynamicBids) {
+            AdPutTencentAdExample adPutTencentAdExample = new AdPutTencentAdExample();
+            adPutTencentAdExample.createCriteria().andIsDeleteEqualTo(0).andAdIdEqualTo(adPutTencentDynamicBid.getAdId());
+            List<AdPutTencentAd> adPutTencentAds = adPutTencentAdMapper.selectByExample(adPutTencentAdExample);
+            AdPutTencentAd adPutTencentAd = adPutTencentAds.get(0);
+            Long avgBid = adPutTencentDynamicBid.getOneFourCpc();
+            Long oneFourCost = adPutTencentDynamicBid.getOneFourCost();
+            Long oneFourEarnings = Objects.isNull(adPutTencentDynamicBid.getOneFourEarnings()) ? 0 : adPutTencentDynamicBid.getOneFourEarnings();
+            double roi = CalculatorUtil.divideWithTwoDecimalPlaces(oneFourEarnings, oneFourCost).doubleValue();
+            double targetRoi = adPutTencentDynamicBid.getTargetRoi();
+            double costCoefficient = CalculatorUtil.divideWithBigDecimal(roi, targetRoi);
+            Long newBid;
+            Integer bidStatus = -999;
+            if (costCoefficient <= 0.6) {
+                // 绝对低价 通知
+                newBid = 2L;
+                bidStatus = AdTencentDynamicBidStatus.LOW_BID.getCode();
+            } else if (costCoefficient > 0.6 && costCoefficient <= 0.9) {
+                // 稍微减价 继续观察
+                newBid = Math.max(avgBid - adTencentDynamicConfig.getAddBid(), 2L);
+                bidStatus = AdTencentDynamicBidStatus.LOW_EXCESSIVE.getCode();
+            } else if (costCoefficient > 0.9 && costCoefficient <= 1.3) {
+                // roi在目标roi一定范围  不做出价调整
+                newBid = avgBid;
+                bidStatus = AdTencentDynamicBidStatus.TARGET.getCode();
+            } else {
+                // 计算调整出价
+                // 调整差值 最大不+-20
+                long adjustNum = (long) (costCoefficient * avgBid - avgBid);
+                adjustNum = Math.min(adjustNum, 20);
+                newBid = Math.min(avgBid + adjustNum, 99);
+                bidStatus = AdTencentDynamicBidStatus.HIGH_ADD_BID.getCode();
+            }
+            // 更新广告出价
+            // 更新出价
+            adPutTencentCommonService.updateAdGroupBid(adPutTencentAd.getAccountId() + "", adPutTencentAd.getAdId() + "", Math.toIntExact(newBid));
+
+            adPutTencentDynamicBid.setLastBid(avgBid);
+            adPutTencentDynamicBid.setNextBid(newBid);
+            adPutTencentDynamicBid.setStatus(DynamicBidStatus.THREE.getCode());
+            adPutTencentDynamicBidMapper.insertSelective(adPutTencentDynamicBid);
+            logBid(AdPutTencentDynamicBidLog.builder()
+                    .adId(adPutTencentAd.getAdId())
+                    .sumDts(Arrays.asList(adPutTencentDynamicBid.getSumDts().split(",")))
+                    .rooSourceIds(adPutTencentAd.getRootSourceId())
+                    .avgBid(avgBid)
+                    .newBid(newBid)
+                    .beforeDayBid(adPutTencentAd.getBidAmount())
+                    .dt(now)
+                    .bidStatus(bidStatus)
+                    .dtLogs(new ArrayList<>())
+                    .build());
+            // 更新广告出价
+            updateAdBidAmount(adPutTencentAd, newBid);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+    private void addBid(AdPutTencentAd adPutTencentAd, List<AdPutTencentDynamicBidDtLog> adPutTencentDynamicBidDtLogList,
+                        List<AdPutTencentAdData> adPutTencentAdData,
+                        AdTencentDynamicConfig adTencentDynamicConfig, String now,
+                        AdPutTencentDynamicBid adPutTencentDynamicBid) {
+        // 计算平均出价
+        Long avgBid = calAvgBid(adPutTencentAdData);
+        // 固定加价
+        Long addBid = adTencentDynamicConfig.getAddBid();
+        if (Objects.isNull(addBid)) {
+            addBid = 5L;
+        }
+        long newBid = Math.min(avgBid + addBid, 99);
+        // 更新出价
+        adPutTencentCommonService.updateAdGroupBid(adPutTencentAd.getAccountId() + "", adPutTencentAd.getAdId() + "", (int) newBid);
+
+        adPutTencentDynamicBid.setLastBid(avgBid);
+        adPutTencentDynamicBid.setNextBid(newBid);
+        adPutTencentDynamicBid.setStatus(DynamicBidStatus.THREE.getCode());
+        adPutTencentDynamicBidMapper.insertSelective(adPutTencentDynamicBid);
+        logBid(AdPutTencentDynamicBidLog.builder()
+                .adId(adPutTencentAd.getAdId())
+                .rooSourceIds(adPutTencentAd.getRootSourceId())
+                .avgBid(avgBid)
+                .newBid(newBid)
+                .beforeDayBid(adPutTencentAd.getBidAmount())
+                .dt(now)
+                .bidStatus(AdTencentDynamicBidStatus.NO_ENOUGH_OST.getCode())
+                .dtLogs(adPutTencentDynamicBidDtLogList)
+                .build());
+        // 更新广告出价
+        updateAdBidAmount(adPutTencentAd, newBid);
+    }
+
+    private void logBid(AdPutTencentDynamicBidLog adPutTencentDynamicBidLog) {
+        logCenterFeign.logUpload(getLogUploadInfo(adPutTencentDynamicBidLog));
+    }
+
+    private String getLogUploadInfo(AdPutTencentDynamicBidLog requestLogVo) {
+        CommonLogRequest<List<JSONObject>> commonLogRequest = new CommonLogRequest<>();
+        BaseLogInfoDTO baseInfo = new BaseLogInfoDTO();
+        List<JSONObject> detail = new ArrayList<>();
+
+
+        LogDetailInfo logDetailInfo = new LogDetailInfo();
+        logDetailInfo.setLogUploadType(DYNAMIC_BID_LOG_KEY);
+        JSONObject params = (JSONObject) JSONObject.toJSON(requestLogVo);
+        logDetailInfo.setParams(params);
+
+        detail.add((JSONObject) JSONObject.toJSON(logDetailInfo));
+
+        commonLogRequest.setBaseInfo(baseInfo);
+        commonLogRequest.setDetail(detail);
+        return JSON.toJSONString(commonLogRequest);
+    }
+
+    private void updateAdBidAmount(AdPutTencentAd adPutTencentAd, long newBid) {
+        adPutTencentAd.setBidAmount(newBid);
+        adPutTencentAdMapper.updateByPrimaryKeySelective(adPutTencentAd);
+    }
+
+    private Long calAvgBid(List<AdPutTencentAdData> adPutTencentAdData) {
+        List<Long> bids = adPutTencentAdData.parallelStream().map(AdPutTencentAdData::getBidAmount).collect(Collectors.toList());
+        return CalculatorUtil.calculateAverageAndCeil(bids);
+    }
+
+    private List<AdPutTencentDynamicBidDtLog> getEnoughCostData(AdPutTencentAd adPutTencentAd, List<AdPutTencentAdData> adPutTencentAdData,
+                                                                AdTencentDynamicConfig adTencentDynamicConfig, String now) {
+        return adPutTencentAdData.stream().map(x -> {
+            boolean isEnough;
+            Long costAmount = x.getCostLimit();
+            Long cost = x.getCost();
+            if (Objects.isNull(costAmount) || costAmount == 0) {
+                isEnough = x.getValidClickCount() > 50;
+            } else {
+                isEnough = ((double) cost / costAmount) > adTencentDynamicConfig.getIncomeMultiple().get(adPutTencentAd.getMarketingGoal());
+            }
+            return AdPutTencentDynamicBidDtLog.builder()
+                    .clickDt(x.getDt())
+                    .dt(now)
+                    .cost(x.getCost())
+                    .status(isEnough ? AdPutDynamicBidDtStatus.PARTICIPATE_CAL.getCode() : AdPutDynamicBidDtStatus.UNDER_CONSUMPTION.getCode())
+                    .dayCostLimit(costAmount)
+                    .cpc(x.getCpc())
+                    .bidAmount(x.getBidAmount())
+                    .build();
+        }).collect(Collectors.toList());
+    }
+
+    private AdTencentDynamicConfig getDynamicConfig(String dynamicConfigStr) {
+        if (StringUtils.isNotBlank(dynamicConfigStr)) {
+            return JSON.parseObject(dynamicConfigStr, AdTencentDynamicConfig.class);
+        }
+        return null;
+    }
+
+    private AdPutTencentDynamicBid getDynamicBidVo(AdPutTencentAd adPutTencentAd, List<String> datesFromPast, String now, AdTencentDynamicConfig adTencentDynamicConfig) {
+        AdPutTencentDynamicBid adPutTencentDynamicBid = new AdPutTencentDynamicBid();
+        adPutTencentDynamicBid.setAdId(adPutTencentAd.getAdId());
+        adPutTencentDynamicBid.setDtFrom(datesFromPast.get(0));
+        adPutTencentDynamicBid.setDtTo(datesFromPast.get(datesFromPast.size() - 1));
+        adPutTencentDynamicBid.setLastBid(adPutTencentAd.getBidAmount());
+        adPutTencentDynamicBid.setTargetRoi(adTencentDynamicConfig.getIncomeMultiple().get(adPutTencentAd.getMarketingGoal()));
+        adPutTencentDynamicBid.setDt(now);
+        return adPutTencentDynamicBid;
+    }
+
+
+    public static List<String> getDatesFromPast(int startDaysAgo, int endDaysAgo) {
+        List<String> dates = new ArrayList<>();
+        LocalDate today = LocalDate.now();
+
+        // 确保startDaysAgo小于或等于endDaysAgo
+        if (startDaysAgo > endDaysAgo) {
+            throw new IllegalArgumentException("startDaysAgo should be less than or equal to endDaysAgo");
+        }
+
+        for (int i = startDaysAgo; i <= endDaysAgo; i++) {
+            LocalDate date = today.minusDays(i);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            dates.add(date.format(formatter));
+        }
+
+        // 反转列表以实现倒序
+        Collections.reverse(dates);
+        return dates;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(getDatesFromPast(4, 7));
+    }
+
+
+    @NotNull
+    private static AdPutTencentAdData getAdPutTencentAdData(AdPutTencentAd adPutTencentAd, List<AdPutTencentAdCostData> adGroupDatas, Long dailyBudget) {
+        AdPutTencentAdCostData adPutTencentAdCostData = adGroupDatas.get(0);
+        AdPutTencentAdData adPutTencentAdData = new AdPutTencentAdData();
+        adPutTencentAdData.setAdId(adPutTencentAd.getAdId());
+        adPutTencentAdData.setValidClickCount(adPutTencentAdCostData.getValid_click_count());
+        adPutTencentAdData.setClickUserCount(adPutTencentAdCostData.getClick_user_count());
+        adPutTencentAdData.setViewCount(adPutTencentAdCostData.getView_count());
+        adPutTencentAdData.setViewUserCount(adPutTencentAdCostData.getView_user_count());
+        adPutTencentAdData.setCost(adPutTencentAdCostData.getCost());
+        adPutTencentAdData.setCostLimit(dailyBudget);
+        adPutTencentAdData.setCpc(adPutTencentAdCostData.getCpc());
+        adPutTencentAdData.setBidAmount(adPutTencentAd.getBidAmount());
+        adPutTencentAdData.setConversionsCount(adPutTencentAdCostData.getConversions_count());
+        adPutTencentAdData.setFromFollowUv(adPutTencentAdCostData.getFrom_follow_uv());
+        adPutTencentAdData.setDt(adPutTencentAdCostData.getDate());
+        adPutTencentAdData.setKeyPageViewCount(adPutTencentAdCostData.getKey_page_view_count());
+        adPutTencentAdData.setRegisterByClickCount(adPutTencentAdCostData.getRegister_by_click_count());
+        adPutTencentAdData.setFromFollowByClickUv(adPutTencentAdCostData.getFrom_follow_by_click_uv());
+        adPutTencentAdData.setBizFollowUv(adPutTencentAdCostData.getBiz_follow_uv());
+        adPutTencentAdData.setRegPv(adPutTencentAdCostData.getReg_pv());
+        return adPutTencentAdData;
+    }
+
+
+    private String getLastDayStr() {
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+
+        // 获取前一日的日期
+        LocalDate yesterday = today.minusDays(1);
+
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        // 将前一日的日期格式化为字符串
+        return yesterday.format(formatter);
+    }
+
+    private String getDayStr() {
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+
+        // 获取前一日的日期
+//        LocalDate yesterday = today.minusDays(1);
+
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        // 将前一日的日期格式化为字符串
+        return today.format(formatter);
+    }
+
+    private String getNowDayTimeStr() {
+        // 获取当前日期
+        LocalDateTime today = LocalDateTime.now();
+
+        // 获取前一日的日期
+//        LocalDate yesterday = today.minusDays(1);
+
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        // 将前一日的日期格式化为字符串
+        return today.format(formatter);
+    }
+
+    @XxlJob("syncTencentAccountBalance")
+    public ReturnT<String> syncTencentAccountBalance(String param) {
+        AdPutTencentAccountExample adPutTencentAccountExample = new AdPutTencentAccountExample();
+        adPutTencentAccountExample.createCriteria().andIsDeleteEqualTo(0).andStatusEqualTo(1);
+        List<AdPutTencentAccount> adPutTencentAccounts = adPutTencentAccountMapper.selectByExample(adPutTencentAccountExample);
+        for (AdPutTencentAccount adPutTencentAccount : adPutTencentAccounts) {
+            // 获取账户余额
+            List<AdPutTencentAccountBalance> balanceList = adPutTencentCommonService.getAccountBalance(adPutTencentAccount.getAccountId());
+            if (CollectionUtil.isEmpty(balanceList)) {
+                continue;
+            }
+            Integer balance = 0;
+            for (AdPutTencentAccountBalance adPutTencentAccountBalance : balanceList) {
+                balance += adPutTencentAccountBalance.getBalance();
+            }
+            adPutTencentAccount.setBalance(balance);
+            adPutTencentAccountMapper.updateByPrimaryKeySelective(adPutTencentAccount);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("checkAdTencentPutUserTokenExpire")
+    public ReturnT<String> checkAdTencentPutUserTokenExpire(String param) {
+        Long expireTime = adOwnRedisUtils.getKeyExpire(EnumRedisPrefix.AD_TENCENT_USER_TOKEN.getPrefix());
+        if (expireTime < 3 * 24 * 60 * 60) {
+            try {
+                long hour = expireTime / 3600;
+                String text = "用户实名认证token即将过期,剩余" + hour + "小时\n" +
+                        "请点击如下链接进行认证: \n" +
+                        "https://ad.qq.com/account-center/single/user-authorize?redirect_uri=" +
+                        URLEncoder.encode("https://api.piaoquantv.com/ad/put/tencent/callback/usertoken", "UTF-8");
+                sendFeishuAlert(text);
+            } catch (Exception e) {
+                log.error("checkAdTencentPutUserTokenExpire error", e);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("dailyCheckAdTencentPutUserTokenExpire")
+    public ReturnT<String> dailyCheckAdTencentPutUserTokenExpire(String param) {
+        Long expireTime = adOwnRedisUtils.getKeyExpire(EnumRedisPrefix.AD_TENCENT_USER_TOKEN.getPrefix());
+        try {
+            long hour = expireTime / 3600;
+            long days = hour / 24;
+            String text = "用户实名认证token每日剩余过期时间报警,剩余" + hour + "小时," + days + "天\n" +
+                    "如想更新,请点击如下链接进行认证: \n" +
+                    "https://ad.qq.com/account-center/single/user-authorize?redirect_uri=" +
+                    URLEncoder.encode("https://api.piaoquantv.com/ad/put/tencent/callback/usertoken", "UTF-8");
+            sendFeishuAlert(text);
+        } catch (Exception e) {
+            log.error("dailyCheckAdTencentPutUserTokenExpire error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private void sendFeishuAlert(String text) {
+        try {
+            // 构建飞书消息格式
+            JSONObject content = new JSONObject();
+            content.put("text", text);
+
+            JSONObject message = new JSONObject();
+            message.put("msg_type", "text");
+            message.put("content", content);
+
+            // 发送飞书消息
+            String response = feiShuService.sendMsg(message.toJSONString(), userTokenExpireRobotUrl);
+            log.info("Feishu alert sent successfully, response: {}", response);
+
+        } catch (Exception e) {
+            log.error("Failed to send Feishu alert", e);
+        }
+    }
+}

+ 1 - 1
core/src/main/java/com/tzld/rta/model/DynamicContentInfoModel.java → core/src/main/java/com/tzld/ad/model/DynamicContentInfoModel.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.model;
+package com.tzld.ad.model;
 
 import lombok.Data;
 

+ 1 - 1
core/src/main/java/com/tzld/rta/model/DynamicProductInfoModel.java → core/src/main/java/com/tzld/ad/model/DynamicProductInfoModel.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.model;
+package com.tzld.ad.model;
 
 import lombok.Data;
 

+ 1 - 1
core/src/main/java/com/tzld/rta/model/RtaRequestModel.java → core/src/main/java/com/tzld/ad/model/RtaRequestModel.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.model;
+package com.tzld.ad.model;
 
 import lombok.Data;
 

+ 1 - 1
core/src/main/java/com/tzld/rta/model/RtaResponseModel.java → core/src/main/java/com/tzld/ad/model/RtaResponseModel.java

@@ -1,4 +1,4 @@
-package com.tzld.rta.model;
+package com.tzld.ad.model;
 
 import lombok.Builder;
 import lombok.Data;

+ 26 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdAutoPackageParam.java

@@ -0,0 +1,26 @@
+package com.tzld.ad.model.adPut;
+
+import java.util.List;
+
+public class AdAutoPackageParam {
+
+    private Long adId;
+
+    private List<String> packageKeys;
+
+    public Long getAdId() {
+        return adId;
+    }
+
+    public void setAdId(Long adId) {
+        this.adId = adId;
+    }
+
+    public List<String> getPackageKeys() {
+        return packageKeys;
+    }
+
+    public void setPackageKeys(List<String> packageKeys) {
+        this.packageKeys = packageKeys;
+    }
+}

+ 123 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPuTencentTargeting.java

@@ -0,0 +1,123 @@
+package com.tzld.ad.model.adPut;
+
+import java.util.List;
+import java.util.Map;
+
+public class AdPuTencentTargeting {
+
+    private ExcludedConvertedAudience excluded_converted_audience;
+
+    private RegionTarget geo_location;
+
+    private List<String> network_type;
+
+    private List<String> gender;
+
+    private List<String> education;
+
+    private List<Map<String,Integer>> age;
+
+    private List<Long> custom_audience;
+
+    public ExcludedConvertedAudience getExcluded_converted_audience() {
+        return excluded_converted_audience;
+    }
+
+    public void setExcluded_converted_audience(ExcludedConvertedAudience excluded_converted_audience) {
+        this.excluded_converted_audience = excluded_converted_audience;
+    }
+
+    public RegionTarget getGeo_location() {
+        return geo_location;
+    }
+
+
+    public List<String> getGender() {
+        return gender;
+    }
+
+    public void setGender(List<String> gender) {
+        this.gender = gender;
+    }
+
+    public List<String> getEducation() {
+        return education;
+    }
+
+    public void setEducation(List<String> education) {
+        this.education = education;
+    }
+
+    public void setGeo_location(RegionTarget geo_location) {
+        this.geo_location = geo_location;
+    }
+
+    public List<String> getNetwork_type() {
+        return network_type;
+    }
+
+    public void setNetwork_type(List<String> network_type) {
+        this.network_type = network_type;
+    }
+
+    public List<Map<String, Integer>> getAge() {
+        return age;
+    }
+
+    public void setAge(List<Map<String, Integer>> age) {
+        this.age = age;
+    }
+
+    public List<Long> getCustom_audience() {
+        return custom_audience;
+    }
+
+    public void setCustom_audience(List<Long> custom_audience) {
+        this.custom_audience = custom_audience;
+    }
+}
+
+
+class ExcludedConvertedAudience{
+    private String excluded_dimension;
+
+    private List<String> conversion_behavior_list;
+
+    public String getExcluded_dimension() {
+        return excluded_dimension;
+    }
+
+    public void setExcluded_dimension(String excluded_dimension) {
+        this.excluded_dimension = excluded_dimension;
+    }
+
+    public List<String> getConversion_behavior_list() {
+        return conversion_behavior_list;
+    }
+
+    public void setConversion_behavior_list(List<String> conversion_behavior_list) {
+        this.conversion_behavior_list = conversion_behavior_list;
+    }
+}
+
+class RegionTarget{
+    private List<Integer> regions;
+
+    private List<String> location_types;
+
+    public List<Integer> getRegions() {
+        return regions;
+    }
+
+    public void setRegions(List<Integer> regions) {
+        this.regions = regions;
+    }
+
+    public List<String> getLocation_types() {
+        return location_types;
+    }
+
+    public void setLocation_types(List<String> location_types) {
+        this.location_types = location_types;
+    }
+}

+ 30 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutAccount.java

@@ -0,0 +1,30 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class AdPutAccount {
+
+    private String accountId;
+
+    private String accountName;
+
+
+//    public String getAccountId() {
+//        return accountId;
+//    }
+//
+//    public void setAccountId(String accountId) {
+//        this.accountId = accountId;
+//    }
+//
+//    public String getAccountName() {
+//        return accountName;
+//    }
+//
+//    public void setAccountName(String accountName) {
+//        this.accountName = accountName;
+//    }
+}

+ 14 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutCreativeComponentCostData.java

@@ -0,0 +1,14 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Data;
+
+@Data
+public class AdPutCreativeComponentCostData {
+    private Long accountId;
+    private Long adId;
+    private Long creativeId;
+    private String creativeName;
+    private Long cost;
+    private String marketingCarrierDetail;
+    private String creativeComponents;
+}

+ 16 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutPeoplePackage.java

@@ -0,0 +1,16 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Builder;
+import lombok.Data;
+
+@Builder
+@Data
+public class AdPutPeoplePackage {
+
+    private Long id;
+
+    private String packageName;
+
+    private String packageKey;
+
+}

+ 40 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAccountBalance.java

@@ -0,0 +1,40 @@
+package com.tzld.ad.model.adPut;
+
+public class AdPutTencentAccountBalance {
+    private String fundType;
+    private Integer balance;
+    private String fundStatus;
+    private Integer realtimeCost;
+
+    public String getFundType() {
+        return fundType;
+    }
+
+    public void setFundType(String fundType) {
+        this.fundType = fundType;
+    }
+
+    public Integer getBalance() {
+        return balance;
+    }
+
+    public void setBalance(Integer balance) {
+        this.balance = balance;
+    }
+
+    public String getFundStatus() {
+        return fundStatus;
+    }
+
+    public void setFundStatus(String fundStatus) {
+        this.fundStatus = fundStatus;
+    }
+
+    public Integer getRealtimeCost() {
+        return realtimeCost;
+    }
+
+    public void setRealtimeCost(Integer realtimeCost) {
+        this.realtimeCost = realtimeCost;
+    }
+}

+ 19 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAccountExt.java

@@ -0,0 +1,19 @@
+package com.tzld.ad.model.adPut;
+
+import com.tzld.ad.model.po.adput.AdPutTencentAccount;
+
+import java.util.List;
+
+public class AdPutTencentAccountExt extends AdPutTencentAccount {
+
+    private List<AdPutTencentAccount> sList;
+
+    public List<AdPutTencentAccount> getsList() {
+        return sList;
+    }
+
+    public void setsList(List<AdPutTencentAccount> sList) {
+        this.sList = sList;
+    }
+}
+

+ 10 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentActionTrace.java

@@ -0,0 +1,10 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AdPutTencentActionTrace {
+    private String clickId;
+}

+ 11 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentActionUserId.java

@@ -0,0 +1,11 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AdPutTencentActionUserId {
+    private String wechatOpenid;
+    private String wechatAppId;
+}

+ 155 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdCostData.java

@@ -0,0 +1,155 @@
+package com.tzld.ad.model.adPut;
+
+public class AdPutTencentAdCostData {
+
+    private Long account_id;
+
+    private Long click_user_count;
+
+    private Long cost;
+
+    private Long valid_click_count;
+
+    private Long view_count;
+
+    private Long view_user_count;
+
+    private String date;
+
+    private Long cpc;
+
+    private Long conversions_count;
+
+    private Long from_follow_uv;
+    //关键页面访问次数
+    private Long key_page_view_count;
+    //注册次数(点击归因)。用户完成注册行为的次数(仅统计点击归因部分)
+    private Long register_by_click_count;
+    //公众号关注人数(点击归因)。完成关注行为的独立用户数,包括非微信流量客户上报+平台上报的数据(该指标仅统计点击归因部分数据)
+    private Long from_follow_by_click_uv;
+    //公众号关注人数(平台上报)。完成公众号关注行为的独立用户数(该指标由平台上报数据,仅微信流量统计)
+    private Long biz_follow_uv;
+    //注册次数。用户完成注册行为的次数
+    private Long reg_pv;
+
+
+    public Long getReg_pv() {
+        return reg_pv;
+    }
+
+    public void setReg_pv(Long reg_pv) {
+        this.reg_pv = reg_pv;
+    }
+
+    public Long getKey_page_view_count() {
+        return key_page_view_count;
+    }
+
+    public void setKey_page_view_count(Long key_page_view_count) {
+        this.key_page_view_count = key_page_view_count;
+    }
+
+    public Long getRegister_by_click_count() {
+        return register_by_click_count;
+    }
+
+    public void setRegister_by_click_count(Long register_by_click_count) {
+        this.register_by_click_count = register_by_click_count;
+    }
+
+    public Long getFrom_follow_by_click_uv() {
+        return from_follow_by_click_uv;
+    }
+
+    public void setFrom_follow_by_click_uv(Long from_follow_by_click_uv) {
+        this.from_follow_by_click_uv = from_follow_by_click_uv;
+    }
+
+    public Long getBiz_follow_uv() {
+        return biz_follow_uv;
+    }
+
+    public void setBiz_follow_uv(Long biz_follow_uv) {
+        this.biz_follow_uv = biz_follow_uv;
+    }
+
+    public Long getAccount_id() {
+        return account_id;
+    }
+
+    public void setAccount_id(Long account_id) {
+        this.account_id = account_id;
+    }
+
+    public Long getClick_user_count() {
+        return click_user_count;
+    }
+
+    public void setClick_user_count(Long click_user_count) {
+        this.click_user_count = click_user_count;
+    }
+
+    public Long getCost() {
+        return cost;
+    }
+
+    public void setCost(Long cost) {
+        this.cost = cost;
+    }
+
+    public Long getValid_click_count() {
+        return valid_click_count;
+    }
+
+    public void setValid_click_count(Long valid_click_count) {
+        this.valid_click_count = valid_click_count;
+    }
+
+    public Long getView_count() {
+        return view_count;
+    }
+
+    public void setView_count(Long view_count) {
+        this.view_count = view_count;
+    }
+
+    public Long getView_user_count() {
+        return view_user_count;
+    }
+
+    public void setView_user_count(Long view_user_count) {
+        this.view_user_count = view_user_count;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public Long getCpc() {
+        return cpc;
+    }
+
+    public void setCpc(Long cpc) {
+        this.cpc = cpc;
+    }
+
+    public Long getConversions_count() {
+        return conversions_count;
+    }
+
+    public void setConversions_count(Long conversions_count) {
+        this.conversions_count = conversions_count;
+    }
+
+    public Long getFrom_follow_uv() {
+        return from_follow_uv;
+    }
+
+    public void setFrom_follow_uv(Long from_follow_uv) {
+        this.from_follow_uv = from_follow_uv;
+    }
+}

+ 57 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdDetail.java

@@ -0,0 +1,57 @@
+package com.tzld.ad.model.adPut;
+
+import java.util.Date;
+
+public class AdPutTencentAdDetail {
+
+    private Long adId;
+
+    private Long accountId;
+
+    private String adName;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+
+    public Long getAdId() {
+        return adId;
+    }
+
+    public void setAdId(Long adId) {
+        this.adId = adId;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getAdName() {
+        return adName;
+    }
+
+    public void setAdName(String adName) {
+        this.adName = adName;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 28 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdGroupCursor.java

@@ -0,0 +1,28 @@
+package com.tzld.ad.model.adPut;
+
+import java.util.List;
+
+public class AdPutTencentAdGroupCursor {
+
+    private List<AdPutTencentAdGroupInfo> list;
+
+    private CursorPageInfo cursor_page_info;
+
+    public List<AdPutTencentAdGroupInfo> getList() {
+        return list;
+    }
+
+    public void setList(List<AdPutTencentAdGroupInfo> list) {
+        this.list = list;
+    }
+
+    public CursorPageInfo getCursor_page_info() {
+        return cursor_page_info;
+    }
+
+    public void setCursor_page_info(CursorPageInfo cursor_page_info) {
+        this.cursor_page_info = cursor_page_info;
+    }
+}
+
+

+ 141 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAdGroupInfo.java

@@ -0,0 +1,141 @@
+package com.tzld.ad.model.adPut;
+
+public class AdPutTencentAdGroupInfo {
+
+
+    private Long adgroup_id;
+
+    private Long daily_budget;
+
+    private AdPuTencentTargeting targeting;
+
+    private String configured_status;
+
+    private String system_status;
+
+    private String adgroup_name;
+
+    private String marketing_goal;
+
+    private String marketing_sub_goal;
+
+    private String marketing_carrier_type;
+
+    private String marketing_carrier_detail;
+    //广告优化目标类型 @see https://developers.e.qq.com/v3.0/docs/api/adgroups/get
+    private String optimization_goal;
+
+    //产品外部 id 数据,当推广产品类型是以下类型的时候,必须使用该字段,不允许使用 marketing_asset_id :
+    // MARKETING_TARGET_TYPE_APP_ANDROID,MARKETING_TARGET_TYPE_APP_IOS,MARKETING_TARGET_TYPE_APP_QUICK_APP,MARKETING_TARGET_TYPE_WECHAT_MINI_GAME
+    // ,MARKETING_TARGET_TYPE_WECHAT_CHANNELS,MARKETING_TARGET_TYPE_MINI_PROGRAM_WECHAT,MARKETING_TARGET_TYPE_WECHAT_CHANNELS_LIVE,
+    // MARKETING_TARGET_TYPE_WECHAT_CHANNELS_LIVE_RESERVATION,MARKETING_TARGET_TYPE_CONSUMER_PRODUCT,MARKETING_TARGET_TYPE_WECHAT_OFFICIAL_ACCOUNT,
+    // MARKETING_TARGET_TYPE_LOCAL_STORE,MARKETING_TARGET_TYPE_LOCAL_STORE_PACKAGE,MARKETING_TARGET_TYPE_COMMODITY_SET,MARKETING_TARGET_TYPE_WECHAT_WORK
+    // ,MARKETING_TARGET_TYPE_MINI_GAME_QQ,MARKETING_TARGET_TYPE_PC_GAME,MARKETING_TARGET_TYPE_WECHAT_STORE_PRODUCT.
+    private AdPutTencentMarketingAssetOuterSpec marketing_asset_outer_spec;
+
+    private Long bid_amount;
+
+    public AdPutTencentMarketingAssetOuterSpec getMarketing_asset_outer_spec() {
+        return marketing_asset_outer_spec;
+    }
+
+    public void setMarketing_asset_outer_spec(AdPutTencentMarketingAssetOuterSpec marketing_asset_outer_spec) {
+        this.marketing_asset_outer_spec = marketing_asset_outer_spec;
+    }
+
+    public String getOptimization_goal() {
+        return optimization_goal;
+    }
+
+    public void setOptimization_goal(String optimization_goal) {
+        this.optimization_goal = optimization_goal;
+    }
+
+    public Long getAdgroup_id() {
+        return adgroup_id;
+    }
+
+    public void setAdgroup_id(Long adgroup_id) {
+        this.adgroup_id = adgroup_id;
+    }
+
+    public Long getDaily_budget() {
+        return daily_budget;
+    }
+
+    public void setDaily_budget(Long daily_budget) {
+        this.daily_budget = daily_budget;
+    }
+
+    public AdPuTencentTargeting getTargeting() {
+        return targeting;
+    }
+
+    public void setTargeting(AdPuTencentTargeting targeting) {
+        this.targeting = targeting;
+    }
+
+    public String getConfigured_status() {
+        return configured_status;
+    }
+
+    public void setConfigured_status(String configured_status) {
+        this.configured_status = configured_status;
+    }
+
+    public String getSystem_status() {
+        return system_status;
+    }
+
+    public void setSystem_status(String system_status) {
+        this.system_status = system_status;
+    }
+
+    public String getAdgroup_name() {
+        return adgroup_name;
+    }
+
+    public void setAdgroup_name(String adgroup_name) {
+        this.adgroup_name = adgroup_name;
+    }
+
+    public String getMarketing_goal() {
+        return marketing_goal;
+    }
+
+    public void setMarketing_goal(String marketing_goal) {
+        this.marketing_goal = marketing_goal;
+    }
+
+    public Long getBid_amount() {
+        return bid_amount;
+    }
+
+    public void setBid_amount(Long bid_amount) {
+        this.bid_amount = bid_amount;
+    }
+
+    public String getMarketing_sub_goal() {
+        return marketing_sub_goal;
+    }
+
+    public void setMarketing_sub_goal(String marketing_sub_goal) {
+        this.marketing_sub_goal = marketing_sub_goal;
+    }
+
+    public String getMarketing_carrier_type() {
+        return marketing_carrier_type;
+    }
+
+    public void setMarketing_carrier_type(String marketing_carrier_type) {
+        this.marketing_carrier_type = marketing_carrier_type;
+    }
+
+    public String getMarketing_carrier_detail() {
+        return marketing_carrier_detail;
+    }
+
+    public void setMarketing_carrier_detail(String marketing_carrier_detail) {
+        this.marketing_carrier_detail = marketing_carrier_detail;
+    }
+}

+ 143 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentAudienceInfo.java

@@ -0,0 +1,143 @@
+package com.tzld.ad.model.adPut;
+
+public class AdPutTencentAudienceInfo {
+
+    private Long account_id;
+
+    private Long audience_id;
+
+    private Boolean cooperated;
+
+    private String created_time;
+    private  String description;
+
+    private Integer error_code;
+
+    private Boolean is_own;
+
+    private String last_modified_time;
+
+    private String name;
+
+    private String outer_audience_id;
+
+    private String source;
+
+    private String status;
+
+    private String type;
+
+    private Integer user_count;
+
+    public Long getAccount_id() {
+        return account_id;
+    }
+
+    public void setAccount_id(Long account_id) {
+        this.account_id = account_id;
+    }
+
+    public Long getAudience_id() {
+        return audience_id;
+    }
+
+    public void setAudience_id(Long audience_id) {
+        this.audience_id = audience_id;
+    }
+
+    public Boolean getCooperated() {
+        return cooperated;
+    }
+
+    public void setCooperated(Boolean cooperated) {
+        this.cooperated = cooperated;
+    }
+
+    public String getCreated_time() {
+        return created_time;
+    }
+
+    public void setCreated_time(String created_time) {
+        this.created_time = created_time;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Integer getError_code() {
+        return error_code;
+    }
+
+    public void setError_code(Integer error_code) {
+        this.error_code = error_code;
+    }
+
+    public Boolean getIs_own() {
+        return is_own;
+    }
+
+    public void setIs_own(Boolean is_own) {
+        this.is_own = is_own;
+    }
+
+    public String getLast_modified_time() {
+        return last_modified_time;
+    }
+
+    public void setLast_modified_time(String last_modified_time) {
+        this.last_modified_time = last_modified_time;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOuter_audience_id() {
+        return outer_audience_id;
+    }
+
+    public void setOuter_audience_id(String outer_audience_id) {
+        this.outer_audience_id = outer_audience_id;
+    }
+
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getUser_count() {
+        return user_count;
+    }
+
+    public void setUser_count(Integer user_count) {
+        this.user_count = user_count;
+    }
+}

+ 19 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentDailyData.java

@@ -0,0 +1,19 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Data;
+
+@Data
+public class AdPutTencentComponentDailyData {
+    private long accountID;
+    private long componentID;
+    private long dynamicCreativeId;
+    private long cost;
+    private long cpc;
+    private double ctr;
+    private String imageIDS;
+    private long validClickCount;
+    private String videoIDS;
+    private long viewCount;
+    private Long conversionsCount;
+    private Long fromFollowUv;
+}

+ 41 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentDetail.java

@@ -0,0 +1,41 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Data;
+
+@Data
+public class AdPutTencentComponentDetail {
+    private long accountID;
+    private long componentID;
+    private ComponentValue componentValue;
+    private long createdTime;
+    private long lastModifiedTime;
+    private String componentSubType;
+    private String componentCustomName;
+    private String generationType;
+    private boolean isDeleted;
+
+    @Data
+    public static class ComponentValue {
+        private Image image;
+        private Video video;
+    }
+    @Data
+    public static class Image {
+        private ImageValue value;
+    }
+
+    @Data
+    public static class ImageValue {
+        private String imageID;
+    }
+
+    @Data
+    public static class Video {
+        private VideoValue value;
+    }
+    @Data
+    public static class VideoValue {
+        private String videoID;
+        private String coverID;
+    }
+}

+ 29 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentImage.java

@@ -0,0 +1,29 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Data;
+
+@Data
+public class AdPutTencentComponentImage {
+    private String imageID;
+    private long width;
+    private long height;
+    private long fileSize;
+    private String type;
+    private String signature;
+    private String description;
+    private String sourceSignature;
+    private String previewURL;
+    private String thumbPreviewURL;
+    private String sourceType;
+    private String imageUsage;
+    private long createdTime;
+    private long lastModifiedTime;
+    private long productCatalogID;
+    private String productOuterID;
+    private String sourceReferenceID;
+    private String ownerAccountID;
+    private String status;
+    private String sampleAspectRatio;
+    private String sourceMaterialID;
+    private String newSourceType;
+}

+ 42 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentComponentVideo.java

@@ -0,0 +1,42 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Data;
+
+@Data
+public class AdPutTencentComponentVideo {
+    private long videoID;
+    private long width;
+    private long height;
+    private long videoFrames;
+    private long videoFPS;
+    private String videoCodec;
+    private long videoBitRate;
+    private String audioCodec;
+    private long audioBitRate;
+    private long fileSize;
+    private String type;
+    private String signature;
+    private String systemStatus;
+    private String description;
+    private String previewURL;
+    private String keyFrameImageURL;
+    private long createdTime;
+    private long lastModifiedTime;
+    private String videoProfileName;
+    private long audioSampleRate;
+    private long maxKeyframeInterval;
+    private long minKeyframeInterval;
+    private String sampleAspectRatio;
+    private String audioProfileName;
+    private String scanType;
+    private long imageDurationMillisecond;
+    private long audioDurationMillisecond;
+    private String sourceType;
+    private String productCatalogID;
+    private String productOuterID;
+    private String sourceReferenceID;
+    private String ownerAccountID;
+    private String status;
+    private String sourceMaterialID;
+    private String newSourceType;
+}

+ 198 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeCostData.java

@@ -0,0 +1,198 @@
+package com.tzld.ad.model.adPut;
+
+/**
+ * 文档
+ * <a href="https://developers.e.qq.com/v3.0/docs/api/daily_reports/get">...</a>
+ */
+public class AdPutTencentCreativeCostData {
+
+    private String date;
+
+    private Long dynamic_creative_id;
+
+    private Long adgroup_id;
+
+    private Long account_id;
+
+    private Long view_count;
+
+    private Long view_user_count;
+
+    private Long avg_view_per_user;
+
+    private Long valid_click_count;
+
+    private Long click_user_count;
+    //关键页面访问次数
+    private Long key_page_view_count;
+    //注册次数(点击归因)。用户完成注册行为的次数(仅统计点击归因部分)
+    private Long register_by_click_count;
+    //公众号关注人数(点击归因)。完成关注行为的独立用户数,包括非微信流量客户上报+平台上报的数据(该指标仅统计点击归因部分数据)
+    private Long from_follow_by_click_uv;
+    //公众号关注人数(平台上报)。完成公众号关注行为的独立用户数(该指标由平台上报数据,仅微信流量统计)
+    private Long biz_follow_uv;
+    //注册次数。用户完成注册行为的次数
+    private Long reg_pv;
+
+    private Long cpc;
+
+    private Double ctr;
+
+    private Long cost;
+
+    private Long conversions_count;
+
+    private Long from_follow_uv;
+
+    public Long getReg_pv() {
+        return reg_pv;
+    }
+
+    public void setReg_pv(Long reg_pv) {
+        this.reg_pv = reg_pv;
+    }
+
+    public Long getKey_page_view_count() {
+        return key_page_view_count;
+    }
+
+    public void setKey_page_view_count(Long key_page_view_count) {
+        this.key_page_view_count = key_page_view_count;
+    }
+
+    public Long getRegister_by_click_count() {
+        return register_by_click_count;
+    }
+
+    public void setRegister_by_click_count(Long register_by_click_count) {
+        this.register_by_click_count = register_by_click_count;
+    }
+
+    public Long getFrom_follow_by_click_uv() {
+        return from_follow_by_click_uv;
+    }
+
+    public void setFrom_follow_by_click_uv(Long from_follow_by_click_uv) {
+        this.from_follow_by_click_uv = from_follow_by_click_uv;
+    }
+
+    public Long getBiz_follow_uv() {
+        return biz_follow_uv;
+    }
+
+    public void setBiz_follow_uv(Long biz_follow_uv) {
+        this.biz_follow_uv = biz_follow_uv;
+    }
+
+    public Long getCost() {
+        return cost;
+    }
+
+    public void setCost(Long cost) {
+        this.cost = cost;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public Long getDynamic_creative_id() {
+        return dynamic_creative_id;
+    }
+
+    public void setDynamic_creative_id(Long dynamic_creative_id) {
+        this.dynamic_creative_id = dynamic_creative_id;
+    }
+
+    public Long getAdgroup_id() {
+        return adgroup_id;
+    }
+
+    public void setAdgroup_id(Long adgroup_id) {
+        this.adgroup_id = adgroup_id;
+    }
+
+    public Long getAccount_id() {
+        return account_id;
+    }
+
+    public void setAccount_id(Long account_id) {
+        this.account_id = account_id;
+    }
+
+    public Long getView_count() {
+        return view_count;
+    }
+
+    public void setView_count(Long view_count) {
+        this.view_count = view_count;
+    }
+
+    public Long getView_user_count() {
+        return view_user_count;
+    }
+
+    public void setView_user_count(Long view_user_count) {
+        this.view_user_count = view_user_count;
+    }
+
+    public Long getAvg_view_per_user() {
+        return avg_view_per_user;
+    }
+
+    public void setAvg_view_per_user(Long avg_view_per_user) {
+        this.avg_view_per_user = avg_view_per_user;
+    }
+
+    public Long getValid_click_count() {
+        return valid_click_count;
+    }
+
+    public void setValid_click_count(Long valid_click_count) {
+        this.valid_click_count = valid_click_count;
+    }
+
+    public Long getClick_user_count() {
+        return click_user_count;
+    }
+
+    public void setClick_user_count(Long click_user_count) {
+        this.click_user_count = click_user_count;
+    }
+
+    public Long getCpc() {
+        return cpc;
+    }
+
+    public void setCpc(Long cpc) {
+        this.cpc = cpc;
+    }
+
+    public Double getCtr() {
+        return ctr;
+    }
+
+    public void setCtr(Double ctr) {
+        this.ctr = ctr;
+    }
+
+    public Long getConversions_count() {
+        return conversions_count;
+    }
+
+    public void setConversions_count(Long conversions_count) {
+        this.conversions_count = conversions_count;
+    }
+
+    public Long getFrom_follow_uv() {
+        return from_follow_uv;
+    }
+
+    public void setFrom_follow_uv(Long from_follow_uv) {
+        this.from_follow_uv = from_follow_uv;
+    }
+}

+ 13 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeCostSimple.java

@@ -0,0 +1,13 @@
+package com.tzld.ad.model.adPut;
+
+import lombok.Data;
+
+/**
+ * 有消耗创意简单信息(用于无回调告警查询)
+ */
+@Data
+public class AdPutTencentCreativeCostSimple {
+    private Long accountId;
+    private Long adId;
+    private Long creativeId;
+}

+ 26 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeCursor.java

@@ -0,0 +1,26 @@
+package com.tzld.ad.model.adPut;
+
+import java.util.List;
+
+public class AdPutTencentCreativeCursor {
+
+    private List<AdPutTencentCreativeInfo> list;
+
+    private CursorPageInfo cursor_page_info;
+
+    public List<AdPutTencentCreativeInfo> getList() {
+        return list;
+    }
+
+    public void setList(List<AdPutTencentCreativeInfo> list) {
+        this.list = list;
+    }
+
+    public CursorPageInfo getCursor_page_info() {
+        return cursor_page_info;
+    }
+
+    public void setCursor_page_info(CursorPageInfo cursor_page_info) {
+        this.cursor_page_info = cursor_page_info;
+    }
+}

+ 63 - 0
core/src/main/java/com/tzld/ad/model/adPut/AdPutTencentCreativeInfo.java

@@ -0,0 +1,63 @@
+package com.tzld.ad.model.adPut;
+
+public class AdPutTencentCreativeInfo {
+
+    private Long adgroup_id;
+    private Long dynamic_creative_id;
+
+    private String dynamic_creative_name;
+
+    private String configured_status;
+
+    private String creative_components;
+
+    private Boolean is_deleted;
+
+    public Long getAdgroup_id() {
+        return adgroup_id;
+    }
+
+    public void setAdgroup_id(Long adgroup_id) {
+        this.adgroup_id = adgroup_id;
+    }
+
+    public Long getDynamic_creative_id() {
+        return dynamic_creative_id;
+    }
+
+    public void setDynamic_creative_id(Long dynamic_creative_id) {
+        this.dynamic_creative_id = dynamic_creative_id;
+    }
+
+    public String getDynamic_creative_name() {
+        return dynamic_creative_name;
+    }
+
+    public void setDynamic_creative_name(String dynamic_creative_name) {
+        this.dynamic_creative_name = dynamic_creative_name;
+    }
+
+    public String getConfigured_status() {
+        return configured_status;
+    }
+
+    public void setConfigured_status(String configured_status) {
+        this.configured_status = configured_status;
+    }
+
+    public String getCreative_components() {
+        return creative_components;
+    }
+
+    public void setCreative_components(String creative_components) {
+        this.creative_components = creative_components;
+    }
+
+    public Boolean getIs_deleted() {
+        return is_deleted;
+    }
+
+    public void setIs_deleted(Boolean is_deleted) {
+        this.is_deleted = is_deleted;
+    }
+}

Some files were not shown because too many files changed in this diff