修改主数据生成类
This commit is contained in:
parent
7b4a0b5ce7
commit
22e1047fd9
buildpackage/src/main/resources
pom.xmlservice/src/main/java/com/hzya/frame/report/reportManage/service/impl
webapp/src/main/java/com/hzya/frame/webapp/web/init
|
@ -5,24 +5,28 @@ logging:
|
|||
root: info
|
||||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
# 日志保存路径
|
||||
path: /Users/apple/Desktop/log/local
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
druid:
|
||||
filters: stat,log4j2
|
||||
datasource:
|
||||
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: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: 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
|
||||
url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8
|
||||
username: hzyazt
|
||||
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:
|
||||
# 文件保存路径
|
||||
# 文件保存路径
|
||||
path: /Users/apple/Desktop/log/local
|
||||
ax:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -16,6 +16,7 @@ spring:
|
|||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
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>
|
||||
<zxing.version>3.3.0</zxing.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-plus-boot-starter.version>3.5.6</mybatis-plus-boot-starter.version>
|
||||
<!-- <mysql-connector-j.version>8.0.33</mysql-connector-j.version>-->
|
||||
|
@ -235,7 +235,8 @@
|
|||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<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>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -245,6 +246,12 @@
|
|||
</dependency>
|
||||
|
||||
<!-- 添加dm8 jdbc jar 包依赖-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.dameng</groupId>-->
|
||||
<!-- <artifactId>DmJdbcDriver18</artifactId>-->
|
||||
<!-- <version>8.1.1.193</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>Dm8JdbcDriver18</artifactId>
|
||||
|
@ -252,6 +259,7 @@
|
|||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
|
@ -383,6 +391,7 @@
|
|||
<artifactId>flyway-mysql</artifactId>
|
||||
<version>8.5.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -13,7 +13,6 @@ import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity;
|
|||
import com.hzya.frame.util.AESUtil;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import dm.jdbc.d.U;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
package com.hzya.frame.webapp.web.init;
|
||||
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||
import com.hzya.frame.util.AESUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flywaydb.core.Flyway;
|
||||
|
@ -7,6 +8,8 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
|
@ -39,13 +42,21 @@ public class FlywayConfig {
|
|||
private String username;
|
||||
@Value("${spring.datasource.dynamic.datasource.master.password}")
|
||||
private String password;
|
||||
@Resource
|
||||
private DataSource dataSource;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void migrateOrder() {
|
||||
String pwd = AESUtil.decrypt(password);
|
||||
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
||||
DataSource dsDatasource = null;
|
||||
|
||||
dsDatasource = ds.getDataSource("master");
|
||||
// 将路径转换
|
||||
Flyway flyway = Flyway.configure()
|
||||
.dataSource(url,username,pwd)
|
||||
//.dataSource(url,username,pwd)
|
||||
.dataSource(dsDatasource)
|
||||
.cleanDisabled(cleanDisabled)
|
||||
.locations(locations)
|
||||
.table(table)
|
||||
|
|
Loading…
Reference in New Issue