From 9ac63f2d7dabf1908e48dd2c4bbf3a6087b5c556 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 18 Jul 2024 11:22:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=9D=83=E9=99=90-?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1203414690660352]后端-工单查看权限-服务目录 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1203414690660352 --- .../neatlogic/framework/dto/AuthorityVo.java | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/framework/dto/AuthorityVo.java b/src/main/java/neatlogic/framework/dto/AuthorityVo.java index 7a499dcf1..d7e6a7661 100644 --- a/src/main/java/neatlogic/framework/dto/AuthorityVo.java +++ b/src/main/java/neatlogic/framework/dto/AuthorityVo.java @@ -15,10 +15,15 @@ along with this program. If not, see .*/ package neatlogic.framework.dto; +import neatlogic.framework.common.constvalue.GroupSearch; + +import java.util.ArrayList; +import java.util.List; + public class AuthorityVo { private String type; private String uuid; - + private String action; public AuthorityVo() { } @@ -44,6 +49,14 @@ public class AuthorityVo { this.uuid = uuid; } + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -54,6 +67,11 @@ public class AuthorityVo { return false; } else if (!type.equals(that.type)) return false; + if (action == null) { + if (that.action != null) + return false; + } else if (!action.equals(that.action)) + return false; if (uuid == null) { return that.uuid == null; } else return uuid.equals(that.uuid); @@ -64,7 +82,34 @@ public class AuthorityVo { final int prime = 31; int result = 1; result = prime * result + ((type == null) ? 0 : type.hashCode()); + result = prime * result + ((action == null) ? 0 : action.hashCode()); result = prime * result + ((uuid == null) ? 0 : uuid.hashCode()); return result; } + + public static List getAuthorityList(List authorityVoList) { + List authorityList = new ArrayList<>(); + for(AuthorityVo authorityVo : authorityVoList) { + GroupSearch groupSearch = GroupSearch.getGroupSearch(authorityVo.getType()); + if(groupSearch != null) { + authorityList.add(groupSearch.getValuePlugin() + authorityVo.getUuid()); + } + } + return authorityList; + } + + public static List getAuthorityVoList(List authorityList, String action) { + List authorityVoList = new ArrayList<>(); + for(String authority : authorityList) { + String[] split = authority.split("#"); + if(GroupSearch.getGroupSearch(split[0]) != null) { + AuthorityVo authorityVo = new AuthorityVo(); + authorityVo.setType(split[0]); + authorityVo.setUuid(split[1]); + authorityVo.setAction(action); + authorityVoList.add(authorityVo); + } + } + return authorityVoList; + } } -- Gitee