Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c2d5dbff3d
@ -117,7 +117,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.microsoft.sqlserver</groupId>
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
<artifactId>mssql-jdbc</artifactId>
|
<artifactId>mssql-jdbc</artifactId>
|
||||||
<version>12.4.2.jre8</version>
|
<version>7.4.1.jre8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.jtds</groupId>
|
||||||
|
<artifactId>jtds</artifactId>
|
||||||
|
<version>1.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -11,33 +11,52 @@ spring:
|
|||||||
url: jdbc:dm://192.168.8.60:5236/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:dm://192.168.8.60:5236/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: SYSDBA
|
username: SYSDBA
|
||||||
password: SYSDBA
|
password: SYSDBA
|
||||||
|
# 初始连接数
|
||||||
|
initialSize: 5
|
||||||
|
# 最小连接池数量
|
||||||
|
minIdle: 10
|
||||||
|
# 最大连接池数量
|
||||||
|
maxActive: 20
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
|
maxEvictableIdleTimeMillis: 900000
|
||||||
|
# 配置检测连接是否有效
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
sqlserver:
|
sqlserver:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
enabled: true
|
enabled: true
|
||||||
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
driverClassName: net.sourceforge.jtds.jdbc.Driver
|
||||||
url: jdbc:sqlserver://192.168.8.68:1433;DatabaseName=DPG_RH_YQ_20240711;encrypt=false;trustServerCertificate=true;
|
url: jdbc:jtds:sqlserver://192.168.8.68:1433/DPG_RH_YQ_20240711
|
||||||
username: sa
|
username: sa
|
||||||
password: rh123456
|
password: rh123456
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
# 最小连接池数量
|
# 最小连接池数量
|
||||||
minIdle: 10
|
minIdle: 10
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
maxActive: 20
|
maxActive: 20
|
||||||
# 配置获取连接等待超时的时间
|
# 配置获取连接等待超时的时间
|
||||||
maxWait: 60000
|
maxWait: 60000
|
||||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
minEvictableIdleTimeMillis: 300000
|
minEvictableIdleTimeMillis: 300000
|
||||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
maxEvictableIdleTimeMillis: 900000
|
maxEvictableIdleTimeMillis: 900000
|
||||||
# 配置检测连接是否有效
|
# 配置检测连接是否有效
|
||||||
validationQuery: SELECT 1 FROM DUAL
|
validationQuery: SELECT 1
|
||||||
testWhileIdle: true
|
testWhileIdle: true
|
||||||
testOnBorrow: false
|
testOnBorrow: false
|
||||||
testOnReturn: false
|
testOnReturn: false
|
||||||
webStatFilter:
|
webStatFilter:
|
||||||
enabled: true
|
enabled: true
|
||||||
statViewServlet:
|
statViewServlet:
|
||||||
|
@ -10,6 +10,8 @@ import javax.servlet.ServletRequest;
|
|||||||
import javax.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import com.ktg.framework.config.properties.DmDruidProperties;
|
||||||
|
import com.ktg.framework.config.properties.SqlserverDruidProperties;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
@ -23,7 +25,6 @@ import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatPropertie
|
|||||||
import com.alibaba.druid.util.Utils;
|
import com.alibaba.druid.util.Utils;
|
||||||
import com.ktg.common.enums.DataSourceType;
|
import com.ktg.common.enums.DataSourceType;
|
||||||
import com.ktg.common.utils.spring.SpringUtils;
|
import com.ktg.common.utils.spring.SpringUtils;
|
||||||
import com.ktg.framework.config.properties.DruidProperties;
|
|
||||||
import com.ktg.framework.datasource.DynamicDataSource;
|
import com.ktg.framework.datasource.DynamicDataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,7 +37,7 @@ public class DruidConfig
|
|||||||
{
|
{
|
||||||
@Bean
|
@Bean
|
||||||
@ConfigurationProperties("spring.datasource.druid.dm")
|
@ConfigurationProperties("spring.datasource.druid.dm")
|
||||||
public DataSource dmDataSource(DruidProperties druidProperties)
|
public DataSource dmDataSource(DmDruidProperties druidProperties)
|
||||||
{
|
{
|
||||||
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||||
return druidProperties.dataSource(dataSource);
|
return druidProperties.dataSource(dataSource);
|
||||||
@ -45,7 +46,7 @@ public class DruidConfig
|
|||||||
@Bean
|
@Bean
|
||||||
@ConfigurationProperties("spring.datasource.druid.sqlserver")
|
@ConfigurationProperties("spring.datasource.druid.sqlserver")
|
||||||
@ConditionalOnProperty(prefix = "spring.datasource.druid.sqlserver", name = "enabled", havingValue = "true")
|
@ConditionalOnProperty(prefix = "spring.datasource.druid.sqlserver", name = "enabled", havingValue = "true")
|
||||||
public DataSource sqlServerDataSource(DruidProperties druidProperties)
|
public DataSource sqlServerDataSource(SqlserverDruidProperties druidProperties)
|
||||||
{
|
{
|
||||||
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||||
return druidProperties.dataSource(dataSource);
|
return druidProperties.dataSource(dataSource);
|
||||||
|
@ -0,0 +1,77 @@
|
|||||||
|
package com.ktg.framework.config.properties;
|
||||||
|
|
||||||
|
import com.alibaba.druid.pool.DruidDataSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* druid 配置属性
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class DmDruidProperties
|
||||||
|
{
|
||||||
|
@Value("${spring.datasource.druid.dm.initialSize}")
|
||||||
|
private int initialSize;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.minIdle}")
|
||||||
|
private int minIdle;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.maxActive}")
|
||||||
|
private int maxActive;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.maxWait}")
|
||||||
|
private int maxWait;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.timeBetweenEvictionRunsMillis}")
|
||||||
|
private int timeBetweenEvictionRunsMillis;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.minEvictableIdleTimeMillis}")
|
||||||
|
private int minEvictableIdleTimeMillis;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.maxEvictableIdleTimeMillis}")
|
||||||
|
private int maxEvictableIdleTimeMillis;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.validationQuery}")
|
||||||
|
private String validationQuery;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.testWhileIdle}")
|
||||||
|
private boolean testWhileIdle;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.testOnBorrow}")
|
||||||
|
private boolean testOnBorrow;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.dm.testOnReturn}")
|
||||||
|
private boolean testOnReturn;
|
||||||
|
|
||||||
|
public DruidDataSource dataSource(DruidDataSource datasource)
|
||||||
|
{
|
||||||
|
/** 配置初始化大小、最小、最大 */
|
||||||
|
datasource.setInitialSize(initialSize);
|
||||||
|
datasource.setMaxActive(maxActive);
|
||||||
|
datasource.setMinIdle(minIdle);
|
||||||
|
|
||||||
|
/** 配置获取连接等待超时的时间 */
|
||||||
|
datasource.setMaxWait(maxWait);
|
||||||
|
|
||||||
|
/** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
|
||||||
|
datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
||||||
|
|
||||||
|
/** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
|
||||||
|
datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
|
||||||
|
datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
|
||||||
|
*/
|
||||||
|
datasource.setValidationQuery(validationQuery);
|
||||||
|
/** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
|
||||||
|
datasource.setTestWhileIdle(testWhileIdle);
|
||||||
|
/** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||||
|
datasource.setTestOnBorrow(testOnBorrow);
|
||||||
|
/** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||||
|
datasource.setTestOnReturn(testOnReturn);
|
||||||
|
return datasource;
|
||||||
|
}
|
||||||
|
}
|
@ -1,77 +1,77 @@
|
|||||||
package com.ktg.framework.config.properties;
|
//package com.ktg.framework.config.properties;
|
||||||
|
//
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
//import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
//import org.springframework.context.annotation.Configuration;
|
||||||
import com.alibaba.druid.pool.DruidDataSource;
|
//import com.alibaba.druid.pool.DruidDataSource;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* druid 配置属性
|
// * druid 配置属性
|
||||||
*
|
// *
|
||||||
* @author ruoyi
|
// * @author ruoyi
|
||||||
*/
|
// */
|
||||||
@Configuration
|
//@Configuration
|
||||||
public class DruidProperties
|
//public class DruidProperties
|
||||||
{
|
//{
|
||||||
@Value("${spring.datasource.druid.initialSize}")
|
// @Value("${spring.datasource.druid.initialSize}")
|
||||||
private int initialSize;
|
// private int initialSize;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.minIdle}")
|
// @Value("${spring.datasource.druid.minIdle}")
|
||||||
private int minIdle;
|
// private int minIdle;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.maxActive}")
|
// @Value("${spring.datasource.druid.maxActive}")
|
||||||
private int maxActive;
|
// private int maxActive;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.maxWait}")
|
// @Value("${spring.datasource.druid.maxWait}")
|
||||||
private int maxWait;
|
// private int maxWait;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
|
// @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
|
||||||
private int timeBetweenEvictionRunsMillis;
|
// private int timeBetweenEvictionRunsMillis;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
|
// @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
|
||||||
private int minEvictableIdleTimeMillis;
|
// private int minEvictableIdleTimeMillis;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
|
// @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
|
||||||
private int maxEvictableIdleTimeMillis;
|
// private int maxEvictableIdleTimeMillis;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.validationQuery}")
|
// @Value("${spring.datasource.druid.validationQuery}")
|
||||||
private String validationQuery;
|
// private String validationQuery;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.testWhileIdle}")
|
// @Value("${spring.datasource.druid.testWhileIdle}")
|
||||||
private boolean testWhileIdle;
|
// private boolean testWhileIdle;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.testOnBorrow}")
|
// @Value("${spring.datasource.druid.testOnBorrow}")
|
||||||
private boolean testOnBorrow;
|
// private boolean testOnBorrow;
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.testOnReturn}")
|
// @Value("${spring.datasource.druid.testOnReturn}")
|
||||||
private boolean testOnReturn;
|
// private boolean testOnReturn;
|
||||||
|
//
|
||||||
public DruidDataSource dataSource(DruidDataSource datasource)
|
// public DruidDataSource dataSource(DruidDataSource datasource)
|
||||||
{
|
// {
|
||||||
/** 配置初始化大小、最小、最大 */
|
// /** 配置初始化大小、最小、最大 */
|
||||||
datasource.setInitialSize(initialSize);
|
// datasource.setInitialSize(initialSize);
|
||||||
datasource.setMaxActive(maxActive);
|
// datasource.setMaxActive(maxActive);
|
||||||
datasource.setMinIdle(minIdle);
|
// datasource.setMinIdle(minIdle);
|
||||||
|
//
|
||||||
/** 配置获取连接等待超时的时间 */
|
// /** 配置获取连接等待超时的时间 */
|
||||||
datasource.setMaxWait(maxWait);
|
// datasource.setMaxWait(maxWait);
|
||||||
|
//
|
||||||
/** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
|
// /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
|
||||||
datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
// datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
||||||
|
//
|
||||||
/** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
|
// /** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
|
||||||
datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
|
// datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
|
||||||
datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
|
// datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
|
// * 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
|
||||||
*/
|
// */
|
||||||
datasource.setValidationQuery(validationQuery);
|
// datasource.setValidationQuery(validationQuery);
|
||||||
/** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
|
// /** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
|
||||||
datasource.setTestWhileIdle(testWhileIdle);
|
// datasource.setTestWhileIdle(testWhileIdle);
|
||||||
/** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
// /** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||||
datasource.setTestOnBorrow(testOnBorrow);
|
// datasource.setTestOnBorrow(testOnBorrow);
|
||||||
/** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
// /** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||||
datasource.setTestOnReturn(testOnReturn);
|
// datasource.setTestOnReturn(testOnReturn);
|
||||||
return datasource;
|
// return datasource;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
@ -0,0 +1,77 @@
|
|||||||
|
package com.ktg.framework.config.properties;
|
||||||
|
|
||||||
|
import com.alibaba.druid.pool.DruidDataSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* druid 配置属性
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class SqlserverDruidProperties
|
||||||
|
{
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.initialSize}")
|
||||||
|
private int initialSize;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.minIdle}")
|
||||||
|
private int minIdle;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.maxActive}")
|
||||||
|
private int maxActive;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.maxWait}")
|
||||||
|
private int maxWait;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.timeBetweenEvictionRunsMillis}")
|
||||||
|
private int timeBetweenEvictionRunsMillis;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.minEvictableIdleTimeMillis}")
|
||||||
|
private int minEvictableIdleTimeMillis;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.maxEvictableIdleTimeMillis}")
|
||||||
|
private int maxEvictableIdleTimeMillis;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.validationQuery}")
|
||||||
|
private String validationQuery;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.testWhileIdle}")
|
||||||
|
private boolean testWhileIdle;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.testOnBorrow}")
|
||||||
|
private boolean testOnBorrow;
|
||||||
|
|
||||||
|
@Value("${spring.datasource.druid.sqlserver.testOnReturn}")
|
||||||
|
private boolean testOnReturn;
|
||||||
|
|
||||||
|
public DruidDataSource dataSource(DruidDataSource datasource)
|
||||||
|
{
|
||||||
|
/** 配置初始化大小、最小、最大 */
|
||||||
|
datasource.setInitialSize(initialSize);
|
||||||
|
datasource.setMaxActive(maxActive);
|
||||||
|
datasource.setMinIdle(minIdle);
|
||||||
|
|
||||||
|
/** 配置获取连接等待超时的时间 */
|
||||||
|
datasource.setMaxWait(maxWait);
|
||||||
|
|
||||||
|
/** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
|
||||||
|
datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
||||||
|
|
||||||
|
/** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
|
||||||
|
datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
|
||||||
|
datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
|
||||||
|
*/
|
||||||
|
datasource.setValidationQuery(validationQuery);
|
||||||
|
/** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
|
||||||
|
datasource.setTestWhileIdle(testWhileIdle);
|
||||||
|
/** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||||
|
datasource.setTestOnBorrow(testOnBorrow);
|
||||||
|
/** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||||
|
datasource.setTestOnReturn(testOnReturn);
|
||||||
|
return datasource;
|
||||||
|
}
|
||||||
|
}
|
@ -62,6 +62,10 @@ public class WmsOutTaskController extends BaseController {
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/open/run/{wmsOutTaskIds}")
|
||||||
|
public AjaxResult openRun(@PathVariable Long[] wmsOutTaskIds) {
|
||||||
|
return toAjax(wmsOutTaskService.runWmsOutTask(wmsOutTaskIds));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开放 查询出库任务列表
|
* 开放 查询出库任务列表
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
package com.ktg.mes.md.mapper;
|
package com.ktg.mes.md.mapper;
|
||||||
|
|
||||||
|
import com.ktg.common.annotation.DataSource;
|
||||||
|
import com.ktg.common.enums.DataSourceType;
|
||||||
import com.ktg.mes.md.domain.AP0AE;
|
import com.ktg.mes.md.domain.AP0AE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface AP0AEMapper {
|
public interface AP0AEMapper {
|
||||||
List<AP0AE> selectAll();
|
@DataSource(DataSourceType.SQLSERVER)
|
||||||
|
List<AP0AE> selectOutNewData();
|
||||||
|
|
||||||
|
@DataSource(DataSourceType.SQLSERVER)
|
||||||
|
int updateOutDataToOld(AP0AE ap0ae);
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,5 @@ import com.ktg.mes.md.domain.AP0AE;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface IAP0AEService {
|
public interface IAP0AEService {
|
||||||
public List<AP0AE> selectAllAP0AE();
|
public List<AP0AE> selectOutNewData();
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,8 @@ public class AP0AEServiceImpl implements IAP0AEService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AP0AEMapper aP0AEMapper;
|
private AP0AEMapper aP0AEMapper;
|
||||||
|
|
||||||
@DataSource(DataSourceType.SQLSERVER)
|
|
||||||
@Override
|
@Override
|
||||||
public List<AP0AE> selectAllAP0AE() {
|
public List<AP0AE> selectOutNewData() {
|
||||||
return this.aP0AEMapper.selectAll();
|
return this.aP0AEMapper.selectOutNewData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,17 @@
|
|||||||
from AP0AE
|
from AP0AE
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectAll" resultMap="AP0AEResult">
|
<select id="selectOutNewData" resultMap="AP0AEResult">
|
||||||
<include refid="AP0AESelectAllCol"/>
|
<include refid="AP0AESelectAllCol"/>
|
||||||
|
where UDF07 != 'ED'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateOutDataToOld">
|
||||||
|
update AP0AE
|
||||||
|
set UDF07 = 'ED'
|
||||||
|
where AE001 = #{AE001}
|
||||||
|
AND AE002 = #{AE002}
|
||||||
|
AND AE003 = #{AE003}
|
||||||
|
AND AE012 = #{AE012}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user