Jelajahi Sumber

Merge branch 'master' into test

syh 4 tahun lalu
induk
melakukan
b8ca3db570

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

@@ -117,6 +117,7 @@ public class CallbackController {
                 throw new Exception("回调信息为空");
             }
             log.info("快手授权返回信息:{}", json);
+            log.info("快手授权返回oauthCode:{}", authCode);
             Integer agentType = json.getInteger("agentType");
             if (StringUtils.isNotBlank(authCode)) {
                 KuaishouResultToken accessToken = kuaishouInterfaceService.getAccessToken(authCode, agentType);

+ 31 - 11
module-check/pom.xml

@@ -1,20 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>jeecg-boot-parent</artifactId>
         <groupId>org.jeecgframework.boot</groupId>
         <version>2.0.2</version>
     </parent>
+    <modelVersion>4.0.0</modelVersion>
     <groupId>cn.com.ctop</groupId>
     <artifactId>module-check</artifactId>
     <version>2.0.2</version>
+    <packaging>jar</packaging>
     <name>module-check</name>
-    <description>Data Check Jar</description>
-
     <properties>
-        <java.version>1.8</java.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.7</maven.compiler.source>
+        <maven.compiler.target>1.7</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -42,12 +43,31 @@
     </dependencies>
 
     <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
+        <resources>
+            <resource>
+                <directory>lib</directory>
+                <targetPath>BOOT-INF/lib/</targetPath>
+                <includes>
+                    <include>**/*.jar</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <targetPath>BOOT-INF/classes/</targetPath>
+            </resource>
+            <!-- 解决MyBatis配置文件引入问题 -->
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <!-- 是否替换资源中的属性-->
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
     </build>
-
 </project>

+ 0 - 13
module-check/src/main/java/cn/com/ctop/ModuleCheckApplication.java

@@ -1,13 +0,0 @@
-package cn.com.ctop;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class ModuleCheckApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(ModuleCheckApplication.class, args);
-    }
-
-}

+ 0 - 15
module-check/src/main/java/cn/com/ctop/check/script/TestGroovyScript.java

@@ -2,28 +2,13 @@ package cn.com.ctop.check.script;
 
 import cn.com.ctop.check.component.execute.GroovyScriptExecutor;
 import cn.com.ctop.check.service.ICtopCheckTaskListService;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IUserAllocationService;
-import cn.com.ctop.kuaishou.modules.report.mapper.AccountReportMapper;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceAccountReportMapper;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.checkerframework.checker.units.qual.A;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.SystemDateConstant;
-import org.jeecg.common.util.DateUtils;
 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.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
 @RestController
 @RequestMapping("/rest/script")
 public class TestGroovyScript {

+ 0 - 4
module-common/pom.xml

@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
@@ -12,10 +11,7 @@
     <groupId>cn.com.ctop</groupId>
     <artifactId>module-common</artifactId>
     <version>2.0.2</version>
-
     <name>module-common</name>
-    <!-- FIXME change it to the project's website -->
-    <url>http://www.example.com</url>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 0 - 8
module-job-bytedance/pom.xml

@@ -79,12 +79,6 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>cn.com.ctop</groupId>
-            <artifactId>performance-appraisal</artifactId>
-            <version>2.0.2</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <version>3.5.0</version>
@@ -110,7 +104,6 @@
             <groupId>org.jeecgframework.boot</groupId>
             <artifactId>module-ctop</artifactId>
             <version>2.0.2</version>
-            <scope>compile</scope>
         </dependency>
 
         <dependency>
@@ -145,7 +138,6 @@
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-check</artifactId>
             <version>2.0.2</version>
-            <scope>compile</scope>
         </dependency>
     </dependencies>
 

+ 1 - 2
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/config/MybatisPlusConfig.java

@@ -11,8 +11,7 @@ import org.springframework.context.annotation.Configuration;
  *
  */
 @Configuration
-@MapperScan(value = {"org.jeecg.modules.**.mapper*", "cn.com.ctop.**.mapper*", "cn.com.ctop.bytedance.mapper*"})
-
+@MapperScan(value = {"org.jeecg.modules.**.mapper*", "cn.com.ctop.**.mapper*"})
 public class MybatisPlusConfig {
 
     /**

+ 2 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceOperationRecordJob.java

@@ -1,3 +1,4 @@
+/*
 package cn.com.ctop.job.bytedance.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
@@ -53,3 +54,4 @@ public class BytedanceOperationRecordJob {
         return ReturnT.SUCCESS;
     }
 }
+*/

+ 54 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceTodayPlaneLoadJob.java

@@ -0,0 +1,54 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+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 宋英豪
+ */
+@Component
+public class BytedanceTodayPlaneLoadJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(15);
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+    @Autowired
+    private IByteDanceCampaignService campaignService;
+    @Autowired
+    private IByteDanceCreativeService creativeService;
+
+    @XxlJob("bytedanceTodayPlaneLoadJob")
+    public ReturnT<String> execute(String params) throws Exception {
+        Date getDate = new Date();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String dateString = dateFormat.format(getDate);
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        tokens.forEach(token -> executorService.submit(() -> {
+            try {
+                advertiserDataService.getAdvertiserPlan(token, "", null, dateString);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }));
+        XxlJobLogger.log("当日计划数据同步完成完成");
+        return ReturnT.SUCCESS;
+    }
+}

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/CheckDataStateJob.java

@@ -25,7 +25,7 @@ public class CheckDataStateJob {
      * 检查任务执行结果
      */
     @XxlJob(jobName)
-    public ReturnT<String> execute() throws Exception {
+    public ReturnT<String> execute(String param) throws Exception {
         //查询需要检查的任务列表
         List<CtopCheckTaskList> ctopCheckTaskList= checkTaskListService.queryExecuteList(jobName);
         if(!ctopCheckTaskList.isEmpty()){

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/CheckExecuteStateJob.java

@@ -25,7 +25,7 @@ public class CheckExecuteStateJob {
      * 检查任务执行结果
      */
     @XxlJob(jobName)
-    public ReturnT<String> execute() throws Exception {
+    public ReturnT<String> execute(String param) throws Exception {
         //查询需要检查的任务列表
         List<CtopCheckTaskList> ctopCheckTaskList= checkTaskListService.queryExecuteList(jobName);
         if(!ctopCheckTaskList.isEmpty()){

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

@@ -104,6 +104,24 @@ mybatis-plus:
       log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 #jeecg专用配置
 jeecg:
+  elasticsearch:
+    cluster-nodes:
+    check-enabled: false
+  uploadType:
+  oss:
+    endpoint:
+    accessKey:
+    secretKey:
+    bucketName:
+    staticDomain:
+  sms:
+    accessKeyId:
+    accessKeySecret:
+  minio:
+    minio_url:
+    minio_name:
+    minio_pass:
+    bucketName:
   ffmpeg:
     bin: D:\java\ffmpeg\bin\ffmpeg.exe
   path:

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

@@ -127,6 +127,24 @@ mybatis-plus:
       log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 #jeecg专用配置
 jeecg:
+  elasticsearch:
+    cluster-nodes:
+    check-enabled: false
+  uploadType:
+  oss:
+    endpoint:
+    accessKey:
+    secretKey:
+    bucketName:
+    staticDomain:
+  sms:
+    accessKeyId:
+    accessKeySecret:
+  minio:
+    minio_url:
+    minio_name:
+    minio_pass:
+    bucketName:
   ffmpeg:
     bin: D:\java\ffmpeg\bin\ffmpeg.exe
   path:

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

@@ -1604,6 +1604,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         KuaishouResultToken kuaiShouResult = null;
         try {
             String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
+            log.info("返回token信息:{}",JSONObject.parseObject(result));
             ObjectMapper mapper = new ObjectMapper();
             mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
             kuaiShouResult = mapper.readValue(result, new TypeReference<KuaishouResultToken>() {

+ 0 - 1
module-toutiao/pom.xml

@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>

+ 1 - 1
pom.xml

@@ -24,11 +24,11 @@
         <module>module-media</module>
         <module>module-ctop</module>
         <module>performance-appraisal</module>
+        <module>module-check</module>
         <module>jeecg-boot-module-system</module>
         <module>module-job-bytedance</module>
         <module>module-job-kuaishou</module>
         <module>module-callback</module>
-        <module>module-check</module>
     </modules>
 
     <distributionManagement>