From 6a428f0ee32c8aea1fe8d4a20bf45e94ed855e3e Mon Sep 17 00:00:00 2001
From: liuxm <liuxm@fescotech.com>
Date: 星期一, 29 四月 2024 16:57:54 +0800
Subject: [PATCH] 分类查询权限方法修改
---
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PriSv.java | 14 ++++++++++----
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PrivilegeCtrl.java | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PriSv.java b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PriSv.java
index 8339844..189cf85 100644
--- a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PriSv.java
+++ b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PriSv.java
@@ -8,8 +8,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@@ -37,10 +36,17 @@
return rsVo ;
}
- public Map<String, List<BaPrivilege>> selectByType(){
+ public List<Map<String, Object>> selectByType(){
List<BaPrivilege> priList = dao.selectAll();
Map<String, List<BaPrivilege>> map = priList.stream()
.collect(Collectors.groupingBy(BaPrivilege::getTypeName));
- return map;
+ List<Map<String,Object>> resultList=new ArrayList<>();
+ map.forEach((key, value) -> {
+ Map<String, Object> temp = new HashMap<>();
+ temp.put("name", key);
+ temp.put("list", value);
+ resultList.add(temp);
+ });
+ return resultList;
}
}
diff --git a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PrivilegeCtrl.java b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PrivilegeCtrl.java
index 307dec3..b0a9298 100644
--- a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PrivilegeCtrl.java
+++ b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PrivilegeCtrl.java
@@ -37,7 +37,7 @@
*/
@GetMapping(path="getByType")
@SsoPowerAop(power = "10100010")
- public BaseResponse<Map<String, List<BaPrivilege>>> getByType(){
+ public BaseResponse<List<Map<String, Object>>> getByType(){
try {
return BaseResponseUtils.buildSuccess(sv.selectByType());
}catch (Exception e){
--
Gitblit v1.8.0