From 296f034c06ca8542b39878f860ffa5b909914338 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 18 一月 2024 22:29:53 +0800
Subject: [PATCH] 数据授权查询接口更改

---
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java            |    2 
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java         |    2 
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java |    4 +-
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java                      |    4 +-
 Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue                                                      |   21 +++++-----
 Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java             |    2 
 Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java     |    2 
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue                                                      |    1 
 Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml                            |   14 +++++-
 Source/UBCS-WEB/src/components/Master/MasterTree.vue                                                             |    1 
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java     |   12 +++---
 11 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
index 2dc9840..4f8c904 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -106,6 +106,7 @@
       let conditionMaps = {};
       conditionMaps["conditionMap[id]"] = this.idData;
       conditionMaps["conditionMap[authType]"] = "data_auth";
+      conditionMaps["conditionMap[buttonCode]"] = this.idData;
       // 鏁版嵁鎺堟潈涓槸鍚﹀叿澶囨煡鐪嬫潈闄�
       conditionMaps["conditionMap[menuCode]"] = "data_view";
       getTreeList(conditionMaps).then(res => {
diff --git a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
index 7024c51..d161011 100644
--- a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -113,6 +113,11 @@
       currentRow: {}
     };
   },
+  computed: {},
+  mounted() {
+  },
+  created() {
+  },
   watch: {
     // 鐩戝惉鐖剁粍浠朵紶鐨勭獥鍙f樉绀洪殣钘忕殑鍊�
     visible() {
@@ -177,18 +182,13 @@
                 this.classifyAuthData.push(item);
                 this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1
                 this.roleHandlerMethods(authData.roleId, 'create', index)
-                console.log('index', index)
+                // console.log('index', index)
               })
             }
           });
         });
       }
     },
-  },
-  computed: {},
-  mounted() {
-  },
-  created() {
   },
   methods: {
     roleHandlerMethods(id, type, index) {
@@ -201,8 +201,8 @@
         const filteredItems = this.classifyAuthButton.filter(item => {
           return !res.data.data.find(x => x.id === item.id);
         });
-        console.log('绂佺敤鎸夐挳',filteredItems)
-        console.log('涓嶇鐢ㄦ寜閽�',res.data.data)
+        // console.log('绂佺敤鎸夐挳',filteredItems)
+        // console.log('涓嶇鐢ㄦ寜閽�',res.data.data)
         //鎷胯〃鏍煎垪澶村惊鐜拰娌℃湁瀵瑰簲鐨勫睘鎬ц繘琛屾瘮杈�
         this.classifyAuthHeader.forEach((item) => {
           const isMatched = filteredItems.some(x => x.id === item.prop);
@@ -243,7 +243,7 @@
             this.classifyAuthData[classIndex].allDisabled = false;
           }
         });
-        console.log('classifyAuthData',this.classifyAuthData)
+        // console.log('classifyAuthData',this.classifyAuthData)
         //寮哄埗鍒锋柊琛ㄦ牸
         this.itemKey = uuidv4();
       })
@@ -295,7 +295,7 @@
         this.$message.warning("褰撳墠绉熸埛涓嶅瓨鍦ㄨ鑹蹭俊鎭紒");
         return;
       }
-      console.log('this.roleList', this.roleList)
+      // console.log('this.roleList', this.roleList)
       this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣
       let item = {
         roleData: this.roleList[0].id,
@@ -307,7 +307,6 @@
       this.classifyAuthButton.forEach(data => {
         Vue.set(item, data.id, false);
       })
-      //console.log(item)
       this.classifyAuthData.push(item);
       this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex)
     },
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index b605db7..24b45f4 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -879,6 +879,7 @@
       return new Promise((resolve, reject) => {
         let conditionMaps = {};
         conditionMaps["conditionMap[authType]"] = "classify_auth";
+        conditionMaps["conditionMap[buttonCode]"] = "classifyTree";
         // 鍒嗙被鎺堟潈涓槸鍚﹀叿澶囨煡鐪嬫潈闄�
         conditionMaps["conditionMap[menuCode]"] = "classify_view";
         getAtrrList(conditionMaps)
diff --git a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
index 0ad731f..fd963c1 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
@@ -392,6 +392,6 @@
 	R<List<String>> getRegexByList(@RequestBody List<String> combinationIds);
 
 	@GetMapping(GETVIEWCLASSIFY)
-	R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("menuCode") String menuCode);
+	R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("buttonCode") String buttonCode,@RequestParam("menuCode") String menuCode);
 
 }
diff --git a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
index 1f27853..03ffadf 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
@@ -200,7 +200,7 @@
 	}
 
 	@Override
-	public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) {
+	public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
 		return R.fail("鑾峰彇鏁版嵁澶辫触");
 	}
 
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
index 04d1501..aced92e 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -119,11 +119,6 @@
 	private CodeBasicSecMapper codeBasicSecMapper;
 
 	/**
-	 * 鑷畾涔夊苟鍙慒orkJoinPool
-	 */
-	private static final ForkJoinPool customForkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()-1);
-
-	/**
 	 * 涓婄骇鑺傜偣鐨勫睘鎬у悕绉�
 	 */
 	public static  final String PARENT_FIELD_NAME = "parentCodeClassifyOid";
@@ -593,7 +588,12 @@
 		// 闈炶秴绠¤繃婊ゆ湭鎺堟潈鐨勫垎绫�
 		if(!VciBaseUtil.checkAdminTenant()){
 			// 閭d簺鍒嗙被鍏峰鏌ョ湅鏉冮檺
-			R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),treeQueryObject.getConditionMap().getOrDefault("menuCode","classify_view"));
+			R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(
+				Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),
+				treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),
+				treeQueryObject.getConditionMap().getOrDefault("buttonCode","classify_view"),
+				treeQueryObject.getConditionMap().getOrDefault("menuCode","classifyTree")
+			);
 			// 璇锋眰澶辫触鎴栬�呰姹傚緱鍒扮殑鍏峰鏌ョ湅鏉冮檺鐨勫垎绫籭d闆嗗悎涓虹┖
 			if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){
 				throw new ServiceException("涓绘暟鎹煡鐪嬫潈闄愭湭閰嶇疆锛屾垨閰嶇疆鏈夎锛�");
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
index 3167d45..3716e18 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
@@ -264,8 +264,8 @@
 		return R.data(mdmCountConfigService.getMdmCountConfig(userId));
 	}
 
-	public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode){
-		return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,menuCode));
+	public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode){
+		return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,buttonCode,menuCode));
 	}
 
 }
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java
index a4194fb..c30608c 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java
@@ -15,6 +15,6 @@
 
 	List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId);
 
-	List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("menuCode") String menuCode);
+	List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("buttonCode") String buttonCode,@Param("menuCode") String menuCode);
 
 }
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java
index c0613bb..71b0907 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java
@@ -53,6 +53,6 @@
 	 * @param roleIds
 	 * @return
 	 */
-	List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode);
+	List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode);
 
 }
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 0c78431..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
@@ -183,11 +183,11 @@
 	 * @return
 	 */
 	@Override
-	public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) {
+	public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
 		if(roleIds.isEmpty()){
 			return new ArrayList<>();
 		}
-		return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,menuCode);
+		return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,buttonCode,menuCode);
 	}
 
 }
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml
index b4c895c..77a8f4d 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml
@@ -26,9 +26,17 @@
             </foreach>
         </if>
           AND AUTH_TYPE = #{authType}
-          AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID
-                                      FROM PL_SYS_MENU
-                                      WHERE CODE = #{menuCode}), '%'))
+          AND BUTTON_IDS LIKE CONCAT('%', CONCAT((
+            SELECT
+                pm.ID
+            FROM
+                PL_SYS_MENU ps,
+                PL_SYS_MENU pm
+            WHERE
+                ps.CODE = #{buttonCode}
+                AND ps.ID = pm.PARENT_ID
+                AND pm.CODE = #{menuCode}
+        ), '%'))
     </select>
 
 

--
Gitblit v1.9.3