From 1e363c55cfef0a4e2a202d4c27d8c1da03075c83 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 23 一月 2024 14:25:51 +0800
Subject: [PATCH] 主题库定义-输入框清空事件
---
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java | 54 ++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java
index b9350dc..124a39c 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java
@@ -19,6 +19,8 @@
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -26,7 +28,7 @@
import java.util.stream.Collectors;
/**
- * 鍒嗙被鎺堟潈
+ * 鍒嗙被鎺堟潈,鏁版嵁鎺堟潈
* @author ludc
* @date 2023/12/25 15:35
*/
@@ -87,7 +89,8 @@
throw new ServiceException("缂哄皯蹇呬紶鍙傛暟鍒嗙被id");
}
LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query()
- .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId());
+ .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId())
+ .eq(ClassifyAuth::getAuthType,classifyAuthVO.getAuthType());
List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper);
if(classifyAuths.isEmpty()){
return new ArrayList<ClassifyAuthVO>();
@@ -98,11 +101,35 @@
/**
* 鏌ヨ璇ュ垎绫讳笅锛屽綋鍓嶇櫥褰曠殑瑙掕壊鏈夊摢浜涙寜閽潈闄�
* @param classifyId
+ * @param menuCode
+ * @param authType
* @return
*/
- public Map<String,Boolean> getAuthButtonList(String classifyId){
- if(Func.isBlank(classifyId)){
+ public Map<String,Boolean> getAuthButtonList(String classifyId,String menuCode,String authType){
+ List<Menu> menuList = this.getButtonList(classifyId, menuCode, authType);
+ if(menuList.isEmpty()){
return new HashMap<>();
+ }
+ Map<String, Boolean> buttonMaps = menuList.stream()
+ .collect(Collectors.toMap(Menu::getCode, menu -> true));
+ return buttonMaps;
+ }
+
+ /**
+ * 鏌ヨ璇ヤ富鏁版嵁涓嬶紝褰撳墠鐧诲綍鐨勮鑹叉湁鍝簺鎸夐挳鑿滃崟鏉冮檺
+ * @param classifyId
+ * @param menuCode
+ * @param authType
+ * @return
+ */
+ public List<Menu> getAuthMenuButtonList(String classifyId,String menuCode,String authType){
+ List<Menu> buttonList = getButtonList(classifyId, menuCode, authType);
+ return buttonList;
+ }
+
+ private List<Menu> getButtonList(String classifyId,String menuCode,String authType){
+ if(Func.isBlank(classifyId)){
+ throw new ServiceException("蹇呬紶鍙傛暟鍒嗙被oid涓嶈兘涓虹┖锛�");
}
//鏌ヨ鍒嗙被鑺傜偣鐨勬墍鏈夌埗绾ц妭鐐�
R<List<String>> listR = codeClassifyClient.selectAllParentOid(classifyId);
@@ -115,6 +142,7 @@
// 鍏堟煡璇㈡寜閽甶d鍒楄〃
LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query()
.lambda().eq(ClassifyAuth::getClassifyId, classifyId)
+ .eq(ClassifyAuth::getAuthType,authType)
.in(ClassifyAuth::getRoleId, roleIds);
List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper);
//濡傛灉褰撳墠鍒嗙被娌℃湁鎵惧埌鎺堟潈閰嶇疆锛屽氨渚濇浠庡綋鍓嶈妭鐐瑰線涓婂眰鑺傜偣鎵炬巿鏉冮厤缃紝鎵惧埌浜嗗氨鍋滄锛屾病鎵惧埌灏变竴鐩存壘鍒版渶鍚�
@@ -139,20 +167,14 @@
Boolean isAdmin = VciBaseUtil.checkAdminTenant();
// 鏈厤缃寜閽潈闄�
if(!isAdmin && (classifyAuths.isEmpty() || Func.isBlank(classifyAuths.get(0).getButtonIds()))){
- return new HashMap<>();
+ return new ArrayList<>();
}
- List<String> condition1 = new ArrayList<>();
+ List<String> ids = new ArrayList<>();
// 濡傛灉涓嶆槸瓒呯鐢ㄦ埛
if(!isAdmin){
- condition1.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(",")));
+ ids.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(",")));
}
- List<Menu> menuList = menuService.getMenuListById(condition1,"1648879284590858241");
- if(menuList.isEmpty()){
- return new HashMap<>();
- }
- Map<String, Boolean> buttonMaps = menuList.stream()
- .collect(Collectors.toMap(Menu::getCode, menu -> true));
- return buttonMaps;
+ return menuService.getMenuListByCode(ids,menuCode,roleIds);
}
/**
@@ -161,11 +183,11 @@
* @return
*/
@Override
- public List<String> getViewClassByRoleIds(List<String> roleIds) {
+ public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
if(roleIds.isEmpty()){
return new ArrayList<>();
}
- return this.classifyAuthMapper.getViewClassByRoleIds(roleIds);
+ return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,buttonCode,menuCode);
}
}
--
Gitblit v1.9.3