From 83dd98faf3cb54f1b84df80384da3a46c2080bec Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 02 九月 2024 14:12:02 +0800 Subject: [PATCH] fix 修复 开启子部门 父部门未关联开启问题 --- ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java index 60be68a..10c6777 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysTenantController.java @@ -24,6 +24,7 @@ import org.dromara.system.domain.bo.SysTenantBo; import org.dromara.system.domain.vo.SysTenantVo; import org.dromara.system.service.ISysTenantService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -38,6 +39,7 @@ @RequiredArgsConstructor @RestController @RequestMapping("/system/tenant") +@ConditionalOnProperty(value = "tenant.enable", havingValue = "true") public class SysTenantController extends BaseController { private final ISysTenantService tenantService; @@ -174,4 +176,18 @@ return toAjax(TenantHelper.ignore(() -> tenantService.syncTenantPackage(tenantId, packageId))); } + /** + * 鍚屾绉熸埛瀛楀吀 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @Log(title = "鍚屾绉熸埛瀛楀吀", businessType = BusinessType.INSERT) + @GetMapping("/syncTenantDict") + public R<Void> syncTenantDict() { + if (!TenantHelper.isEnable()) { + return R.fail("褰撳墠鏈紑鍚鎴锋ā寮�"); + } + tenantService.syncTenantDict(); + return R.ok("鍚屾绉熸埛瀛楀吀鎴愬姛"); + } + } -- Gitblit v1.9.3