接口映射 增加 4,5,6 数据源

tags/yfai-mes-ext-v3.2
王杰 2 months ago
parent 67fd0b8a14
commit c55224a658

@ -0,0 +1,67 @@
package cn.estsh.i3plus.ext.mes.apiservice.cus_suit;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.plugin.datasource.DynamicDataSourceProxy;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* @Description : pisces4
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces4Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces4
*/
@Value("${impp.pisces4.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces4.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces4.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces4.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces4.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces4.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces4DataSource")
@ConditionalOnExpression("'${impp.pisces4.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces4数据源加载...】");
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -0,0 +1,67 @@
package cn.estsh.i3plus.ext.mes.apiservice.cus_suit;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.plugin.datasource.DynamicDataSourceProxy;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* @Description : pisces5
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces5Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces5
*/
@Value("${impp.pisces5.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces5.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces5.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces5.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces5.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces5.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces5DataSource")
@ConditionalOnExpression("'${impp.pisces5.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces5数据源加载...】");
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -0,0 +1,67 @@
package cn.estsh.i3plus.ext.mes.apiservice.cus_suit;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.plugin.datasource.DynamicDataSourceProxy;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* @Description : pisces6
* @Reference :
* @Author : junsheng.li
* @CreateDate 2024/11/5 11:29
* @Modify:
**/
@Configuration
public class Pisces6Properties {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
/***********************
* pisces6
*/
@Value("${impp.pisces6.datasource.isopen}")
@Getter
private boolean piscesIsOpen;
@Value("${impp.pisces6.datasource.driver-class-name}")
@Getter
private String piscesDriverClassName;
@Value("${impp.pisces6.datasource.alias}")
@Getter
private String piscesDsAlias;
@Value("${impp.pisces6.datasource.jdbc-url}")
@Getter
private String piscesDsJdbcUrl;
@Value("${impp.pisces6.datasource.username}")
@Getter
private String piscesDsUsername;
@Value("${impp.pisces6.datasource.password}")
@Getter
private String piscesDsPassword;
@Bean(name = "pisces6DataSource")
@ConditionalOnExpression("'${impp.pisces6.datasource.isopen:false}' == 'true'")
public DynamicDataSourceProxy initPiscesCustomerSet(){
LOGGER.info("【初始化客户定制化...】");
/**
*
*/
LOGGER.info("【客户定制化pisces6数据源加载...】");
return DynamicDataSourceProxy.initDataSourceFactory(this.getPiscesDriverClassName(),
this.getPiscesDsJdbcUrl(), this.getPiscesDsUsername(), this.getPiscesDsPassword(),TimeUnit.MINUTES.toMillis(30));
}
}

@ -59,6 +59,15 @@ public class MesSAPDbAdapter {
@Resource(name = "pisces3DataSource")
private DynamicDataSourceProxy pisces3DataSourceProxy;
@Resource(name = "pisces4DataSource")
private DynamicDataSourceProxy pisces4DataSourceProxy;
@Resource(name = "pisces5DataSource")
private DynamicDataSourceProxy pisces5DataSourceProxy;
@Resource(name = "pisces6DataSource")
private DynamicDataSourceProxy pisces6DataSourceProxy;
@Value("${sync.redis.time:1800}")
private Integer redisTime;
@ -89,7 +98,10 @@ public class MesSAPDbAdapter {
DynamicDataSourceProxy piscesDataSourceProxy,
DynamicDataSourceProxy pisces1DataSourceProxy,
DynamicDataSourceProxy pisces2DataSourceProxy,
DynamicDataSourceProxy pisces3DataSourceProxy) throws Exception {
DynamicDataSourceProxy pisces3DataSourceProxy,
DynamicDataSourceProxy pisces4DataSourceProxy,
DynamicDataSourceProxy pisces5DataSourceProxy,
DynamicDataSourceProxy pisces6DataSourceProxy) throws Exception {
WmsSAPDbWriter wmsSAPDbWriter = null;
@ -133,6 +145,29 @@ public class MesSAPDbAdapter {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces3DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES42MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces4DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES4.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces4DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES52MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces5DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES5.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces5DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES62MES.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(pisces6DataSourceProxy, mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES6.getCode())) {
wmsSAPDbWriter = new WmsSAPDbWriter(mesDataSourceProxy, pisces6DataSourceProxy);
}
// new 的对象需要手工注入 bean
if (SpringContextsUtil.getApplicationContext() != null) {
@ -165,7 +200,10 @@ public class MesSAPDbAdapter {
DynamicDataSourceProxy piscesDataSourceProxy,
DynamicDataSourceProxy pisces1DataSourceProxy,
DynamicDataSourceProxy pisces2DataSourceProxy,
DynamicDataSourceProxy pisces3DataSourceProxy) {
DynamicDataSourceProxy pisces3DataSourceProxy,
DynamicDataSourceProxy pisces4DataSourceProxy,
DynamicDataSourceProxy pisces5DataSourceProxy,
DynamicDataSourceProxy pisces6DataSourceProxy) {
WmsSAPDbReader wmsSAPDbReader = null;
@ -209,6 +247,30 @@ public class MesSAPDbAdapter {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES42MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces4DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES4.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES52MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces5DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES5.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.PISCES62MES.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(pisces6DataSourceProxy);
}
if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.MES2PISCES6.getCode())) {
wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
}
// if (groupName.equals(MesInterfaceEnumUtil.DIRECTION_TYPE.WMS2MES.getName())) {
// wmsSAPDbReader = new WmsSAPDbReader(mesDataSourceProxy);
// }
@ -261,11 +323,15 @@ public class MesSAPDbAdapter {
// 不需要在这里处理
//initConnection();
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
writer.setSrcConn(this.srcConn);
writer.setDestConn(this.destConn);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
reader.setSrcConn(this.srcConn);
@ -422,11 +488,15 @@ public class MesSAPDbAdapter {
// 不需要在这里处理
//initConnection();
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
writer = buildWriter(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
writer.setSrcConn(this.srcConn);
writer.setDestConn(this.destConn);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,piscesDataSourceProxy,pisces1DataSourceProxy,pisces2DataSourceProxy,pisces3DataSourceProxy);
reader = buildReader(groupName, sapDataSourceProxy, mesDataSourceProxy,
piscesDataSourceProxy, pisces1DataSourceProxy, pisces2DataSourceProxy, pisces3DataSourceProxy, pisces4DataSourceProxy, pisces5DataSourceProxy, pisces6DataSourceProxy);
reader.setSrcConn(this.srcConn);

@ -69,4 +69,28 @@ impp.pisces3.datasource.alias=pisces3DataSource
impp.pisces3.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces3.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces3.datasource.username=sa
impp.pisces3.datasource.password=sahasnopassword
impp.pisces3.datasource.password=sahasnopassword
#Pisces4\u6570\u636E\u6E90
impp.pisces4.datasource.isopen=true
impp.pisces4.datasource.alias=pisces4DataSource
impp.pisces4.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces4.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces4.datasource.username=sa
impp.pisces4.datasource.password=sahasnopassword
#Pisces5\u6570\u636E\u6E90
impp.pisces5.datasource.isopen=true
impp.pisces5.datasource.alias=pisces5DataSource
impp.pisces5.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces5.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces5.datasource.username=sa
impp.pisces5.datasource.password=sahasnopassword
#Pisces6\u6570\u636E\u6E90
impp.pisces6.datasource.isopen=true
impp.pisces6.datasource.alias=pisces6DataSource
impp.pisces6.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces6.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces6.datasource.username=sa
impp.pisces6.datasource.password=sahasnopassword

@ -1,64 +0,0 @@
#\u5B89\u9053\u62D3\u6570\u636E\u6E90
impp.yfas.datasource.isopen=true
#WMS\u6570\u636E\u6E90
impp.mes.datasource.isopen=true
#\u6570\u636E\u6E90\u7684\u522B\u540D
impp.mes.datasource.alias=mesDataSource
impp.mes.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.mes.datasource.jdbc-url=jdbc:mysql://10.195.88.71:3306/impp_i3_mes?autoReconnect=true&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
#impp.mes.datasource.jdbc-url=jdbc:sqlserver://139.224.200.147:20037;DatabaseName=impp_i3_mes;
impp.mes.datasource.username=root
#impp.mes.datasource.password=Test123!
impp.mes.datasource.password=estsh123
#Admin123!
#\u6570\u636E\u6E90\u7684\u522B\u540D
impp.yfas.datasource.alias=yfasDataSource
impp.yfas.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.yfas.datasource.jdbc-url=jdbc:mysql://10.195.88.71:3316/impp_i3_wms_sap_if?autoReconnect=true&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
#impp.yfas.datasource.jdbc-url=jdbc:sqlserver://139.224.200.147:20037;DatabaseName=impp_i3_mes;
impp.yfas.datasource.username=root
impp.yfas.datasource.password=estsh123
#\u6570\u636E\u6E90\u7684\u522B\u540D
#impp.wms.datasource.isopen=true
#impp.wms.datasource.alias=wmsDataSource
#impp.wms.datasource.driver-class-name=com.mysql.jdbc.Driver
#impp.wms.datasource.jdbc-url=jdbc:mysql://dbmaster:3306/impp_i3_wms?autoReconnect=true&useSSL=false&characterEncoding=utf-8
#impp.wms.datasource.username=root
#impp.wms.datasource.password=estsh123
#
##SWEB??????????
#impp.sweb.datasource.isopen=true
#impp.sweb.datasource.alias=swebDataSource
#impp.sweb.datasource.driver-class-name=com.mysql.jdbc.Driver
#impp.sweb.datasource.jdbc-url=jdbc:mysql://dbmaster:3306/impp_i3_wms?autoReconnect=true&useSSL=false&characterEncoding=utf-8
#impp.sweb.datasource.username=root
#impp.sweb.datasource.password=estsh123
#Pisces数据源
impp.pisces.datasource.isopen=true
impp.pisces.datasource.alias=piscesDataSource
impp.pisces.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces.datasource.username=sa
impp.pisces.datasource.password=sahasnopassword
#Pisces数据源
impp.pisces1.datasource.isopen=true
impp.pisces1.datasource.alias=piscesDataSource
impp.pisces1.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces1.datasource.jdbc-url=jdbc:sqlserver://172.28.239.113:1433;SelectMethod=cursor;DatabaseName=PiscesTest;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces1.datasource.username=sa
impp.pisces1.datasource.password=sahasnopassword
#Pisces中间表数据源
impp.pisces1.datasource.isopen=true
impp.pisces1.datasource.alias=pisces1DataSource
impp.pisces1.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
impp.pisces1.datasource.jdbc-url=jdbc:sqlserver://172.28.16.73:1433;SelectMethod=cursor;DatabaseName=YFMES_DATACENTER;applicationIntent=schemaOnly;selectedSchema=MES
impp.pisces1.datasource.username=sa
impp.pisces1.datasource.password=sahasnopassword
Loading…
Cancel
Save