Sfoglia il codice sorgente

数据同步定时任务修改

tags/24080901
CMM 1 anno fa
parent
commit
280ca0747a
4 ha cambiato i file con 8 aggiunte e 54 eliminazioni
  1. +0
    -48
      syn-data-task/pom.xml
  2. +3
    -1
      syn-data-task/src/main/java/com/ningdatech/syndataapi/SynDataTaskApp.java
  3. +1
    -1
      syn-data-task/src/main/java/com/ningdatech/syndataapi/scheduler/task/SynDataTask.java
  4. +4
    -4
      syn-data-task/src/main/resources/application-pre.yml

+ 0
- 48
syn-data-task/pom.xml Vedi File

@@ -42,10 +42,6 @@
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
@@ -59,10 +55,6 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
@@ -80,37 +72,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--cache-->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>

<!--引入jwt-->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.10.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-log-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-basic</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-swagger2-starter</artifactId>
@@ -121,7 +82,6 @@
</exclusion>
</exclusions>
</dependency>

</dependencies>

<!-- 打包 -->
@@ -197,14 +157,6 @@
</execution>
</executions>
</plugin>
<!-- 跳过单元测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>

+ 3
- 1
syn-data-task/src/main/java/com/ningdatech/syndataapi/SynDataTaskApp.java Vedi File

@@ -3,7 +3,9 @@ package com.ningdatech.syndataapi;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
@@ -14,7 +16,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @author CMM
* @since 2023/08/22 18:14
*/
@SpringBootApplication
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
@EnableAsync
@MapperScan(SynDataTaskApp.MAPPER_PACKAGES)
@EnableScheduling


+ 1
- 1
syn-data-task/src/main/java/com/ningdatech/syndataapi/scheduler/task/SynDataTask.java Vedi File

@@ -193,7 +193,7 @@ public class SynDataTask {
* 定时同步前置机数据 每天3点开始执行一次
*
*/
@Scheduled(cron = "0 0 3 * * ?")
@Scheduled(cron = "0 55 19 * * ?")
public void doTask() throws UnknownHostException {
if (flag && HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("数据同步任务开始");


+ 4
- 4
syn-data-task/src/main/resources/application-pre.yml Vedi File

@@ -19,10 +19,10 @@ spring:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.53.129.228:63306/szls_da_lsxmss_sjgx?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false
username: szls_da_lsxmss
password: 1Lzo6XqF
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.53.129.228:63306/szls_da_lsxmss_sjgx?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false
username: szls_da_lsxmss
password: 1Lzo6XqF
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数


Loading…
Annulla
Salva