From 97c7b7c70318a37471996ea8037063aa09c7d11b Mon Sep 17 00:00:00 2001 From: shao1121353141 <> Date: Thu, 28 Sep 2023 23:36:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=96=B9=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/impl/AppGroupRepositoryCustomizedImpl.java | 6 +++--- .../repository/app/impl/AppRepositoryCustomizedImpl.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppGroupRepositoryCustomizedImpl.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppGroupRepositoryCustomizedImpl.java index 93f20020..18712d8a 100644 --- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppGroupRepositoryCustomizedImpl.java +++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppGroupRepositoryCustomizedImpl.java @@ -117,7 +117,7 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto public List getAppGroupList(Long userId, AppGroupQuery query) { //@formatter:on Map paramMap = new HashMap<>(16); - paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId)); + paramMap.put("subjectIds", getSubjectIds(userId)); //@formatter:off StringBuilder builder = new StringBuilder("SELECT `group`.id_, `group`.name_, `group`.code_, `group`.type_, `group`.create_time, `group`.remark_, IFNULL( ass.app_count, 0) AS app_count FROM app_group `group` LEFT JOIN(SELECT aga.group_id, COUNT(DISTINCT aga.id_) AS `app_count` FROM app_group_association aga LEFT JOIN app ON aga.app_id = app.id_ AND app.is_deleted = 0 LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id and app_acce.is_deleted = 0 WHERE aga.is_deleted = 0 and (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+ "') GROUP BY aga.group_id ) ass ON `group`.id_ = ass.group_id WHERE is_deleted = '0'"); //分组名称 @@ -148,7 +148,7 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto public Long getAppCount(String groupId, Long userId) { //@formatter:on Map paramMap = new HashMap<>(16); - paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId)); + paramMap.put("subjectIds", getSubjectIds(userId)); //@formatter:off StringBuilder builder = new StringBuilder("SELECT COUNT(DISTINCT app.id_) FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' LEFT JOIN app_group_association ass ON app.id_ = ass.app_id AND ass.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+"')"); builder.append(" AND ass.group_id = ").append(groupId); @@ -164,7 +164,7 @@ public class AppGroupRepositoryCustomizedImpl implements AppGroupRepositoryCusto * @param userId {@link Long} * @return {@link List} */ - private List getAccessPolicysubjectIdsByUserId(Long userId){ + private List getSubjectIds(Long userId){ //@formatter:on List list = Lists.newArrayList(); //当前用户加入的用户组Id diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppRepositoryCustomizedImpl.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppRepositoryCustomizedImpl.java index 86f222c4..da5fa783 100644 --- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppRepositoryCustomizedImpl.java +++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppRepositoryCustomizedImpl.java @@ -66,7 +66,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized { @Override public Page getAppList(Long userId, GetAppListQuery query, Pageable pageable) { Map paramMap = new HashMap<>(16); - paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId)); + paramMap.put("subjectIds", getSubjectIds(userId)); //@formatter:off StringBuilder builder = new StringBuilder("SELECT DISTINCT app.* FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' LEFT JOIN app_group_association ass ON app.id_ = ass.app_id AND ass.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '"+ALL_ACCESS.getCode()+"')"); //用户名 @@ -139,7 +139,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized { public Long getAppCount(Long userId) { //@formatter:on Map paramMap = new HashMap<>(16); - paramMap.put("subjectIds", getAccessPolicysubjectIdsByUserId(userId)); + paramMap.put("subjectIds", getSubjectIds(userId)); StringBuilder builder = new StringBuilder( "SELECT COUNT(DISTINCT app.id_) FROM app LEFT JOIN app_access_policy app_acce ON app.id_ = app_acce.app_id AND app_acce.is_deleted = '0' WHERE app.is_enabled = 1 AND app.is_deleted = '0' AND (app_acce.subject_id IN (:subjectIds) OR app.authorization_type = '" + ALL_ACCESS.getCode() + "')"); @@ -154,7 +154,7 @@ public class AppRepositoryCustomizedImpl implements AppRepositoryCustomized { * @param userId {@link Long} * @return {@link List} */ - private List getAccessPolicysubjectIdsByUserId(Long userId){ + private List getSubjectIds(Long userId){ //@formatter:on List list = Lists.newArrayList(); //当前用户加入的用户组Id