修改主数据生成类
This commit is contained in:
parent
7b4a0b5ce7
commit
22e1047fd9
|
@ -5,24 +5,28 @@ logging:
|
||||||
root: info
|
root: info
|
||||||
encodings: UTF-8
|
encodings: UTF-8
|
||||||
file:
|
file:
|
||||||
# 日志保存路径
|
# 日志保存路径
|
||||||
path: /Users/apple/Desktop/log/local
|
path: /Users/apple/Desktop/log/local
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
dynamic:
|
dynamic:
|
||||||
|
druid:
|
||||||
|
filters: stat,log4j2
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8
|
||||||
# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenterauto?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
username: hzyazt
|
||||||
# username: root
|
|
||||||
# password: bd993088e8a7c3dc5f44441617f9b4bf
|
|
||||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
||||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
|
||||||
username: root
|
|
||||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
driver-class-name: dm.jdbc.driver.DmDriver
|
||||||
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
# url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||||
|
# username: root
|
||||||
|
# password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
|
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
|
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
|
||||||
|
|
||||||
savefile:
|
savefile:
|
||||||
# 文件保存路径
|
# 文件保存路径
|
||||||
path: /Users/apple/Desktop/log/local
|
path: /Users/apple/Desktop/log/local
|
||||||
ax:
|
ax:
|
||||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -16,6 +16,7 @@ spring:
|
||||||
username: root
|
username: root
|
||||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
|
|
||||||
savefile:
|
savefile:
|
||||||
# 文件保存路径
|
# 文件保存路径
|
||||||
path: E:/yongansystem/webservice/zt/file
|
path: E:/yongansystem/webservice/zt/file
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
ALTER TABLE sys_data_source ADD COLUMN data_state char(1) DEFAULT NULL COMMENT '数据源状态 0校验失败 1校验成功';
|
|
||||||
UPDATE sys_data_source SET data_state = '1';
|
|
||||||
COMMIT;
|
|
13
pom.xml
13
pom.xml
|
@ -29,7 +29,7 @@
|
||||||
<gson.version>2.8.5</gson.version>
|
<gson.version>2.8.5</gson.version>
|
||||||
<zxing.version>3.3.0</zxing.version>
|
<zxing.version>3.3.0</zxing.version>
|
||||||
<hutool.version>5.8.19</hutool.version>
|
<hutool.version>5.8.19</hutool.version>
|
||||||
<druid.version>1.1.22</druid.version>
|
<druid.version>1.2.0</druid.version>
|
||||||
<!-- <mybatis-spring-boot-starter.version>2.2.2</mybatis-spring-boot-starter.version>-->
|
<!-- <mybatis-spring-boot-starter.version>2.2.2</mybatis-spring-boot-starter.version>-->
|
||||||
<mybatis-plus-boot-starter.version>3.5.6</mybatis-plus-boot-starter.version>
|
<mybatis-plus-boot-starter.version>3.5.6</mybatis-plus-boot-starter.version>
|
||||||
<!-- <mysql-connector-j.version>8.0.33</mysql-connector-j.version>-->
|
<!-- <mysql-connector-j.version>8.0.33</mysql-connector-j.version>-->
|
||||||
|
@ -235,7 +235,8 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid-spring-boot-starter.version}</version>
|
<version>1.2.23</version>
|
||||||
|
<!-- <version>${druid-spring-boot-starter.version}</version>-->
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -245,6 +246,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 添加dm8 jdbc jar 包依赖-->
|
<!-- 添加dm8 jdbc jar 包依赖-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.dameng</groupId>-->
|
||||||
|
<!-- <artifactId>DmJdbcDriver18</artifactId>-->
|
||||||
|
<!-- <version>8.1.1.193</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.dameng</groupId>
|
<groupId>com.dameng</groupId>
|
||||||
<artifactId>Dm8JdbcDriver18</artifactId>
|
<artifactId>Dm8JdbcDriver18</artifactId>
|
||||||
|
@ -252,6 +259,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-beanutils</groupId>
|
<groupId>commons-beanutils</groupId>
|
||||||
<artifactId>commons-beanutils</artifactId>
|
<artifactId>commons-beanutils</artifactId>
|
||||||
|
@ -383,6 +391,7 @@
|
||||||
<artifactId>flyway-mysql</artifactId>
|
<artifactId>flyway-mysql</artifactId>
|
||||||
<version>8.5.13</version>
|
<version>8.5.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -13,7 +13,6 @@ import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity;
|
||||||
import com.hzya.frame.util.AESUtil;
|
import com.hzya.frame.util.AESUtil;
|
||||||
import com.hzya.frame.web.entity.BaseResult;
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import dm.jdbc.d.U;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
package com.hzya.frame.webapp.web.init;
|
package com.hzya.frame.webapp.web.init;
|
||||||
|
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||||
import com.hzya.frame.util.AESUtil;
|
import com.hzya.frame.util.AESUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
|
@ -7,6 +8,8 @@ import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -39,13 +42,21 @@ public class FlywayConfig {
|
||||||
private String username;
|
private String username;
|
||||||
@Value("${spring.datasource.dynamic.datasource.master.password}")
|
@Value("${spring.datasource.dynamic.datasource.master.password}")
|
||||||
private String password;
|
private String password;
|
||||||
|
@Resource
|
||||||
|
private DataSource dataSource;
|
||||||
|
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void migrateOrder() {
|
public void migrateOrder() {
|
||||||
String pwd = AESUtil.decrypt(password);
|
String pwd = AESUtil.decrypt(password);
|
||||||
|
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
||||||
|
DataSource dsDatasource = null;
|
||||||
|
|
||||||
|
dsDatasource = ds.getDataSource("master");
|
||||||
// 将路径转换
|
// 将路径转换
|
||||||
Flyway flyway = Flyway.configure()
|
Flyway flyway = Flyway.configure()
|
||||||
.dataSource(url,username,pwd)
|
//.dataSource(url,username,pwd)
|
||||||
|
.dataSource(dsDatasource)
|
||||||
.cleanDisabled(cleanDisabled)
|
.cleanDisabled(cleanDisabled)
|
||||||
.locations(locations)
|
.locations(locations)
|
||||||
.table(table)
|
.table(table)
|
||||||
|
|
Loading…
Reference in New Issue