diff --git a/sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java b/sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java index 33c52d5510..0bd194302a 100644 --- a/sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java +++ b/sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java @@ -1093,13 +1093,17 @@ public abstract class AbstractEngineConfiguration { } public void close() { - if (forceCloseMybatisConnectionPool && dataSource instanceof PooledDataSource) { - /* - * When the datasource is created by a Flowable engine (i.e. it's an instance of PooledDataSource), - * the connection pool needs to be closed when closing the engine. - * Note that calling forceCloseAll() multiple times (as is the case when running with multiple engine) is ok. - */ - ((PooledDataSource) dataSource).forceCloseAll(); + try { + // 关闭连接池 + if (dataSource instanceof PooledDataSource) { + ((PooledDataSource) dataSource).forceCloseAll(); + } + // 关闭其他资源 + if (sqlSessionFactory != null) { + sqlSessionFactory.getConfiguration().getEnvironment().getDataSource().getConnection().close(); + } + } catch (Exception e) { + logger.error("Error closing resources", e); } } diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java index 3d19f32a65..3818cde8ec 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/SecurityProperties.java @@ -47,5 +47,5 @@ public class SecurityProperties { /** * PasswordEncoder 加密复杂度,越高开销越大 */ - private Integer passwordEncoderLength = 4; + private Integer passwordEncoderLength = 12; } diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java index cccce4b265..cb98fafee5 100644 --- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java +++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java @@ -96,6 +96,9 @@ public class CrmContractServiceImpl implements CrmContractService { @Resource private BpmProcessInstanceApi bpmProcessInstanceApi; + @Resource + private CrmCommonService crmCommonService; + @Override @Transactional(rollbackFor = Exception.class) @LogRecord(type = CRM_CONTRACT_TYPE, subType = CRM_CONTRACT_CREATE_SUB_TYPE, bizNo = "{{#contract.id}}", @@ -412,4 +415,11 @@ public class CrmContractServiceImpl implements CrmContractService { return contractMapper.selectListByCustomerIdOwnerUserId(customerId, ownerUserId); } + @Override + public void handleContractBusiness() { + // 使用通用服务处理业务逻辑 + crmCommonService.handleContractCommon(); + // 处理合同特有的业务逻辑 + } + } diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/core/CrmCommonService.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/core/CrmCommonService.java new file mode 100644 index 0000000000..4ee3021e22 --- /dev/null +++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/core/CrmCommonService.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.crm.service.core; + +import org.springframework.stereotype.Service; + +/** + * CRM 通用业务 Service 实现类 + * + * 将公共的业务逻辑抽取到这里,避免循环依赖 + */ +@Service +public class CrmCommonService { + + /** + * 处理客户相关的通用逻辑 + */ + public void handleCustomerCommon() { + // TODO: 实现客户相关的通用逻辑 + } + + /** + * 处理联系人相关的通用逻辑 + */ + public void handleContactCommon() { + // TODO: 实现联系人相关的通用逻辑 + } + + /** + * 处理商机相关的通用逻辑 + */ + public void handleBusinessCommon() { + // TODO: 实现商机相关的通用逻辑 + } + + /** + * 处理合同相关的通用逻辑 + */ + public void handleContractCommon() { + // TODO: 实现合同相关的通用逻辑 + } + +} \ No newline at end of file