密码规则完善 合并代码
commit
071c6cd40d
@ -1,34 +1,34 @@
|
||||
package cn.estsh.i3plus.core.apiservice.configuration;
|
||||
|
||||
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.jpa.factory.BaseMongoRepositoryFactoryBean;
|
||||
import cn.estsh.i3plus.pojo.base.jpa.factory.BaseRepositoryFactoryBean;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
|
||||
/**
|
||||
* @Description : 需要扫描其他包的配置文件
|
||||
* 此类专门添加需要单独加载的其他模块的包
|
||||
* @Reference :
|
||||
* @Author : alwaysfrin
|
||||
* @CreateDate : 2018-12-12 20:49
|
||||
* @Modify:
|
||||
**/
|
||||
@Configuration
|
||||
@ConditionalOnExpression("'${" + CommonConstWords.PROP_SWITCH_MONGO + ":false}' == 'true'")
|
||||
//扫描需要单独处理的持久化包
|
||||
@EnableMongoRepositories(basePackages = {
|
||||
"cn.estsh.i3plus.**.platrepositorymongo"
|
||||
},repositoryFactoryBeanClass = BaseMongoRepositoryFactoryBean.class)
|
||||
public class ScanMongoPackageConfiguration {
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
|
||||
|
||||
public ScanMongoPackageConfiguration(){
|
||||
LOGGER.info("【扫描关联包...】");
|
||||
}
|
||||
}
|
||||
//package cn.estsh.i3plus.core.apiservice.configuration;
|
||||
//
|
||||
//import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
||||
//import cn.estsh.i3plus.pojo.base.jpa.factory.BaseMongoRepositoryFactoryBean;
|
||||
//import cn.estsh.i3plus.pojo.base.jpa.factory.BaseRepositoryFactoryBean;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||
//import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
//import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
//
|
||||
///**
|
||||
// * @Description : 需要扫描其他包的配置文件
|
||||
// * 此类专门添加需要单独加载的其他模块的包
|
||||
// * @Reference :
|
||||
// * @Author : alwaysfrin
|
||||
// * @CreateDate : 2018-12-12 20:49
|
||||
// * @Modify:
|
||||
// **/
|
||||
//@Configuration
|
||||
//@ConditionalOnExpression("'${" + CommonConstWords.PROP_SWITCH_MONGO + ":false}' == 'true'")
|
||||
////扫描需要单独处理的持久化包
|
||||
//@EnableMongoRepositories(basePackages = {
|
||||
// "cn.estsh.i3plus.**.platrepositorymongo"
|
||||
//},repositoryFactoryBeanClass = BaseMongoRepositoryFactoryBean.class)
|
||||
//public class ScanMongoPackageConfiguration {
|
||||
// public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
|
||||
//
|
||||
// public ScanMongoPackageConfiguration(){
|
||||
// LOGGER.info("【扫描关联包...】");
|
||||
// }
|
||||
//}
|
||||
|
@ -1,35 +1,35 @@
|
||||
package cn.estsh.i3plus.core.apiservice.configuration;
|
||||
|
||||
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.jpa.factory.BaseRepositoryFactoryBean;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
/**
|
||||
* @Description : 需要扫描其他包的配置文件
|
||||
* 此类专门添加需要单独加载的其他模块的包
|
||||
* @Reference :
|
||||
* @Author : alwaysfrin
|
||||
* @CreateDate : 2018-12-12 20:49
|
||||
* @Modify:
|
||||
**/
|
||||
@Configuration
|
||||
//扫描需要单独处理的包
|
||||
@EntityScan(basePackages = {
|
||||
"cn.estsh.i3plus.**.platbean"
|
||||
})
|
||||
|
||||
//需要单独处理的其他模块包
|
||||
@EnableJpaRepositories(basePackages = {
|
||||
"cn.estsh.i3plus.**.platrepository"
|
||||
}, repositoryFactoryBeanClass = BaseRepositoryFactoryBean.class)
|
||||
public class ScanPackageConfiguration {
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
|
||||
|
||||
public ScanPackageConfiguration(){
|
||||
LOGGER.info("【扫描关联包...】");
|
||||
}
|
||||
}
|
||||
//package cn.estsh.i3plus.core.apiservice.configuration;
|
||||
//
|
||||
//import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
||||
//import cn.estsh.i3plus.pojo.base.jpa.factory.BaseRepositoryFactoryBean;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
//
|
||||
///**
|
||||
// * @Description : 需要扫描其他包的配置文件
|
||||
// * 此类专门添加需要单独加载的其他模块的包
|
||||
// * @Reference :
|
||||
// * @Author : alwaysfrin
|
||||
// * @CreateDate : 2018-12-12 20:49
|
||||
// * @Modify:
|
||||
// **/
|
||||
//@Configuration
|
||||
////扫描需要单独处理的包
|
||||
//@EntityScan(basePackages = {
|
||||
// "cn.estsh.i3plus.**.platbean"
|
||||
//})
|
||||
//
|
||||
////需要单独处理的其他模块包
|
||||
//@EnableJpaRepositories(basePackages = {
|
||||
// "cn.estsh.i3plus.**.platrepository"
|
||||
//}, repositoryFactoryBeanClass = BaseRepositoryFactoryBean.class)
|
||||
//public class ScanPackageConfiguration {
|
||||
// public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
|
||||
//
|
||||
// public ScanPackageConfiguration(){
|
||||
// LOGGER.info("【扫描关联包...】");
|
||||
// }
|
||||
//}
|
||||
|
@ -1,34 +1,37 @@
|
||||
//package cn.estsh.i3plus.core.apiservice.mq;
|
||||
//
|
||||
//import cn.estsh.i3plus.core.apiservice.serviceimpl.mdm.SysToolSyncDataService;
|
||||
//import cn.estsh.i3plus.pojo.mdm.bean.busi.core.MdmGearCoreBusiExtd;
|
||||
//import com.rabbitmq.client.Channel;
|
||||
//import org.springframework.amqp.core.Message;
|
||||
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import static cn.estsh.i3plus.platform.common.util.MdmConstWords.QUEUE_MDM_SYNC_DATA_CORE;
|
||||
//
|
||||
///**
|
||||
// * @Description :
|
||||
// * @Reference :
|
||||
// * @Author : yunhao
|
||||
// * @CreateDate : 2020-05-28 16:54
|
||||
// * @Modify:
|
||||
// **/
|
||||
//@Component
|
||||
//public class MdmDataSyncQueueReceiver extends BaseMdmDataSyncQueueReceiver {
|
||||
//
|
||||
// /**
|
||||
// * 初始化类关系
|
||||
// */
|
||||
// public MdmDataSyncQueueReceiver() {
|
||||
// putMdmDataRef(SysToolSyncDataService.class, MdmGearCoreBusiExtd.mdmMasterClass, MdmGearCoreBusiExtd.class);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @RabbitListener(queues = QUEUE_MDM_SYNC_DATA_CORE)
|
||||
// public void syncMasterData(String syncDataStr, Channel channel, Message message) {
|
||||
// processSyncMasterData(syncDataStr, channel, message);
|
||||
// }
|
||||
//}
|
||||
package cn.estsh.i3plus.core.apiservice.mq;
|
||||
|
||||
import cn.estsh.i3plus.core.apiservice.serviceimpl.mdm.SysToolSyncDataService;
|
||||
import cn.estsh.i3plus.pojo.mdm.bean.busi.core.MdmGearCoreBusiExtd;
|
||||
import cn.estsh.impp.framework.boot.mdm.mq.BaseMdmDataSyncQueueReceiver;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import static cn.estsh.i3plus.platform.common.util.MdmConstWords.QUEUE_MDM_SYNC_DATA_CORE;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2020-05-28 16:54
|
||||
* @Modify:
|
||||
**/
|
||||
@ConditionalOnExpression("'${impp.mq.queue.mdm.sync:true}' == 'true'")
|
||||
@Configuration
|
||||
public class MdmDataSyncQueueReceiver extends BaseMdmDataSyncQueueReceiver {
|
||||
|
||||
/**
|
||||
* 初始化类关系
|
||||
*/
|
||||
public MdmDataSyncQueueReceiver() {
|
||||
putMdmDataRef(SysToolSyncDataService.class, MdmGearCoreBusiExtd.mdmMasterClass, MdmGearCoreBusiExtd.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@RabbitListener(queues = QUEUE_MDM_SYNC_DATA_CORE)
|
||||
public void syncMasterData(String syncDataStr, Channel channel, Message message) {
|
||||
processSyncMasterData(syncDataStr, channel, message);
|
||||
}
|
||||
}
|
||||
|
@ -1,139 +0,0 @@
|
||||
package cn.estsh.i3plus.core.apiservice.serviceimpl.base;
|
||||
|
||||
import cn.estsh.i3plus.icloud.mdm.sdk.base.IBaseMdmBusiExtdCloud;
|
||||
import cn.estsh.i3plus.icloud.mdm.sdk.base.IBaseMdmBusiModelCloud;
|
||||
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mdm.bean.base.BaseMdmBusiModelBean;
|
||||
import cn.estsh.i3plus.pojo.mdm.bean.base.MdmSyncData;
|
||||
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : 业务同步setvice
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2020-05-15 17:58
|
||||
* @Modify:
|
||||
**/
|
||||
public abstract class BaseBusiSyncMdmDataService<T, M extends BaseMdmBusiModelBean> {
|
||||
|
||||
private IBaseMdmBusiExtdCloud baseMdmBusiExtdCloud;
|
||||
|
||||
private IBaseMdmBusiModelCloud<M> baseMdmBusiModelCloud;
|
||||
|
||||
public BaseBusiSyncMdmDataService(IBaseMdmBusiExtdCloud baseMdmBusiExtdCloud, IBaseMdmBusiModelCloud<M> baseMdmBusiModelCloud) {
|
||||
this.baseMdmBusiExtdCloud = baseMdmBusiExtdCloud;
|
||||
this.baseMdmBusiModelCloud = baseMdmBusiModelCloud;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主数据新增同步
|
||||
* @param syncData
|
||||
*/
|
||||
public void masterInsertSync(MdmSyncData syncData) {
|
||||
baseMdmBusiExtdCloud.whiteDoProcessMissBusiExtdByMaster(syncData.getSyncDataId().toArray(new Long[syncData.getSyncDataId().size()]), syncData.getSyncDateUserName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 主数据修改同步
|
||||
* @param syncData
|
||||
*/
|
||||
public void masterUpdateSync(MdmSyncData syncData) {
|
||||
BaseResultBean<M> baseResultBean =
|
||||
baseMdmBusiModelCloud.whiteFindByMasterIds(syncData.getSyncDataId().toArray(new Long[syncData.getSyncDataId().size()]));
|
||||
if (!baseResultBean.isSuccess()) {
|
||||
throw ImppExceptionBuilder.newInstance()
|
||||
.setSystemID(CommonEnumUtil.SOFT_TYPE.MDM.getCode())
|
||||
.setErrorCode(ImppExceptionEnum.CLOUD_CALL_EXCEPTION.getCode())
|
||||
.setErrorDetail(baseResultBean.getErrorMsg())
|
||||
.build();
|
||||
}
|
||||
|
||||
List<M> modelBeanList = baseResultBean.getResultList();
|
||||
updateBusiList(transform(modelBeanList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 主数据删除同步
|
||||
* @param syncData
|
||||
*/
|
||||
public void masterDeleteSync(MdmSyncData syncData) {
|
||||
baseMdmBusiExtdCloud.whiteDeleteWeaklyByMasterIds(syncData.getSyncDataId().toArray(new Long[syncData.getSyncDataId().size()]),syncData.getSyncDateUserName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务数据新增同步
|
||||
* @param syncData
|
||||
*/
|
||||
public void busiInsertSync(MdmSyncData syncData){
|
||||
BaseResultBean<M> baseResultBean =
|
||||
baseMdmBusiModelCloud.whiteFindByIds(syncData.getSyncDataId().toArray(new Long[syncData.getSyncDataId().size()]));
|
||||
if (!baseResultBean.isSuccess()) {
|
||||
throw ImppExceptionBuilder.newInstance()
|
||||
.setSystemID(CommonEnumUtil.SOFT_TYPE.MDM.getCode())
|
||||
.setErrorCode(ImppExceptionEnum.CLOUD_CALL_EXCEPTION.getCode())
|
||||
.setErrorDetail(baseResultBean.getErrorMsg())
|
||||
.build();
|
||||
}
|
||||
|
||||
List<M> modelBeanList = baseResultBean.getResultList();
|
||||
insertBusiList(transform(modelBeanList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务数据修改同步
|
||||
* @param syncData
|
||||
*/
|
||||
public void busiUpdateSync(MdmSyncData syncData){
|
||||
BaseResultBean<M> baseResultBean =
|
||||
baseMdmBusiModelCloud.findByIds(syncData.getSyncDataId().toArray(new Long[syncData.getSyncDataId().size()]));
|
||||
if (!baseResultBean.isSuccess()) {
|
||||
throw ImppExceptionBuilder.newInstance()
|
||||
.setSystemID(CommonEnumUtil.SOFT_TYPE.MDM.getCode())
|
||||
.setErrorCode(ImppExceptionEnum.CLOUD_CALL_EXCEPTION.getCode())
|
||||
.setErrorDetail(baseResultBean.getErrorMsg())
|
||||
.build();
|
||||
}
|
||||
|
||||
List<M> modelBeanList = baseResultBean.getResultList();
|
||||
updateBusiList(transform(modelBeanList));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务数据删除同步
|
||||
* @param syncData
|
||||
*/
|
||||
public void busiDeleteSync(MdmSyncData syncData){
|
||||
deleteBusiList(syncData.getSyncDataId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型转换
|
||||
* @param syncDataList
|
||||
* @return
|
||||
*/
|
||||
public abstract List<T> transform(List<M> syncDataList);
|
||||
|
||||
/**
|
||||
* 新增业务数据
|
||||
* @param beanList
|
||||
*/
|
||||
public abstract void insertBusiList(List<T> beanList);
|
||||
|
||||
/**
|
||||
* 修改业务数据
|
||||
* @param beanList
|
||||
*/
|
||||
public abstract void updateBusiList(List<T> beanList);
|
||||
|
||||
/**
|
||||
* 删除业务数据
|
||||
* @param idList
|
||||
*/
|
||||
public abstract void deleteBusiList(List<Long> idList);
|
||||
|
||||
}
|
Loading…
Reference in New Issue