Commit dd7da5e941513051325022f8c7d791cf35fec5f5
1 parent
4f29d01a
refactor(context): 重构租户管道加载逻辑
- 移除原有 ApplicationReadyEvent 监听器注解 - 新增独立的事件监听方法 loadTenantPipelineEvent - 通过事件方法调用原有的加载逻辑 - 确保应用启动时正确加载租户管道配置
Showing
1 changed file
with
5 additions
and
1 deletions
tax-central/src/main/java/com/diligrp/tax/central/context/TenantStorageContext.java
| @@ -43,7 +43,6 @@ public class TenantStorageContext { | @@ -43,7 +43,6 @@ public class TenantStorageContext { | ||
| 43 | return Optional.ofNullable(pipelineMap.get(pipelineCode)).or(() -> tenantTaxService.findByTenantIdAndPipelineCode(tenantId, pipelineCode)); | 43 | return Optional.ofNullable(pipelineMap.get(pipelineCode)).or(() -> tenantTaxService.findByTenantIdAndPipelineCode(tenantId, pipelineCode)); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | - @EventListener(ApplicationReadyEvent.class) | ||
| 47 | public void loadTenantPipeline() { | 46 | public void loadTenantPipeline() { |
| 48 | List<TenantPipeline> taxPipelineVOS = tenantTaxService.listAllEnablePipeline(); | 47 | List<TenantPipeline> taxPipelineVOS = tenantTaxService.listAllEnablePipeline(); |
| 49 | Optional.ofNullable(taxPipelineVOS).ifPresent(pipelines -> { | 48 | Optional.ofNullable(taxPipelineVOS).ifPresent(pipelines -> { |
| @@ -52,4 +51,9 @@ public class TenantStorageContext { | @@ -52,4 +51,9 @@ public class TenantStorageContext { | ||
| 52 | TENANT_PIPELINE_MAP.putAll(tenantPipelineMap); | 51 | TENANT_PIPELINE_MAP.putAll(tenantPipelineMap); |
| 53 | }); | 52 | }); |
| 54 | } | 53 | } |
| 54 | + | ||
| 55 | + @EventListener(ApplicationReadyEvent.class) | ||
| 56 | + public void loadTenantPipelineEvent() { | ||
| 57 | + this.loadTenantPipeline(); | ||
| 58 | + } | ||
| 55 | } | 59 | } |