소스 검색

代码迁移 初版

zhaoxian 1 년 전
부모
커밋
2d988e3370
100개의 변경된 파일13179개의 추가작업 그리고 39개의 파일을 삭제
  1. 48 32
      kuaishou/pom.xml
  2. 7 4
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/KuaishouJobApplication.java
  3. 17 3
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/controller/KuaishouController.java
  4. 167 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/CtopOauthToken.java
  5. 108 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/EtlKuaiShouNewly.java
  6. 328 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/EtlKuaishouReportAccountHourly.java
  7. 273 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/JyClipCooperation.java
  8. 116 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/JyClipTopList.java
  9. 476 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/JyOrderList.java
  10. 82 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouAppInfo.java
  11. 118 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouCampaign.java
  12. 204 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouDailyAgent.java
  13. 125 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouDailyFlows.java
  14. 148 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouGroup.java
  15. 242 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouGroupTarget.java
  16. 108 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouSchedule.java
  17. 76 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouAccountBalanceBudget.java
  18. 126 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouPlanCreate.java
  19. 202 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouReportDailyAccount.java
  20. 145 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouReportDailyCampaign.java
  21. 147 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouReportHourlyAccount.java
  22. 199 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouSupplyChain.java
  23. 100 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/OauthAgentToken.java
  24. 153 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/Project.java
  25. 45 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDataAccountKuaishou.java
  26. 70 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDataTargetKuaishou.java
  27. 28 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDatePlanKuaishou.java
  28. 94 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDateUnitKuaishou.java
  29. 33 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/TransactionDay.java
  30. 73 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/TransactionDetails.java
  31. 167 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/UserAllocation.java
  32. 75 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/WarningOperationLog.java
  33. 86 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/WexinConfig.java
  34. 69 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/enums/KuaishouHourEnum.java
  35. 57 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/enums/KuaishouMinSecEnum.java
  36. 17 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AccountAttributionInfoJob.java
  37. 21 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckKuaishouActivityInfoJob.java
  38. 20 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckPromoterJob.java
  39. 20 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckPromoterStatusJob.java
  40. 30 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckSupplyChainJob.java
  41. 29 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/ExternalMaterialCollectionJob.java
  42. 48 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/HostingCreateJob.java
  43. 374 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/JiaoYangFenXiaoJob.java
  44. 19 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KFXAccessTokenJob.java
  45. 58 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouBudgetJob.java
  46. 21 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouRefreshAgentTokenJob.java
  47. 22 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouRefreshLiveTokenJob.java
  48. 21 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouRefreshTokenJob.java
  49. 24 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouYesterdayAgentReportJob.java
  50. 33 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCampaignJob.java
  51. 54 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCleanNews.java
  52. 48 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java
  53. 71 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java
  54. 54 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyCampaignReportLoadJob.java
  55. 31 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyFlowsJob.java
  56. 35 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDingPanCleanJob.java
  57. 42 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupJob.java
  58. 31 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadEtlJob.java
  59. 53 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadJob.java
  60. 45 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountWarningLoadJob.java
  61. 36 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouNowDateGroupJob.java
  62. 156 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouOrderLIstGetJob.java
  63. 157 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/MgsOrderLIstGetJob.java
  64. 41 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/NewMonitorJob.java
  65. 40 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/NewMonitorOneDayJob.java
  66. 41 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataAccountCleanJob.java
  67. 39 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataPlanCleanJob.java
  68. 38 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataTargetCleanJob.java
  69. 41 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataUnitCleanJob.java
  70. 90 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/SettlementJob.java
  71. 134 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/SyncMaterialUploadJob.java
  72. 62 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/SynchronousAccountTransactionJob.java
  73. 64 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/TrackWarningJob.java
  74. 82 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/AccountInfoMapper.java
  75. 154 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/CommonMapper.java
  76. 14 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/MgsMapper.java
  77. 30 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/RuixuanMapper.java
  78. 23 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/SendMapper.java
  79. 31 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/TokenMapper.java
  80. 26 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/UserMapper.java
  81. 821 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/AccountInfoMapper.xml
  82. 1523 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/CommonMapper.xml
  83. 74 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/MgsMapper.xml
  84. 173 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/RuixuanMapper.xml
  85. 62 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/SendMapper.xml
  86. 110 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/TokenMapper.xml
  87. 63 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/UserMapper.xml
  88. 43 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/AccountInfoService.java
  89. 101 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/CommonService.java
  90. 11 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/IMessageTemplate.java
  91. 21 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/ISendMessageService.java
  92. 15 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/MgsService.java
  93. 29 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/RuixuanService.java
  94. 28 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/TokenService.java
  95. 23 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/UserService.java
  96. 1068 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/AccountInfoServiceImpl.java
  97. 1822 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/CommonServiceImpl.java
  98. 34 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/MessageTemplateImpl.java
  99. 126 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/MgsServiceImpl.java
  100. 0 0
      kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/RuixuanServiceImpl.java

+ 48 - 32
kuaishou/pom.xml

@@ -31,11 +31,11 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>com.github.xiaoymin</groupId>
-            <artifactId>swagger-bootstrap-ui</artifactId>
-            <version>1.9.3</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.github.xiaoymin</groupId>-->
+<!--            <artifactId>swagger-bootstrap-ui</artifactId>-->
+<!--            <version>1.9.3</version>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
@@ -78,6 +78,22 @@
             <artifactId>mybatis-plus-boot-starter</artifactId>
             <version>${mybatis-plus.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-cp</artifactId>
+            <version>3.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.pdfbox</groupId>
+            <artifactId>fontbox</artifactId>
+            <version>2.0.15</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
         <!-- druid -->
         <dependency>
             <groupId>com.alibaba</groupId>
@@ -91,12 +107,12 @@
             <version>2.5.4</version>
         </dependency>
         <!-- junit -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>junit</groupId>-->
+<!--            <artifactId>junit</artifactId>-->
+<!--            <version>4.12</version>-->
+<!--            <scope>test</scope>-->
+<!--        </dependency>-->
         <!-- json -->
         <dependency>
             <groupId>com.alibaba</groupId>
@@ -115,27 +131,27 @@
             <version>5.1.47</version>
             <scope>runtime</scope>
         </dependency>
-        <dependency>
-            <groupId>net.sourceforge.jtds</groupId>
-            <artifactId>jtds</artifactId>
-            <version>1.3.1</version>
-            <scope>runtime</scope>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>net.sourceforge.jtds</groupId>-->
+<!--            <artifactId>jtds</artifactId>-->
+<!--            <version>1.3.1</version>-->
+<!--            <scope>runtime</scope>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
             <version>4.5.9</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpcore</artifactId>
-            <version>4.4</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.retrofit2</groupId>
-            <artifactId>retrofit</artifactId>
-            <version>2.6.0</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.apache.httpcomponents</groupId>-->
+<!--            <artifactId>httpcore</artifactId>-->
+<!--            <version>4.4</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>com.squareup.retrofit2</groupId>-->
+<!--            <artifactId>retrofit</artifactId>-->
+<!--            <version>2.6.0</version>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>commons-codec</groupId>
             <artifactId>commons-codec</artifactId>
@@ -145,11 +161,11 @@
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
         </dependency>
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-            <version>4.5.11</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>cn.hutool</groupId>-->
+<!--            <artifactId>hutool-all</artifactId>-->
+<!--            <version>4.5.11</version>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>

+ 7 - 4
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/KuaishouJobApplication.java

@@ -5,18 +5,21 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
+
 @Slf4j
 @SpringBootApplication
 @ComponentScan(basePackages = {"cn.com.ctop"})
 @Configuration
 public class KuaishouJobApplication {
-    public static void main(String[] args){
+    public static void main(String[] args) {
 
         SpringApplication.run(KuaishouJobApplication.class, args);
 
-        log.info("\n----------------------------------------------------------\n\t" +
-                "job service is running\n\t" +
-                "----------------------------------------------------------");
+        log.info("\n\t----------------------------------------------------------\n\t" +
+                "\t\t\t\tjob service is running\n\t" +
+                "----------------------------------------------------------\n\t" +
+                "Local_Url: \thttp://localhost:8086/kuaishouController\n\t"
+        );
     }
 
 }

+ 17 - 3
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/controller/KuaishouController.java

@@ -1,24 +1,38 @@
 package cn.com.ctop.job.controller;
 
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.entity.OauthAgentToken;
+import cn.com.ctop.job.kuaishou.entity.WarningOperationLog;
+import cn.com.ctop.job.kuaishou.mapper.SendMapper;
+import cn.com.ctop.job.kuaishou.mapper.TokenMapper;
+import cn.com.ctop.job.kuaishou.service.CommonService;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Date;
+
 
 @RestController
 @RequestMapping("/kuaishouController")
-@Api(tags = "快手直播")
 @Slf4j
 public class KuaishouController {
 
-   /* @Autowired
-    private AgentTokenService tokenService;*/
+    @Autowired
+    private CommonService commonService;
 
+    @Autowired
+    private SendMapper sendMapper;
+    @Autowired
+    private TokenMapper tokenMapper;
 
     @GetMapping(value = "/test")
     public String test(Long accountId) {
+        String byAccountId = commonService.getByAccountId(1L);
+        System.out.println(byAccountId);
         System.out.println("ok");
         return "ok";
     }

+ 167 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/CtopOauthToken.java

@@ -0,0 +1,167 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * @Description: oauth授权码
+ * @Author: jeecg-boot
+ * @Date: 2019-07-09
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_oauth_token")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_oauth_token对象", description = "oauth授权码")
+public class CtopOauthToken {
+
+    /**
+     * 主键ID
+     */
+    @TableId()
+    @ApiModelProperty(value = "主键ID")
+    private String id;
+    /**
+     * 媒体ID(外部广告平台类型,快手/头条/抖音等)
+     */
+    @Excel(name = "媒体ID(外部广告平台类型,快手/头条/抖音等)", width = 15)
+    @ApiModelProperty(value = "媒体ID(外部广告平台类型,快手/头条/抖音等)")
+    private String mediaId;
+    /**
+     * 广告主ID(自己平台用户内部id)
+     */
+    @Excel(name = "广告主ID(自己平台用户内部id)", width = 15)
+    @ApiModelProperty(value = "广告主ID(自己平台用户内部id)")
+    private String advertiserId;
+    /**
+     * 广告账户ID(相当于头条返回的access_token数据中的advertiser_id)
+     */
+    @Excel(name = "广告账户ID(相当于头条返回的access_token数据中的advertiser_id)", width = 15)
+    @ApiModelProperty(value = "广告账户ID(相当于头条返回的access_token数据中的advertiser_id)")
+    private Long accountId;
+    /**
+     * 访问令牌
+     */
+    @Excel(name = "访问令牌", width = 15)
+    @ApiModelProperty(value = "访问令牌")
+    private String accessToken;
+    /**
+     * 访问令牌有效期
+     */
+    @Excel(name = "访问令牌有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "访问令牌有效期")
+    private Date accessTokenExpiresIn;
+    /**
+     * 刷新令牌
+     */
+    @Excel(name = "刷新令牌", width = 15)
+    @ApiModelProperty(value = "刷新令牌")
+    private String refreshToken;
+
+
+    private Integer agentType;
+    private Long appId;
+
+    /**
+     * 刷新令牌有效期
+     */
+    @Excel(name = "刷新令牌有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "刷新令牌有效期")
+    private Date refreshTokenExpiresIn;
+
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    public CtopOauthToken(String userId, JSONObject data) {
+        Long accountId = data.getLong("advertiser_id");
+        this.id = String.valueOf(accountId);
+        this.advertiserId = userId;
+        this.mediaId = "1";
+        this.accountId = accountId;
+        String accessToken = data.getString("access_token");
+        Integer refreshTokenExpiresIn = data.getInteger("refresh_token_expires_in");
+        Integer expiresIn = data.getInteger("expires_in");
+        String refreshToken = data.getString("refresh_token");
+        this.accessToken = accessToken;
+        this.refreshToken = refreshToken;
+        Date now = new Date();
+        this.accessTokenExpiresIn = addSecond(now, expiresIn);
+        this.refreshTokenExpiresIn = addSecond(now, refreshTokenExpiresIn);
+        this.createTime = now;
+        this.updateTime = now;
+    }
+
+    public CtopOauthToken() {
+    }
+
+    public CtopOauthToken(CtopOauthToken token, JSONObject data) {
+        this.advertiserId = token.getAdvertiserId();
+        this.mediaId = "1";
+        this.accountId = token.getAccountId();
+        String accessToken = data.getString("access_token");
+        Integer refreshTokenExpiresIn = data.getInteger("refresh_token_expires_in");
+        Integer expiresIn = data.getInteger("expires_in");
+        String refreshToken = data.getString("refresh_token");
+        this.accessToken = accessToken;
+        this.refreshToken = refreshToken;
+        Date now = new Date();
+        this.accessTokenExpiresIn = addSecond(now, expiresIn);
+        this.refreshTokenExpiresIn = addSecond(now, refreshTokenExpiresIn);
+        this.updateTime = now;
+    }
+
+    private static Date addSecond(Date date, int seconds) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.SECOND, seconds);
+        return calendar.getTime();
+    }
+
+    @Override
+    public String toString() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return id +
+                "," + mediaId +
+                "," + advertiserId +
+                "," + accountId +
+                "," + accessToken +
+                "," + sdf.format(accessTokenExpiresIn) +
+                "," + refreshToken +
+                "," + sdf.format(refreshTokenExpiresIn) +
+                "," + sdf.format(createTime) +
+                "," + sdf.format(updateTime);
+    }
+}

+ 108 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/EtlKuaiShouNewly.java

@@ -0,0 +1,108 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+
+/**
+ * 快手 新上计划数据汇总
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-03-08
+ */
+@Data
+@TableName("ctop_etl_kuaishou_newly")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_newly对象", description = "快手 新上计划数据汇总")
+public class EtlKuaiShouNewly {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 账户授权名称
+     */
+    @Excel(name = "账户授权名称", width = 15)
+    @ApiModelProperty(value = "账户授权名称")
+    private String oauthName;
+    /**
+     * 绑定人id
+     */
+    @Excel(name = "绑定人id", width = 15)
+    @ApiModelProperty(value = "绑定人id")
+    private String userId;
+    /**
+     * 绑定人名称
+     */
+    @Excel(name = "绑定人名称", width = 15)
+    @ApiModelProperty(value = "绑定人名称")
+    private String userName;
+    /**
+     * 新上数量
+     */
+    @Excel(name = "新上数量", width = 15)
+    @ApiModelProperty(value = "新上数量")
+    private Integer newCount;
+    /**
+     * campaign:计划  unit:组 creative:创意
+     */
+    @Excel(name = "campaign:计划  unit:组 creative:创意", width = 15)
+    @ApiModelProperty(value = "campaign:计划  unit:组 creative:创意")
+    private String newType;
+    /**
+     * 时间
+     */
+    @Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private String statDate;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 328 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/EtlKuaishouReportAccountHourly.java

@@ -0,0 +1,328 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 账户维度-每小时盯盘数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-03-04
+ */
+@Data
+@TableName("ctop_etl_kuaishou_report_account_hourly")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_report_account_hourly对象", description = "账户维度-每小时盯盘数据")
+public class EtlKuaishouReportAccountHourly {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.INPUT)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 时间
+     */
+    @Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private Long statHour;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 分享数
+     */
+    @Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+    private Long photoShare;
+    /**
+     * 评论数
+     */
+    @Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+    private Long photoComment;
+    /**
+     * 点赞数
+     */
+    @Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+    private Long photoLike;
+    /**
+     * 新增关注数
+     */
+    @Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    @Excel(name = "取消关注数", width = 15)
+    @ApiModelProperty(value = "取消关注数")
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    @Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    @Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    @Excel(name = "减少此类作品数", width = 15)
+    @ApiModelProperty(value = "减少此类作品数")
+    private Long negative;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    @Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    @Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    @Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+    private Long activation;
+    /**
+     * 提交按钮点击数
+     */
+    @Excel(name = "提交按钮点击数", width = 15)
+    @ApiModelProperty(value = "提交按钮点击数")
+    private Long submit;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    @Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    @Excel(name = "应用下载数据-首日付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费金额")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-付费次数
+     */
+    @Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    @Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-注册数
+     */
+    @Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+    private Long eventRegister;
+    /**
+     * 应用下载数据-完件数
+     */
+    @Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-授信数
+     */
+    @Excel(name = "应用下载数据-授信数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信数")
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    @Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    @Excel(name = "应用下载数据-付款成功金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功金额")
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    @Excel(name = "落地页数据-落地页完件数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件数")
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    @Excel(name = "落地页数据-落地页授信数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信数")
+    private Long eventCreditGrantLandingPage;
+    /**
+     * Save pv the next day
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+    private Long eventNextDayStay;
+    /**
+     * 落地页数据-表单提交数
+     */
+    @Excel(name = "落地页数据-表单提交数", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交数")
+    private Long formCount;
+    /**
+     * 3s播放数
+     */
+    @Excel(name = "3s播放数", width = 15)
+    @ApiModelProperty(value = "3s播放数")
+    private long play3sCount;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private BigDecimal totalBalance;//余额
+    @TableField(exist = false)
+    private BigDecimal budget;//预算
+    @TableField(exist = false)
+    private String authName;//账户名称
+    @TableField(exist = false)
+    private BigDecimal activationCost;//激活单价
+    @TableField(exist = false)
+    private BigDecimal impression1kCost;//平均千次素材曝光花费 = 花费/素材曝光数*1000
+    @TableField(exist = false)
+    private BigDecimal photoClickCost;//平均封面点击单价 = 花费/封面点击数
+    @TableField(exist = false)
+    private BigDecimal actionCost;//平均行为单价 = 总花费/行为数
+    @TableField(exist = false)
+    private BigDecimal play3sRatio;//3S播放率 = 广告视频播放3s数量/封面曝光数
+    @TableField(exist = false)
+    private BigDecimal downloadStartedCost;//安卓下载开始单价(元) =花费/安卓下载开始数
+    @TableField(exist = false)
+    private BigDecimal downloadCompletedCost;//安卓下载完成单价(元) =花费/安卓下载完成数
+    @TableField(exist = false)
+    private BigDecimal formCost;//表单提交单价 =当日消耗/当日回传表单数
+    @TableField(exist = false)
+    private BigDecimal eventPayFirstDayCost;//首日付费次数成本 =消耗/首日付费次数
+    @TableField(exist = false)
+    private BigDecimal eventPayCost;//付费次数成本 =消耗/付费次数
+    @TableField(exist = false)
+    private BigDecimal eventRegisterCost;//注册成本 =当日消耗/当日回传注册数
+    @TableField(exist = false)
+    private BigDecimal eventNextDayStayCost;//次日留存成本 =消耗/次日留存PV
+    @TableField(exist = false)
+    private BigDecimal eventJinJianAppCost;//完件成本 =消耗/完件数
+    @TableField(exist = false)
+    private BigDecimal eventCreditGrantAppCost;//授信成本 =消耗/授信数
+    @TableField(exist = false)
+    private BigDecimal eventJinJianLandingPageCost;//落地页完件成本 =当日消耗/当日回传完件数
+    @TableField(exist = false)
+    private BigDecimal eventCreditGrantLandingPageCost;//落地页授信成本 =当日消耗/当日回传授信数
+    @TableField(exist = false)
+    private BigDecimal submitCost;//按钮点击成本 =当日消耗 / 当日按钮点击数
+    @TableField(exist = false)
+    private BigDecimal eventPayFirstDayRoi;//首日ROI =首日付费金额/当日消耗
+    @TableField(exist = false)
+    private BigDecimal eventPayRoi;//ROI =付费金额/当日消耗
+    @TableField(exist = false)
+    private BigDecimal actionRatio;//行为率 =行为数占素材曝光数百分比
+    @TableField(exist = false)
+    private BigDecimal photoClickRatio;//封面点击率 =封面点击数占封面曝光数百分比
+    @TableField(exist = false)
+    private BigDecimal downloadStartedRatio;//安卓下载开始率 =安卓下载开始数/行为数
+    @TableField(exist = false)
+    private BigDecimal downloadCompletedRatio;//安卓下载完成率 =安卓下载完成数/安卓下载开始数
+    @TableField(exist = false)
+    private BigDecimal activationRatio;//下载完成激活率 =激活数/安卓下载完成数
+    @TableField(exist = false)
+    private BigDecimal clickOnActivationRatio;//下载完成激活率 =激活数/安卓下载完成数
+    @TableField(exist = false)
+    private BigDecimal eventRegisterRatio;//注册率 =当日回传注册数/当日激活数
+    @TableField(exist = false)
+    private BigDecimal eventNextDayStayRatio;//次日留存率 =次留数/前一日激活数
+    @TableField(exist = false)
+    private BigDecimal eventCreditGrantAppRatio;//授信率 =当日回传授信数/当日回传的完件数
+    @TableField(exist = false)
+    private BigDecimal formActionRatio;//表单提交点击率 =当日回传表单数/当日行为数
+    @TableField(exist = false)
+    private BigDecimal submitRatio;//按钮点击率 =当日按钮点击数 / 当日行为数
+    private BigDecimal grew = new BigDecimal(0);//同比 = (今日实时花费-昨日截止到此时的花费)/昨日截止到此时的花费*100%;
+}

+ 273 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/JyClipCooperation.java

@@ -0,0 +1,273 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+
+/**
+ * 骄阳-二创者信息对象 jy_clip_cooperation
+ *
+ * @author ruoyi
+ * @date 2023-11-01
+ */
+public class JyClipCooperation {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long clipId;
+
+    /**
+     * 二创者名称
+     */
+    @Excel(name = "二创者名称")
+    private String clipName;
+
+    /**
+     * 头像
+     */
+    @Excel(name = "头像")
+    private String headImg;
+
+    /**
+     * 二创佣金比例
+     */
+    @Excel(name = "二创佣金比例")
+    private Long commissionRate;
+
+    /**
+     * 粉丝数
+     */
+    @Excel(name = "粉丝数")
+    private String fansNum;
+
+    /**
+     * 创作者gmv
+     */
+    @Excel(name = "创作者gmv")
+    private String gmv30d;
+
+    /**
+     * 周期-开始日期
+     */
+    @Excel(name = "周期-开始日期")
+    private String startTime;
+
+    /**
+     * 周期-结束日期
+     */
+    @Excel(name = "周期-结束日期")
+    private String endTime;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private Integer status;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private String terminationReason;
+
+    /**
+     * 佣金比例
+     */
+    @Excel(name = "佣金比例")
+    private String commissionRateView;
+
+    /**
+     * 口碑评分
+     */
+    @Excel(name = "口碑评分")
+    private String shopScore;
+
+    /**
+     * 创作者30日gmv
+     */
+    @Excel(name = "创作者30日gmv")
+    private String clipGmv30d;
+
+    /**
+     * 授权商品gmv
+     */
+    @Excel(name = "授权商品gmv")
+    private String authItemGmv30d;
+
+    /**
+     * 挂车视频
+     */
+    @Excel(name = "挂车视频")
+    private String videoCount;
+    private String videoShow;
+
+    /**
+     * 日期
+     */
+    @Excel(name = "日期")
+    private Long statDate;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getClipId() {
+        return clipId;
+    }
+
+    public void setClipId(Long clipId) {
+        this.clipId = clipId;
+    }
+
+    public String getClipName() {
+        return clipName;
+    }
+
+    public void setClipName(String clipName) {
+        this.clipName = clipName;
+    }
+
+    public String getHeadImg() {
+        return headImg;
+    }
+
+    public void setHeadImg(String headImg) {
+        this.headImg = headImg;
+    }
+
+    public Long getCommissionRate() {
+        return commissionRate;
+    }
+
+    public void setCommissionRate(Long commissionRate) {
+        this.commissionRate = commissionRate;
+    }
+
+    public String getFansNum() {
+        return fansNum;
+    }
+
+    public void setFansNum(String fansNum) {
+        this.fansNum = fansNum;
+    }
+
+    public String getGmv30d() {
+        return gmv30d;
+    }
+
+    public void setGmv30d(String gmv30d) {
+        this.gmv30d = gmv30d;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getTerminationReason() {
+        return terminationReason;
+    }
+
+    public void setTerminationReason(String terminationReason) {
+        this.terminationReason = terminationReason;
+    }
+
+    public String getCommissionRateView() {
+        return commissionRateView;
+    }
+
+    public void setCommissionRateView(String commissionRateView) {
+        this.commissionRateView = commissionRateView;
+    }
+
+    public String getShopScore() {
+        return shopScore;
+    }
+
+    public void setShopScore(String shopScore) {
+        this.shopScore = shopScore;
+    }
+
+    public String getClipGmv30d() {
+        return clipGmv30d;
+    }
+
+    public void setClipGmv30d(String clipGmv30d) {
+        this.clipGmv30d = clipGmv30d;
+    }
+
+    public String getAuthItemGmv30d() {
+        return authItemGmv30d;
+    }
+
+    public void setAuthItemGmv30d(String authItemGmv30d) {
+        this.authItemGmv30d = authItemGmv30d;
+    }
+
+    public String getVideoCount() {
+        return videoCount;
+    }
+
+    public void setVideoCount(String videoCount) {
+        this.videoCount = videoCount;
+    }
+
+    public String getVideoShow() {
+        return videoShow;
+    }
+
+    public void setVideoShow(String videoShow) {
+        this.videoShow = videoShow;
+    }
+
+    public Long getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(Long statDate) {
+        this.statDate = statDate;
+    }
+
+    @Override
+    public String toString() {
+        return "JyClipCooperation{" +
+                "clipId=" + clipId +
+                ", clipName='" + clipName + '\'' +
+                ", headImg='" + headImg + '\'' +
+                ", commissionRate=" + commissionRate +
+                ", fansNum='" + fansNum + '\'' +
+                ", gmv30d='" + gmv30d + '\'' +
+                ", startTime='" + startTime + '\'' +
+                ", endTime='" + endTime + '\'' +
+                ", status=" + status +
+                ", terminationReason='" + terminationReason + '\'' +
+                ", commissionRateView='" + commissionRateView + '\'' +
+                ", shopScore='" + shopScore + '\'' +
+                ", clipGmv30d='" + clipGmv30d + '\'' +
+                ", authItemGmv30d='" + authItemGmv30d + '\'' +
+                ", videoCount='" + videoCount + '\'' +
+                ", videoShow='" + videoShow + '\'' +
+                ", statDate=" + statDate +
+                '}';
+    }
+}

+ 116 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/JyClipTopList.java

@@ -0,0 +1,116 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+public class JyClipTopList {
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long clipId;
+    private String clipName;
+    private Long itemId;
+    private String itemName;
+    private String itemImgUrl;
+    private String itemPrice;
+    private Long promotionVolume;
+    private Long promotionPromoterCount;
+    private Long statDate;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getClipId() {
+        return clipId;
+    }
+
+    public void setClipId(Long clipId) {
+        this.clipId = clipId;
+    }
+
+    public String getClipName() {
+        return clipName;
+    }
+
+    public void setClipName(String clipName) {
+        this.clipName = clipName;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getItemImgUrl() {
+        return itemImgUrl;
+    }
+
+    public void setItemImgUrl(String itemImgUrl) {
+        this.itemImgUrl = itemImgUrl;
+    }
+
+    public String getItemPrice() {
+        return itemPrice;
+    }
+
+    public void setItemPrice(String itemPrice) {
+        this.itemPrice = itemPrice;
+    }
+
+    public Long getPromotionVolume() {
+        return promotionVolume;
+    }
+
+    public void setPromotionVolume(Long promotionVolume) {
+        this.promotionVolume = promotionVolume;
+    }
+
+    public Long getPromotionPromoterCount() {
+        return promotionPromoterCount;
+    }
+
+    public void setPromotionPromoterCount(Long promotionPromoterCount) {
+        this.promotionPromoterCount = promotionPromoterCount;
+    }
+
+    public Long getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(Long statDate) {
+        this.statDate = statDate;
+    }
+
+    @Override
+    public String toString() {
+        return "JyClipTopList{" +
+                "id=" + id +
+                ", clipId=" + clipId +
+                ", clipName='" + clipName + '\'' +
+                ", itemId=" + itemId +
+                ", itemName='" + itemName + '\'' +
+                ", itemImgUrl='" + itemImgUrl + '\'' +
+                ", itemPrice='" + itemPrice + '\'' +
+                ", promotionVolume=" + promotionVolume +
+                ", promotionPromoterCount=" + promotionPromoterCount +
+                ", statDate=" + statDate +
+                '}';
+    }
+}

+ 476 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/JyOrderList.java

@@ -0,0 +1,476 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+
+/**
+ * 骄阳-快分销数据对象 jy_order_list
+ *
+ * @author ruoyi
+ * @date 2023-10-31
+ */
+public class JyOrderList {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long oid;
+
+    /**
+     * 商品ID
+     */
+    @Excel(name = "商品ID")
+    private Long itemId;
+
+    /**
+     * 商品标题
+     */
+    @Excel(name = "商品标题")
+    private String itemTitle;
+
+    /**
+     * 商品单价
+     */
+    @Excel(name = "商品单价")
+    private Long reservePrice;
+
+    /**
+     * 商品图片
+     */
+    @Excel(name = "商品图片")
+    private String imageUrl;
+
+    /**
+     * 订单状态
+     */
+    @Excel(name = "订单状态")
+    private Integer orderStatus;
+
+    /**
+     * 订单创建时间
+     */
+    @Excel(name = "订单创建时间")
+    private Long orderCreateTime;
+
+    /**
+     * 是否发货(1-发货)
+     */
+    @Excel(name = "是否发货")
+    private Integer sendStatus;
+
+    /**
+     * 订单类型
+     */
+    @Excel(name = "订单类型")
+    private Integer settlementBizType;
+
+    /**
+     * 订单类型翻译
+     */
+    @Excel(name = "订单类型翻译")
+    private String settlementBizTypeDesc;
+
+    /**
+     * 发货时间
+     */
+    @Excel(name = "发货时间")
+    private Long sendTime;
+
+    /**
+     * 收获时间
+     */
+    @Excel(name = "收获时间")
+    private Long recvTime;
+
+    /**
+     * 商家id
+     */
+    @Excel(name = "商家id")
+    private Long sellerId;
+
+    /**
+     * 推广者id
+     */
+    @Excel(name = "推广者id")
+    private Long promotionId;
+
+    /**
+     * 推广者昵称
+     */
+    @Excel(name = "推广者昵称")
+    private String promotionNickName;
+
+    /**
+     * 二创者id
+     */
+    @Excel(name = "二创者id")
+    private Long clipUserId;
+
+    /**
+     * 二创者昵称
+     */
+    @Excel(name = "二创者昵称")
+    private String clipNickName;
+
+    /**
+     * 活动id
+     */
+    @Excel(name = "活动id")
+    private Long activityId;
+
+    /**
+     * 订单金额
+     */
+    @Excel(name = "订单金额")
+    private Long orderAmount;
+
+    /**
+     * 付款金额
+     */
+    @Excel(name = "付款金额")
+    private Long payAmount;
+
+    /**
+     * 服务费率
+     */
+    @Excel(name = "服务费率")
+    private Long regimentalPromotionRate;
+
+    /**
+     * 分成比例
+     */
+    @Excel(name = "分成比例")
+    private Long shareRate;
+
+    /**
+     * 货款基数
+     */
+    @Excel(name = "货款基数")
+    private Long baseAmount;
+
+    /**
+     * 技术服务费
+     */
+    @Excel(name = "技术服务费")
+    private Long serviceAmount;
+
+    /**
+     * 商品推广佣金率
+     */
+    @Excel(name = "商品推广佣金率")
+    private Long commissionRate;
+
+    /**
+     * 预估服务费收入
+     */
+    @Excel(name = "预估服务费收入")
+    private Long regimentalPromotionAmount;
+
+    /**
+     * 结算服务费收入
+     */
+    @Excel(name = "结算服务费收入")
+    private Long totalRegimentalSettleAmount;
+    private Long mcnPromotionAmount;
+    private Long mcnSettlementAmount;
+
+    /**
+     * 订单时间
+     */
+    @Excel(name = "订单时间")
+    private Long statDate;
+
+    private Integer statHour;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getOid() {
+        return oid;
+    }
+
+    public void setOid(Long oid) {
+        this.oid = oid;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemTitle() {
+        return itemTitle;
+    }
+
+    public void setItemTitle(String itemTitle) {
+        this.itemTitle = itemTitle;
+    }
+
+    public Long getReservePrice() {
+        return reservePrice;
+    }
+
+    public void setReservePrice(Long reservePrice) {
+        this.reservePrice = reservePrice;
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public Integer getOrderStatus() {
+        return orderStatus;
+    }
+
+    public void setOrderStatus(Integer orderStatus) {
+        this.orderStatus = orderStatus;
+    }
+
+    public Long getOrderCreateTime() {
+        return orderCreateTime;
+    }
+
+    public void setOrderCreateTime(Long orderCreateTime) {
+        this.orderCreateTime = orderCreateTime;
+    }
+
+    public Integer getSendStatus() {
+        return sendStatus;
+    }
+
+    public void setSendStatus(Integer sendStatus) {
+        this.sendStatus = sendStatus;
+    }
+
+    public Integer getSettlementBizType() {
+        return settlementBizType;
+    }
+
+    public void setSettlementBizType(Integer settlementBizType) {
+        this.settlementBizType = settlementBizType;
+    }
+
+    public String getSettlementBizTypeDesc() {
+        return settlementBizTypeDesc;
+    }
+
+    public void setSettlementBizTypeDesc(String settlementBizTypeDesc) {
+        this.settlementBizTypeDesc = settlementBizTypeDesc;
+    }
+
+    public Long getSendTime() {
+        return sendTime;
+    }
+
+    public void setSendTime(Long sendTime) {
+        this.sendTime = sendTime;
+    }
+
+    public Long getRecvTime() {
+        return recvTime;
+    }
+
+    public void setRecvTime(Long recvTime) {
+        this.recvTime = recvTime;
+    }
+
+    public Long getSellerId() {
+        return sellerId;
+    }
+
+    public void setSellerId(Long sellerId) {
+        this.sellerId = sellerId;
+    }
+
+    public Long getPromotionId() {
+        return promotionId;
+    }
+
+    public void setPromotionId(Long promotionId) {
+        this.promotionId = promotionId;
+    }
+
+    public String getPromotionNickName() {
+        return promotionNickName;
+    }
+
+    public void setPromotionNickName(String promotionNickName) {
+        this.promotionNickName = promotionNickName;
+    }
+
+    public Long getClipUserId() {
+        return clipUserId;
+    }
+
+    public void setClipUserId(Long clipUserId) {
+        this.clipUserId = clipUserId;
+    }
+
+    public String getClipNickName() {
+        return clipNickName;
+    }
+
+    public void setClipNickName(String clipNickName) {
+        this.clipNickName = clipNickName;
+    }
+
+    public Long getActivityId() {
+        return activityId;
+    }
+
+    public void setActivityId(Long activityId) {
+        this.activityId = activityId;
+    }
+
+    public Long getOrderAmount() {
+        return orderAmount;
+    }
+
+    public void setOrderAmount(Long orderAmount) {
+        this.orderAmount = orderAmount;
+    }
+
+    public Long getPayAmount() {
+        return payAmount;
+    }
+
+    public void setPayAmount(Long payAmount) {
+        this.payAmount = payAmount;
+    }
+
+    public Long getRegimentalPromotionRate() {
+        return regimentalPromotionRate;
+    }
+
+    public void setRegimentalPromotionRate(Long regimentalPromotionRate) {
+        this.regimentalPromotionRate = regimentalPromotionRate;
+    }
+
+    public Long getShareRate() {
+        return shareRate;
+    }
+
+    public void setShareRate(Long shareRate) {
+        this.shareRate = shareRate;
+    }
+
+    public Long getBaseAmount() {
+        return baseAmount;
+    }
+
+    public void setBaseAmount(Long baseAmount) {
+        this.baseAmount = baseAmount;
+    }
+
+    public Long getServiceAmount() {
+        return serviceAmount;
+    }
+
+    public void setServiceAmount(Long serviceAmount) {
+        this.serviceAmount = serviceAmount;
+    }
+
+    public Long getCommissionRate() {
+        return commissionRate;
+    }
+
+    public void setCommissionRate(Long commissionRate) {
+        this.commissionRate = commissionRate;
+    }
+
+    public Long getRegimentalPromotionAmount() {
+        return regimentalPromotionAmount;
+    }
+
+    public void setRegimentalPromotionAmount(Long regimentalPromotionAmount) {
+        this.regimentalPromotionAmount = regimentalPromotionAmount;
+    }
+
+    public Long getTotalRegimentalSettleAmount() {
+        return totalRegimentalSettleAmount;
+    }
+
+    public void setTotalRegimentalSettleAmount(Long totalRegimentalSettleAmount) {
+        this.totalRegimentalSettleAmount = totalRegimentalSettleAmount;
+    }
+
+    public Long getMcnPromotionAmount() {
+        return mcnPromotionAmount;
+    }
+
+    public void setMcnPromotionAmount(Long mcnPromotionAmount) {
+        this.mcnPromotionAmount = mcnPromotionAmount;
+    }
+
+    public Long getMcnSettlementAmount() {
+        return mcnSettlementAmount;
+    }
+
+    public void setMcnSettlementAmount(Long mcnSettlementAmount) {
+        this.mcnSettlementAmount = mcnSettlementAmount;
+    }
+
+    public Long getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(Long statDate) {
+        this.statDate = statDate;
+    }
+
+    public Integer getStatHour() {
+        return statHour;
+    }
+
+    public void setStatHour(Integer statHour) {
+        this.statHour = statHour;
+    }
+
+    @Override
+    public String toString() {
+        return "JyOrderList{" +
+                "oid=" + oid +
+                ", itemId=" + itemId +
+                ", itemTitle='" + itemTitle + '\'' +
+                ", reservePrice=" + reservePrice +
+                ", imageUrl='" + imageUrl + '\'' +
+                ", orderStatus=" + orderStatus +
+                ", orderCreateTime=" + orderCreateTime +
+                ", sendStatus=" + sendStatus +
+                ", settlementBizType=" + settlementBizType +
+                ", settlementBizTypeDesc='" + settlementBizTypeDesc + '\'' +
+                ", sendTime=" + sendTime +
+                ", recvTime=" + recvTime +
+                ", sellerId=" + sellerId +
+                ", promotionId=" + promotionId +
+                ", promotionNickName='" + promotionNickName + '\'' +
+                ", clipUserId=" + clipUserId +
+                ", clipNickName='" + clipNickName + '\'' +
+                ", activityId=" + activityId +
+                ", orderAmount=" + orderAmount +
+                ", payAmount=" + payAmount +
+                ", regimentalPromotionRate=" + regimentalPromotionRate +
+                ", shareRate=" + shareRate +
+                ", baseAmount=" + baseAmount +
+                ", serviceAmount=" + serviceAmount +
+                ", commissionRate=" + commissionRate +
+                ", regimentalPromotionAmount=" + regimentalPromotionAmount +
+                ", totalRegimentalSettleAmount=" + totalRegimentalSettleAmount +
+                ", mcnPromotionAmount=" + mcnPromotionAmount +
+                ", mcnSettlementAmount=" + mcnSettlementAmount +
+                ", statDate=" + statDate +
+                ", statHour=" + statHour +
+                '}';
+    }
+}
+

+ 82 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouAppInfo.java

@@ -0,0 +1,82 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Description: 广告组-app信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_app_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_app_info对象", description = "广告组-app信息")
+public class KuaiShouAppInfo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * accountId
+     */
+    @Excel(name = "accountId", width = 15)
+    @ApiModelProperty(value = "accountId")
+    private Long accountId;
+    /**
+     * 广告组id
+     */
+    @Excel(name = "广告组id", width = 15)
+    @ApiModelProperty(value = "广告组id")
+    private Long unitId;
+    /**
+     * appPackageName
+     */
+    @Excel(name = "appPackageName", width = 15)
+    @ApiModelProperty(value = "appPackageName")
+    private String appPackageName;
+    /**
+     * appName
+     */
+    @Excel(name = "appName", width = 15)
+    @ApiModelProperty(value = "appName")
+    private String appName;
+    /**
+     * deviceOsType
+     */
+    @Excel(name = "deviceOsType", width = 15)
+    @ApiModelProperty(value = "deviceOsType")
+    private Integer deviceOsType;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 118 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouCampaign.java

@@ -0,0 +1,118 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Description: 快手-获取广告计划信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_campaign")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_campaign对象", description = "快手-获取广告计划信息")
+public class KuaiShouCampaign {
+
+    /**
+     * id
+     */
+    @TableId
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long campaignId;
+    /**
+     * 计划名称
+     */
+    @Excel(name = "计划名称", width = 15)
+    @ApiModelProperty(value = "计划名称")
+    private String campaignName;
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+
+    /**
+     * 广告计划类型
+     */
+    @Excel(name = "广告计划类型", width = 15)
+    @ApiModelProperty(value = "1:投放中;2:暂停")
+    private Integer campaignType;
+
+    /**
+     * 创建渠道
+     */
+    @Excel(name = "创建渠道", width = 15)
+    @ApiModelProperty(value = "0:投放后台创建;1:Marketing API创建")
+    private Integer createChannel;
+
+    /**
+     * 投放状态
+     */
+    @Excel(name = "投放状态", width = 15)
+    @ApiModelProperty(value = "1:投放中;2:暂停")
+    private Integer putStatus;
+
+
+    /**
+     * 每日预算
+     */
+    @Excel(name = "每日预算", width = 15)
+    @ApiModelProperty(value = "每日预算")
+    private Long dayBudget;
+    private String dayBudgetSchedule;
+
+
+    @Excel(name = "广告投放时间", width = 15)
+    @ApiModelProperty(value = "广告投放时间")
+    private String putCreateTime;
+
+
+    @Excel(name = "广告修改时间", width = 15)
+    @ApiModelProperty(value = "广告投放时间")
+    private String putUpdateTime;
+
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 204 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouDailyAgent.java

@@ -0,0 +1,204 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+
+/**
+ * 代理商报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-08-18
+ */
+@Data
+@TableName("ctop_kuaishou_daily_agent")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_daily_agent对象", description = "代理商报表")
+public class KuaiShouDailyAgent {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 代理商id
+     */
+    @Excel(name = "代理商id", width = 15)
+    @ApiModelProperty(value = "代理商id")
+    private Long agentId;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String dateTime;
+    /**
+     * user_id
+     */
+    @Excel(name = "user_id", width = 15)
+    @ApiModelProperty(value = "user_id")
+    private Long userId;
+    /**
+     * 广告主名称
+     */
+    @Excel(name = "广告主名称", width = 15)
+    @ApiModelProperty(value = "广告主名称")
+    private String accountName;
+    /**
+     * 总消耗(元)
+     */
+    @Excel(name = "总消耗(元)", width = 15)
+    @ApiModelProperty(value = "总消耗(元)")
+    private java.math.BigDecimal totalChargedInYuan;
+    /**
+     * 总余额(元)
+     */
+    @Excel(name = "总余额(元)", width = 15)
+    @ApiModelProperty(value = "总余额(元)")
+    private java.math.BigDecimal totalBalanceInYuan;
+    /**
+     * 现金消耗(元)
+     */
+    @Excel(name = "现金消耗(元)", width = 15)
+    @ApiModelProperty(value = "现金消耗(元)")
+    private java.math.BigDecimal realChargedInYuan;
+    /**
+     * 返点消耗(元)
+     */
+    @Excel(name = "返点消耗(元)", width = 15)
+    @ApiModelProperty(value = "返点消耗(元)")
+    private java.math.BigDecimal totalRebateRealChargedInYuan;
+    /**
+     * 框返消耗(元)
+     */
+    @Excel(name = "框返消耗(元)", width = 15)
+    @ApiModelProperty(value = "框返消耗(元)")
+    private java.math.BigDecimal contractRebateRealChargedInYuan;
+    /**
+     * 激励消耗(元)
+     */
+    @Excel(name = "激励消耗(元)", width = 15)
+    @ApiModelProperty(value = "激励消耗(元)")
+    private java.math.BigDecimal directRebateRealChargedInYuan;
+    /**
+     * 信用消耗(元)
+     */
+    @Excel(name = "信用消耗(元)", width = 15)
+    @ApiModelProperty(value = "信用消耗(元)")
+    private java.math.BigDecimal creditRealChargedInYuan;
+    /**
+     * 消耗环比
+     */
+    @Excel(name = "消耗环比", width = 15)
+    @ApiModelProperty(value = "消耗环比")
+    private String chargeDayOnDayPercent;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long adPhotoImpression;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long adPhotoClick;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long adItemImpression;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long adItemClick;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private String photoClickRatio;
+    /**
+     * 行为点击率
+     */
+    @Excel(name = "行为点击率", width = 15)
+    @ApiModelProperty(value = "行为点击率")
+    private String itemClickRatio;
+    /**
+     * 有消费计划数
+     */
+    @Excel(name = "有消费计划数", width = 15)
+    @ApiModelProperty(value = "有消费计划数")
+    private Long chargedCampaignCount;
+    /**
+     * 产品名
+     */
+    @Excel(name = "产品名", width = 15)
+    @ApiModelProperty(value = "产品名")
+    private String productName;
+    /**
+     * 企业名称
+     */
+    @Excel(name = "企业名称", width = 15)
+    @ApiModelProperty(value = "企业名称")
+    private String corporationName;
+    /**
+     * 首次消耗日期
+     */
+    @Excel(name = "首次消耗日期", width = 15)
+    @ApiModelProperty(value = "首次消耗日期")
+    private String firstCostDay;
+    /**
+     * 一级行业
+     */
+    @Excel(name = "一级行业", width = 15)
+    @ApiModelProperty(value = "一级行业")
+    private String industry;
+    /**
+     * 二级行业
+     */
+    @Excel(name = "二级行业", width = 15)
+    @ApiModelProperty(value = "二级行业")
+    private String secondIndustry;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 125 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouDailyFlows.java

@@ -0,0 +1,125 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手-日流水信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-12-05
+ */
+@Data
+@TableName("ctop_kuaishou_daily_flows")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_daily_flows对象", description = "快手-日流水信息")
+public class KuaiShouDailyFlows {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private String date;
+    /**
+     * 总花费(元)
+     */
+    @Excel(name = "总花费(元)", width = 15)
+    @ApiModelProperty(value = "总花费(元)")
+    private java.math.BigDecimal dailyCharge;
+    /**
+     * 充值话费(元)
+     */
+    @Excel(name = "充值话费(元)", width = 15)
+    @ApiModelProperty(value = "充值话费(元)")
+    private java.math.BigDecimal realCharged;
+    /**
+     * 框返花费(元)
+     */
+    @Excel(name = "框返花费(元)", width = 15)
+    @ApiModelProperty(value = "框返花费(元)")
+    private java.math.BigDecimal contractRebateRealCharged;
+    /**
+     * 激励花费(元)
+     */
+    @Excel(name = "激励花费(元)", width = 15)
+    @ApiModelProperty(value = "激励花费(元)")
+    private java.math.BigDecimal directRebateRealCharged;
+    /**
+     * 转入(元)
+     */
+    @Excel(name = "转入(元)", width = 15)
+    @ApiModelProperty(value = "转入(元)")
+    private java.math.BigDecimal dailyTransferIn;
+    /**
+     * 转出(元)
+     */
+    @Excel(name = "转出(元)", width = 15)
+    @ApiModelProperty(value = "转出(元)")
+    private java.math.BigDecimal dailyTransferOut;
+    /**
+     * 日终结余(元)
+     */
+    @Excel(name = "日终结余(元)", width = 15)
+    @ApiModelProperty(value = "日终结余(元)")
+    private java.math.BigDecimal balance;
+    /**
+     * 充值转入(元)
+     */
+    @Excel(name = "充值转入(元)", width = 15)
+    @ApiModelProperty(value = "充值转入(元)")
+    private java.math.BigDecimal realRecharged;
+    /**
+     * 框返转入(元)
+     */
+    @Excel(name = "框返转入(元)", width = 15)
+    @ApiModelProperty(value = "框返转入(元)")
+    private java.math.BigDecimal contractRebateRealRecharged;
+    /**
+     * 激励转入(元)
+     */
+    @Excel(name = "激励转入(元)", width = 15)
+    @ApiModelProperty(value = "激励转入(元)")
+    private java.math.BigDecimal directRebateRealRecharged;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 148 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouGroup.java

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

+ 242 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouGroupTarget.java

@@ -0,0 +1,242 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手-定向信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-12-17
+ */
+@Data
+@TableName("ctop_kuaishou_group_target")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_group_target对象", description = "快手-定向信息")
+public class KuaiShouGroupTarget {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 广告组ID
+     */
+    @Excel(name = "广告组ID", width = 15)
+    @ApiModelProperty(value = "广告组ID")
+    private Long unitId;
+    /**
+     * 地域
+     */
+    @Excel(name = "地域", width = 15)
+    @ApiModelProperty(value = "地域")
+    private String region;
+    /**
+     * 年龄最小限制
+     */
+    @Excel(name = "年龄最小限制", width = 15)
+    @ApiModelProperty(value = "年龄最小限制")
+    private Integer ageMin;
+    /**
+     * 年龄最大限制
+     */
+    @Excel(name = "年龄最大限制", width = 15)
+    @ApiModelProperty(value = "年龄最大限制")
+    private Integer ageMax;
+    /**
+     * 固定年龄段 【0:表示0-11岁】【12:表示12-17岁】【18:表示18-23岁】【24:表示24-30岁】【31:表示31-40岁】【41:表示41-49岁】【50:表示50-100岁】
+     */
+    @Excel(name = "固定年龄段 【0:表示0-11岁】【12:表示12-17岁】【18:表示18-23岁】【24:表示24-30岁】【31:表示31-40岁】【41:表示41-49岁】【50:表示50-100岁】", width = 15)
+    @ApiModelProperty(value = "固定年龄段 【0:表示0-11岁】【12:表示12-17岁】【18:表示18-23岁】【24:表示24-30岁】【31:表示31-40岁】【41:表示41-49岁】【50:表示50-100岁】")
+    private String agesRange;
+    /**
+     * 性别 1:女性, 2:男性, 0:不限
+     */
+    @Excel(name = "性别 1:女性, 2:男性, 0:不限", width = 15)
+    @ApiModelProperty(value = "性别 1:女性, 2:男性, 0:不限")
+    private Integer gender;
+    /**
+     * 操作系统 1: Android, 2: iOS, 0:不限
+     */
+    @Excel(name = "操作系统 1: Android, 2: iOS, 0:不限", width = 15)
+    @ApiModelProperty(value = "操作系统 1: Android, 2: iOS, 0:不限")
+    private Integer platformOs;
+    /**
+     * 安卓版本  3:不限, 4: 4.x+, 5: 5.x+, 6: 6.x+, 7: 7.x+;
+     */
+    @Excel(name = "安卓版本  3:不限, 4: 4.x+, 5: 5.x+, 6: 6.x+, 7: 7.x+;", width = 15)
+    @ApiModelProperty(value = "安卓版本  3:不限, 4: 4.x+, 5: 5.x+, 6: 6.x+, 7: 7.x+;")
+    private Integer androidOsv;
+    /**
+     * ios版本  6:不限, 7: 7.x+, 8: 8.x+,9: 9.x+, 10: 10.x+
+     */
+    @Excel(name = "ios版本  6:不限, 7: 7.x+, 8: 8.x+,9: 9.x+, 10: 10.x+", width = 15)
+    @ApiModelProperty(value = "ios版本  6:不限, 7: 7.x+, 8: 8.x+,9: 9.x+, 10: 10.x+")
+    private Integer iosOsv;
+    /**
+     * 网络环境 1: Wi-Fi, 2:移动网络,0:表示不限
+     */
+    @Excel(name = "网络环境 1: Wi-Fi, 2:移动网络,0:表示不限", width = 15)
+    @ApiModelProperty(value = "网络环境 1: Wi-Fi, 2:移动网络,0:表示不限")
+    private Integer network;
+    /**
+     * 设备品牌 1: OPPO, 2: VIVO,3:华为, 4:小米,5:荣耀, 6:三星,7:金立, 8:魅族,9:乐视, 10:其他,11 : 苹 果
+     */
+    @Excel(name = "设备品牌 1: OPPO, 2: VIVO,3:华为, 4:小米,5:荣耀, 6:三星,7:金立, 8:魅族,9:乐视, 10:其他,11 : 苹 果", width = 15)
+    @ApiModelProperty(value = "设备品牌 1: OPPO, 2: VIVO,3:华为, 4:小米,5:荣耀, 6:三星,7:金立, 8:魅族,9:乐视, 10:其他,11 : 苹 果")
+    private String deviceBrand;
+    /**
+     * 设备价格 1: 1500 元以下,2: 1501~2000,3: 2001~2500,4: 2501~3000,5: 3001~3500,6: 3501~4000,7: 4001~4500,8: 4501~5000,9: 5001~5500,10: 5500 元以上
+     */
+    @Excel(name = "设备价格 1: 1500 元以下,2: 1501~2000,3: 2001~2500,4: 2501~3000,5: 3001~3500,6: 3501~4000,7: 4001~4500,8: 4501~5000,9: 5001~5500,10: 5500 元以上", width = 15)
+    @ApiModelProperty(value = "设备价格 1: 1500 元以下,2: 1501~2000,3: 2001~2500,4: 2501~3000,5: 3001~3500,6: 3501~4000,7: 4001~4500,8: 4501~5000,9: 5001~5500,10: 5500 元以上")
+    private String devicePrice;
+    /**
+     * 商业兴趣类型 0:不限,2:按照兴趣标签
+     */
+    @Excel(name = "商业兴趣类型 0:不限,2:按照兴趣标签", width = 15)
+    @ApiModelProperty(value = "商业兴趣类型 0:不限,2:按照兴趣标签")
+    private Integer businessInterestType;
+    /**
+     * 商业兴趣
+     */
+    @Excel(name = "商业兴趣", width = 15)
+    @ApiModelProperty(value = "商业兴趣")
+    private String businessInterest;
+    /**
+     * 网红粉丝
+     */
+    @Excel(name = "网红粉丝", width = 15)
+    @ApiModelProperty(value = "网红粉丝")
+    private String fansStar;
+    /**
+     * 兴趣视频用户
+     */
+    @Excel(name = "兴趣视频用户", width = 15)
+    @ApiModelProperty(value = "兴趣视频用户")
+    private String interestVideo;
+    /**
+     * APP行为-按分类
+     */
+    @Excel(name = "APP行为-按分类", width = 15)
+    @ApiModelProperty(value = "APP行为-按分类")
+    private String appInterest;
+    /**
+     * APP行为-按APP名称
+     */
+    @Excel(name = "APP行为-按APP名称", width = 15)
+    @ApiModelProperty(value = "APP行为-按APP名称")
+    private String appIds;
+
+    private Integer filterConvertedLevel;
+    /**
+     * 人群包定向
+     */
+    @Excel(name = "人群包定向", width = 15)
+    @ApiModelProperty(value = "人群包定向")
+    private String population;
+    /**
+     * 人群包排除
+     */
+    @Excel(name = "人群包排除", width = 15)
+    @ApiModelProperty(value = "人群包排除")
+    private String excludePopulation;
+    private String thirdPlatformCode;
+    /**
+     * 0:关闭智能扩量,1:打开智能扩量
+     */
+    @Excel(name = "0:关闭智能扩量,1:打开智能扩量", width = 15)
+    @ApiModelProperty(value = "0:关闭智能扩量,1:打开智能扩量")
+    private Integer isOpen;
+    /**
+     * 不可突破年龄 0:可突破/无需控制,1:不可突破
+     */
+    @Excel(name = "不可突破年龄 0:可突破/无需控制,1:不可突破", width = 15)
+    @ApiModelProperty(value = "不可突破年龄 0:可突破/无需控制,1:不可突破")
+    private Integer noAgeBreak;
+    /**
+     * 不可突破性别 0:可突破/无需控制,1:不可突破
+     */
+    @Excel(name = "不可突破性别 0:可突破/无需控制,1:不可突破", width = 15)
+    @ApiModelProperty(value = "不可突破性别 0:可突破/无需控制,1:不可突破")
+    private Integer noGenderBreak;
+    /**
+     * 不可突破地域 0:可突破/无需控制,1:不可突破
+     */
+    @Excel(name = "不可突破地域 0:可突破/无需控制,1:不可突破", width = 15)
+    @ApiModelProperty(value = "不可突破地域 0:可突破/无需控制,1:不可突破")
+    private Integer noAreaBreak;
+    /**
+     * 行为定向关键词
+     */
+    @Excel(name = "行为定向关键词", width = 15)
+    @ApiModelProperty(value = "行为定向关键词")
+    private String keyword;
+    /**
+     * 行为定向 类目词
+     */
+    @Excel(name = "行为定向 类目词", width = 15)
+    @ApiModelProperty(value = "行为定向 类目词")
+    private String label;
+    /**
+     * 兴趣定向类目词
+     */
+    @Excel(name = "兴趣定向类目词", width = 15)
+    @ApiModelProperty(value = "兴趣定向类目词")
+    private String interestLabel;
+    /**
+     * 在多少天内发生行为的用户 0:7天 1:15天 2:30天 3:90天 4:180天
+     */
+    @Excel(name = "在多少天内发生行为的用户 0:7天 1:15天 2:30天 3:90天 4:180天", width = 15)
+    @ApiModelProperty(value = "在多少天内发生行为的用户 0:7天 1:15天 2:30天 3:90天 4:180天")
+    private Integer timeType;
+    /**
+     * 行为强度	0:不限 1:高强度
+     */
+    @Excel(name = "行为强度	0:不限 1:高强度", width = 15)
+    @ApiModelProperty(value = "行为强度	0:不限 1:高强度")
+    private Integer strengthType;
+    /**
+     * 行为场景	1:社区 2:APP 4:推广
+     */
+    @Excel(name = "行为场景	1:社区 2:APP 4:推广", width = 15)
+    @ApiModelProperty(value = "行为场景	1:社区 2:APP 4:推广")
+    private String sceneType;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 108 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaiShouSchedule.java

@@ -0,0 +1,108 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Description: 广告组-时间段范围
+ * @Author: jeecg-boot
+ * @Date: 2019-07-24
+ * @Version: V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_schedule")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_schedule对象", description = "广告组-时间段范围")
+public class KuaiShouSchedule {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    /**
+     * accountId
+     */
+    @Excel(name = "账号id", width = 15)
+    @ApiModelProperty(value = "账号id")
+    private Long accountId;
+
+    /**
+     * 广告组id
+     */
+    @Excel(name = "广告组id", width = 15)
+    @ApiModelProperty(value = "广告组id")
+    private Long unitId;
+    /**
+     * 周一时间段
+     */
+    @Excel(name = "周一时间段", width = 15)
+    @ApiModelProperty(value = "周一时间段")
+    private String mon;
+    /**
+     * 周二时间段
+     */
+    @Excel(name = "周二时间段", width = 15)
+    @ApiModelProperty(value = "周二时间段")
+    private String tues;
+    /**
+     * 周三时间段
+     */
+    @Excel(name = "周三时间段", width = 15)
+    @ApiModelProperty(value = "周三时间段")
+    private String wed;
+    /**
+     * 周四时间段
+     */
+    @Excel(name = "周四时间段", width = 15)
+    @ApiModelProperty(value = "周四时间段")
+    private String thur;
+    /**
+     * 周五时间段
+     */
+    @Excel(name = "周五时间段", width = 15)
+    @ApiModelProperty(value = "周五时间段")
+    private String fri;
+    /**
+     * 周六时间段
+     */
+    @Excel(name = "周六时间段", width = 15)
+    @ApiModelProperty(value = "周六时间段")
+    private String sat;
+    /**
+     * 周日时间段
+     */
+    @Excel(name = "周日时间段", width = 15)
+    @ApiModelProperty(value = "周日时间段")
+    private String sun;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 76 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouAccountBalanceBudget.java

@@ -0,0 +1,76 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 快手-账余额、预算
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-04-16
+ */
+@Data
+@TableName("ctop_kuaishou_account_balance_budget")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_account_balance_budget对象", description = "快手-账余额、预算")
+public class KuaishouAccountBalanceBudget {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 状态 0 失效,1有效
+     */
+    private Integer state;
+
+    /**
+     * 账户总余额
+     */
+    @Excel(name = "账户总余额", width = 15)
+    @ApiModelProperty(value = "账户总余额")
+    private BigDecimal balance;
+    /**
+     * 单日预算
+     */
+    @Excel(name = "单日预算", width = 15)
+    @ApiModelProperty(value = "单日预算")
+    private BigDecimal dayBudget;
+    /**
+     * 分日预算
+     */
+    @Excel(name = "分日预算", width = 15)
+    @ApiModelProperty(value = "分日预算")
+    private String dayBudgetSchedule;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 126 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouPlanCreate.java

@@ -0,0 +1,126 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手-计划创建记录
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-11-18
+ */
+@Data
+@TableName("ctop_kuaishou_plan_create")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_plan_create对象", description = "快手-计划创建记录")
+public class KuaishouPlanCreate {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    private String companyId;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 项目ID
+     */
+    @Excel(name = "项目ID", width = 15)
+    @ApiModelProperty(value = "项目ID")
+    private Long projectId;
+    /**
+     * 运营id
+     */
+    @Excel(name = "运营id", width = 15)
+    @ApiModelProperty(value = "运营id")
+    private String userId;
+    /**
+     * 运营姓名
+     */
+    @Excel(name = "运营姓名", width = 15)
+    @ApiModelProperty(value = "运营姓名")
+    private String userName;
+    /**
+     * leader姓名
+     */
+    @Excel(name = "leader姓名", width = 15)
+    @ApiModelProperty(value = "leader姓名")
+    private String leaderName;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 新建计划数
+     */
+    @Excel(name = "新建计划数", width = 15)
+    @ApiModelProperty(value = "新建计划数")
+    private Integer newPlan;
+    private Integer newUnit;
+    /**
+     * 自动化新建组数
+     */
+    @Excel(name = "自动化新建组数", width = 15)
+    @ApiModelProperty(value = "自动化新建组数")
+    private Integer autoUnit;
+
+    /**
+     * 有效新建组数
+     */
+    @Excel(name = "有效新建组数", width = 15)
+    @ApiModelProperty(value = "有效新建组数")
+    private Integer effectiveUnit;
+    /**
+     * 智能托管计划数
+     */
+    private Integer hostingPlans;
+
+    /**
+     * 批量工具搭建组数量(不包含智能托管)
+     */
+    private Integer batchUnit;
+
+
+    /**
+     * 媒体后台组搭建数(含智能托管)
+     */
+    private Integer mediaUnit;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 202 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouReportDailyAccount.java

@@ -0,0 +1,202 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("ctop_kuaishou_report_daily_account")
+public class KuaishouReportDailyAccount implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId
+    private String id;
+
+    private Long accountId;
+
+    @JsonProperty("charge")
+    private BigDecimal charge;
+
+    @JsonProperty("ad_scene")
+    private String adScene;
+
+    @JsonProperty("photo_show")
+    private Long photoShow;
+
+    @JsonProperty("aclick")
+    private Long aclick;
+
+    @JsonProperty("bclick")
+    private Long bclick;
+
+    @JsonProperty("photo_share")
+    private Long photoShare;
+
+    @JsonProperty("photo_comment")
+    private Long photoComment;
+
+    @JsonProperty("photo_like")
+    private Long photoLike;
+
+    @JsonProperty("follow")
+    private Long follow;
+
+    @JsonProperty("cancel_follow")
+    private Long cancelFollow;
+
+    @JsonProperty("report")
+    private Long report;
+
+    @JsonProperty("block")
+    private Long block;
+
+    @JsonProperty("negative")
+    private Long negative;
+
+    @JsonProperty("download_started")
+    private Long downloadStarted;
+
+    @JsonProperty("download_completed")
+    private Long downloadCompleted;
+
+    @JsonProperty("activation")
+    private Long activation;
+
+    @JsonProperty("submit")
+    private Long submit;
+
+    @JsonProperty("stat_date")
+    private String statDate;
+
+    @JsonProperty("photo_click")
+    private Long photoClick;
+
+    @JsonProperty("photo_click_ratio")
+    private Double photoClickRatio;
+
+    @JsonProperty("action_ratio")
+    private Double actionRatio;
+
+    @JsonProperty("impression_1k_cost")
+    private BigDecimal impression1kCost;
+
+    @JsonProperty("photo_click_cost")
+    private BigDecimal photoClickCost;
+
+    @JsonProperty("action_cost")
+    private BigDecimal actionCost;
+
+    @JsonProperty("event_pay_first_day")
+    private Long eventPayFirstDay;
+
+    @JsonProperty("event_pay_purchase_amount_first_day")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+
+    @JsonProperty("event_pay_first_day_roi")
+    private Double eventPayFirstDayRoi;
+
+    @JsonProperty("event_pay")
+    private Long eventPay;
+
+    @JsonProperty("event_pay_purchase_amount")
+    private BigDecimal eventPayPurchaseAmount;
+
+    @JsonProperty("event_pay_roi")
+    private Double eventPayRoi;
+
+    @JsonProperty("event_register")
+    private Long eventRegister;
+
+    @JsonProperty("event_register_cost")
+    private BigDecimal eventRegisterCost;
+
+    @JsonProperty("event_register_ratio")
+    private Double eventRegisterRatio;
+
+    @JsonProperty("event_jin_jian_app")
+    private Long eventJinJianApp;
+
+    @JsonProperty("event_jin_jian_app_cost")
+    private BigDecimal eventJinJianAppCost;
+
+    @JsonProperty("event_credit_grant_app")
+    private Long eventCreditGrantApp;
+
+    @JsonProperty("event_credit_grant_app_cost")
+    private BigDecimal eventCreditGrantAppCost;
+
+    @JsonProperty("event_credit_grant_app_ratio")
+    private Double eventCreditGrantAppRatio;
+
+    @JsonProperty("event_order_paid")
+    private Long eventOrderPaid;
+
+    @JsonProperty("event_order_paid_purchase_amount")
+    private BigDecimal eventOrderPaidPurchaseAmount;
+
+    @JsonProperty("event_jin_jian_landing_page")
+    private Long eventJinJianLandingPage;
+
+    @JsonProperty("event_jin_jian_landing_page_cost")
+    private BigDecimal eventJinJianLandingPageCost;
+
+    @JsonProperty("event_credit_grant_landing_page")
+    private Long eventCreditGrantLandingPage;
+
+    @JsonProperty("event_credit_grant_landing_page_cost")
+    private BigDecimal eventCreditGrantLandingPageCost;
+
+    @JsonProperty("event_credit_grant_landing_ratio")
+    private Double eventCreditGrantLandingRatio;
+
+    @JsonProperty("event_next_day_stay_cost")
+    private BigDecimal eventNextDayStayCost;
+
+    @JsonProperty("event_next_day_stay_ratio")
+    private BigDecimal eventNextDayStayRatio;
+
+    @JsonProperty("form_action_ratio")
+    private Double formActionRatio;
+
+    @JsonProperty("event_order_paid_cost")
+    private BigDecimal eventOrderPaidCost;
+
+    @JsonProperty("event_next_day_stay")
+    private Long eventNextDayStay;
+
+    @JsonProperty("form_cost")
+    private BigDecimal formCost;
+
+    @JsonProperty("form_count")
+    private Long formCount;
+
+    @JsonProperty("play_3s_ratio")
+    private Double play3sRatio;
+    @JsonProperty("play_5s_ratio")
+    @TableField("play_5s_ratio")
+    private Double play5sRatio;
+    @JsonProperty("play_end_ratio")
+    private Double playEndRatio;
+    @JsonProperty("event_app_invoked")
+    private Long eventAppInvoked;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    /**新增付费人数*/
+    private Long eventNewUserPay;
+    /**新增付费人数成本*/
+    private BigDecimal eventNewUserPayCost;
+    /**新增付费人数率*/
+    private BigDecimal eventNewUserPayRatio;
+
+    @JsonProperty
+    private Long keyAction;
+}
+

+ 145 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouReportDailyCampaign.java

@@ -0,0 +1,145 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("ctop_kuaishou_report_daily_campaign")
+public class KuaishouReportDailyCampaign implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private Long accountId;
+    @JsonProperty("campaign_id")
+    private Long campaignId;
+    @JsonProperty("stat_date")
+    private String statDate;
+    @JsonProperty
+    private BigDecimal charge;
+    @JsonProperty
+    private Long photoShow;
+    @JsonProperty("photo_click")
+    @TableField("photo_click")
+    private Long photoClick;
+    @JsonProperty
+    private Long aclick;
+    @JsonProperty
+    private Long bclick;
+    @JsonProperty("photo_share")
+    private Long photoShare;
+    @JsonProperty("photo_comment")
+    private Long photoComment;
+    @JsonProperty
+    private Long photoLike;
+    @JsonProperty
+    private Long follow;
+    @JsonProperty("cancel_follow")
+    private Long cancelFollow;
+    @JsonProperty
+    private Long report;
+    @JsonProperty
+    private Long block;
+    @JsonProperty
+    private Long negative;
+    @JsonProperty("download_started")
+    private Long downloadStarted;
+    @JsonProperty("download_completed")
+    private Long downloadCompleted;
+    @JsonProperty
+    private Long activation;
+    @JsonProperty
+    private Long submit;
+    @JsonProperty
+    private BigDecimal photoClickRatio;
+    @JsonProperty
+    private BigDecimal actionRatio;
+    @JsonProperty("impression_1k_cost")
+    @TableField("impression_1k_cost")
+    private BigDecimal impression1kCost;
+
+    @JsonProperty("play_3s_ratio")
+    @TableField("play_3s_ratio")
+    private BigDecimal play3sRatio;
+    @JsonProperty
+    private BigDecimal photoClickCost;
+    @JsonProperty
+    private BigDecimal actionCost;
+    @JsonProperty
+    private Long eventPayFirstDay;
+    @JsonProperty
+    private BigDecimal eventPayFirstDayRoi;
+    @JsonProperty
+    private BigDecimal eventPay;
+    @JsonProperty
+    private BigDecimal eventPayPurchaseAmount;
+    @JsonProperty
+    private BigDecimal eventPayRoi;
+    @JsonProperty
+    private Long eventRegister;
+    @JsonProperty
+    private BigDecimal eventRegisterCost;
+    private BigDecimal eventRegisterRatio;
+    private BigDecimal eventCreditGrantLandingRatio;
+    private BigDecimal eventNextDayStayCost;
+    private Long eventNextDayStay;
+    private BigDecimal eventNextDayStayRatio;
+    @JsonProperty
+    private Long eventJinJianApp;
+    @JsonProperty
+    private BigDecimal eventJinJianAppCost;
+    @JsonProperty
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    @JsonProperty
+    private Long eventCreditGrantApp;
+    @JsonProperty
+    private BigDecimal eventCreditGrantAppCost;
+    @JsonProperty
+    private BigDecimal eventCreditGrantAppRatio;
+    @JsonProperty
+    private BigDecimal eventOrderPaid;
+    @JsonProperty
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    @JsonProperty
+    private BigDecimal eventOrderPaidCost;
+    @JsonProperty
+    private Long formCount;
+    @JsonProperty
+    private BigDecimal formCost;
+    @JsonProperty
+    private BigDecimal formActionRatio;
+    @JsonProperty
+    private Long eventJinJianLandingPage;
+    @JsonProperty
+    private BigDecimal eventJinJianLandingPageCost;
+    @JsonProperty
+    private Long eventCreditGrantLandingPage;
+    @JsonProperty
+    private BigDecimal eventCreditGrantLandingPageCost;
+    private Integer status;
+    private String campaignName;
+    @JsonProperty
+    private Date createTime;
+    @JsonProperty
+    private Date updateTime;
+    @JsonProperty
+    @TableField("event_new_user_pay")
+    private Long eventNewUserPay;
+    @JsonProperty
+    @TableField("event_new_user_pay_cost")
+    private BigDecimal eventNewUserPayCost;
+    @JsonProperty
+    @TableField("event_new_user_pay_ratio")
+    private BigDecimal eventNewUserPayRatio;
+    @JsonProperty
+    @TableField("event_new_user_pay")
+    private Long keyAction;
+
+}

+ 147 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouReportHourlyAccount.java

@@ -0,0 +1,147 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("ctop_kuaishou_report_hourly_account")
+public class KuaishouReportHourlyAccount implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(type = IdType.UUID)
+    private String id;
+    private Long accountId;
+    @JsonProperty("stat_date")
+    private String statDate;
+
+    @JsonProperty("stat_hour")
+    private Integer statHour;
+
+    @JsonProperty
+    private BigDecimal charge;
+
+    @JsonProperty
+    private Long photoShow;
+    @JsonProperty("photo_click")
+    private Long photoClick;
+    @JsonProperty
+    private Long aclick;
+    @JsonProperty
+    private Long bclick;
+
+    @JsonProperty("download_started")
+    private Long downloadStarted;
+    @JsonProperty("download_completed")
+    private Long downloadCompleted;
+    @JsonProperty
+    private Long activation;
+    @JsonProperty
+    private Long submit;
+
+    @JsonProperty
+    private BigDecimal photoClickRatio;
+    @JsonProperty
+    private BigDecimal actionRatio;
+    @JsonProperty("impression_1k_cost")
+    @TableField("impression_1k_cost")
+    private BigDecimal impression1kCost;
+    @JsonProperty
+    private BigDecimal photoClickCost;
+    @JsonProperty
+    private BigDecimal actionCost;
+    @JsonProperty
+    private Long eventPayFirstDay;
+    @JsonProperty
+    private BigDecimal eventPayFirstDayRoi;
+    @JsonProperty
+    private BigDecimal eventPay;
+    @JsonProperty
+    private BigDecimal eventPayPurchaseAmount;
+    @JsonProperty
+    private BigDecimal eventPayRoi;
+    @JsonProperty
+    private Long eventRegister;
+    @JsonProperty
+    private BigDecimal eventRegisterCost;
+    @JsonProperty
+    private Long eventJinJianApp;
+    @JsonProperty
+    private BigDecimal eventJinJianAppCost;
+    @JsonProperty
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    @JsonProperty
+    private Long eventCreditGrantApp;
+    @JsonProperty
+    private BigDecimal eventCreditGrantAppCost;
+    @JsonProperty
+    private BigDecimal eventCreditGrantAppRatio;
+    @JsonProperty
+    private BigDecimal eventOrderPaid;
+    @JsonProperty
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    @JsonProperty
+    private BigDecimal eventOrderPaidCost;
+    @JsonProperty
+    private Long formCount;
+    @JsonProperty
+    private BigDecimal formCost;
+    @JsonProperty
+    private BigDecimal formActionRatio;
+    @JsonProperty
+    private Long eventJinJianLandingPage;
+    @JsonProperty
+    private BigDecimal eventJinJianLandingPageCost;
+    @JsonProperty
+    private Long eventCreditGrantLandingPage;
+    @JsonProperty
+    private BigDecimal eventCreditGrantLandingPageCost;
+    @JsonProperty
+    private BigDecimal eventNextDayStay;
+    @JsonProperty("play_3s_ratio")
+    @TableField("play_3s_ratio")
+    private BigDecimal play3sRatio;
+
+    @JsonProperty("play_5s_ratio")
+    @TableField("play_5s_ratio")
+    private Double play5sRatio;
+     @JsonProperty("play_end_ratio")
+    private Double playEndRatio;
+
+    @JsonProperty
+    private Long share;
+    @JsonProperty
+    private Long comment;
+    @JsonProperty
+    private Long photoLike;
+    @JsonProperty
+    private Long follow;
+    @JsonProperty("cancel_follow")
+    private Long cancelFollow;
+    @JsonProperty
+    private Long report;
+    @JsonProperty
+    private Long block;
+    @JsonProperty
+    private Long negative;
+    @JsonProperty
+    private Long eventAppInvoked;
+    /**新增付费人数*/
+    private Long eventNewUserPay;
+    /**新增付费人数成本*/
+    private BigDecimal eventNewUserPayCost;
+    /**新增付费人数率*/
+    private BigDecimal eventNewUserPayRatio;
+    @JsonProperty
+    private Date createTime;
+    @JsonProperty
+    private Date updateTime;
+    @JsonProperty
+    private Long keyAction;
+}

+ 199 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/KuaishouSupplyChain.java

@@ -0,0 +1,199 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手电商-供应链订单信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-12-01
+ */
+@Data
+@TableName("kuaishou_supply_chain")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "kuaishou_supply_chain对象", description = "快手电商-供应链订单信息")
+public class KuaishouSupplyChain {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 订单ID
+     */
+    @Excel(name = "订单ID", width = 15)
+    @ApiModelProperty(value = "订单ID")
+    private Long oid;
+    /**
+     * 商品ID
+     */
+    @Excel(name = "商品ID", width = 15)
+    @ApiModelProperty(value = "商品ID")
+    private Long itemId;
+    /**
+     * 商品标题
+     */
+    @Excel(name = "商品标题", width = 15)
+    @ApiModelProperty(value = "商品标题")
+    private String itemTitle;
+    /**
+     * 商品单价
+     */
+    @Excel(name = "商品单价", width = 15)
+    @ApiModelProperty(value = "商品单价")
+    private Long reservePrice;
+    /**
+     * 商品图片
+     */
+    @Excel(name = "商品图片", width = 15)
+    @ApiModelProperty(value = "商品图片")
+    private String imageUrl;
+    /**
+     * 订单状态
+     */
+    @Excel(name = "订单状态", width = 15)
+    @ApiModelProperty(value = "订单状态")
+    private Integer orderStatus;
+    /**
+     * 订单创建时间
+     */
+    @Excel(name = "订单创建时间", width = 15)
+    @ApiModelProperty(value = "订单创建时间")
+    private Long orderCreateTime;
+    /**
+     * 是否发货
+     */
+    @Excel(name = "是否发货", width = 15)
+    @ApiModelProperty(value = "是否发货")
+    private Integer sendStatus;
+    /**
+     * 订单类型
+     */
+    @Excel(name = "订单类型", width = 15)
+    @ApiModelProperty(value = "订单类型")
+    private Integer settlementBizType;
+    /**
+     * 订单类型翻译
+     */
+    @Excel(name = "订单类型翻译", width = 15)
+    @ApiModelProperty(value = "订单类型翻译")
+    private String settlementBizTypeDesc;
+    /**
+     * 发货时间
+     */
+    @Excel(name = "发货时间", width = 15)
+    @ApiModelProperty(value = "发货时间")
+    private Long sendTime;
+    /**
+     * 收获时间
+     */
+    @Excel(name = "收获时间", width = 15)
+    @ApiModelProperty(value = "收获时间")
+    private Long recvTime;
+    /**
+     * 商家id
+     */
+    @Excel(name = "商家id", width = 15)
+    @ApiModelProperty(value = "商家id")
+    private Long sellerId;
+    /**
+     * 达人id
+     */
+    @Excel(name = "达人id", width = 15)
+    @ApiModelProperty(value = "达人id")
+    private Long promoterId;
+    /**
+     * 达人昵称
+     */
+    @Excel(name = "达人昵称", width = 15)
+    @ApiModelProperty(value = "达人昵称")
+    private String promoterNickName;
+    /**
+     * 活动id
+     */
+    @Excel(name = "活动id", width = 15)
+    @ApiModelProperty(value = "活动id")
+    private Long activityId;
+    /**
+     * 订单金额
+     */
+    @Excel(name = "订单金额", width = 15)
+    @ApiModelProperty(value = "订单金额")
+    private Long orderAmount;
+    /**
+     * 付款金额
+     */
+    @Excel(name = "付款金额", width = 15)
+    @ApiModelProperty(value = "付款金额")
+    private Long payAmount;
+    /**
+     * 服务费率
+     */
+    @Excel(name = "服务费率", width = 15)
+    @ApiModelProperty(value = "服务费率")
+    private Long regimentalPromotionRate;
+    /**
+     * 分成比例
+     */
+    @Excel(name = "分成比例", width = 15)
+    @ApiModelProperty(value = "分成比例")
+    private Long shareRate;
+    /**
+     * 货款基数
+     */
+    @Excel(name = "货款基数", width = 15)
+    @ApiModelProperty(value = "货款基数")
+    private Long baseAmount;
+    /**
+     * 技术服务费
+     */
+    @Excel(name = "技术服务费", width = 15)
+    @ApiModelProperty(value = "技术服务费")
+    private Long serviceAmount;
+    /**
+     * 预估服务费收入
+     */
+    @Excel(name = "预估服务费收入", width = 15)
+    @ApiModelProperty(value = "预估服务费收入")
+    private Long regimentalPromotionAmount;
+    /**
+     * 结算服务费收入
+     */
+    @Excel(name = "结算服务费收入", width = 15)
+    @ApiModelProperty(value = "结算服务费收入")
+    private Long totalRegimentalSettleAmount;
+    private String statDate;
+    private Long itemCommissionRate;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 100 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/OauthAgentToken.java

@@ -0,0 +1,100 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 代理商token
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-08-18
+ */
+@Data
+@TableName("ctop_oauth_agent_token")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_oauth_agent_token对象", description = "代理商token")
+public class OauthAgentToken {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "主键ID")
+    private String id;
+    /**
+     * 媒体ID(外部广告平台类型,快手/头条/抖音等)
+     */
+    @Excel(name = "媒体ID(外部广告平台类型,快手/头条/抖音等)", width = 15)
+    @ApiModelProperty(value = "媒体ID(外部广告平台类型,快手/头条/抖音等)")
+    private String mediaId;
+
+    private Long agentId;
+    /**
+     * 访问令牌
+     */
+    @Excel(name = "访问令牌", width = 15)
+    @ApiModelProperty(value = "访问令牌")
+    private String accessToken;
+    /**
+     * 访问令牌有效期
+     */
+    @Excel(name = "访问令牌有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "访问令牌有效期")
+    private Date accessTokenExpiresIn;
+    /**
+     * 刷新令牌
+     */
+    @Excel(name = "刷新令牌", width = 15)
+    @ApiModelProperty(value = "刷新令牌")
+    private String refreshToken;
+    /**
+     * 刷新令牌有效期
+     */
+    @Excel(name = "刷新令牌有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "刷新令牌有效期")
+    private Date refreshTokenExpiresIn;
+    /**
+     * 代理商类型 0:三方代理商 1:本代理商
+     */
+    @Excel(name = "代理商类型 0:三方代理商 1:本代理商", width = 15)
+    @ApiModelProperty(value = "代理商类型 0:三方代理商 1:本代理商")
+    private Integer agentType;
+
+
+    private  Long appId;
+    private String secret;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 153 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/Project.java

@@ -0,0 +1,153 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 项目
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-19
+ */
+@Data
+@TableName("ctop_project")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_project对象", description = "项目")
+public class Project {
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+    /**
+     * 广告主id
+     */
+    @Excel(name = "广告主id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    private String advertiserId;
+
+
+    @Excel(name = "产品id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    private Long productId;
+
+    /**
+     * 创建人
+     */
+    @Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+    private String userId;
+    /**
+     * 负责人id
+     */
+    @Excel(name = "负责人id", width = 15)
+    @ApiModelProperty(value = "负责人id")
+    private String responsibleId;
+
+
+    @Excel(name = "设计负责人", width = 15)
+    @ApiModelProperty(value = "设计负责人")
+    private String designResponsibleId;
+
+
+    @Excel(name = "公司id", width = 15)
+    @ApiModelProperty(value = "公司id")
+    private String companyId;
+    /**
+     * 媒体类型
+     */
+    @Excel(name = "媒体类型", width = 15)
+    @ApiModelProperty(value = "媒体类型")
+    private String mediaId;
+
+    /**
+     * 最高出价
+     */
+    private Long maxBid;
+
+    private String supplierCode;
+
+
+    // 销售
+    private String saleId;
+    /**
+     * 最高深度转化出价
+     */
+    private BigDecimal maxDeepCpaBid;
+    private Integer checkLink;
+    private Integer materialShare;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+
+    //优化目标出价类型
+    private String bidType;
+
+    //转化目标
+    private String ocpxActionType;
+
+    //深度转化目标
+    private String deepConversionType;
+
+    @TableField(exist = false)
+    private String responsibleId_dictText; // 运营负责人
+
+    @TableField(exist = false)
+    private String saleId_dictText; // 销售
+
+    @TableField(exist = false)
+    private String designResponsibleId_dictText; // 设计负责人
+    @TableField(exist = false)
+    private String advertiserId_dictText; // 广告主名称
+    @TableField(exist = false)
+    private String productId_dictText; // 产品名称
+    @TableField(exist = false)
+    private Integer needExamine;
+    @TableField(exist = false)
+    private String supplierCode_dictText;
+
+    //转化目标
+    @TableField(exist = false)
+    private JSONArray ocpxActionTypeArray;
+
+    //深度转化目标
+    @TableField(exist = false)
+    private JSONArray deepConversionTypeArray;
+}

+ 45 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDataAccountKuaishou.java

@@ -0,0 +1,45 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 快手预警数据账户维度
+ */
+@Data
+@TableName("ctop_rule_data_account_kuaishou")
+public class RuleDataAccountKuaishou {
+    
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**账户id*/
+	private Long accountId;
+	/**accountName*/
+	private String accountName;
+	/**消耗*/
+	private BigDecimal cost;
+	/**validBalance*/
+	private BigDecimal validBalance;
+	/**转化数*/
+	private Long convertNum;
+	/**转化成本*/
+	private BigDecimal convertCost;
+	/**次留数*/
+	private Long nextDayOpenNum;
+	/**nextDayOpenCost*/
+	private BigDecimal nextDayOpenCost;
+	/**次留率*/
+	private BigDecimal nextDayOpenRate;
+	/**status*/
+	private Integer status;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+}

+ 70 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDataTargetKuaishou.java

@@ -0,0 +1,70 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 快手预警指标数据
+ */
+@Data
+@TableName("ctop_rule_data_target_kuaishou")
+public class RuleDataTargetKuaishou {
+
+	/**id*/
+	private Long id;
+	/**accountId*/
+	private Long accountId;
+	/**planId*/
+	private Long planId;
+	/**unitId*/
+	private Long unitId;
+	/**广告位*/
+	private String sceneId;
+	/**地域定向*/
+	private String region;
+	/**gender*/
+	private Integer gender;
+	/**操作系统*/
+	private Integer platformOs;
+	/**手机品牌*/
+	private String deviceBrand;
+	/**手机价格*/
+	private String devicePrice;
+	/**智能扩量*/
+	private Integer isOpen;
+	/**过滤已转化人群*/
+	private Integer filterConvertedLevel;
+	/**投放时段*/
+	private String scheduleTime;
+
+	private Integer status;
+
+	/**应用商店*/
+	private String appStore;
+
+	/**定向人群包*/
+	private String population;
+
+	/**排除人群包*/
+	private String excludePopulation;
+
+	/**年龄范围*/
+	private String agesRange;
+
+	/**商业兴趣*/
+	private String businessInterest;
+
+	/**网络环境*/
+	private Integer network;
+
+	private java.util.Date createTime;
+	private java.util.Date updateTime;
+
+	private BigDecimal cpaBid;
+	private Integer ocpxActionType;
+	private Integer deepConversionType;
+	private BigDecimal deepConversionBid;
+
+}

+ 28 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDatePlanKuaishou.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * 预警快手计划数据清洗
+ */
+@Data
+@TableName("ctop_rule_date_plan_kuaishou")
+public class RuleDatePlanKuaishou {
+    
+	/**id*/
+	private Long id;
+	/**accountId*/
+	private Long accountId;
+	/**accountName*/
+	private String accountName;
+	/**planId*/
+	private Long planId;
+	/**planName*/
+	private String planName;
+
+	private Integer status;
+
+	private java.util.Date createTime;
+
+}

+ 94 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/RuleDateUnitKuaishou.java

@@ -0,0 +1,94 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 快手预警组数据
+ */
+@Data
+@TableName("ctop_rule_data_unit_kuaishou")
+public class RuleDateUnitKuaishou {
+
+    /**
+     * id
+     */
+    private Long id;
+    /**
+     * accountId
+     */
+    private Long accountId;
+    /**
+     * planId
+     */
+    private Long planId;
+    /**
+     * unitId
+     */
+    private Long unitId;
+    /**
+     * unitName
+     */
+    private String unitName;
+    /**
+     * 消耗
+     */
+    private BigDecimal charge;
+
+    private Long convertNum;
+
+    private BigDecimal convertCost;
+
+    /**
+     * activation
+     */
+    private Long activation;
+    /**
+     * 激活单价
+     */
+    private BigDecimal activationCost;
+    /**
+     * 注册数
+     */
+    private Long eventRegister;
+    /**
+     * 表单
+     */
+    private BigDecimal registerCost;
+    /**
+     * 表单
+     */
+    private Long formCount;
+    /**
+     * 表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 付费
+     */
+    private Long eventPay;
+    /**
+     * 深度转化目标出价
+     */
+
+    /**
+     * 安卓版本  3:不限, 4: 4.x+, 5: 5.x+, 6: 6.x+, 7: 7.x+;
+     */
+    private Integer androidOsv;
+    /**
+     * 优化目标
+     * 2:行为数;180:激活数;53:表单数;190: 付费;191:首日ROI;324:唤起应用;348:有效线索;383: 授信;384: 完件;394:订单提交;;396:注册
+     */
+
+
+    private BigDecimal payCost;
+    /**
+     * 出价
+     */
+    private Integer status;
+
+    private java.util.Date createTime;
+    private java.util.Date updateTime;
+}

+ 33 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/TransactionDay.java

@@ -0,0 +1,33 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import lombok.Data;
+
+@Data
+public class TransactionDay {
+    //
+    private String id;
+    //广告主ID
+    private String advertiserId;
+    //日期
+    private String date;
+    //日终结余(单位元)
+    private String balance;
+    //现金支出(单位元)
+    private String cashCost;
+    //总支出(单位元)
+    private String cost;
+    //冻结(单位元)
+    private String frozen;
+    //总存入(单位元)
+    private String income;
+    //赠款支出(单位元)
+    private String rewardCost;
+    //共享钱包支出(单位元)
+    private String sharedWalletCost;
+    //总转入(单位元)
+    private String transferIn;
+    //总转出(单位元)
+    private String transferOut;
+    //创建时间
+    private String createTime;
+}

+ 73 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/TransactionDetails.java

@@ -0,0 +1,73 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("ctop_account_transaction_details")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_account_transaction_details对象", description = "账户交易流水")
+public class TransactionDetails {
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private String id;
+
+    //广告主ID
+    @ApiModelProperty(value = "advertiser_id")
+    private String advertiser_id;
+
+    //流水类型  RECHARGE:充值      TRANSFER:转账
+    @ApiModelProperty(value = "transaction_type")
+    private String transaction_type;
+
+    //流水产生时间
+    @ApiModelProperty(value = "data_time")
+    private String data_time;
+
+    //交易总金额(单位元)
+    @ApiModelProperty(value = "amount")
+    private BigDecimal amount;
+
+    //现金总金额(单位元)
+    @ApiModelProperty(value = "cash")
+    private BigDecimal cash;
+
+    //赠款总金额(单位元)
+    @ApiModelProperty(value = "grant")
+    private BigDecimal grant;
+
+    //返货总金额(单位元)
+    @ApiModelProperty(value = "return_goods")
+    private BigDecimal return_goods;
+
+    //交易流水号
+    @ApiModelProperty(value = "transaction_seq")
+    private String transaction_seq;
+
+    //付款方,即广告主id
+    @ApiModelProperty(value = "remitter")
+    private String remitter;
+
+    //收款方,即广告主id。
+    @ApiModelProperty(value = "payee")
+    private String payee;
+
+    //返点
+    @ApiModelProperty(value = "dealbase")
+    private String dealbase;
+
+    //数据创建时间
+    @ApiModelProperty(value = "create_time")
+    private String create_time;
+
+
+}

+ 167 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/UserAllocation.java

@@ -0,0 +1,167 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 用户分配
+ */
+@Data
+@TableName("ctop_user_allocation")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_user_allocation对象", description = "用户分配")
+public class UserAllocation implements Serializable {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 登陆人id
+     */
+    @Excel(name = "登陆人id", width = 15)
+    @ApiModelProperty(value = "登陆人id")
+    private String userId;
+
+
+    @Excel(name = "登陆人名称", width = 15)
+    @ApiModelProperty(value = "登陆人名称")
+    private String userName;
+
+    /**
+     * 账户id --授权
+     */
+    @Excel(name = "账户id --授权", width = 15)
+    @ApiModelProperty(value = "账户id --授权")
+    private Long accountId;
+    /**
+     * 广告主ID
+     */
+    @Excel(name = "广告主ID", width = 15)
+    @ApiModelProperty(value = "广告主ID")
+    private String advertiserId;
+
+    private String systemType;
+
+    /**
+     * 项目id
+     */
+    private Long projectId;
+
+    /**
+     * 输入账号  --登陆
+     */
+    @Excel(name = "输入账号  --登陆", width = 15)
+    @ApiModelProperty(value = "输入账号  --登陆")
+    private String accountName;
+
+    /**
+     * 预警 金额
+     */
+    private BigDecimal warningAmount;
+
+    /**
+     * 预警 比例
+     */
+    private BigDecimal warningProportion;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 授权名称
+     */
+    @Excel(name = "授权名称", width = 15)
+    @ApiModelProperty(value = "授权名称")
+    private String authName;
+
+    /**
+     * 授权开始时间
+     */
+    @Excel(name = "授权开始时间", width = 15)
+    @ApiModelProperty(value = "授权开始时间")
+    private String authBeginTime;
+
+
+    /**
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer accountStatus;
+
+    /**
+     * 检测链接预警
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer monitoringLink;
+
+    /**
+     * 检测链接预警
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer landingPage;
+
+    /**
+     * 是否开启删评论
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer deleteComment;
+    /**
+     * 自动投放,0关闭,1开启
+     */
+    private Integer autoDelivery;
+    /**
+     * 物料类型 0-不同步,1应用包,(2人群包,3定向包)
+     */
+    private String materialType;
+
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+    /**
+     * 平台类型 1 头条 2快手
+     */
+    @Excel(name = "平台类型 1 头条 2快手", width = 15)
+    @ApiModelProperty(value = "平台类型 1 头条 2快手")
+    private String mediaId;
+
+
+
+
+   /* @TableField(exist = false)
+    private String advertiserName;
+
+    @TableField(exist = false)
+    private String projectName;*/
+
+}

+ 75 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/WarningOperationLog.java

@@ -0,0 +1,75 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 预警操作记录
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-11
+ */
+@Data
+@TableName("ctop_warning_operation_log")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_warning_operation_log对象", description = "预警操作记录")
+public class WarningOperationLog {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long unitId;
+    /**
+     * 发送人
+     */
+    @Excel(name = "发送人", width = 15)
+    @ApiModelProperty(value = "发送人")
+    private String userId;
+    /**
+     * 标题
+     */
+    @Excel(name = "标题", width = 15)
+    @ApiModelProperty(value = "标题")
+    private String subject;
+    /**
+     * 预警类型 1 出价方式  2 出价过高
+     */
+    @Excel(name = "预警类型 1 出价方式  2 出价过高 ", width = 15)
+    @ApiModelProperty(value = "预警类型 1 出价方式  2 出价过高 ")
+    private Integer warningType;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 86 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/entity/WexinConfig.java

@@ -0,0 +1,86 @@
+package cn.com.ctop.job.kuaishou.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import me.chanjar.weixin.cp.api.WxCpService;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 企业微信配置信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-06-17
+ */
+@Data
+@TableName("ctop_wexin_config")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_wexin_config对象", description = "企业微信配置信息")
+public class WexinConfig {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * corpId
+     */
+    @Excel(name = "corpId", width = 15)
+    @ApiModelProperty(value = "corpId")
+    private String corpId;
+    /**
+     * agentId
+     */
+    @Excel(name = "agentId", width = 15)
+    @ApiModelProperty(value = "agentId")
+    private Integer agentId;
+    /**
+     * corpSecret
+     */
+    @Excel(name = "corpSecret", width = 15)
+    @ApiModelProperty(value = "corpSecret")
+    private String corpSecret;
+    /**
+     * aesKey
+     */
+    @Excel(name = "aesKey", width = 15)
+    @ApiModelProperty(value = "aesKey")
+    private String aesKey;
+    /**
+     * token
+     */
+    @Excel(name = "token", width = 15)
+    @ApiModelProperty(value = "token")
+    private String token;
+    /**
+     * remarks
+     */
+    @Excel(name = "remarks", width = 15)
+    @ApiModelProperty(value = "remarks")
+    private String remarks;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private WxCpService wxCpService;
+}

+ 69 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/enums/KuaishouHourEnum.java

@@ -0,0 +1,69 @@
+package cn.com.ctop.job.kuaishou.enums;
+
+
+import com.alibaba.fastjson.JSONArray;
+
+public enum KuaishouHourEnum {
+    HOUR_0(" 00:"),
+    HOUR_1(" 01:"),
+    HOUR_2(" 02:"),
+    HOUR_3(" 03:"),
+    HOUR_4(" 04:"),
+    HOUR_5(" 05:"),
+    HOUR_6(" 06:"),
+    HOUR_7(" 07:"),
+    HOUR_8(" 08:"),
+    HOUR_9(" 09:"),
+    HOUR_10(" 10:"),
+    HOUR_11(" 11:"),
+    HOUR_12(" 12:"),
+    HOUR_13(" 13:"),
+    HOUR_14(" 14:"),
+    HOUR_15(" 15:"),
+    HOUR_16(" 16:"),
+    HOUR_17(" 17:"),
+    HOUR_18(" 18:"),
+    HOUR_19(" 19:"),
+    HOUR_20(" 20:"),
+    HOUR_21(" 21:"),
+    HOUR_22(" 22:"),
+    HOUR_23(" 23:");
+
+
+    /**
+     * 类型
+     */
+    private String value;
+
+
+    KuaishouHourEnum(String value) {
+        this.value = value;
+
+    }
+
+    public static JSONArray getHourList() {
+        JSONArray hourList = new JSONArray();
+        for (KuaishouHourEnum hourEnum : KuaishouHourEnum.values()) {
+            hourList.add(hourEnum.getValue());
+        }
+        return hourList;
+    }
+
+
+    public String getValue() {
+        return this.value;
+    }
+
+
+    public void setType(String value) {
+        this.value = value;
+    }
+
+    public static void main(String[] args) {
+        JSONArray hourList = getHourList();
+        System.err.println(hourList);
+    }
+
+
+
+}

+ 57 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/enums/KuaishouMinSecEnum.java

@@ -0,0 +1,57 @@
+package cn.com.ctop.job.kuaishou.enums;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+public enum KuaishouMinSecEnum {
+    MIN_SEC_1("00:00", "60:00");
+    // MIN_SEC_2("30:00", "60:00");
+
+
+
+    /**
+     * 类型
+     */
+    private String startTime;
+    private String endTime;
+
+
+    KuaishouMinSecEnum(String startTime, String endTime) {
+        this.startTime = startTime;
+        this.endTime = endTime;
+
+    }
+
+    public static JSONArray getMinSecList() {
+        JSONArray minSecList = new JSONArray();
+        for (KuaishouMinSecEnum minSecEnum : KuaishouMinSecEnum.values()) {
+            JSONObject json = new JSONObject();
+            json.put("startTime",minSecEnum.getStartTime());
+            json.put("endTime",minSecEnum.getEndTime());
+            minSecList.add(json);
+        }
+        return minSecList;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public static void main(String[] args) {
+        JSONArray minSecList = getMinSecList();
+        System.err.println(minSecList);
+    }
+}

+ 17 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/AccountAttributionInfoJob.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AccountAttributionInfoJob {
+    @Autowired
+    private CommonService commonService;
+
+    @XxlJob("reloadAccountAttributionInfo")
+    public void execute() throws Exception {
+        commonService.reloadData();
+    }
+}

+ 21 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckKuaishouActivityInfoJob.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.stereotype.Component;
+
+/**
+ * 供应链-快分销数据
+ */
+@Component
+public class CheckKuaishouActivityInfoJob {
+
+    @XxlJob("checkKuaishouActivityInfoJob")
+    public void execute() throws Exception {
+        //昨天
+        HttpUtils.httpGet("http://ruixuan.api.tjyourong.com.cn/isv/supply_chain/addListKuaishouActivityInfo", null, null);
+        XxlJobHelper.log(" --------团长查询招商活动列表,执行完成-------- ");
+    }
+}

+ 20 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckPromoterJob.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.stereotype.Component;
+
+/**
+ * 达人补全定时
+ */
+@Component
+public class CheckPromoterJob {
+
+    @XxlJob("checkPromoterJob")
+    public void execute() throws Exception {
+        HttpUtils.httpGet("http://ruixuan.api.tjyourong.com.cn/kuaishou/promoter/supplementInfo", null, null);
+        XxlJobHelper.log(" --------达人补全,执行完成-------- ");
+    }
+}

+ 20 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckPromoterStatusJob.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.stereotype.Component;
+
+/**
+ * 申样达人单品出单大于等于50单  定时任务直接审核通过,无需上传作业
+ */
+@Component
+public class CheckPromoterStatusJob {
+
+    @XxlJob("checkPromoterStatusJob")
+    public void execute() throws Exception {
+        HttpUtils.httpGet("http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/updateStatusToApproved", null, null);
+        XxlJobHelper.log(" --------申样达人单品出单大于等于50单 定时任务直接审核通过,无需上传作业-------- ");
+    }
+}

+ 30 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CheckSupplyChainJob.java

@@ -0,0 +1,30 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 供应链-快分销数据
+ */
+@Component
+public class CheckSupplyChainJob {
+
+    @XxlJob("checkSupplyChainJob")
+    public void execute() throws Exception {
+        String today = DateUtils.getNowDateStr();
+        //昨天
+        String yesterday = DateUtils.getLastDay(today, 1);
+        Map<String, Object> paramMap = new HashMap<String, Object>();
+        paramMap.put("endDate", today);
+        paramMap.put("beginDate", yesterday);
+        HttpUtils.httpGet("http://ruixuan.api.tjyourong.com.cn/isv/supply_chain/addList", paramMap, null);
+        XxlJobHelper.log(" --------供应链-快分销数据,执行完成-------- " + paramMap.toString());
+    }
+}

+ 29 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/ExternalMaterialCollectionJob.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * 清洗外部素材集信息表
+ */
+@Component
+@Slf4j
+public class ExternalMaterialCollectionJob {
+
+    /**
+     * 快手自动创建组
+     */
+    @XxlJob("externalMaterialCollectionJob")
+    public void execute() {
+        String url = "http://api.tjyourong.com.cn/jeecg-boot/external/materialCollection/createInternalMaterial";
+        log.info("请求地址:{}", url);
+        try {
+            HttpUtils.httpGet(url, null, null);
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+}

+ 48 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/HostingCreateJob.java

@@ -0,0 +1,48 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Component
+public class HostingCreateJob {
+    @Autowired
+    private CommonService commonService;
+
+    /**
+     * 智能托管
+     */
+    @XxlJob("createHosting")
+    public void createHosting() {
+        String url = "http://api.tjyourong.com.cn/jeecg-boot/task/kuaishouHostingTask/createHosting";
+        List<Long> idList = commonService.getHostingIdList();
+        if (Check.isNull(idList)) {
+            log.error("没有待创建的智能托管定时任务");
+            return;
+        }
+        for (int i = 0; i < idList.size(); i++) {
+            Long tableId = idList.get(i);
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("id", tableId);
+            String s = HttpUtils.httpGet(url, requestMap, null);
+            JSONObject result = JSONObject.parseObject(s);
+            if (!Check.isNull(result)) {
+                if (result.getInteger("code") != 0) {
+                    log.error("任务提交失败,id:{}", tableId);
+                }
+            } else {
+                log.error("任务提交返回结果为空,id:{}", tableId);
+            }
+        }
+    }
+}

+ 374 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/JiaoYangFenXiaoJob.java

@@ -0,0 +1,374 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.enums.KuaishouHourEnum;
+import cn.com.ctop.job.kuaishou.enums.KuaishouMinSecEnum;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Component
+public class JiaoYangFenXiaoJob {
+    @Autowired
+    private CommonService commonService;
+
+
+    /**
+     * 获取二创信息
+     *
+     * @throws Exception
+     */
+    @XxlJob("jyTopItem")
+    public void jyTopItem() throws Exception {
+        String cookie = commonService.getCookieById(341063986L);
+        if (Check.isNull(cookie)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDateStr();
+        Long statDate = Long.valueOf(nowDate.replace("-", ""));
+        List<JSONObject> accountList = commonService.getAccountList();
+        for (int i = 0; i < accountList.size(); i++) {
+            JSONObject jsonObject = accountList.get(i);
+            Long id = jsonObject.getLong("id");
+            String name = jsonObject.getString("name");
+            commonService.getItemTop(cookie, statDate, id, name, 0);
+        }
+    }
+
+
+    /**
+     * 获取二创信息
+     *
+     * @throws Exception
+     */
+    @XxlJob("jyClipCooperation")
+    public void jyClipCooperation() throws Exception {
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        Long statDate = Long.valueOf(date.replace("-", ""));
+        List<Integer> statusList = new ArrayList();
+
+        statusList.add(1);
+
+        for (int p = 0; p < cookies.size(); p++) {
+            JSONObject cookieJson = cookies.get(p);
+            String cookie = cookieJson.getString("cookie");
+            for (int i = 0; i < statusList.size(); i++) {
+                Integer status = statusList.get(i);
+                commonService.getClipCooperation(cookie, 0, statDate, status);
+            }
+
+        }
+
+
+    }
+
+
+    /**
+     * 获取二创信息
+     *
+     * @throws Exception
+     */
+    @XxlJob("jyClipCooperationV2")
+    public void jyClipCooperationV2() throws Exception {
+
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        Long statDate = Long.valueOf(date.replace("-", ""));
+        List<Integer> statusList = new ArrayList();
+
+        statusList.add(1);
+
+        for (int p = 0; p < cookies.size(); p++) {
+            JSONObject cookieJson = cookies.get(p);
+            String cookie = cookieJson.getString("cookie");
+            for (int i = 0; i < statusList.size(); i++) {
+                Integer status = statusList.get(i);
+                commonService.getClipCooperationV2(cookie, 0, statDate, status);
+            }
+
+        }
+
+
+    }
+
+    /**
+     * 当前小时数据获取
+     **/
+    @XxlJob("jyNowHourOrderGet")
+    public void jyNowHourOrderGet() throws Exception {
+        log.info("-------------------------获取快分销订单当天当小时数据开始--------------------------");
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String date = DateUtils.getNowDate("yyyy-MM-dd");
+        Integer nowHour = DateUtils.getNowHour();
+        JSONArray hours = new JSONArray();
+        hours.add(nowHour);
+        if (nowHour >= 1) {
+            hours.add(nowHour - 1);
+        }
+
+
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        for (int i = 0; i < hours.size(); i++) {
+            Integer hour = hours.getInteger(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + " " + hour + ":" + startTime;
+                String end = date + " " + hour + ":" + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    commonService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 当天前前小时数据获取
+     **/
+    /**
+     * 当天数据获取
+     **/
+    @XxlJob("jyFrontHourOrderGet")
+    public void frontHourOrderGet() throws Exception {
+
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String date = DateUtils.getNowDate("yyyy-MM-dd");
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Integer nowHour = DateUtils.getNowHour();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            Integer integer = Integer.valueOf(hour.replace(":", "").replace(" ", ""));
+            if (integer <= nowHour) {
+                for (int j = 0; j < minSecList.size(); j++) {
+                    JSONObject minSecJson = minSecList.getJSONObject(j);
+                    String startTime = minSecJson.getString("startTime");
+                    String endTime = minSecJson.getString("endTime");
+                    String start = date + hour + startTime;
+                    String end = date + hour + endTime;
+                    System.err.println("开始时间:" + start);
+                    System.err.println("结束时间:" + end);
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Long orderCreateTimeStart = sdf.parse(start).getTime();
+                    Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                    for (int p = 0; p < cookies.size(); p++) {
+                        JSONObject cookieJson = cookies.get(p);
+                        String cookie = cookieJson.getString("cookie");
+                        commonService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
+                    }
+                }
+            }
+        }
+
+
+    }
+
+
+    /**
+     * 昨日快分销数据获取
+     **/
+    @XxlJob("jyYesterdayOrderGet")
+    public void jyYesterdayOrderGet() throws Exception {
+        log.info("-------------------------获取快分销订单昨日数据开始数据开始--------------------------");
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + hour + startTime;
+                String end = date + hour + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    commonService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 前日日快分销数据获取
+     **/
+    @XxlJob("jyBeforeYesterdayOrderGet")
+    public void jyBeforeYesterdayOrderGet() throws Exception {
+        log.info("-------------------------获取快分销订单前日数据开始数据开始--------------------------");
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + hour + startTime;
+                String end = date + hour + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    commonService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
+                }
+
+            }
+        }
+    }
+
+
+    /**
+     * 快分销-当前月所有数据
+     **/
+    @XxlJob("jyNowMonthyOrderGet")
+    public void jyNowMonthyOrderGet() throws Exception {
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -3);
+        String monthFirstDay = DateUtils.getMonthFirstDay();
+        List<String> days = DateUtils.getDays(monthFirstDay, endDate);
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        for (int z = 0; z < days.size(); z++) {
+            String date = days.get(z);
+            for (int i = 0; i < hourList.size(); i++) {
+                String hour = hourList.getString(i);
+                for (int j = 0; j < minSecList.size(); j++) {
+                    JSONObject minSecJson = minSecList.getJSONObject(j);
+                    String startTime = minSecJson.getString("startTime");
+                    String endTime = minSecJson.getString("endTime");
+                    String start = date + hour + startTime;
+                    String end = date + hour + endTime;
+                    System.err.println("开始时间:" + start);
+                    System.err.println("结束时间:" + end);
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Long orderCreateTimeStart = sdf.parse(start).getTime();
+                    Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                    for (int p = 0; p < cookies.size(); p++) {
+                        JSONObject cookieJson = cookies.get(p);
+                        String cookie = cookieJson.getString("cookie");
+                        commonService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 上个月数据获取
+     *
+     * @throws Exception
+     */
+    @XxlJob("jyAllOrderGet")
+    public void jyAllOrderGet() throws Exception {
+        //   List<String> dateList = new ArrayList<>();
+        Map<String, String> monthStartAndEnd = DateUtils.getMonthStartAndEnd();
+        String firstDay = monthStartAndEnd.get("firstDay");
+        String lastDay = monthStartAndEnd.get("lastDay");
+        List<String> days = DateUtils.getDays(firstDay, lastDay);
+        List<JSONObject> cookies = commonService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+
+
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        for (int z = 0; z < days.size(); z++) {
+            String date = days.get(z);
+            for (int i = 0; i < hourList.size(); i++) {
+                String hour = hourList.getString(i);
+                for (int j = 0; j < minSecList.size(); j++) {
+                    JSONObject minSecJson = minSecList.getJSONObject(j);
+                    String startTime = minSecJson.getString("startTime");
+                    String endTime = minSecJson.getString("endTime");
+                    String start = date + hour + startTime;
+                    String end = date + hour + endTime;
+                    System.err.println("开始时间:" + start);
+                    System.err.println("结束时间:" + end);
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Long orderCreateTimeStart = sdf.parse(start).getTime();
+                    Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                    for (int p = 0; p < cookies.size(); p++) {
+                        JSONObject cookieJson = cookies.get(p);
+                        String cookie = cookieJson.getString("cookie");
+                        commonService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd);
+                    }
+                }
+            }
+
+        }
+    }
+
+
+}

+ 19 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KFXAccessTokenJob.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KFXAccessTokenJob {
+
+    @XxlJob("refreshAccessToken")
+    public void refreshAccessToken() {
+        String url = "http://ruixuan.api.tjyourong.com.cn/item/accessToken";
+        HttpUtils.httpGet(url, null, null);
+        String mgsUrl = "http://mgs.api.tjyourong.com.cn/item/accessToken";
+        HttpUtils.httpGet(mgsUrl, null, null);
+
+    }
+
+}

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

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

+ 21 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouRefreshAgentTokenJob.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaiShouRefreshAgentTokenJob {
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 代理商刷新token
+     */
+    @XxlJob("kuaiShouRefreshAgentTokenJob")
+    public void execute() throws Exception {
+        tokenService.getKuaiShouAgentRefresh();
+    }
+}
+

+ 22 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouRefreshLiveTokenJob.java

@@ -0,0 +1,22 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaiShouRefreshLiveTokenJob {
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 刷新快手直播token(ruixuan)
+     */
+    @XxlJob("kuaiShouLiveRefreshTokenJob")
+    public void execute() throws Exception {
+        tokenService.getLiveKuaiShouAgentRefresh();
+    }
+
+}
+

+ 21 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouRefreshTokenJob.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaiShouRefreshTokenJob {
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 快手刷新token
+     */
+    @XxlJob("kuaiShouRefreshTokenJob")
+    public void execute() throws Exception {
+        tokenService.getKuaiShouRefresh();
+    }
+}
+

+ 24 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouYesterdayAgentReportJob.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class KuaiShouYesterdayAgentReportJob {
+    @Autowired
+    private AccountInfoService accountInfoService;
+    /**
+     * 代理商t-1数据获取
+     */
+    @XxlJob("kuaiShouYesterdayAgentReportJob")
+    public void execute() throws Exception {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
+        accountInfoService.getAgentReportByPage(startDate, endDate);
+    }
+}
+

+ 33 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCampaignJob.java

@@ -0,0 +1,33 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouCampaignJob {
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    /**
+     * 快手全量计划物料数据
+     */
+    @XxlJob("kuaishouCampaignJob")
+    public void execute() {
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        tokens.forEach(token -> executorService.submit(() -> commonService.getCampaignList(token, null, null)));
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+}

+ 54 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCleanNews.java

@@ -0,0 +1,54 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+
+
+@Component
+@Slf4j
+public class KuaishouCleanNews {
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService cleanService = Executors.newFixedThreadPool(15);
+
+    @XxlJob("cleanNews")
+    public void cleanNews() {
+        String nowDate = DateUtils.getDate("yyyy-MM-dd");
+        String statDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        Date startDate = DateUtils.getStartDate(statDate);
+        Date endDate = DateUtils.getEndDate(statDate);
+        List<UserAllocation> userAllocations = commonService.listByMediaId("2", 0);
+        if (!Check.isNull(userAllocations)) {
+            for (UserAllocation allocation : userAllocations) {
+                cleanService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            commonService.cleanCreateDetail(allocation.getProjectId(), allocation.getUserId(), allocation.getUserName(), allocation.getAccountId(), statDate, startDate, endDate);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            }
+        }
+    }
+}
+

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

@@ -0,0 +1,48 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 账户维度-盯盘每日数据
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyAccountReportLoadEtlJob {
+    @Autowired
+    private CommonService commonService;
+
+    /**
+     * 清洗账户维度-每日盯盘数据
+     */
+    @XxlJob("kuaishouDailyAccountReportLoadEtl")
+    public void execute() throws Exception {
+        try {
+            commonService.queryEveryDayDataForAccount();
+            XxlJobHelper.log("queryEveryDayDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+
+    /**
+     * 快手账户素材数据清洗任务
+     */
+    @XxlJob("etlKuaishouAccountMaterialReportDailyData")
+    public void etlKuaishouAccountMaterialReportDailyData() throws Exception {
+        try {
+            commonService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
+            commonService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(new Date(), -1)));
+            XxlJobHelper.log("queryEveryDayDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+}

+ 71 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java

@@ -0,0 +1,71 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 快手广告主分天数据
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyAccountReportLoadJob {
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+    static ExecutorService adSceneExecutorService = Executors.newFixedThreadPool(5);
+
+    /**
+     * 快手广告主日报
+     */
+    @XxlJob("kuaishouDailyAccountReport")
+    public void execute() throws Exception {
+        Date getDate = new Date();
+        Date getDate2 = DateUtils.addDay(new Date(), -2);
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        tokens.forEach(token -> executorService.submit(() -> {
+            commonService.getAdvertiserReportDaily(token, getDate2, getDate, null);
+        }));
+    }
+
+    /**
+     * 账户日报-分版位数据
+     * @throws Exception
+     */
+    @XxlJob("kuaishouDailyAccountAdSceneReport")
+    public void kuaishouDailyAccountAdSceneReport() throws Exception {
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date getDate2 = DateUtils.addDay(new Date(), -2);
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        tokens.forEach(token -> adSceneExecutorService.submit(() -> {
+            commonService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
+        }));
+    }
+
+}

+ 54 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyCampaignReportLoadJob.java

@@ -0,0 +1,54 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 广告计划分天报表
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyCampaignReportLoadJob {
+
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    /**
+     * 快手计划日报数据
+     * @throws Exception
+     */
+    @XxlJob("kuaishouDailyCampaignReport")
+    public void execute() throws Exception {
+        Date getDate = DateUtils.addDay(new Date(), -2);
+        Date endDate = DateUtils.addDay(new Date(), -1);
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+
+        tokens.forEach(token -> executorService.submit(() -> commonService.getAdvertiserCampaignReportDaily(token, getDate, endDate)));
+    }
+
+
+
+
+}

+ 31 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyFlowsJob.java

@@ -0,0 +1,31 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class KuaishouDailyFlowsJob {
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+    /**
+     * 快手账户流水信息
+     */
+    @XxlJob("kuaishouDailyFlowsJob")
+    public void execute() {
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        if (!Check.isNull(tokens)) {
+            for (CtopOauthToken ctopOauthToken : tokens) {
+                commonService.getDailyFlows(ctopOauthToken);
+            }
+        }
+    }
+}

+ 35 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDingPanCleanJob.java

@@ -0,0 +1,35 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouDingPanCleanJob {
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(6);
+    static ExecutorService materialExecutorService = Executors.newFixedThreadPool(6);
+
+    /**
+     * 快手盯盘每日上新数据
+     */
+    @XxlJob("cleanNewlyData")
+    public void cleanNewlyData() {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterdayDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        commonService.cleanNewlyData(yesterdayDate);
+        XxlJobHelper.log("快手清洗上新计划数据完成");
+    }
+
+}

+ 42 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupJob.java

@@ -0,0 +1,42 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouGroupJob {
+    @Autowired
+    private AccountInfoService accountInfoService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 快手广告组物料
+     */
+    @XxlJob("kuaishouGroup")
+    public void execute() throws Exception {
+        Date endDate = new Date();
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
+        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = sim.parse(anotherDay);
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        tokens.forEach(token -> executorService.submit(() -> accountInfoService.getGroupList(token, parse, parse)));
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+
+}

+ 31 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadEtlJob.java

@@ -0,0 +1,31 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 账户维度-盯盘每小时数据
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyAccountReportLoadEtlJob {
+    @Autowired
+    private AccountInfoService accountInfoService;
+
+    /**
+     * 清洗账户维度-盯盘小时数据
+     */
+    @XxlJob("kuaishouHourlyAccountReportLoadEtl")
+    public void execute() throws Exception {
+        try {
+            accountInfoService.queryEveryhourlyDataForAccount();
+            XxlJobHelper.log("queryEveryhourlyDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+}

+ 53 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadJob.java

@@ -0,0 +1,53 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 获取广告主分时报表
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyAccountReportLoadJob {
+    @Autowired
+    private AccountInfoService accountInfoService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(8);
+
+    /**
+     * 快手广告主时报
+     */
+    @XxlJob("kuaishouHourlyAccountReport")
+    public void execute() throws Exception {
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if ("00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        if (null == tokens || tokens.size() <= 0) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        Date finalGetDate = getDate;
+        tokens.forEach(token -> executorService.submit(() -> accountInfoService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate)));
+    }
+}

+ 45 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountWarningLoadJob.java

@@ -0,0 +1,45 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * @author 于蒙
+ */
+@Component
+public class KuaishouHourlyAccountWarningLoadJob {
+    @Autowired
+    private AccountInfoService accountInfoService;
+    @Autowired
+    private TokenService tokenService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 快手时段消耗预警
+     */
+    @XxlJob("kuaishouHourlyAccountWarning")
+    public void execute() throws Exception {
+        XxlJobHelper.log("开始时段消耗预警定时任务");
+        long l = System.currentTimeMillis();
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        if (null == tokens || tokens.size() <= 0) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return ;
+        }
+        String statDate = DateUtils.getDate("yyyy-MM-dd");
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", statDate, -1);
+        tokens.forEach(token -> executorService.submit(() -> accountInfoService.kuaiShouAccountWarning(token.getAccountId(), statDate, anotherDay)));
+        XxlJobHelper.log("异步时段消耗预警定时任务执行完毕,耗时:{} ms", System.currentTimeMillis() - l);
+    }
+}

+ 36 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouNowDateGroupJob.java

@@ -0,0 +1,36 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouNowDateGroupJob {
+    @Autowired
+    private AccountInfoService accountInfoService;
+    @Autowired
+    private TokenService tokenService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 快手当日广告组物料数据
+     */
+    @XxlJob("kuaishouNowDateGroup")
+    public void execute() throws Exception {
+        //查询当日数据
+        Date nowDate = new Date();
+        List<CtopOauthToken> tokens = tokenService.getAllKuaiShouTokens();
+        tokens.forEach(token -> executorService.submit(() -> accountInfoService.getGroupList(token, nowDate, nowDate)));
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+
+}

+ 156 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouOrderLIstGetJob.java

@@ -0,0 +1,156 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.enums.KuaishouHourEnum;
+import cn.com.ctop.job.kuaishou.enums.KuaishouMinSecEnum;
+import cn.com.ctop.job.kuaishou.service.RuixuanService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@Component
+public class KuaishouOrderLIstGetJob {
+    @Autowired
+    private RuixuanService ruixuanService;
+    @Autowired
+    private TokenService tokenService;
+
+    static ExecutorService fxService = Executors.newFixedThreadPool(3);
+    static ExecutorService fxNowService = Executors.newFixedThreadPool(3);
+
+
+    /**
+     * 昨日快分销数据获取
+     **/
+    @XxlJob("yesterdayOrderGet")
+    public void yesterdayOrderGet() throws Exception {
+        log.info("-------------------------获取快分销订单昨日数据开始数据开始--------------------------");
+        List<JSONObject> cookies = ruixuanService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Map<Long, Long> itemMap = ruixuanService.getItemMap();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + hour + startTime;
+                String end = date + hour + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    ruixuanService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+                }
+            }
+        }
+    }
+
+    /**
+     * 当前小时数据获取
+     **/
+    @XxlJob("nowHourOrderGet")
+    public void nowHourOrderGet() throws Exception {
+        log.info("-------------------------获取快分销订单当天当小时数据开始--------------------------");
+        List<JSONObject> cookies = ruixuanService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String date = DateUtils.getNowDate("yyyy-MM-dd");
+        Integer nowHour = DateUtils.getNowHour();
+        JSONArray hours = new JSONArray();
+        hours.add(nowHour);
+        if (nowHour >= 1) {
+            hours.add(nowHour - 1);
+        }
+
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Map<Long, Long> itemMap = ruixuanService.getItemMap();
+        for (int i = 0; i < hours.size(); i++) {
+            Integer hour = hours.getInteger(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + " " + hour + ":" + startTime;
+                String end = date + " " + hour + ":" + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    ruixuanService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+                }
+            }
+        }
+    }
+
+    /**
+     * 当天数据获取
+     **/
+    @XxlJob("frontHourOrderGet")
+    public void frontHourOrderGet() throws Exception {
+        log.info("-------------------------获取快分销订单当天数据开始--------------------------");
+        List<JSONObject> cookies = ruixuanService.getCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String date = DateUtils.getNowDate("yyyy-MM-dd");
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Map<Long, Long> itemMap = ruixuanService.getItemMap();
+        Integer nowHour = DateUtils.getNowHour();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            Integer integer = Integer.valueOf(hour.replace(":", "").replace(" ", ""));
+            if (integer <= nowHour) {
+                for (int j = 0; j < minSecList.size(); j++) {
+                    JSONObject minSecJson = minSecList.getJSONObject(j);
+                    String startTime = minSecJson.getString("startTime");
+                    String endTime = minSecJson.getString("endTime");
+                    String start = date + hour + startTime;
+                    String end = date + hour + endTime;
+                    System.err.println("开始时间:" + start);
+                    System.err.println("结束时间:" + end);
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Long orderCreateTimeStart = sdf.parse(start).getTime();
+                    Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                    for (int p = 0; p < cookies.size(); p++) {
+                        JSONObject cookieJson = cookies.get(p);
+                        String cookie = cookieJson.getString("cookie");
+                        ruixuanService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+                    }
+                }
+            }
+        }
+    }
+
+}

+ 157 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/MgsOrderLIstGetJob.java

@@ -0,0 +1,157 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.enums.KuaishouHourEnum;
+import cn.com.ctop.job.kuaishou.enums.KuaishouMinSecEnum;
+import cn.com.ctop.job.kuaishou.service.MgsService;
+import cn.com.ctop.job.kuaishou.service.RuixuanService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Component
+public class MgsOrderLIstGetJob {
+
+    @Autowired
+    private MgsService mgsService;
+
+    @Autowired
+    private RuixuanService ruixuanService;
+
+    @Autowired
+    private TokenService tokenService;
+
+
+    /**
+     * 昨日快分销数据获取
+     **/
+    @XxlJob("mgsYesterdayOrderGet")
+    public void mgsYesterdayOrderGet() throws Exception {
+        List<JSONObject> cookies = mgsService.getMgsCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Map<Long, Long> itemMap = ruixuanService.getItemMap();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + hour + startTime;
+                String end = date + hour + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    mgsService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 当前小时数据获取
+     **/
+    @XxlJob("mgsNowHourOrderGet")
+    public void mgsNowHourOrderGet() throws Exception {
+        List<JSONObject> cookies = mgsService.getMgsCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String date = DateUtils.getNowDate("yyyy-MM-dd");
+        Integer nowHour = DateUtils.getNowHour();
+        JSONArray hours = new JSONArray();
+        hours.add(nowHour);
+        if (nowHour >= 1) {
+            hours.add(nowHour - 1);
+        }
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Map<Long, Long> itemMap = ruixuanService.getItemMap();
+        for (int i = 0; i < hours.size(); i++) {
+            Integer hour = hours.getInteger(i);
+            for (int j = 0; j < minSecList.size(); j++) {
+                JSONObject minSecJson = minSecList.getJSONObject(j);
+                String startTime = minSecJson.getString("startTime");
+                String endTime = minSecJson.getString("endTime");
+                String start = date + " " + hour + ":" + startTime;
+                String end = date + " " + hour + ":" + endTime;
+                System.err.println("开始时间:" + start);
+                System.err.println("结束时间:" + end);
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Long orderCreateTimeStart = sdf.parse(start).getTime();
+                Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                for (int p = 0; p < cookies.size(); p++) {
+                    JSONObject cookieJson = cookies.get(p);
+                    String cookie = cookieJson.getString("cookie");
+                    mgsService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+                }
+            }
+        }
+    }
+
+    /**
+     * 当天所有数据获取
+     **/
+    /**
+     * 当天数据获取
+     **/
+    @XxlJob("mgsFrontHourOrderGet")
+    public void mgsFrontHourOrderGet() throws Exception {
+        List<JSONObject> cookies = mgsService.getMgsCookie();
+        if (Check.isNull(cookies)) {
+            log.error("cookie数据为空");
+            return;
+        }
+        String date = DateUtils.getNowDate("yyyy-MM-dd");
+        JSONArray hourList = KuaishouHourEnum.getHourList();
+        JSONArray minSecList = KuaishouMinSecEnum.getMinSecList();
+        Map<Long, Long> itemMap = ruixuanService.getItemMap();
+        Integer nowHour = DateUtils.getNowHour();
+        for (int i = 0; i < hourList.size(); i++) {
+            String hour = hourList.getString(i);
+            Integer integer = Integer.valueOf(hour.replace(":", "").replace(" ", ""));
+            if (integer <= nowHour) {
+                for (int j = 0; j < minSecList.size(); j++) {
+                    JSONObject minSecJson = minSecList.getJSONObject(j);
+                    String startTime = minSecJson.getString("startTime");
+                    String endTime = minSecJson.getString("endTime");
+                    String start = date + hour + startTime;
+                    String end = date + hour + endTime;
+                    System.err.println("开始时间:" + start);
+                    System.err.println("结束时间:" + end);
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Long orderCreateTimeStart = sdf.parse(start).getTime();
+                    Long orderCreateTimeEnd = sdf.parse(end).getTime();
+                    for (int p = 0; p < cookies.size(); p++) {
+                        JSONObject cookieJson = cookies.get(p);
+                        String cookie = cookieJson.getString("cookie");
+                        mgsService.getOrderList(cookie, 0, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+                    }
+                }
+            }
+        }
+    }
+
+}

+ 41 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/NewMonitorJob.java

@@ -0,0 +1,41 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.service.UserService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Slf4j
+public class NewMonitorJob {
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private AccountInfoService accountInfoService;
+
+    /**
+     * 账户清理
+     *
+     * @author ZZY
+     */
+    @XxlJob("synchronousMonitor")
+    public void execute() throws Exception {
+        try {
+            List<Long> kuaiShouallAccountId = userService.getAccountIdsByMedia("2");
+            List<Long> touTiaoAccountId = userService.getAccountIdsByMedia("1");
+            for (Long aLong : kuaiShouallAccountId) {
+                accountInfoService.synchronousKuaiShouMonitor("0", aLong);
+            }
+            for (Long aLong : touTiaoAccountId) {
+                accountInfoService.synchronousTouTiaoMonitor("0", aLong);
+            }
+        } catch (Exception e) {
+            log.info("清理完成完成");
+        }
+    }
+}

+ 40 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/NewMonitorOneDayJob.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.AccountInfoService;
+import cn.com.ctop.job.kuaishou.service.UserService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Slf4j
+public class NewMonitorOneDayJob {
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private AccountInfoService accountInfoService;
+
+    /**
+     * 账户清理
+     *
+     * @author ZZY
+     */
+    @XxlJob("synchronousMonitorOneDay")
+    public void execute() throws Exception {
+        try {
+            List<Long> kuaiShouallAccountId = userService.getAccountIdsByMedia("2");
+            List<Long> touTiaoAccountId = userService.getAccountIdsByMedia("1");
+            for (Long aLong : kuaiShouallAccountId) {
+                accountInfoService.synchronousKuaiShouMonitor("1", aLong);
+            }
+            for (Long aLong : touTiaoAccountId) {
+                accountInfoService.synchronousTouTiaoMonitor("1", aLong);
+            }
+        } catch (Exception e) {
+            log.info("清理完成完成");
+        }
+    }
+}

+ 41 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataAccountCleanJob.java

@@ -0,0 +1,41 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class RuleKuaiShouDataAccountCleanJob {
+
+    @Autowired
+    private CommonService commonService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    private ExecutorService executorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 快手规则引擎账户数据
+     * @throws Exception
+     */
+    @XxlJob("ruleKuaiShouDataAccountCleanJob")
+    public void execute() throws Exception {
+        XxlJobHelper.log("规则预警账户维度数据开始清洗");
+        List<CtopOauthToken> tokens = tokenService.queryKsValidRuleAccountsToken();
+        tokens.forEach(token -> executorService.submit(()->{
+            commonService.deleteRuleAccountId(token.getAccountId());
+            commonService.cleanRuleDataAccount(token.getAccountId());
+        }));
+    }
+}

+ 39 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataPlanCleanJob.java

@@ -0,0 +1,39 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class RuleKuaiShouDataPlanCleanJob {
+    @Autowired
+    private CommonService commonService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    private ExecutorService executorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 快手规则引擎计划数据
+     */
+    @XxlJob("ruleKuaiShouDataPlanCleanJob")
+    public void execute() throws Exception {
+        XxlJobHelper.log("规则预警计划维度数据开始清洗");
+        List<CtopOauthToken> tokens = tokenService.queryKsValidRuleAccountsToken();
+        tokens.forEach(token -> executorService.submit(()->{
+            commonService.deleteRulePlan(token.getAccountId());
+            commonService.cleanRuleDataPlan(token.getAccountId(),1);
+        }));
+    }
+}

+ 38 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataTargetCleanJob.java

@@ -0,0 +1,38 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class RuleKuaiShouDataTargetCleanJob {
+    @Autowired
+    private CommonService commonService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    private ExecutorService executorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 快手规则引擎定向数据
+     */
+    @XxlJob("ruleKuaiShouDataTargetCleanJob")
+    public void execute() throws Exception {
+        XxlJobHelper.log("规则预警定向维度数据开始清洗");
+        List<CtopOauthToken> tokens = tokenService.queryKsValidRuleAccountsToken();
+        tokens.forEach(token -> executorService.submit(() -> {
+            commonService.deleteRuleTarge(token.getAccountId());
+            commonService.cleanRuleDataTarget(token.getAccountId(), token.getAccessToken(), 1);
+        }));
+    }
+
+}

+ 41 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/RuleKuaiShouDataUnitCleanJob.java

@@ -0,0 +1,41 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class RuleKuaiShouDataUnitCleanJob {
+    @Autowired
+    private CommonService commonService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    private ExecutorService executorService = Executors.newFixedThreadPool(10);
+
+    /**
+     * 快手规则引擎组维度数据
+     *
+     * @throws Exception
+     */
+    @XxlJob("ruleKuaiShouDataUnitCleanJob")
+    public void execute() throws Exception {
+        XxlJobHelper.log("规则预警组维度数据开始清洗");
+        List<CtopOauthToken> tokens = tokenService.queryKsValidRuleAccountsToken();
+        tokens.forEach(token -> executorService.submit(() -> {
+            commonService.deleteRuleUnit(token.getAccountId());
+            commonService.cleanRuleDataUnit(token.getAccountId(), token.getAccessToken(), DateUtils.date2Str(), DateUtils.date2Str(), 1);
+        }));
+    }
+
+}

+ 90 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/SettlementJob.java

@@ -0,0 +1,90 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.RuixuanService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class SettlementJob {
+
+    @Autowired
+    private RuixuanService ruixuanService;
+    @Autowired
+    private TokenService tokenService;
+
+
+    @XxlJob("refreshCourierNumber")
+    public void refreshCourierNumber() throws Exception {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -31);
+        List<JSONObject> list = ruixuanService.getSamplesData(startDate);
+        if (Check.isNull(list)) {
+            return;
+        }
+        for (JSONObject jsonObject : list) {
+            Long id = jsonObject.getLong("id");
+            String courierNumber = jsonObject.getString("courierNumber");
+            if (Check.isNull(courierNumber)) {
+                continue;
+            }
+            String companyCode = jsonObject.getString("companyCode");
+            if (Check.isNull(companyCode)) {
+                continue;
+            }
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", id);
+            map.put("courierNumber", courierNumber);
+            map.put("companyCode", companyCode);
+            HttpUtils.httpGet("http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/refreshCourierNumber", map, null);
+            Thread.sleep(1000L);
+        }
+    }
+
+
+    /**
+     * 自定义创建监测链接预警
+     */
+    @XxlJob("cleanSettlementData")
+    public void cleanSettlementData() {
+        String url = "http://ruixuan.api.tjyourong.com.cn/settlement/data";
+        String date = DateUtils.getLastDay(DateUtils.date2Str(), 1);
+        Long statDate = Long.valueOf(date.replace("-", ""));
+        List<JSONObject> list = ruixuanService.getDataList(statDate);
+        if (Check.isNull(list)) {
+            return;
+        }
+        List<List<JSONObject>> partition = Lists.partition(list, 1000);
+        for (int i = 0; i < partition.size(); i++) {
+            List<JSONObject> jsonObjects = partition.get(i);
+            Map<String, Object> param = new HashMap<>();
+            param.put("statDate", statDate);
+            param.put("data", jsonObjects);
+            HttpUtils.httpPostRequest(url, param, null);
+        }
+    }
+
+
+    @XxlJob("cleanPromoterBindChannel")
+    public void cleanPromoterBindChannel() {
+        Long date = Long.valueOf(DateUtils.getNowDate("yyyyMMdd"));
+        ruixuanService.deletePromoterBindChannelByDate(date);
+        ruixuanService.cleanKuaiShouPromoterBindChannel(date);
+        ruixuanService.cleanBytedancePromoterBindChannel(date);
+        ruixuanService.deleteMgsPromoterBindChannelByDate(date);
+        ruixuanService.cleanMgsKuaiShouPromoterBindChannel(date);
+    }
+
+
+}

+ 134 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/SyncMaterialUploadJob.java

@@ -0,0 +1,134 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@Component
+public class SyncMaterialUploadJob {
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    private static String uploadUrl = "http://upload.tjyourong.com.cn/material/materialUploadTask/uploadMaterial";
+    static ExecutorService kuaishouShouService = Executors.newFixedThreadPool(10);
+    static ExecutorService bytedanceervice = Executors.newFixedThreadPool(10);
+
+
+    /**
+     * 素材同步
+     */
+    @XxlJob("syncMaterialUpload")
+    public void syncMaterialUpload() {
+        List<String> md5List = commonService.getMd5List();
+        if (Check.isNull(md5List)) {
+            log.error("没有待上传的素材");
+            return;
+        }
+        for (int i = 0; i < md5List.size(); i++) {
+            String signature = md5List.get(i);
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("signature", signature);
+            try {
+                commonService.updateBySignature(signature);
+                String s = HttpUtils.httpGet(uploadUrl, requestMap, null);
+                if (!Check.isNull(s)) {
+                    JSONObject result = JSONObject.parseObject(s);
+                    Integer code = result.getInteger("code");
+                    if (code == 0) {
+                        log.info("素材同步任务提交成功");
+                    }
+                }
+            } catch (Exception e) {
+                log.error("请求同步素材服务失败,signature:{}", signature);
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * 更新快手同步状态
+     */
+    @XxlJob("updateKuaiShouMaterialStatus")
+    public void updateKuaiShouMaterialStatus() {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -30);
+        anotherDay += " 00:00:01";
+        log.info("查询快手未同步素材列表,开始时间:{}", anotherDay);
+        List<String> codeList = commonService.getMaterialInfoCodeList(anotherDay);
+        log.info("查询条数:{}", codeList.size());
+        if (Check.isNull(codeList)) {
+            return;
+        }
+        for (int i = 0; i < codeList.size(); i++) {
+            String code = codeList.get(i);
+            if (Check.isNull(code)) {
+                continue;
+            }
+            kuaishouShouService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        Integer num = commonService.getMaterialInfoCountByCode(code);
+                        if (num > 0) {
+                            commonService.updateMaterialInfoByCode(code);
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+
+
+    /**
+     * 更新头条同步状态
+     */
+    @XxlJob(value = "updateBytedanceMaterialStatus")
+    public void updateBytedanceMaterialStatus() {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -30);
+        anotherDay += " 00:00:01";
+        log.info("查询头条未同步素材列表,开始时间:{}", anotherDay);
+        List<String> codeList = commonService.getBytedanceCodeList(anotherDay);
+        log.info("查询条数:{}", codeList.size());
+        if (Check.isNull(codeList)) {
+            return;
+        }
+        for (int i = 0; i < codeList.size(); i++) {
+            String code = codeList.get(i);
+            if (Check.isNull(code)) {
+                continue;
+            }
+            bytedanceervice.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        Integer num = commonService.getBytedanceCountByCode(code);
+                        if (num > 0) {
+                            commonService.updateByteDanceByCode(code);
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+}

+ 62 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/SynchronousAccountTransactionJob.java

@@ -0,0 +1,62 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+@Component
+@Slf4j
+public class SynchronousAccountTransactionJob {
+
+    @Autowired
+    private CommonService commonService;
+
+    /**
+     * 同步头条账户交易流水
+     *
+     * @author ZZY
+     */
+    @XxlJob("synchronousAccountTransaction")
+    public void execute() throws Exception {
+        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
+        ca.setTime(new Date()); //设置时间为当前时间
+        ca.add(Calendar.DAY_OF_MONTH, -1);  //设置为前一天
+        String date = sd.format(ca.getTime());
+        try {
+            commonService.synchronousAccount();
+            commonService.synchronousAccountTransactionDay(date, date);
+            commonService.synchronousAccountTransactionDetails(date, date);
+        } catch (Exception e) {
+            log.info("同步完成");
+        }
+
+    }
+
+    /**
+     * 同步头条账户交易流水
+     * 获取前3天数据
+     */
+    @XxlJob("synchronousAccountTransactionNew")
+    public void synchronousAccountTransactionNew() throws Exception {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterda1 = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String yesterda2 = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
+        String yesterda3 = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -3);
+        try {
+//            commonService.synchronousAccount();
+            commonService.insertAccountTransactionDay(yesterda1, yesterda1);
+            commonService.insertAccountTransactionDay(yesterda2, yesterda2);
+            commonService.insertAccountTransactionDay(yesterda3, yesterda3);
+        } catch (Exception e) {
+            log.info("同步完成");
+        }
+    }
+}

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

@@ -0,0 +1,64 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.job.kuaishou.service.CommonService;
+import cn.com.ctop.job.kuaishou.service.TokenService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class TrackWarningJob {
+
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 自定义创建监测链接预警
+     */
+    @XxlJob("monitorCreative")
+    public void monitorCreative() {
+        String url = "http://api.tjyourong.com.cn/jeecg-boot/monitor/trackMonitorLogs/monitorCreative";
+        System.err.println("请求地址为:" + url);
+        List<Long> idList = commonService.getAccountIds();
+        if (Check.isNull(idList)) {
+            XxlJobHelper.log("自定义创意监测链接预警");
+            return;
+        }
+        for (int i = 0; i < idList.size(); i++) {
+            Long id = idList.get(i);
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("accountId", id);
+            HttpUtils.httpGet(url, requestMap, null);
+        }
+    }
+
+    /**
+     * 程序化监测链接预警
+     */
+    @XxlJob("monitorProgramCreative")
+    public void monitorProgramCreative() {
+        String url = "http://api.tjyourong.com.cn/jeecg-boot/monitor/trackMonitorLogs/monitorProgramCreative";
+        System.err.println("请求地址为:" + url);
+        List<Long> idList = commonService.getAccountIds();
+        if (Check.isNull(idList)) {
+            XxlJobHelper.log("自定义创意监测链接预警");
+            return;
+        }
+        for (int i = 0; i < idList.size(); i++) {
+            Long id = idList.get(i);
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("accountId", id);
+            HttpUtils.httpGet(url, requestMap, null);
+        }
+    }
+
+}

+ 82 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/AccountInfoMapper.java

@@ -0,0 +1,82 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.EtlKuaishouReportAccountHourly;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouAppInfo;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouCampaign;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouDailyAgent;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouGroup;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouGroupTarget;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouSchedule;
+import cn.com.ctop.job.kuaishou.entity.KuaishouReportHourlyAccount;
+import org.apache.ibatis.annotations.Param;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+public interface AccountInfoMapper {
+
+    void deleteUnitById(@Param("accountId") Long accountId, @Param("unitId") Long unitId);
+
+    void replaceBatchGroup(@Param(value = "groups") List<KuaiShouGroup> groups);
+
+    void replaceBatchShouSchedule(@Param(value = "schedules") List<KuaiShouSchedule> shouSchedules);
+
+    void replaceBatchAppInfo(@Param(value = "appInfos") List<KuaiShouAppInfo> appInfos);
+
+    void replaceBatchGroupTarget(@Param("targets") List<KuaiShouGroupTarget> targets);
+
+    List<EtlKuaishouReportAccountHourly> queryEveryhourlyDataForAccount();
+
+    void replaceBatchEtlHourlyAccount(@Param("list") List<EtlKuaishouReportAccountHourly> list);
+
+    void replaceBatchEtlDailyAccount(@Param("list") List<EtlKuaishouReportAccountHourly> list);
+
+    void replaceBatchKuaishouReportHourlyAccount(@Param("addList") List<KuaishouReportHourlyAccount> addList);
+
+    Integer selectMaxHour(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    BigDecimal getkuaishouReportHourlyCost(@Param("accountId") Long accountId, @Param("statHour") Integer statHour, @Param("statDate") String statDate);
+
+    void replaceBatchKuaiShouDailyAgent(@Param(value = "list") List<KuaiShouDailyAgent> list);
+
+    List<Map> getKuaiShouGroup(@Param("date") String date, @Param("accountId") String accountId);
+
+    List<Map> getKuaiShouGroupNow(@Param("date") String date, @Param("accountId") String accountId);
+
+    BigDecimal getGroupCharge(@Param("unitId") String unitId, @Param("afterDate") String afterDate);
+
+    String getMonitorGroupByUnitId(@Param("unitId") String unitId);
+
+    void updateMonitorGroupByUnitId(@Param("unitId") String unitId, @Param("effective") String effective);
+
+    void saveMonitorGroup(@Param("accountId") String accountId, @Param("accountName") String accountName, @Param("operatingName") String operatingName, @Param("unitId") String unitId, @Param("createTime") String createTime, @Param("projectType") String projectType, @Param("effective") String effective);
+
+    List<Map> getKuaiShouCampaign(@Param("date") String date, @Param("accountId") String accountId);
+
+    List<Map> getKuaiShouCampaignNow(@Param("date") String date, @Param("accountId") String accountId);
+
+    BigDecimal getCampaignCharge(@Param("campaignId") String campaignId, @Param("afterDate") String afterDate);
+
+    String getMonitorPlanByCampaignId(@Param("campaignId") String campaignId);
+
+    void updateMonitorPlanByCampaignId(@Param("campaignId") String campaignId, @Param("effective") String effective);
+
+    void saveMonitorCampaign(@Param("accountId") String accountId, @Param("accountName") String accountName, @Param("operatingName") String operatingName, @Param("campaignId") String campaignId, @Param("createTime") String createTime, @Param("projectType") String projectType, @Param("effective") String effective);
+
+    List<Map> getTouTiaoCampaign(@Param("date") String date, @Param("accountId") String accountId);
+
+    List<Map> getTouTiaoCampaignNow(@Param("date") String date, @Param("accountId") String accountId);
+
+    BigDecimal getCampaignChargeTouTiao(@Param("campaignId") String campaignId, @Param("afterDate") String afterDate);
+
+    List<KuaiShouCampaign> getCampaignByAccountId(@Param("accountId") Long accountId);
+
+    KuaiShouGroup getGroupOneByUnitId(@Param("unitId") Long unitId);
+
+    KuaiShouGroupTarget getTargetOneByUnitId(Long unitId);
+
+    List<String> getAllAccountId();
+
+    List<String> getAccountIdByMedia(@Param("mediaId") String mediaId);
+}

+ 154 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/CommonMapper.java

@@ -0,0 +1,154 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.EtlKuaiShouNewly;
+import cn.com.ctop.job.kuaishou.entity.EtlKuaishouReportAccountHourly;
+import cn.com.ctop.job.kuaishou.entity.JyClipCooperation;
+import cn.com.ctop.job.kuaishou.entity.JyClipTopList;
+import cn.com.ctop.job.kuaishou.entity.JyOrderList;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouCampaign;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouDailyFlows;
+import cn.com.ctop.job.kuaishou.entity.KuaishouAccountBalanceBudget;
+import cn.com.ctop.job.kuaishou.entity.KuaishouPlanCreate;
+import cn.com.ctop.job.kuaishou.entity.KuaishouReportDailyAccount;
+import cn.com.ctop.job.kuaishou.entity.KuaishouReportDailyCampaign;
+import cn.com.ctop.job.kuaishou.entity.RuleDataAccountKuaishou;
+import cn.com.ctop.job.kuaishou.entity.RuleDataTargetKuaishou;
+import cn.com.ctop.job.kuaishou.entity.RuleDatePlanKuaishou;
+import cn.com.ctop.job.kuaishou.entity.RuleDateUnitKuaishou;
+import cn.com.ctop.job.kuaishou.entity.TransactionDay;
+import cn.com.ctop.job.kuaishou.entity.TransactionDetails;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+public interface CommonMapper {
+
+    void reloadData();
+
+    String getByAccountId(@Param("accountId") Long accountId);
+
+    List<UserAllocation> listByMediaId(@Param("mediaId") String mediaId, @Param("accountStatus") Integer accountStatus);
+
+    List<Long> getHostingIdList();
+
+    String getCookieById(@Param("id") Long id);
+
+    List<JSONObject> getAccountList();
+
+    void replaceTopItem(@Param("adds") List<JyClipTopList> adds);
+
+    List<JSONObject> getCookie();
+
+    void replaceClipCooperation(@Param("adds") List<JyClipCooperation> adds);
+
+    void replace(@Param("adds") List<JyOrderList> adds);
+
+    void updateAllIsInvalidState();
+
+    void replaceBudget(KuaishouAccountBalanceBudget budget);
+
+    void replaceBatchCampaigns(@Param(value = "campaigns") List<KuaiShouCampaign> campaigns);
+
+    void deleteByAccountId(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    String getCompanyId(@Param("userId") String userId);
+
+    String getLeaderNameByUserId(@Param("userId") String userId);
+
+    Integer getNewPlan(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    Integer getNewUnit(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    Integer getAutoUnit(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    Integer getHostPlan(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    Integer getBatchUnit(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    Integer getMediaCount(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    Integer getEffectiveUnit(@Param("accountId") Long accountId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    int insertKuaishouPlanCreate(KuaishouPlanCreate create);
+
+    List<EtlKuaishouReportAccountHourly> queryEveryDayDataForAccount();
+
+    void replaceBatchEveryDayDataForAccount(@Param("list") List<EtlKuaishouReportAccountHourly> list);
+
+    List<EtlKuaishouReportAccountHourly> selectEtlKuaishouReportAccountHourlyList(@Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    void replaceBatchEtlKuaishouReportAccountHourl(@Param("list") List<EtlKuaishouReportAccountHourly> list);
+
+    void etlKuaishouAccountMaterialReportDailyData(@Param(value = "date") String date);
+
+    void replaceBatchKuaishouReportDailyAccount(@Param("addList") List<KuaishouReportDailyAccount> addList);
+
+    void replaceBatchAdSceneKuaishouReportDailyAccount(@Param("addList") List<KuaishouReportDailyAccount> addList);
+
+    void replaceBatchKuaishouReportDailyCampaign(@Param(value = "records") List<KuaishouReportDailyCampaign> campaigns);
+
+    void deleteKuaiShouDailyFlows(@Param("date") String date, @Param("accountId") Long accountId);
+
+    void saveKuaiShouDailyFlows(KuaiShouDailyFlows dailyFlows);
+
+    Integer getCampaignNewDataByAccountIdAndDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    Integer getGroupNewDataByAccountIdAndDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    Integer getCreativeNewDataByAccountIdAndDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    void replaceBatchEtlKuaiShouNewly(@Param("addList") List<EtlKuaiShouNewly> addList);
+
+    void deleteRuleAccountId(@Param("accountId") Long accountId);
+
+    void replaceRuleDataAccount(RuleDataAccountKuaishou ruleDataAccount);
+
+    void deleteRulePlan(@Param("accountId") Long accountId);
+
+    void replaceRuleDataPlan(@Param("batch") List<RuleDatePlanKuaishou> batch);
+
+    void deleteRuleTarge(@Param("accountId") Long accountId);
+
+    void replaceRuleDataTarget(@Param("add") List<RuleDataTargetKuaishou> batch);
+
+    void deleteRuleUnit(@Param("accountId") Long accountId);
+
+    void replaceBatchRuleDateUnitKuaishou(@Param("add") List<RuleDateUnitKuaishou> batch);
+
+    void updateAgentAccountState(List<String> removeList, int i);
+
+    void insertAccountData(@Param("list") List<String> list, @Param("agent_id") String agent_id, @Param("create_time") String create_time);
+
+    List<String> getAccountTransactionDayIdByDate(@Param("date") String date, @Param("advertiserId") String advertiserId);
+
+    void deleteAccountTransactionById( @Param("id") String id);
+
+    void saveAccountTransactionDay(@Param("list") List<TransactionDay> list, @Param("date") String date);
+
+    List<String> getTransactionSeq(@Param("date") String date);
+
+    void saveAccountTransactionDetails(@Param("list") List<TransactionDetails> list, @Param("date") String date);
+
+    void replaceAccountTransactionDay(@Param("list") List<TransactionDay> list);
+
+    List<String> getMd5List();
+
+    void updateBySignature(@Param("signature") String signature);
+
+    List<String> getMaterialInfoCodeList(@Param("date") String date);
+
+    Integer getMaterialInfoCountByCode(@Param("code") String code);
+
+    void updateMaterialInfoByCode(@Param("signature") String signature);
+
+    List<String> getBytedanceCodeList(@Param("date") String date);
+
+    Integer getBytedanceCountByCode(@Param("code") String code);
+
+    void updateByteDanceByCode(@Param("code") String code);
+
+    List<Long> getAccountIds();
+}

+ 14 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/MgsMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.KuaishouSupplyChain;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MgsMapper {
+
+    List<JSONObject> getMgsCookie();
+
+    void replaceSupplyChains(@Param(value = "adds") List<KuaishouSupplyChain> supplyChains);
+}

+ 30 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/RuixuanMapper.java

@@ -0,0 +1,30 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.KuaishouSupplyChain;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface RuixuanMapper {
+
+    List<JSONObject> getCookie();
+
+    List<JSONObject> itemList();
+
+    void replaceSupplyChains(@Param(value = "adds") List<KuaishouSupplyChain> supplyChains);
+
+    List<JSONObject> getSamplesData(@Param("statDate") String statDate);
+
+    List<JSONObject> getDataList(@Param("statDate") Long statDate);
+
+    void deletePromoterBindChannelByDate(@Param("date") Long date);
+
+    void cleanKuaiShouPromoterBindChannel(@Param("date") Long date);
+
+    void cleanBytedancePromoterBindChannel(@Param("date") Long date);
+
+    void deleteMgsPromoterBindChannelByDate(@Param("date") Long date);
+
+    void cleanMgsKuaiShouPromoterBindChannel(@Param("date") Long date);
+}

+ 23 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/SendMapper.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.JyClipTopList;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import cn.com.ctop.job.kuaishou.entity.WarningOperationLog;
+import cn.com.ctop.job.kuaishou.entity.WexinConfig;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SendMapper {
+
+    JSONObject getWChatIdByUserId(@Param("userId") String userId);
+
+    List<WexinConfig> orderByDescList();
+
+    String queryUserIdByAccountId(@Param("accountId") Long accountId);
+
+    void insertWarningOperationLog(WarningOperationLog warningOperationLog);
+
+    List<JSONObject> selectWeiXinIdListByAccountId(@Param("accountId") Long accountId);
+}

+ 31 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/TokenMapper.java

@@ -0,0 +1,31 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.entity.OauthAgentToken;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface TokenMapper {
+
+    List<CtopOauthToken> getAllKuaiShouTokens();
+
+    CtopOauthToken getTokenByAccountId(@Param("accountId") Long accountId);
+
+    OauthAgentToken getAgentTokenByAppId(@Param("appId") Long appId);
+
+    List<OauthAgentToken> getAgentList();
+
+    int updateAgentTokenById(@Param(value = "agentToken")  OauthAgentToken agentToken);
+
+    List<OauthAgentToken> getLiveKuaiShouAgentList();
+
+    int updateLiveById(OauthAgentToken agentToken);
+
+    List<JSONObject> getListByMediaId();
+
+    int updateTokenById(CtopOauthToken oauthToken);
+
+    List<CtopOauthToken> queryKsValidRuleAccountsToken();
+}

+ 26 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/UserMapper.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.job.kuaishou.mapper;
+
+import cn.com.ctop.job.kuaishou.entity.Project;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface UserMapper {
+
+    List<JSONObject> getUserMapByMap(@Param("ids") Map<String, String> userIdMap);
+
+    List<JSONObject> getListByMap(@Param("ids") Map<Long, Long> projectIdMap);
+
+    Long getProjectIdByAccountId(@Param("accountId") Long accountId);
+
+    JSONObject getWarningInfoByProjectId(@Param("projectId") Long projectId);
+
+    UserAllocation getOneByAccountId(@Param("accountId") Long accountId);
+
+    Project getProjectById(@Param("projectId") Long projectId);
+
+    List<Long> getAccountIdsByMedia(@Param("mediaId") String mediaId);
+}

+ 821 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/AccountInfoMapper.xml

@@ -0,0 +1,821 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.mapper.AccountInfoMapper">
+
+
+    <delete id="deleteUnitById">
+        DELETE
+        FROM ctop_kuaishou_group
+        where account_id = #{accountId}
+          AND unit_id = #{unitId}
+    </delete>
+
+    <insert id="replaceBatchGroup">
+        replace into ctop_kuaishou_group(
+        id,
+        account_id,
+        campaign_id,
+        unit_id,
+        unit_name,
+        status,
+        put_status,
+        create_channel,
+        review_detail,
+        bid_type,
+        bid,
+        cpa_bid,
+        ocpx_action_type,
+        deep_conversion_type,
+        deep_conversion_bid,
+        day_budget,
+        speed,
+        begin_time,
+        end_time,
+        schedule_time,
+        scene_id,
+        show_mode,
+        unit_type,
+        url_type,
+        url,
+        schema_uri,
+        app_id,
+        app_icon_url,
+        convert_id,
+        use_app_market,
+        app_store,
+        group_create_time,
+        group_update_time,
+        create_time,
+        update_time,
+        study_status,
+        unit_source)
+        values
+        <foreach collection="groups" item="getGroup" separator=",">
+            (
+            #{getGroup.id},
+            #{getGroup.accountId},
+            #{getGroup.campaignId},
+            #{getGroup.unitId},
+            #{getGroup.unitName},
+            #{getGroup.status},
+            #{getGroup.putStatus},
+            #{getGroup.createChannel},
+            #{getGroup.reviewDetail},
+            #{getGroup.bidType},
+            #{getGroup.bid},
+            #{getGroup.cpaBid},
+            #{getGroup.ocpxActionType},
+            #{getGroup.deepConversionType},
+            #{getGroup.deepConversionBid},
+            #{getGroup.dayBudget},
+            #{getGroup.speed},
+            #{getGroup.beginTime},
+            #{getGroup.endTime},
+            #{getGroup.scheduleTime},
+            #{getGroup.sceneId},
+            #{getGroup.showMode},
+            #{getGroup.unitType},
+            #{getGroup.urlType},
+            #{getGroup.url},
+            #{getGroup.schemaUri},
+            #{getGroup.appId},
+            #{getGroup.appIconUrl},
+            #{getGroup.convertId},
+            #{getGroup.useAppMarket},
+            #{getGroup.appStore,},
+            #{getGroup.groupCreateTime},
+            #{getGroup.groupUpdateTime},
+            #{getGroup.createTime},
+            #{getGroup.updateTime},
+            #{getGroup.studyStatus},
+            #{getGroup.unitSource})
+        </foreach>
+    </insert>
+
+    <insert id="replaceBatchShouSchedule">
+        replace into ctop_kuaishou_schedule(
+        account_id,
+        unit_id,
+        mon,
+        tues,
+        wed,
+        thur,
+        fri,
+        sat,
+        sun,
+        create_time,
+        update_time)
+        values
+        <foreach collection="schedules" item="schedule" separator=",">
+            (
+            #{schedule.accountId},
+            #{schedule.unitId},
+            #{schedule.mon},
+            #{schedule.tues},
+            #{schedule.wed},
+            #{schedule.thur},
+            #{schedule.fri},
+            #{schedule.sat},
+            #{schedule.sun},
+            #{schedule.createTime},
+            #{schedule.updateTime})
+        </foreach>
+    </insert>
+
+    <insert id="replaceBatchAppInfo">
+        replace into ctop_kuaishou_app_info(
+        account_id,
+        unit_id,
+        app_package_name,
+        app_name,
+        device_os_type,
+        create_time,
+        update_time)
+        values
+        <foreach collection="appInfos" item="appInfo" separator=",">
+            (#{appInfo.accountId},
+            #{appInfo.unitId},
+            #{appInfo.appPackageName},
+            #{appInfo.appName},
+            #{appInfo.deviceOsType},
+            #{appInfo.createTime},
+            #{appInfo.updateTime})
+        </foreach>
+    </insert>
+
+    <insert id="replaceBatchGroupTarget">
+        replace into ctop_kuaishou_group_target(
+        account_id ,
+        unit_id,
+        region,
+        age_min,
+        age_max,
+        ages_range,
+        gender,
+        platform_os,
+        android_osv,
+        ios_osv,
+        network,
+        device_brand,
+        device_price,
+        business_interest_type,
+        business_interest,
+        fans_star,
+        interest_video,
+        app_interest,
+        app_ids,
+        population,
+        exclude_population,
+        third_platform_code,
+        filter_converted_level,
+        is_open,
+        no_age_break,
+        no_gender_break,
+        no_area_break,
+        keyword,
+        label,
+        interest_label,
+        time_type,
+        strength_type,
+        scene_type
+        )
+        values
+        <foreach collection="targets" item="targets" separator=",">
+            (
+            #{targets.accountId},
+            #{targets.unitId},
+            #{targets.region},
+            #{targets.ageMin},
+            #{targets.ageMax},
+            #{targets.agesRange},
+            #{targets.gender},
+            #{targets.platformOs},
+            #{targets.androidOsv},
+            #{targets.iosOsv},
+            #{targets.network},
+            #{targets.deviceBrand},
+            #{targets.devicePrice},
+            #{targets.businessInterestType},
+            #{targets.businessInterest},
+            #{targets.fansStar},
+            #{targets.interestVideo},
+            #{targets.appInterest},
+            #{targets.appIds},
+            #{targets.population},
+            #{targets.excludePopulation},
+            #{targets.thirdPlatformCode},
+            #{targets.filterConvertedLevel},
+            #{targets.isOpen},
+            #{targets.noAgeBreak},
+            #{targets.noGenderBreak},
+            #{targets.noAreaBreak},
+            #{targets.keyword},
+            #{targets.label},
+            #{targets.interestLabel},
+            #{targets.timeType},
+            #{targets.strengthType},
+            #{targets.sceneType}
+            )
+        </foreach>
+    </insert>
+
+    <select id="queryEveryhourlyDataForAccount"
+            resultType="cn.com.ctop.job.kuaishou.entity.EtlKuaishouReportAccountHourly">
+        SELECT stat_date,
+               account_id,
+               DATE_FORMAT(now(), '%H') as 'statHour',
+               SUM(charge) as 'charge',
+               SUM(photo_show) as 'photoShow',
+               SUM(photo_click) as 'photoClick',
+               SUM(aclick) as 'aclick',
+               SUM(bclick) as 'bclick',
+               SUM(share) as 'photoShare',
+               SUM(comment) as 'photoComment',
+               SUM(photo_like) as 'photoLike',
+               SUM(follow) as 'follow',
+               SUM(cancel_follow) as 'cancelFollow',
+               SUM(report) as 'report',
+               SUM(block) as 'block',
+               SUM(negative) as 'negative',
+               SUM(download_started) as 'downloadStarted',
+               SUM(download_completed) as 'downloadCompleted',
+               SUM(activation) as 'activation',
+               SUM(submit) as 'submit',
+               SUM(event_pay_first_day) as 'eventPayFirstDay',
+               SUM(event_pay_purchase_amount_first_day) as 'eventPayPurchaseAmountFirstDay',
+               SUM(event_pay) as 'eventPay',
+               SUM(event_pay_purchase_amount) as 'eventPayPurchaseAmount',
+               SUM(event_register) as 'eventRegister',
+               SUM(event_jin_jian_app) as 'eventJinJianApp',
+               SUM(event_credit_grant_app) as 'eventCreditGrantApp',
+               SUM(event_order_paid) as 'eventOrderPaid',
+               SUM(event_order_paid_purchase_amount) as 'eventOrderPaidPurchaseAmount',
+               SUM(event_jin_jian_landing_page) as 'eventJinJianLandingPage',
+               SUM(event_credit_grant_landing_page) as 'eventCreditGrantLandingPage',
+               SUM(event_next_day_stay) as 'eventNextDayStay',
+               SUM(form_count) as 'formCount',
+               SUM(play_3s_ratio * aclick) as 'play3sCount'
+        FROM ctop_kuaishou_report_hourly_account
+        WHERE stat_date = DATE_FORMAT(now(), '%Y-%m-%d')
+          AND stat_hour &lt;= DATE_FORMAT(now(), '%H')
+        GROUP BY account_id
+    </select>
+
+    <insert id="replaceBatchEtlHourlyAccount">
+        replace into ctop_etl_kuaishou_report_account_hourly(
+        stat_date,
+        stat_hour,
+        account_id,
+        charge,
+        photo_show,
+        photo_click,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay,
+        event_pay_purchase_amount,
+        event_register,
+        event_jin_jian_app,
+        event_credit_grant_app,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_jin_jian_landing_page,
+        event_credit_grant_landing_page,
+        event_next_day_stay,
+        form_count,
+        play_3s_count
+        )
+        values
+        <foreach collection="list" item="appInfo" separator=",">
+            (
+            #{appInfo.statDate},
+            #{appInfo.statHour},
+            #{appInfo.accountId},
+            #{appInfo.charge},
+            #{appInfo.photoShow},
+            #{appInfo.photoClick},
+            #{appInfo.aclick},
+            #{appInfo.bclick},
+            #{appInfo.photoShare},
+            #{appInfo.photoComment},
+            #{appInfo.photoLike},
+            #{appInfo.follow},
+            #{appInfo.cancelFollow},
+            #{appInfo.report},
+            #{appInfo.block},
+            #{appInfo.negative},
+            #{appInfo.downloadStarted},
+            #{appInfo.downloadCompleted},
+            #{appInfo.activation},
+            #{appInfo.submit},
+            #{appInfo.eventPayFirstDay},
+            #{appInfo.eventPayPurchaseAmountFirstDay},
+            #{appInfo.eventPay},
+            #{appInfo.eventPayPurchaseAmount},
+            #{appInfo.eventRegister},
+            #{appInfo.eventJinJianApp},
+            #{appInfo.eventCreditGrantApp},
+            #{appInfo.eventOrderPaid},
+            #{appInfo.eventOrderPaidPurchaseAmount},
+            #{appInfo.eventJinJianLandingPage},
+            #{appInfo.eventCreditGrantLandingPage},
+            #{appInfo.eventNextDayStay},
+            #{appInfo.formCount},
+            #{appInfo.play3sCount}
+            )
+        </foreach>
+    </insert>
+
+    <insert id="replaceBatchEtlDailyAccount">
+        replace into ctop_etl_kuaishou_report_account_daily(
+        stat_date,
+        account_id,
+        charge,
+        photo_show,
+        photo_click,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay,
+        event_pay_purchase_amount,
+        event_register,
+        event_jin_jian_app,
+        event_credit_grant_app,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_jin_jian_landing_page,
+        event_credit_grant_landing_page,
+        event_next_day_stay,
+        form_count,
+        play_3s_count
+        )
+        values
+        <foreach collection="list" item="appInfo" separator=",">
+            (
+            #{appInfo.statDate},
+            #{appInfo.accountId},
+            #{appInfo.charge},
+            #{appInfo.photoShow},
+            #{appInfo.photoClick},
+            #{appInfo.aclick},
+            #{appInfo.bclick},
+            #{appInfo.photoShare},
+            #{appInfo.photoComment},
+            #{appInfo.photoLike},
+            #{appInfo.follow},
+            #{appInfo.cancelFollow},
+            #{appInfo.report},
+            #{appInfo.block},
+            #{appInfo.negative},
+            #{appInfo.downloadStarted},
+            #{appInfo.downloadCompleted},
+            #{appInfo.activation},
+            #{appInfo.submit},
+            #{appInfo.eventPayFirstDay},
+            #{appInfo.eventPayPurchaseAmountFirstDay},
+            #{appInfo.eventPay},
+            #{appInfo.eventPayPurchaseAmount},
+            #{appInfo.eventRegister},
+            #{appInfo.eventJinJianApp},
+            #{appInfo.eventCreditGrantApp},
+            #{appInfo.eventOrderPaid},
+            #{appInfo.eventOrderPaidPurchaseAmount},
+            #{appInfo.eventJinJianLandingPage},
+            #{appInfo.eventCreditGrantLandingPage},
+            #{appInfo.eventNextDayStay},
+            #{appInfo.formCount},
+            #{appInfo.play3sCount}
+            )
+        </foreach>
+    </insert>
+
+    <insert id="replaceBatchKuaishouReportHourlyAccount">
+        replace into ctop_kuaishou_report_hourly_account(
+        id,
+        account_id,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        share,
+        comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        form_action_ratio,
+        event_order_paid_cost,
+        event_next_day_stay,
+        form_cost,
+        form_count,
+        play_3s_ratio,
+        play_5s_ratio,
+        play_end_ratio,
+        event_app_invoked,
+        event_new_user_pay,
+        event_new_user_pay_cost,
+        event_new_user_pay_ratio,
+        key_action)
+        values
+        <foreach collection="addList" item="add" separator=",">
+            (
+            #{add.id},
+            #{add.accountId},
+            #{add.charge},
+            #{add.photoShow},
+            #{add.aclick},
+            #{add.bclick},
+            #{add.share},
+            #{add.comment},
+            #{add.photoLike},
+            #{add.follow},
+            #{add.cancelFollow},
+            #{add.report},
+            #{add.block},
+            #{add.negative},
+            #{add.downloadStarted},
+            #{add.downloadCompleted},
+            #{add.activation},
+            #{add.submit},
+            #{add.statDate},
+            #{add.statHour},
+            #{add.photoClick},
+            #{add.photoClickRatio},
+            #{add.actionRatio},
+            #{add.impression1kCost},
+            #{add.photoClickCost},
+            #{add.actionCost},
+            #{add.eventPayFirstDay},
+            #{add.eventPayPurchaseAmountFirstDay},
+            #{add.eventPayFirstDayRoi},
+            #{add.eventPay},
+            #{add.eventPayPurchaseAmount},
+            #{add.eventPayRoi},
+            #{add.eventRegister},
+            #{add.eventRegisterCost},
+            #{add.eventJinJianApp},
+            #{add.eventJinJianAppCost},
+            #{add.eventCreditGrantApp},
+            #{add.eventCreditGrantAppCost},
+            #{add.eventCreditGrantAppRatio},
+            #{add.eventOrderPaid},
+            #{add.eventOrderPaidPurchaseAmount},
+            #{add.eventJinJianLandingPage},
+            #{add.eventJinJianLandingPageCost},
+            #{add.eventCreditGrantLandingPage},
+            #{add.eventCreditGrantLandingPageCost},
+            #{add.formActionRatio},
+            #{add.eventOrderPaidCost},
+            #{add.eventNextDayStay},
+            #{add.formCost},
+            #{add.formCount},
+            #{add.play3sRatio},
+            #{add.play5sRatio},
+            #{add.playEndRatio},
+            #{add.eventAppInvoked},
+            #{add.eventNewUserPay},
+            #{add.eventNewUserPayCost},
+            #{add.eventNewUserPayRatio},
+            #{add.keyAction}
+            )
+        </foreach>
+    </insert>
+
+    <select id="selectMaxHour" resultType="java.lang.Integer">
+        select max(stat_hour)
+        from ctop_kuaishou_report_hourly_account
+        where account_id = #{accountId}
+          and stat_date = #{statDate}
+    </select>
+
+    <select id="getkuaishouReportHourlyCost" resultType="java.math.BigDecimal">
+        select charge
+        from ctop_kuaishou_report_hourly_account
+        where account_id = #{accountId}
+          and stat_date = #{statDate}
+          and stat_hour = #{statHour}
+    </select>
+
+    <insert id="replaceBatchKuaiShouDailyAgent">
+        replace into ctop_kuaishou_daily_agent(
+        agent_id,
+        account_id,
+        date_time,
+        user_id,
+        account_name,
+        total_charged_in_yuan,
+        total_balance_in_yuan,
+        real_charged_in_yuan,
+        total_rebate_real_charged_in_yuan,
+        contract_rebate_real_charged_in_yuan,
+        direct_rebate_real_charged_in_yuan,
+        credit_real_charged_in_yuan,
+        charge_day_on_day_percent,
+        ad_photo_impression,
+        ad_photo_click,
+        ad_item_impression,
+        ad_item_click,
+        photo_click_ratio,
+        item_click_ratio,
+        charged_campaign_count,
+        product_name,
+        corporation_name,
+        first_cost_day,
+        industry,
+        second_industry
+        )
+        values
+        <foreach collection="list" item="agent" separator=",">
+            (
+            #{agent.agentId},
+            #{agent.accountId},
+            #{agent.dateTime},
+            #{agent.userId},
+            #{agent.accountName},
+            #{agent.totalChargedInYuan},
+            #{agent.totalBalanceInYuan},
+            #{agent.realChargedInYuan},
+            #{agent.totalRebateRealChargedInYuan},
+            #{agent.contractRebateRealChargedInYuan},
+            #{agent.directRebateRealChargedInYuan},
+            #{agent.creditRealChargedInYuan},
+            #{agent.chargeDayOnDayPercent},
+            #{agent.adPhotoImpression},
+            #{agent.adPhotoClick},
+            #{agent.adItemImpression},
+            #{agent.adItemClick},
+            #{agent.photoClickRatio},
+            #{agent.itemClickRatio},
+            #{agent.chargedCampaignCount},
+            #{agent.productName},
+            #{agent.corporationName},
+            #{agent.firstCostDay},
+            #{agent.industry},
+            #{agent.secondIndustry}
+            )
+        </foreach>
+    </insert>
+
+
+    <select id="getKuaiShouGroup" resultType="Map">
+        SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.unit_id as
+        'unitId',t.group_create_time as 'groupCreatTime',DATE_FORMAT(DATE_ADD(t.group_create_time,INTERVAL 7
+        DAY),'%Y-%m-%d') as 'afterTime'
+        from ctop_user_allocation t1 LEFT JOIN ctop_kuaishou_group t on t1.account_id=t.account_id
+        <where>
+            and t.account_id=#{accountId}
+            <choose>
+                <when test="date!= null and date!=''">
+                    and t.group_create_time &gt;= DATE_SUB(#{date},INTERVAL 7 DAY)
+                </when>
+                <otherwise>
+                    and t.group_create_time &gt;= DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y-%m-%d')
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+
+    <select id="getKuaiShouGroupNow" resultType="Map">
+        SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.unit_id as
+        'unitId',t.group_create_time as 'groupCreatTime',DATE_FORMAT(DATE_ADD(t.group_create_time,INTERVAL 7
+        DAY),'%Y-%m-%d') as 'afterTime'
+        from ctop_user_allocation t1 LEFT JOIN ctop_kuaishou_group t on t1.account_id=t.account_id
+        <where>
+            and t.account_id=#{accountId}
+            and t.group_create_time &gt;= #{date}
+        </where>
+    </select>
+
+    <select id="getGroupCharge" resultType="java.math.BigDecimal">
+        select sum(charge)
+        from ctop_kuaishou_report_daily_group t
+        where t.stat_date &lt; #{afterDate}
+          and t.unit_id = #{unitId}
+    </select>
+
+    <select id="getMonitorGroupByUnitId" resultType="String">
+        select t.effective
+        from ctop_new_monitor_group t
+        where t.unit_id = #{unitId}
+    </select>
+
+    <update id="updateMonitorGroupByUnitId">
+        update ctop_new_monitor_group t
+        set t.effective=#{effective}
+        where t.unit_id = #{unitId}
+    </update>
+
+    <insert id="saveMonitorGroup">
+        insert into ctop_new_monitor_group
+        (account_id,
+         account_name,
+         operating_name,
+         unit_id,
+         create_time,
+         project_type,
+         effective)
+        values (#{accountId},
+                #{accountName},
+                #{operatingName},
+                #{unitId},
+                #{createTime},
+                #{projectType},
+                #{effective})
+    </insert>
+
+    <select id="getKuaiShouCampaign" resultType="Map">
+        SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.campaign_id as
+        'campaignId',t.put_create_time as 'campaignCreatTime',DATE_FORMAT(DATE_ADD(t.put_create_time,INTERVAL 7
+        DAY),'%Y-%m-%d') as 'afterTime'
+        from ctop_user_allocation t1 LEFT JOIN ctop_kuaishou_campaign t on t1.account_id=t.account_id
+        <where>
+            and t.account_id=#{accountId}
+            <choose>
+                <when test="date != null and date !=''">
+                    and t.put_create_time &gt;= DATE_SUB(#{date},INTERVAL 7 DAY)
+                </when>
+                <otherwise>
+                    and t.put_create_time &gt;= DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y-%m-%d')
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+
+    <select id="getKuaiShouCampaignNow" resultType="Map">
+        SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.campaign_id as
+        'campaignId',t.put_create_time as 'campaignCreatTime',DATE_FORMAT(DATE_ADD(t.put_create_time,INTERVAL 7
+        DAY),'%Y-%m-%d') as 'afterTime'
+        from ctop_user_allocation t1 LEFT JOIN ctop_kuaishou_campaign t on t1.account_id=t.account_id
+        <where>
+            and t.account_id=#{accountId}
+            and t.put_create_time &gt;=#{date}
+        </where>
+    </select>
+
+    <select id="getCampaignCharge" resultType="java.math.BigDecimal">
+        select sum(charge)
+        from ctop_kuaishou_report_daily_campaign t
+        where t.stat_date &lt; #{afterDate}
+          and t.campaign_id = #{campaignId}
+    </select>
+
+    <select id="getMonitorPlanByCampaignId" resultType="String">
+        select t.effective
+        from ctop_new_monitor_campaign t
+        where t.campaign_id = #{campaignId}
+    </select>
+
+    <update id="updateMonitorPlanByCampaignId">
+        update ctop_new_monitor_campaign t
+        set t.effective=#{effective}
+        where t.campaign_id = #{campaignId}
+    </update>
+
+    <insert id="saveMonitorCampaign">
+        insert into ctop_new_monitor_campaign
+        (account_id,
+         account_name,
+         operating_name,
+         campaign_id,
+         create_time,
+         project_type,
+         effective)
+        values (#{accountId},
+                #{accountName},
+                #{operatingName},
+                #{campaignId},
+                #{createTime},
+                #{projectType},
+                #{effective})
+    </insert>
+
+
+    <select id="getTouTiaoCampaign" resultType="Map">
+        SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.id as
+        'campaignId',t.ad_create_time as 'campaignCreatTime',DATE_FORMAT(DATE_ADD(t.ad_create_time,INTERVAL 7
+        DAY),'%Y-%m-%d') as 'afterTime'
+        from ctop_user_allocation t1 LEFT JOIN ctop_bytedance_advertise_plan t on t1.account_id=t.account_id
+        <where>
+            and t.account_id=#{accountId}
+            <choose>
+                <when test="date != null and date !=''">
+                    and t.ad_create_time &gt;= DATE_SUB(#{date},INTERVAL 7 DAY)
+                </when>
+                <otherwise>
+                    and t.ad_create_time &gt;= DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y-%m-%d')
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+
+    <select id="getTouTiaoCampaignNow" resultType="Map">
+        SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.id as
+        'campaignId',t.ad_create_time as 'campaignCreatTime',DATE_FORMAT(DATE_ADD(t.ad_create_time,INTERVAL 7
+        DAY),'%Y-%m-%d') as 'afterTime'
+        from ctop_user_allocation t1 LEFT JOIN ctop_bytedance_advertise_plan t on t1.account_id=t.account_id
+        <where>
+            and t.account_id=#{accountId}
+            and t.ad_create_time &gt;= #{date}
+        </where>
+    </select>
+
+    <select id="getCampaignChargeTouTiao" resultType="java.math.BigDecimal">
+        select sum(cost)
+        from ctop_bytedance_report_plan_daily t
+        where t.stat_datetime &lt; #{afterDate}
+          and t.ad_id = #{campaignId}
+    </select>
+
+    <select id="getCampaignByAccountId" resultType="cn.com.ctop.job.kuaishou.entity.KuaiShouCampaign">
+        SELECT *
+        FROM ctop_kuaishou_campaign
+        WHERE account_id = #{accountId}
+        ORDER BY put_create_time DESC limit 15
+    </select>
+
+    <select id="getGroupOneByUnitId" resultType="cn.com.ctop.job.kuaishou.entity.KuaiShouGroup">
+        SELECT *
+        FROM ctop_kuaishou_group
+        WHERE unit_id = #{unitId}
+    </select>
+
+    <select id="getTargetOneByUnitId" resultType="cn.com.ctop.job.kuaishou.entity.KuaiShouGroupTarget">
+        SELECT *
+        FROM ctop_kuaishou_group_target
+        WHERE unit_id = #{unitId}
+    </select>
+
+    <select id="getAllAccountId" resultType="String">
+        SELECT a.account_id
+        FROM ctop_agent_account a
+                 LEFT JOIN ctop_user_allocation u ON a.account_id = u.account_id
+        WHERE a.state = 0
+          AND u.account_status = 0
+    </select>
+
+    <select id="getAccountIdByMedia" resultType="String">
+        SELECT account_id
+        FROM ctop_user_allocation
+        WHERE account_status = 0
+          AND media_id = #{mediaId}
+    </select>
+</mapper>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1523 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/CommonMapper.xml


+ 74 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/MgsMapper.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.mapper.MgsMapper">
+
+    <select id="getMgsCookie" resultType="com.alibaba.fastjson.JSONObject">
+        select id, cookie
+        from miaogousi.kuaishou_supply_chain_cookie
+    </select>
+
+    <insert id="replaceSupplyChains">
+        replace into miaogousi.kuaishou_supply_chain(
+        id,
+        oid,
+        item_id,
+        item_title,
+        reserve_price,
+        image_url,
+        order_status,
+        order_create_time,
+        send_status,
+        settlement_biz_type,
+        settlement_biz_type_desc,
+        send_time,
+        recv_time,
+        seller_id,
+        promoter_id,
+        promoter_nick_name,
+        activity_id,
+        order_amount,
+        pay_amount,
+        regimental_promotion_rate,
+        share_rate,
+        base_amount,
+        service_amount,
+        regimental_promotion_amount,
+        total_regimental_settle_amount,
+        stat_date,
+        item_commission_rate
+        )
+        values
+        <foreach collection="adds" item="add" separator=",">
+            (
+            #{add.id},
+            #{add.oid},
+            #{add.itemId},
+            #{add.itemTitle},
+            #{add.reservePrice},
+            #{add.imageUrl},
+            #{add.orderStatus},
+            #{add.orderCreateTime},
+            #{add.sendStatus},
+            #{add.settlementBizType},
+            #{add.settlementBizTypeDesc},
+            #{add.sendTime},
+            #{add.recvTime},
+            #{add.sellerId},
+            #{add.promoterId},
+            #{add.promoterNickName},
+            #{add.activityId},
+            #{add.orderAmount},
+            #{add.payAmount},
+            #{add.regimentalPromotionRate},
+            #{add.shareRate},
+            #{add.baseAmount},
+            #{add.serviceAmount},
+            #{add.regimentalPromotionAmount},
+            #{add.totalRegimentalSettleAmount},
+            #{add.statDate},
+            #{add.itemCommissionRate}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 173 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/RuixuanMapper.xml

@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.mapper.RuixuanMapper">
+
+    <select id="getCookie" resultType="com.alibaba.fastjson.JSONObject">
+        select id, cookie
+        from ruixuan.kuaishou_supply_chain_cookie
+    </select>
+
+    <select id="itemList" resultType="com.alibaba.fastjson.JSONObject">
+        select item_id as 'itemId', item_commission_rate as 'itemCommissionRate'
+        from ruixuan.kuaishou_activity_item_list
+    </select>
+
+    <insert id="replaceSupplyChains">
+        replace into ruixuan.kuaishou_supply_chain(
+        id,
+        oid,
+        item_id,
+        item_title,
+        reserve_price,
+        image_url,
+        order_status,
+        order_create_time,
+        send_status,
+        settlement_biz_type,
+        settlement_biz_type_desc,
+        send_time,
+        recv_time,
+        seller_id,
+        promoter_id,
+        promoter_nick_name,
+        activity_id,
+        order_amount,
+        pay_amount,
+        regimental_promotion_rate,
+        share_rate,
+        base_amount,
+        service_amount,
+        regimental_promotion_amount,
+        total_regimental_settle_amount,
+        stat_date,
+        item_commission_rate
+        )
+        values
+        <foreach collection="adds" item="add" separator=",">
+            (
+            #{add.id},
+            #{add.oid},
+            #{add.itemId},
+            #{add.itemTitle},
+            #{add.reservePrice},
+            #{add.imageUrl},
+            #{add.orderStatus},
+            #{add.orderCreateTime},
+            #{add.sendStatus},
+            #{add.settlementBizType},
+            #{add.settlementBizTypeDesc},
+            #{add.sendTime},
+            #{add.recvTime},
+            #{add.sellerId},
+            #{add.promoterId},
+            #{add.promoterNickName},
+            #{add.activityId},
+            #{add.orderAmount},
+            #{add.payAmount},
+            #{add.regimentalPromotionRate},
+            #{add.shareRate},
+            #{add.baseAmount},
+            #{add.serviceAmount},
+            #{add.regimentalPromotionAmount},
+            #{add.totalRegimentalSettleAmount},
+            #{add.statDate},
+            #{add.itemCommissionRate}
+            )
+        </foreach>
+    </insert>
+
+    <select id="getSamplesData" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.String">
+        select  id,courier_number as 'courierNumber',company_code as 'companyCode' from ruixuan.kuaishou_item_collect_samples
+        where courier_number_time  &gt;=  str_to_date(CONCAT(date_format(#{startDate}, '%Y-%m-%d'), '00:00:01'), '%Y-%m-%d %H:%i:%s')
+          and collect_sample_status  = 4
+          and collect_sample_desc = '单号异常'
+    </select>
+
+    <select id="getDataList" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.Long">
+        select t.*, tt.rule_type
+        from (select *
+              from (select t1.relate_id                                 as 'relateId',
+                                (case
+                                when t2.rule_id is not null
+                                    then t2.rule_id
+                                else 1
+                               end
+                               )                                        as 'ruleId',
+                           group_concat(t1.item_id)                     as 'itemIds',
+                           t1.promoter_id                               as 'promoterId',
+                           t1.promoter_name                             as 'promoterName',
+                           t1.item_create_id                            as 'itemCreateId',
+                           t1.item_create_name                          as 'itemCreateName',
+                           t1.promoter_create_id                        as 'promoterCreateId',
+                           t1.promoter_create_name                      as 'promoterCreateName',
+                           ifnull(sum(t1.order_num), 0)                 as 'orderNum',
+                           ifnull(sum(t1.valid_order_num), 0)           as 'validOrderNum',
+                           ifnull(sum(t1.yesterday_order_num), 0)       as 'yesterdayOrderNum',
+                           ifnull(sum(t1.yesterday_valid_order_num), 0) as 'yesterdayValidOrderNum',
+                           t1.stat_date                                 as 'statDate',
+                           round(t2.item_price / 100, 2)                as 'itemPrice'
+                    from ruixuan.kuaishou_rule_order_data t1
+                             left join ruixuan.kuaishou_item_list t2 on t1.item_id = t2.item_id
+                    where t1.stat_date = #{statDate}
+                      and t1.relate_id is not null
+                    group by t1.relate_id, t1.promoter_id) t
+              where t.itemPrice >= 6
+              order by t.validOrderNum desc) t
+                 left join ruixuan.kuaishou_settlement_rules tt
+                           on t.ruleId = tt.id
+    </select>
+
+    <delete id="deletePromoterBindChannelByDate" parameterType="java.lang.Long">
+        delete from ruixuan.promoter_bind_channel_date where stat_date = #{date}
+    </delete>
+
+    <insert id="cleanKuaiShouPromoterBindChannel" parameterType="java.lang.Long">
+        insert into ruixuan.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
+        select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
+        from ruixuan.kuaishou_promoter t1
+                 left join ruixuan.sys_user_role t2
+                           on t1.user_id = t2.user_id
+                 left join ruixuan.sys_role t3
+                           on t2.role_id = t3.role_id
+        where  1 = 1
+          and t1.media_id = '2'
+          and t3.role_key in ('bdManager', 'bd')
+          and date_format(t1.create_time, '%Y%m%d')  &lt; #{date}
+        group by t1.promoter_id
+    </insert>
+
+    <select id="cleanBytedancePromoterBindChannel" parameterType="java.lang.Long">
+        insert into ruixuan.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
+        select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
+        from ruixuan.kuaishou_promoter t1
+                 left join ruixuan.sys_user_role t2
+                           on t1.user_id = t2.user_id
+                 left join ruixuan.sys_role t3
+                           on t2.role_id = t3.role_id
+        where  1 = 1
+          and t1.media_id = '1'
+          and t3.role_key in ('bdManager', 'bd')
+          and date_format(t1.create_time, '%Y%m%d')  &lt;= #{date}
+        group by t1.promoter_id
+    </select>
+
+    <delete id="deleteMgsPromoterBindChannelByDate" parameterType="java.lang.Long">
+        delete from miaogousi.promoter_bind_channel_date where stat_date = #{date}
+    </delete>
+
+    <insert id="cleanMgsKuaiShouPromoterBindChannel" parameterType="java.lang.Long">
+        insert into miaogousi.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
+        select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
+        from miaogousi.kuaishou_promoter t1
+                 left join miaogousi.sys_user_role t2
+                           on t1.user_id = t2.user_id
+                 left join miaogousi.sys_role t3
+                           on t2.role_id = t3.role_id
+        where  1 = 1
+          and t1.media_id = '2'
+          and t3.role_key in ('bdManager', 'bd')
+          and date_format(t1.create_time, '%Y%m%d')  &lt; #{date}
+        group by t1.promoter_id
+    </insert>
+
+</mapper>

+ 62 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/SendMapper.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.mapper.SendMapper">
+
+
+    <select id="getWChatIdByUserId" resultType="com.alibaba.fastjson.JSONObject">
+        select t1.wexin_id, corp_id
+        from ctop_corp_wexin_user t1
+                 left join sys_user t2
+                           on t1.user_id = t2.id
+        where t1.user_id = #{userId}
+          and t2.`status` = 1
+    </select>
+
+    <select id="orderByDescList" resultType="cn.com.ctop.job.kuaishou.entity.WexinConfig">
+        select *
+        from ctop_wexin_config
+        order by create_time desc
+    </select>
+
+    <select id="queryUserIdByAccountId" resultType="String">
+        select distinct user_id
+        from ctop_user_allocation
+        where account_id = #{accountId}
+    </select>
+
+
+    <insert id="insertWarningOperationLog">
+        INSERT INTO ctop_warning_operation_log (account_id, unit_id, user_id, subject, warning_type)
+        VALUES (#{accountId},
+                #{unitId},
+                #{userId},
+                #{subject},
+                #{warningType})
+    </insert>
+
+    <select id="selectWeiXinIdListByAccountId" resultType="com.alibaba.fastjson.JSONObject"
+            parameterType="java.lang.Long">
+        select t.*
+        from (
+                 select wexin_id, corp_id
+                 from ctop_corp_wexin_user
+                 where user_id = (select ctop_user_allocation.user_id
+                                  from ctop_user_allocation
+                                  where account_id = #{accountId} limit 1)
+        union all
+        select wexin_id, corp_id
+        from ctop_corp_wexin_user
+        where user_id = (select leader_id
+                         from sys_user
+                         where id = (SELECT ctop_user_allocation.user_id
+                                     FROM ctop_user_allocation
+                                     WHERE account_id = #{accountId}
+            LIMIT 1))
+        union all
+        select wexin_id, corp_id
+        from ctop_corp_wexin_user
+        where user_id = 'f6a6843879c949618e4a859140c8a127')  t
+        group by t.wexin_id
+    </select>
+
+</mapper>

+ 110 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/TokenMapper.xml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.mapper.TokenMapper">
+
+
+    <select id="getAllKuaiShouTokens" resultType="cn.com.ctop.job.kuaishou.entity.CtopOauthToken">
+        SELECT t1.id AS 'id', t1.media_id AS 'mediaId', t1.advertiser_id AS 'advertiser_id', t1.account_id AS 'accountId', (CASE
+                                                                                                                                WHEN t3.access_token IS NOT NULL
+                                                                                                                                    THEN t3.access_token
+                                                                                                                                ELSE t1.access_token END) AS 'accessToken', (CASE
+                                                                                                                                                                                 WHEN t3.refresh_token IS NOT NULL
+                                                                                                                                                                                     THEN t3.refresh_token
+                                                                                                                                                                                 ELSE t1.refresh_token END) AS 'refreshToken', t1.agent_type AS 'agentType', t1.app_id AS 'appId', t1.access_token_expires_in AS 'accessTokenExpiresIn', t1.refresh_token_expires_in AS 'refreshTokenExpiresIn', t1.create_time AS 'createTime', t1.update_time AS 'updateTime'
+        FROM ctop_oauth_token t1
+                 LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+                 LEFT JOIN ctop_oauth_agent_token t3 ON t1.app_id = t3.app_id
+        WHERE t2.account_status = 0
+          AND t1.media_id = 2;
+
+    </select>
+
+    <select id="getTokenByAccountId" resultType="cn.com.ctop.job.kuaishou.entity.CtopOauthToken">
+        SELECT *
+        FROM ctop_oauth_token
+        WHERE account_id = #{accountId}
+        ORDER BY create_time desc LIMIT 1
+    </select>
+
+    <select id="getAgentTokenByAppId" resultType="cn.com.ctop.job.kuaishou.entity.OauthAgentToken">
+        SELECT *
+        FROM ctop_oauth_agent_token
+        WHERE app_id = #{appId} LIMIT 1
+    </select>
+
+    <select id="getAgentList" resultType="cn.com.ctop.job.kuaishou.entity.OauthAgentToken">
+        SELECT *
+        FROM ctop_oauth_agent_token
+        WHERE media_id = 2
+    </select>
+
+    <update id="updateAgentTokenById" parameterType="cn.com.ctop.job.kuaishou.entity.OauthAgentToken">
+        UPDATE ctop_oauth_agent_token
+        <trim prefix="set" suffixOverrides=",">
+            <if test="agentToken.accessToken!=null">
+                access_token=#{agentToken.accessToken},
+            </if>
+            <if test="agentToken.refreshToken!=null">
+                refresh_token=#{agentToken.refreshToken},
+            </if>
+            <if test="agentToken.accessTokenExpiresIn!=null">
+                access_token_expires_in=#{agentToken.accessTokenExpiresIn},
+            </if>
+            <if test="agentToken.refreshTokenExpiresIn!=null">
+                refresh_token_expires_in=#{agentToken.refreshTokenExpiresIn},
+            </if>
+        </trim>
+        WHERE id=#{agentToken.id}
+    </update>
+
+    <select id="getLiveKuaiShouAgentList" resultType="cn.com.ctop.job.kuaishou.entity.OauthAgentToken">
+        select *
+        from ruixuan.agent_token
+        where media_id = 2
+    </select>
+
+    <update id="updateLiveById">
+        UPDATE
+        ruixuan.agent_token
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accessToken != null">access_token = #{accessToken},</if>
+            <if test="accessTokenExpiresIn != null">access_token_expires_in = #{accessTokenExpiresIn},</if>
+            <if test="refreshToken != null">refresh_token = #{refreshToken},</if>
+            <if test="refreshTokenExpiresIn != null">refresh_token_expires_in = #{refreshTokenExpiresIn},</if>
+        </trim>
+        WHERE id = #{id}
+    </update>
+
+    <select id="getListByMediaId" resultType="com.alibaba.fastjson.JSONObject">
+        select app_id,
+               secret
+        from ctop_oauth_config
+        where media_id = 2
+    </select>
+
+    <update id="updateTokenById">
+        UPDATE
+        ctop_oauth_token
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accessToken != null">access_token = #{accessToken},</if>
+            <if test="accessTokenExpiresIn != null">access_token_expires_in = #{accessTokenExpiresIn},</if>
+            <if test="refreshToken != null">refresh_token = #{refreshToken},</if>
+            <if test="refreshTokenExpiresIn != null">refresh_token_expires_in = #{refreshTokenExpiresIn},</if>
+        </trim>
+        WHERE id = #{id}
+    </update>
+
+    <select id="queryKsValidRuleAccountsToken" resultType="cn.com.ctop.job.kuaishou.entity.CtopOauthToken">
+        SELECT *
+        FROM ctop_oauth_token
+        WHERE account_id IN
+              (SELECT t2.account_id
+               FROM ctop_rule_template t1
+                        INNER JOIN ctop_rule_account_template t2 ON t1.id = t2.template_id
+               WHERE t1.media_type = 2
+                 AND t2.template_status = 0
+               GROUP BY t2.account_id
+              )
+    </select>
+
+</mapper>

+ 63 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/mapper/xml/UserMapper.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.job.kuaishou.mapper.UserMapper">
+
+    <select id="getUserMapByMap" resultType="com.alibaba.fastjson.JSONObject">
+        select id,realname from sys_user
+        where id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
+
+    <select id="getListByMap" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        id as 'id',
+        project_name as 'projectName'
+        from ctop_project
+        where id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
+
+
+    <select id="getProjectIdByAccountId" resultType="java.lang.Long">
+        select project_id
+        from ctop_user_allocation
+        where account_id = #{accountId} limit 1
+    </select>
+
+
+    <select id="getWarningInfoByProjectId" resultType="com.alibaba.fastjson.JSONObject">
+        select id                   projectId,
+               project_name         projectName,
+               max_bid              maxBid,
+               bid_type             bidType,
+               ocpx_action_type     ocpxActionType,
+               deep_conversion_type deepConversionType
+        from ctop_project
+        where id = #{projectId}
+    </select>
+
+    <select id="getOneByAccountId" resultType="cn.com.ctop.job.kuaishou.entity.UserAllocation">
+        SELECT *
+        FROM ctop_user_allocation
+        WHERE media_id = 2
+          AND account_id = #{accountId}
+        ORDER BY create_time desc LIMIT 1
+    </select>
+
+    <select id="getProjectById" resultType="cn.com.ctop.job.kuaishou.entity.Project">
+        SELECT *
+        FROM ctop_project
+        WHERE id = #{projectId}
+    </select>
+
+    <select id="getAccountIdsByMedia" resultType="Long">
+        SELECT DISTINCT t.account_id as 'accountId'
+        from ctop_user_allocation t
+        where account_status = 0
+          and media_id = #{mediaId}
+    </select>
+</mapper>

+ 43 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/AccountInfoService.java

@@ -0,0 +1,43 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouGroup;
+import cn.com.ctop.job.kuaishou.entity.KuaiShouGroupTarget;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Date;
+import java.util.List;
+
+public interface AccountInfoService {
+
+    void getGroupList(CtopOauthToken token, Date startDate, Date endDate);
+
+    void updateUnitStatus(String accessToken, Long advertiserId, Long unitId, int i, String admin);
+
+    void queryEveryhourlyDataForAccount();
+
+    void getAdvertiserReportHourly(CtopOauthToken token, Date startDate, Date endDate);
+
+    void kuaiShouAccountWarning(Long account, String statDate, String anotherDay);
+
+    void getAgentReportByPage(String startDate, String endDate);
+
+    void synchronousKuaiShouMonitor(String s, Long aLong);
+
+    void synchronousTouTiaoMonitor(String s, Long aLong);
+
+    JSONObject getAccountReportBy(CtopOauthToken oauthToken, Long accountId);
+
+    JSONObject getAccountFundBy(CtopOauthToken oauthToken, Long accountId);
+
+    void getGroupListByAccountId(String accessToken, Long accountId);
+
+    KuaiShouGroup getGroupOneByUnitId(Long unit_id);
+
+    KuaiShouGroupTarget getTargetOneByUnitId(Long unit_id);
+
+    List<String> getAllAccountId();
+
+    List<String> getAccountIdByMedia(String mediaId);
+}
+

+ 101 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/CommonService.java

@@ -0,0 +1,101 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.entity.KuaishouAccountBalanceBudget;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+public interface CommonService {
+
+    void reloadData();
+
+    String getByAccountId(Long accountId);
+
+    List<UserAllocation> listByMediaId(String type, int i);
+
+    List<Long> getHostingIdList();
+
+    String getCookieById(Long id);
+
+    List<JSONObject> getAccountList();
+
+    void getItemTop(String cookie, Long statDate, Long id, String name, Integer offset);
+
+    List<JSONObject> getCookie();
+
+    void getClipCooperation(String cookie, Integer offset, Long statDate, Integer status) throws Exception;
+
+    void getClipCooperationV2(String cookie, int i, Long statDate, Integer status) throws Exception;
+
+    void getOrderList(String cookie, Integer offset, Long orderCreateTimeStart, Long orderCreateTimeEnd) throws Exception;
+
+    void updateAllIsInvalidState();
+
+    JSONObject fundGet(CtopOauthToken token);
+
+    JSONObject getAccountBudget(CtopOauthToken token);
+
+    void replaceBudget(KuaishouAccountBalanceBudget budget);
+
+    void getCampaignList(CtopOauthToken token, Date startDate, Date endDate);
+
+    void cleanCreateDetail(Long projectId, String userId, String userName, Long accountId, String statDate, Date startDate, Date endDate);
+
+    void queryEveryDayDataForAccount();
+
+    void etlKuaishouAccountMaterialReportDailyData(String formatDate);
+
+    void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate, String reportDims);
+
+    void getAdvertiserCampaignReportDaily(CtopOauthToken token, Date getDate, Date endDate);
+
+    void getDailyFlows(CtopOauthToken token);
+
+    void cleanNewlyData(String statDate);
+
+    void deleteRuleAccountId(Long accountId);
+
+    void cleanRuleDataAccount(Long accountId);
+
+    void deleteRulePlan(Long accountId);
+
+    void cleanRuleDataPlan(Long accountId, int i);
+
+    void deleteRuleTarge(Long accountId);
+
+    void cleanRuleDataTarget(Long accountId, String accessToken, int i);
+
+    void deleteRuleUnit(Long accountId);
+
+    void cleanRuleDataUnit(Long accountId, String accessToken, String date2Str, String date2Str1, int i);
+
+    void synchronousAccount();
+
+    void synchronousAccountTransactionDay(String startDate, String endDate);
+
+    void synchronousAccountTransactionDetails(String startDate, String endDate);
+
+    void insertAccountTransactionDay(String startDate, String endDate);
+
+    List<String> getMd5List();
+
+    void updateBySignature(String signature);
+
+    List<String> getMaterialInfoCodeList(String anotherDay);
+
+    Integer getMaterialInfoCountByCode(String code);
+
+    void updateMaterialInfoByCode(String code);
+
+    List<String> getBytedanceCodeList(String anotherDay);
+
+    Integer getBytedanceCountByCode(String code);
+
+    void updateByteDanceByCode(String code);
+
+    List<Long> getAccountIds();
+}

+ 11 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/IMessageTemplate.java

@@ -0,0 +1,11 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+public interface IMessageTemplate {
+
+
+    String getKuaiShouBidTypeMessage(String projectName, Long accountId, Long unitId, String unit_name);
+
+    String getKuaiShouBidMessage(String projectName, Long accountId, Long unitId, String unit_name);
+}

+ 21 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/ISendMessageService.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import cn.com.ctop.job.kuaishou.entity.WexinConfig;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public interface ISendMessageService {
+
+    void sendMessage(String id, String text);
+
+    List<WexinConfig> orderByDescList();
+
+    void kuaiShouWarningOperation(Long projectId, String projectName, Long accountId, Long unitId, String unit_name);
+
+    void kuaiShouBidWarningOperation(Long projectId, String projectName, Long accountId, Long unitId, String unit_name);
+
+    void sendChargeEarlyWarningMessage(Long accountId, String authName, Integer maxHour, BigDecimal nowCost, Long projectId, String projectName, String userName);
+
+    void sendYesterdayChargeEarlyWarningMessageMessage(Long accountId, String authName, Integer maxHour, BigDecimal nowCost, Long projectId, String projectName, String userName);
+}

+ 15 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/MgsService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import cn.com.ctop.job.kuaishou.entity.Project;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.util.Map;
+
+public interface MgsService {
+
+    List<JSONObject> getMgsCookie();
+
+    void getOrderList(String cookie, Integer offset, Long orderCreateTimeStart, Long orderCreateTimeEnd, Map<Long,Long> itemMap) throws Exception;
+}

+ 29 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/RuixuanService.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.util.Map;
+
+public interface RuixuanService {
+
+    List<JSONObject> getCookie();
+
+    Map<Long, Long> getItemMap();
+
+    void getOrderList(String cookie, Integer offset, Long orderCreateTimeStart, Long orderCreateTimeEnd, Map<Long, Long> itemMap) throws Exception;
+
+    List<JSONObject> getSamplesData(String startDate);
+
+    List<JSONObject> getDataList(Long statDate);
+
+    void deletePromoterBindChannelByDate(Long date);
+
+    void cleanKuaiShouPromoterBindChannel(Long date);
+
+    void cleanBytedancePromoterBindChannel(Long date);
+
+    void deleteMgsPromoterBindChannelByDate(Long date);
+
+    void cleanMgsKuaiShouPromoterBindChannel(Long date);
+}

+ 28 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/TokenService.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import cn.com.ctop.job.kuaishou.entity.CtopOauthToken;
+import cn.com.ctop.job.kuaishou.entity.OauthAgentToken;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+
+/**
+ * token信息
+ */
+public interface TokenService {
+
+    List<CtopOauthToken> getAllKuaiShouTokens();
+
+    CtopOauthToken getTokenByAccountId(Long accountId);
+
+    void getKuaiShouAgentRefresh();
+
+    void getLiveKuaiShouAgentRefresh();
+
+    void getKuaiShouRefresh();
+
+    OauthAgentToken getAgentTokenByAppId(Long appId);
+
+    List<CtopOauthToken> queryKsValidRuleAccountsToken();
+}

+ 23 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/UserService.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.job.kuaishou.service;
+
+import cn.com.ctop.job.kuaishou.entity.Project;
+import cn.com.ctop.job.kuaishou.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.util.Map;
+
+public interface UserService {
+
+    Map<String, String> getUserMapByMap(Map<String, String> userIdMap);
+
+    Map<Long, String> getProjectMap(Map<Long, Long> projectIdMap);
+
+    JSONObject getBidTypeAndMaxBid(Long accountId);
+
+    UserAllocation getOneByAccountId(Long accountId);
+
+    Project getProjectById(Long projectId);
+
+    List<Long> getAccountIdsByMedia(String mediaId);
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1068 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/AccountInfoServiceImpl.java


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1822 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/CommonServiceImpl.java


+ 34 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/MessageTemplateImpl.java

@@ -0,0 +1,34 @@
+package cn.com.ctop.job.kuaishou.service.impl;
+
+import cn.com.ctop.job.kuaishou.service.IMessageTemplate;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MessageTemplateImpl implements IMessageTemplate {
+
+    @Override
+    public String getKuaiShouBidTypeMessage(String projectName, Long advertiserId, Long unitId, String unit_name) {
+        StringBuilder text = new StringBuilder();
+        text.append("出价方式错误预警").append("<br/>")
+                .append("您的项目:").append(projectName + ",").append("<br/>")
+                .append("下的账户:").append(advertiserId + ",").append("<br/>")
+                .append("广告组id为:").append(unitId).append("<br/>")
+                .append("广告组名称为:").append(unit_name).append("<br/>")
+                .append("出价方式设置错误。").append("<br/>")
+                .append("系统已执行暂停此组操作,请您及时查看!");
+        return text.toString();
+    }
+
+    @Override
+    public String getKuaiShouBidMessage(String projectName, Long accountId, Long unitId, String unit_name) {
+        StringBuilder text = new StringBuilder();
+        text.append("出价过高预警").append("<br/>")
+                .append("您的项目:").append(projectName + ",").append("<br/>")
+                .append("下的账户:").append(accountId + ",").append("<br/>")
+                .append("广告组id为:").append(unitId).append("<br/>")
+                .append("广告组名称为:").append(unit_name).append("<br/>")
+                .append("出价设置过高。").append("<br/>")
+                .append("系统已执行暂停此组操作,请您及时查看!");
+        return text.toString();
+    }
+}

+ 126 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/MgsServiceImpl.java

@@ -0,0 +1,126 @@
+package cn.com.ctop.job.kuaishou.service.impl;
+
+import cn.com.ctop.job.kuaishou.entity.KuaishouSupplyChain;
+import cn.com.ctop.job.kuaishou.mapper.MgsMapper;
+import cn.com.ctop.job.kuaishou.service.ISendMessageService;
+import cn.com.ctop.job.kuaishou.service.MgsService;
+import cn.com.ctop.job.kuaishou.utils.Check;
+import cn.com.ctop.job.kuaishou.utils.DateUtils;
+import cn.com.ctop.job.kuaishou.utils.HttpUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class MgsServiceImpl implements MgsService {
+    @Autowired
+    private MgsMapper mgsMapper;
+
+    @Autowired
+    private ISendMessageService sendMessageService;
+
+    @Override
+    public List<JSONObject> getMgsCookie() {
+        return mgsMapper.getMgsCookie();
+    }
+
+    @Transactional
+    @Override
+    public void getOrderList(String cookie, Integer offset, Long orderCreateTimeStart, Long orderCreateTimeEnd, Map<Long, Long> itemMap) throws Exception {
+        String url = "https://cps.kwaixiaodian.com/distribute/pc/investment/order/list";
+        Thread.sleep(1000);
+        log.info("mgs团长抓取订单数据入参,开始时间:{},结束时间:{},数据:{}", DateUtils.tempToLongDateStr(orderCreateTimeStart), DateUtils.tempToLongDateStr(orderCreateTimeEnd), offset);
+        Map<String, Object> params = new HashMap<>();
+        if (!Check.isNull(orderCreateTimeStart)) {
+            params.put("orderCreateTimeStart", orderCreateTimeStart);
+        }
+        if (!Check.isNull(orderCreateTimeEnd)) {
+            params.put("orderCreateTimeEnd", orderCreateTimeEnd);
+        }
+        params.put("fundType", 1);
+        params.put("timeType", 1);
+        params.put("limit", 100);
+        params.put("offset", offset);
+
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Cookie", cookie);
+
+        String resultStr = HttpUtils.KuaiShouttpGetRequest(url, params, headers);
+        JSONObject result = JSONObject.parseObject(resultStr);
+        if (Check.isNull(result)) {
+            log.error("快分销数据返回为空");
+            return;
+        }
+        Integer code = result.getInteger("result");
+        if (code != 1) {
+            log.info("mgs快分销数据返回异常:", resultStr);
+            sendMessageService.sendMessage("113dee46c7df464da78c07a985e92cd1", "mgscookie失效,请及时更新。媒体返回信息:" + resultStr);
+            return;
+        }
+        JSONObject dataJson = result.getJSONObject("data");
+        if (Check.isNull(dataJson)) {
+            log.error("mgs数据返回为data数据为空");
+            return;
+        }
+        JSONArray list = dataJson.getJSONArray("list");
+        if (Check.isNull(list)) {
+            log.error("mgs数据返回为list数据为空");
+            return;
+        }
+        log.info("mgs当前数据条数:{}", list.size());
+        List<KuaishouSupplyChain> supplyChains = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+            JSONObject jsonObject = list.getJSONObject(i);
+            KuaishouSupplyChain supplyChain = new KuaishouSupplyChain();
+            supplyChain.setOid(jsonObject.getLong("oid"));
+            JSONObject item = jsonObject.getJSONArray("itemList").getJSONObject(0);
+            if (!Check.isNull(item)) {
+                supplyChain.setItemId(item.getLong("itemId"));
+                supplyChain.setItemTitle(item.getString("itemTitle"));
+                supplyChain.setReservePrice(item.getLong("reservePrice"));
+                supplyChain.setImageUrl(item.getString("imageUrl"));
+            }
+            supplyChain.setOrderStatus(jsonObject.getInteger("orderStatus"));
+            supplyChain.setOrderCreateTime(jsonObject.getLong("orderCreateTime"));
+            supplyChain.setSendStatus(jsonObject.getInteger("sendStatus"));
+            supplyChain.setSettlementBizType(jsonObject.getInteger("settlementBizType"));
+            supplyChain.setSettlementBizTypeDesc(jsonObject.getString("settlementBizTypeDesc"));
+            supplyChain.setSendTime(jsonObject.getLong("sendTime"));
+            supplyChain.setRecvTime(jsonObject.getLong("recvTime"));
+            supplyChain.setSellerId(jsonObject.getLong("sellerId"));
+            supplyChain.setPromoterId(jsonObject.getLong("promoterId"));
+            supplyChain.setPromoterNickName(RuixuanServiceImpl.filterSupplement(jsonObject.getString("promoterNickName")));
+            supplyChain.setActivityId(jsonObject.getLong("activityId"));
+            supplyChain.setOrderAmount(jsonObject.getLong("orderAmount"));
+            supplyChain.setPayAmount(jsonObject.getLong("payAmount"));
+            supplyChain.setRegimentalPromotionRate(jsonObject.getLong("regimentalPromotionRate"));
+            supplyChain.setShareRate(jsonObject.getLong("shareRate"));
+            supplyChain.setBaseAmount(jsonObject.getLong("baseAmount"));
+            supplyChain.setServiceAmount(jsonObject.getLong("serviceAmount"));
+            supplyChain.setRegimentalPromotionAmount(jsonObject.getLong("regimentalPromotionAmount"));
+            supplyChain.setTotalRegimentalSettleAmount(jsonObject.getLong("totalRegimentalSettleAmount"));
+            supplyChain.setStatDate(DateUtils.tempToDate(jsonObject.getLong("orderCreateTime")));
+            supplyChain.setItemCommissionRate(itemMap.get(item.getLong("itemId")));
+            supplyChains.add(supplyChain);
+        }
+        try {
+            mgsMapper.replaceSupplyChains(supplyChains);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        if (list.size() >= 100) {
+            getOrderList(cookie, offset + 100, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+        }
+
+    }
+}

+ 0 - 0
kuaishou/src/main/java/cn/com/ctop/job/kuaishou/service/impl/RuixuanServiceImpl.java


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.