新增department,role,position,group的简单格式类,调整了原先使用PO的代码,减少了不必要的属性
This commit is contained in:
parent
f0b5c64ba7
commit
bb1a5d7633
@ -3,6 +3,7 @@ package ink.wgink.interfaces.department;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
@ -90,19 +91,19 @@ public interface IDepartmentBaseService {
|
||||
/**
|
||||
* 获取基础部门ID列表
|
||||
*
|
||||
* @param departmentPOS
|
||||
* @param departmentSimpleDTOs
|
||||
* @return
|
||||
*/
|
||||
List<String> listRootId(List<DepartmentPO> departmentPOS);
|
||||
List<String> listRootId(List<DepartmentSimpleDTO> departmentSimpleDTOs);
|
||||
|
||||
/**
|
||||
* 获取上级部门
|
||||
*
|
||||
* @param departmentPO1
|
||||
* @param departmentPO2
|
||||
* @param departmentSimpleDTO1
|
||||
* @param departmentSimpleDTO2
|
||||
* @return
|
||||
*/
|
||||
DepartmentPO getHigherLevel(DepartmentPO departmentPO1, DepartmentPO departmentPO2);
|
||||
DepartmentSimpleDTO getHigherLevel(DepartmentSimpleDTO departmentSimpleDTO1, DepartmentSimpleDTO departmentSimpleDTO2);
|
||||
|
||||
/**
|
||||
* 获得同一级部门数量(按部门名称)
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ink.wgink.interfaces.group;
|
||||
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.group.GroupSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.group.GroupUserDTO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -51,4 +52,12 @@ public interface IGroupUserBaseService {
|
||||
* @return
|
||||
*/
|
||||
List<GroupPO> listGroupPOByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 组列表(简单)
|
||||
*
|
||||
* @param groupPOs
|
||||
* @return
|
||||
*/
|
||||
List<GroupSimpleDTO> listSimple(List<GroupPO> groupPOs);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ink.wgink.interfaces.position;
|
||||
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.position.PositionSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionUserDTO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -59,4 +60,12 @@ public interface IPositionUserBaseService {
|
||||
* @return
|
||||
*/
|
||||
List<PositionPO> listPositionPOByUserIds(List<String> userIds);
|
||||
|
||||
/**
|
||||
* 职位列表(简单)
|
||||
*
|
||||
* @param positionPOs
|
||||
* @return
|
||||
*/
|
||||
List<PositionSimpleDTO> listSimple(List<PositionPO> positionPOs);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ink.wgink.interfaces.role;
|
||||
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleUserDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -46,8 +47,17 @@ public interface IRoleUserBaseService {
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<RolePO> listRolePOByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 角色列表(简单)
|
||||
*
|
||||
* @param rolePOs
|
||||
* @return
|
||||
*/
|
||||
List<RoleSimpleDTO> listSimple(List<RolePO> rolePOs);
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
package ink.wgink.pojo.bos;
|
||||
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.group.GroupSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -31,14 +30,10 @@ public class LoginUser extends User {
|
||||
private String dataRight;
|
||||
private List<String> baseDepartmentIds;
|
||||
private List<String> dataRightUserIds;
|
||||
private List<RolePO> roles;
|
||||
private List<GroupPO> groups;
|
||||
private List<DepartmentPO> departments;
|
||||
private List<PositionPO> positions;
|
||||
private String roleIdAndNamesValue;
|
||||
private String groupIdAndNamesValue;
|
||||
private String departmentIdAndNamesValue;
|
||||
private String positionIdAndNamesValue;
|
||||
private List<RoleSimpleDTO> roles;
|
||||
private List<GroupSimpleDTO> groups;
|
||||
private List<DepartmentSimpleDTO> departments;
|
||||
private List<PositionSimpleDTO> positions;
|
||||
/**
|
||||
* 拓展数据,用于自定义登录用户所拥有的权限加载
|
||||
*/
|
||||
@ -136,108 +131,37 @@ public class LoginUser extends User {
|
||||
this.dataRightUserIds = dataRightUserIds;
|
||||
}
|
||||
|
||||
public List<RolePO> getRoles() {
|
||||
return roles == null ? new ArrayList<>(0) : roles;
|
||||
|
||||
public List<RoleSimpleDTO> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<RolePO> roles) {
|
||||
public void setRoles(List<RoleSimpleDTO> roles) {
|
||||
this.roles = roles;
|
||||
if (roles == null || roles.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
roles.forEach(roleBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(roleBO.getRoleId());
|
||||
nameSB.append(roleBO.getRoleName());
|
||||
});
|
||||
this.roleIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public List<GroupPO> getGroups() {
|
||||
return groups == null ? new ArrayList<>(0) : groups;
|
||||
public List<GroupSimpleDTO> getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public void setGroups(List<GroupPO> groups) {
|
||||
public void setGroups(List<GroupSimpleDTO> groups) {
|
||||
this.groups = groups;
|
||||
if (groups == null || groups.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
groups.forEach(groupBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(groupBO.getGroupId());
|
||||
nameSB.append(groupBO.getGroupName());
|
||||
});
|
||||
this.groupIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public List<DepartmentPO> getDepartments() {
|
||||
return departments == null ? new ArrayList<>(0) : departments;
|
||||
public List<DepartmentSimpleDTO> getDepartments() {
|
||||
return departments;
|
||||
}
|
||||
|
||||
public void setDepartments(List<DepartmentPO> departments) {
|
||||
public void setDepartments(List<DepartmentSimpleDTO> departments) {
|
||||
this.departments = departments;
|
||||
if (departments == null || departments.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
departments.forEach(departmentBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(departmentBO.getDepartmentId());
|
||||
nameSB.append(departmentBO.getDepartmentName());
|
||||
});
|
||||
this.departmentIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public List<PositionPO> getPositions() {
|
||||
return positions == null ? new ArrayList<>(0) : positions;
|
||||
public List<PositionSimpleDTO> getPositions() {
|
||||
return positions;
|
||||
}
|
||||
|
||||
public void setPositions(List<PositionPO> positions) {
|
||||
public void setPositions(List<PositionSimpleDTO> positions) {
|
||||
this.positions = positions;
|
||||
if (positions == null || positions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
positions.forEach(positionBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(positionBO.getPositionId());
|
||||
nameSB.append(positionBO.getPositionName());
|
||||
});
|
||||
this.positionIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public String getRoleIdAndNamesValue() {
|
||||
return roleIdAndNamesValue == null ? "" : roleIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public String getGroupIdAndNamesValue() {
|
||||
return groupIdAndNamesValue == null ? "" : groupIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public String getDepartmentIdAndNamesValue() {
|
||||
return departmentIdAndNamesValue == null ? "" : departmentIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public String getPositionIdAndNamesValue() {
|
||||
return positionIdAndNamesValue == null ? "" : positionIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public Object getExpandData() {
|
||||
@ -247,49 +171,4 @@ public class LoginUser extends User {
|
||||
public void setExpandData(Object expandData) {
|
||||
this.expandData = expandData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"userId\":\"")
|
||||
.append(userId).append('\"');
|
||||
sb.append(",\"userName\":\"")
|
||||
.append(userName).append('\"');
|
||||
sb.append(",\"userPhone\":\"")
|
||||
.append(userPhone).append('\"');
|
||||
sb.append(",\"userAvatar\":\"")
|
||||
.append(userAvatar).append('\"');
|
||||
sb.append(",\"userEmail\":\"")
|
||||
.append(userEmail).append('\"');
|
||||
sb.append(",\"userUKey\":\"")
|
||||
.append(userUKey).append('\"');
|
||||
sb.append(",\"loginType\":")
|
||||
.append(loginType);
|
||||
sb.append(",\"dataRight\":\"")
|
||||
.append(dataRight).append('\"');
|
||||
sb.append(",\"baseDepartmentIds\":")
|
||||
.append(baseDepartmentIds);
|
||||
sb.append(",\"dataRightUserIds\":")
|
||||
.append(dataRightUserIds);
|
||||
sb.append(",\"roles\":")
|
||||
.append(roles);
|
||||
sb.append(",\"groups\":")
|
||||
.append(groups);
|
||||
sb.append(",\"departments\":")
|
||||
.append(departments);
|
||||
sb.append(",\"positions\":")
|
||||
.append(positions);
|
||||
sb.append(",\"roleIdAndNamesValue\":\"")
|
||||
.append(roleIdAndNamesValue).append('\"');
|
||||
sb.append(",\"groupIdAndNamesValue\":\"")
|
||||
.append(groupIdAndNamesValue).append('\"');
|
||||
sb.append(",\"departmentIdAndNamesValue\":\"")
|
||||
.append(departmentIdAndNamesValue).append('\"');
|
||||
sb.append(",\"positionIdAndNamesValue\":\"")
|
||||
.append(positionIdAndNamesValue).append('\"');
|
||||
sb.append(",\"expandData\":")
|
||||
.append(expandData);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
package ink.wgink.pojo.bos;
|
||||
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.group.GroupSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -26,14 +26,10 @@ public class UserInfoBO {
|
||||
private String dataRight;
|
||||
private List<String> dataUserIds;
|
||||
private List<String> rootDepartmentIds;
|
||||
private List<DepartmentPO> departments;
|
||||
private List<RolePO> roles;
|
||||
private List<GroupPO> groups;
|
||||
private List<PositionPO> positions;
|
||||
private String roleIdAndNamesValue;
|
||||
private String groupIdAndNamesValue;
|
||||
private String departmentIdAndNamesValue;
|
||||
private String positionIdAndNamesValue;
|
||||
private List<DepartmentSimpleDTO> departments;
|
||||
private List<RoleSimpleDTO> roles;
|
||||
private List<GroupSimpleDTO> groups;
|
||||
private List<PositionSimpleDTO> positions;
|
||||
private Object expandData;
|
||||
|
||||
public String getUserId() {
|
||||
@ -108,108 +104,36 @@ public class UserInfoBO {
|
||||
this.rootDepartmentIds = rootDepartmentIds;
|
||||
}
|
||||
|
||||
public List<DepartmentPO> getDepartments() {
|
||||
public List<DepartmentSimpleDTO> getDepartments() {
|
||||
return departments == null ? new ArrayList<>(0) : departments;
|
||||
}
|
||||
|
||||
public void setDepartments(List<DepartmentPO> departments) {
|
||||
public void setDepartments(List<DepartmentSimpleDTO> departments) {
|
||||
this.departments = departments;
|
||||
if (departments == null || departments.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
departments.forEach(departmentBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(departmentBO.getDepartmentId());
|
||||
nameSB.append(departmentBO.getDepartmentName());
|
||||
});
|
||||
this.departmentIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public List<RolePO> getRoles() {
|
||||
return roles == null ? new ArrayList<>(0) : roles;
|
||||
public List<RoleSimpleDTO> getRoles() {
|
||||
return roles == null ? new ArrayList<>() : roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<RolePO> roles) {
|
||||
public void setRoles(List<RoleSimpleDTO> roles) {
|
||||
this.roles = roles;
|
||||
if (roles == null || roles.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
roles.forEach(roleBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(roleBO.getRoleId());
|
||||
nameSB.append(roleBO.getRoleName());
|
||||
});
|
||||
this.roleIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public List<GroupPO> getGroups() {
|
||||
return groups == null ? new ArrayList<>(0) : groups;
|
||||
public List<GroupSimpleDTO> getGroups() {
|
||||
return groups == null ? new ArrayList<>() : groups;
|
||||
}
|
||||
|
||||
public void setGroups(List<GroupPO> groups) {
|
||||
public void setGroups(List<GroupSimpleDTO> groups) {
|
||||
this.groups = groups;
|
||||
if (groups == null || groups.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
groups.forEach(groupBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(groupBO.getGroupId());
|
||||
nameSB.append(groupBO.getGroupName());
|
||||
});
|
||||
this.groupIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public List<PositionPO> getPositions() {
|
||||
return positions == null ? new ArrayList<>(0) : positions;
|
||||
public List<PositionSimpleDTO> getPositions() {
|
||||
return positions == null ? new ArrayList<>() : positions;
|
||||
}
|
||||
|
||||
public void setPositions(List<PositionPO> positions) {
|
||||
public void setPositions(List<PositionSimpleDTO> positions) {
|
||||
this.positions = positions;
|
||||
if (positions == null || positions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder idSB = new StringBuilder();
|
||||
StringBuilder nameSB = new StringBuilder();
|
||||
positions.forEach(positionBO -> {
|
||||
if (idSB.length() > 0) {
|
||||
idSB.append(",");
|
||||
nameSB.append(",");
|
||||
}
|
||||
idSB.append(positionBO.getPositionId());
|
||||
nameSB.append(positionBO.getPositionName());
|
||||
});
|
||||
this.positionIdAndNamesValue = idSB.append("|").append(nameSB).toString();
|
||||
}
|
||||
|
||||
public String getRoleIdAndNamesValue() {
|
||||
return roleIdAndNamesValue == null ? "" : roleIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public String getGroupIdAndNamesValue() {
|
||||
return groupIdAndNamesValue == null ? "" : groupIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public String getDepartmentIdAndNamesValue() {
|
||||
return departmentIdAndNamesValue == null ? "" : departmentIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public String getPositionIdAndNamesValue() {
|
||||
return positionIdAndNamesValue == null ? "" : positionIdAndNamesValue.trim();
|
||||
}
|
||||
|
||||
public Object getExpandData() {
|
||||
@ -219,47 +143,4 @@ public class UserInfoBO {
|
||||
public void setExpandData(Object expandData) {
|
||||
this.expandData = expandData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"userId\":\"")
|
||||
.append(userId).append('\"');
|
||||
sb.append(",\"userUsername\":\"")
|
||||
.append(userUsername).append('\"');
|
||||
sb.append(",\"userName\":\"")
|
||||
.append(userName).append('\"');
|
||||
sb.append(",\"userPhone\":\"")
|
||||
.append(userPhone).append('\"');
|
||||
sb.append(",\"userAvatar\":\"")
|
||||
.append(userAvatar).append('\"');
|
||||
sb.append(",\"userEmail\":\"")
|
||||
.append(userEmail).append('\"');
|
||||
sb.append(",\"dataRight\":\"")
|
||||
.append(dataRight).append('\"');
|
||||
sb.append(",\"dataUserIds\":")
|
||||
.append(dataUserIds);
|
||||
sb.append(",\"rootDepartmentIds\":")
|
||||
.append(rootDepartmentIds);
|
||||
sb.append(",\"departments\":")
|
||||
.append(departments);
|
||||
sb.append(",\"roles\":")
|
||||
.append(roles);
|
||||
sb.append(",\"groups\":")
|
||||
.append(groups);
|
||||
sb.append(",\"positions\":")
|
||||
.append(positions);
|
||||
sb.append(",\"roleIdAndNamesValue\":\"")
|
||||
.append(roleIdAndNamesValue).append('\"');
|
||||
sb.append(",\"groupIdAndNamesValue\":\"")
|
||||
.append(groupIdAndNamesValue).append('\"');
|
||||
sb.append(",\"departmentIdAndNamesValue\":\"")
|
||||
.append(departmentIdAndNamesValue).append('\"');
|
||||
sb.append(",\"positionIdAndNamesValue\":\"")
|
||||
.append(positionIdAndNamesValue).append('\"');
|
||||
sb.append(",\"expandData\":")
|
||||
.append(expandData);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package ink.wgink.pojo.dtos.department;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: DepartmentSimpleDTO
|
||||
* @Description: 部门(简单)
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/9/15 10:55 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class DepartmentSimpleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1768705756600267000L;
|
||||
private String departmentId;
|
||||
private String departmentParentId;
|
||||
private String departmentName;
|
||||
private String departmentCode;
|
||||
|
||||
public String getDepartmentId() {
|
||||
return departmentId == null ? "" : departmentId.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentId(String departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public String getDepartmentParentId() {
|
||||
return departmentParentId == null ? "" : departmentParentId.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentParentId(String departmentParentId) {
|
||||
this.departmentParentId = departmentParentId;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName == null ? "" : departmentName.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentName(String departmentName) {
|
||||
this.departmentName = departmentName;
|
||||
}
|
||||
|
||||
public String getDepartmentCode() {
|
||||
return departmentCode == null ? "" : departmentCode.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentCode(String departmentCode) {
|
||||
this.departmentCode = departmentCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package ink.wgink.pojo.dtos.group;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: GroupSimpleDTO
|
||||
* @Description: 组(简单)
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/9/15 10:57 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class GroupSimpleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4261993079252150377L;
|
||||
private String groupId;
|
||||
private String groupParentId;
|
||||
private String groupName;
|
||||
private String groupCode;
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId == null ? "" : groupId.trim();
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getGroupParentId() {
|
||||
return groupParentId == null ? "" : groupParentId.trim();
|
||||
}
|
||||
|
||||
public void setGroupParentId(String groupParentId) {
|
||||
this.groupParentId = groupParentId;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName == null ? "" : groupName.trim();
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getGroupCode() {
|
||||
return groupCode == null ? "" : groupCode.trim();
|
||||
}
|
||||
|
||||
public void setGroupCode(String groupCode) {
|
||||
this.groupCode = groupCode;
|
||||
}
|
||||
}
|
@ -1,241 +0,0 @@
|
||||
package ink.wgink.pojo.dtos.oauth.client;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @ClassName: OauthClientDTO
|
||||
* @Description: 授权认证客户端
|
||||
* @Author: wenc
|
||||
* @Date: 2019/1/8 7:43 PM
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class OauthClientDTO extends OauthClientSimpleDTO {
|
||||
|
||||
@ApiModelProperty(name = "resourceIds", value = "资源ID列表")
|
||||
private String resourceIds;
|
||||
@ApiModelProperty(name = "clientSecret", value = "客户端密码")
|
||||
private String clientSecret;
|
||||
@ApiModelProperty(name = "scope", value = "范围")
|
||||
private String scope;
|
||||
@ApiModelProperty(name = "authorizedGrantTypes", value = "授权类型")
|
||||
private String authorizedGrantTypes;
|
||||
@ApiModelProperty(name = "authorities", value = "权限")
|
||||
private String authorities;
|
||||
@ApiModelProperty(name = "accessTokenValidity", value = "访问令牌时效")
|
||||
private Integer accessTokenValidity;
|
||||
@ApiModelProperty(name = "refreshTokenValidity", value = "刷新令牌时效")
|
||||
private Integer refreshTokenValidity;
|
||||
@ApiModelProperty(name = "additionalInformation", value = "附加信息")
|
||||
private String additionalInformation;
|
||||
@ApiModelProperty(name = "autoapprove", value = "自动授权")
|
||||
private String autoapprove;
|
||||
@ApiModelProperty(name = "menuId", value = "菜单ID")
|
||||
private String menuId;
|
||||
@ApiModelProperty(name = "menuName", value = "菜单名称")
|
||||
private String menuName;
|
||||
@ApiModelProperty(name = "environment", value = "系统环境")
|
||||
private String environment;
|
||||
@ApiModelProperty(name = "systemType", value = "系统类型")
|
||||
private String systemType;
|
||||
@ApiModelProperty(name = "systemState", value = "系统状态")
|
||||
private String systemState;
|
||||
@ApiModelProperty(name = "expireTime", value = "系统到期时间")
|
||||
private String expireTime;
|
||||
@ApiModelProperty(name = "systemSummary", value = "系统介绍")
|
||||
private String systemSummary;
|
||||
@ApiModelProperty(name = "systemIcon", value = "系统图标")
|
||||
private String systemIcon;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
|
||||
private String gmtCreate;
|
||||
|
||||
public String getResourceIds() {
|
||||
return resourceIds == null ? "" : resourceIds.trim();
|
||||
}
|
||||
|
||||
public void setResourceIds(String resourceIds) {
|
||||
this.resourceIds = resourceIds;
|
||||
}
|
||||
|
||||
public String getClientSecret() {
|
||||
return clientSecret == null ? "" : clientSecret.trim();
|
||||
}
|
||||
|
||||
public void setClientSecret(String clientSecret) {
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope == null ? "" : scope.trim();
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getAuthorizedGrantTypes() {
|
||||
return authorizedGrantTypes == null ? "" : authorizedGrantTypes.trim();
|
||||
}
|
||||
|
||||
public void setAuthorizedGrantTypes(String authorizedGrantTypes) {
|
||||
this.authorizedGrantTypes = authorizedGrantTypes;
|
||||
}
|
||||
|
||||
public String getAuthorities() {
|
||||
return authorities == null ? "" : authorities.trim();
|
||||
}
|
||||
|
||||
public void setAuthorities(String authorities) {
|
||||
this.authorities = authorities;
|
||||
}
|
||||
|
||||
public Integer getAccessTokenValidity() {
|
||||
return accessTokenValidity;
|
||||
}
|
||||
|
||||
public void setAccessTokenValidity(Integer accessTokenValidity) {
|
||||
this.accessTokenValidity = accessTokenValidity;
|
||||
}
|
||||
|
||||
public Integer getRefreshTokenValidity() {
|
||||
return refreshTokenValidity;
|
||||
}
|
||||
|
||||
public void setRefreshTokenValidity(Integer refreshTokenValidity) {
|
||||
this.refreshTokenValidity = refreshTokenValidity;
|
||||
}
|
||||
|
||||
public String getAdditionalInformation() {
|
||||
return additionalInformation == null ? "" : additionalInformation.trim();
|
||||
}
|
||||
|
||||
public void setAdditionalInformation(String additionalInformation) {
|
||||
this.additionalInformation = additionalInformation;
|
||||
}
|
||||
|
||||
public String getAutoapprove() {
|
||||
return autoapprove == null ? "" : autoapprove.trim();
|
||||
}
|
||||
|
||||
public void setAutoapprove(String autoapprove) {
|
||||
this.autoapprove = autoapprove;
|
||||
}
|
||||
|
||||
public String getMenuId() {
|
||||
return menuId == null ? "" : menuId.trim();
|
||||
}
|
||||
|
||||
public void setMenuId(String menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
public String getMenuName() {
|
||||
return menuName == null ? "" : menuName.trim();
|
||||
}
|
||||
|
||||
public void setMenuName(String menuName) {
|
||||
this.menuName = menuName;
|
||||
}
|
||||
|
||||
public String getEnvironment() {
|
||||
return environment == null ? "" : environment.trim();
|
||||
}
|
||||
|
||||
public void setEnvironment(String environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
public String getSystemType() {
|
||||
return systemType == null ? "" : systemType.trim();
|
||||
}
|
||||
|
||||
public void setSystemType(String systemType) {
|
||||
this.systemType = systemType;
|
||||
}
|
||||
|
||||
public String getSystemState() {
|
||||
return systemState == null ? "" : systemState.trim();
|
||||
}
|
||||
|
||||
public void setSystemState(String systemState) {
|
||||
this.systemState = systemState;
|
||||
}
|
||||
|
||||
public String getExpireTime() {
|
||||
return expireTime == null ? "" : expireTime.trim();
|
||||
}
|
||||
|
||||
public void setExpireTime(String expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public String getSystemSummary() {
|
||||
return systemSummary == null ? "" : systemSummary.trim();
|
||||
}
|
||||
|
||||
public void setSystemSummary(String systemSummary) {
|
||||
this.systemSummary = systemSummary;
|
||||
}
|
||||
|
||||
public String getSystemIcon() {
|
||||
return systemIcon == null ? "" : systemIcon.trim();
|
||||
}
|
||||
|
||||
public void setSystemIcon(String systemIcon) {
|
||||
this.systemIcon = systemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"resourceIds\":")
|
||||
.append("\"").append(resourceIds).append("\"");
|
||||
sb.append(",\"clientSecret\":")
|
||||
.append("\"").append(clientSecret).append("\"");
|
||||
sb.append(",\"scope\":")
|
||||
.append("\"").append(scope).append("\"");
|
||||
sb.append(",\"authorizedGrantTypes\":")
|
||||
.append("\"").append(authorizedGrantTypes).append("\"");
|
||||
sb.append(",\"authorities\":")
|
||||
.append("\"").append(authorities).append("\"");
|
||||
sb.append(",\"accessTokenValidity\":")
|
||||
.append(accessTokenValidity);
|
||||
sb.append(",\"refreshTokenValidity\":")
|
||||
.append(refreshTokenValidity);
|
||||
sb.append(",\"additionalInformation\":")
|
||||
.append("\"").append(additionalInformation).append("\"");
|
||||
sb.append(",\"autoapprove\":")
|
||||
.append("\"").append(autoapprove).append("\"");
|
||||
sb.append(",\"menuId\":")
|
||||
.append("\"").append(menuId).append("\"");
|
||||
sb.append(",\"menuName\":")
|
||||
.append("\"").append(menuName).append("\"");
|
||||
sb.append(",\"environment\":")
|
||||
.append("\"").append(environment).append("\"");
|
||||
sb.append(",\"systemType\":")
|
||||
.append("\"").append(systemType).append("\"");
|
||||
sb.append(",\"systemState\":")
|
||||
.append("\"").append(systemState).append("\"");
|
||||
sb.append(",\"expireTime\":")
|
||||
.append("\"").append(expireTime).append("\"");
|
||||
sb.append(",\"systemSummary\":")
|
||||
.append("\"").append(systemSummary).append("\"");
|
||||
sb.append(",\"systemIcon\":")
|
||||
.append("\"").append(systemIcon).append("\"");
|
||||
sb.append(",\"gmtCreate\":")
|
||||
.append("\"").append(gmtCreate).append("\"");
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package ink.wgink.pojo.dtos.oauth.client;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: OauthClientSimpleDTO
|
||||
* @Description: 客户端简单信息
|
||||
* @Author: WangGeng
|
||||
* @Date: 2020/7/17 18:18
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class OauthClientSimpleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1552124710719004198L;
|
||||
@ApiModelProperty(name = "clientId", value = "客户端ID")
|
||||
private String clientId;
|
||||
@ApiModelProperty(name = "clientName", value = "客户端名称")
|
||||
private String clientName;
|
||||
@ApiModelProperty(name = "webServerRedirectUri", value = "重定向链接")
|
||||
private String webServerRedirectUri;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
|
||||
private String gmtCreate;
|
||||
|
||||
public String getClientId() {
|
||||
return clientId == null ? "" : clientId.trim();
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getClientName() {
|
||||
return clientName == null ? "" : clientName.trim();
|
||||
}
|
||||
|
||||
public void setClientName(String clientName) {
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
public String getWebServerRedirectUri() {
|
||||
return webServerRedirectUri == null ? "" : webServerRedirectUri.trim();
|
||||
}
|
||||
|
||||
public void setWebServerRedirectUri(String webServerRedirectUri) {
|
||||
this.webServerRedirectUri = webServerRedirectUri;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"clientId\":\"")
|
||||
.append(clientId).append('\"');
|
||||
sb.append(",\"clientName\":\"")
|
||||
.append(clientName).append('\"');
|
||||
sb.append(",\"webServerRedirectUri\":\"")
|
||||
.append(webServerRedirectUri).append('\"');
|
||||
sb.append(",\"gmtCreate\":\"")
|
||||
.append(gmtCreate).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package ink.wgink.pojo.dtos.position;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: PositionSimpleDTO
|
||||
* @Description: 职位(简单)
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/9/15 10:58 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class PositionSimpleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9213492008110236735L;
|
||||
private String positionId;
|
||||
private String positionParentId;
|
||||
private String positionName;
|
||||
private String positionCode;
|
||||
|
||||
public String getPositionId() {
|
||||
return positionId == null ? "" : positionId.trim();
|
||||
}
|
||||
|
||||
public void setPositionId(String positionId) {
|
||||
this.positionId = positionId;
|
||||
}
|
||||
|
||||
public String getPositionParentId() {
|
||||
return positionParentId == null ? "" : positionParentId.trim();
|
||||
}
|
||||
|
||||
public void setPositionParentId(String positionParentId) {
|
||||
this.positionParentId = positionParentId;
|
||||
}
|
||||
|
||||
public String getPositionName() {
|
||||
return positionName == null ? "" : positionName.trim();
|
||||
}
|
||||
|
||||
public void setPositionName(String positionName) {
|
||||
this.positionName = positionName;
|
||||
}
|
||||
|
||||
public String getPositionCode() {
|
||||
return positionCode == null ? "" : positionCode.trim();
|
||||
}
|
||||
|
||||
public void setPositionCode(String positionCode) {
|
||||
this.positionCode = positionCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package ink.wgink.pojo.dtos.role;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: RoleSimpleDTO
|
||||
* @Description: 角色(简单)
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/9/15 10:59 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class RoleSimpleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4972434857911570930L;
|
||||
private String roleId;
|
||||
private String roleParentId;
|
||||
private String roleName;
|
||||
private String roleCode;
|
||||
private String roleDataRight;
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId == null ? "" : roleId.trim();
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getRoleParentId() {
|
||||
return roleParentId == null ? "" : roleParentId.trim();
|
||||
}
|
||||
|
||||
public void setRoleParentId(String roleParentId) {
|
||||
this.roleParentId = roleParentId;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName == null ? "" : roleName.trim();
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getRoleCode() {
|
||||
return roleCode == null ? "" : roleCode.trim();
|
||||
}
|
||||
|
||||
public void setRoleCode(String roleCode) {
|
||||
this.roleCode = roleCode;
|
||||
}
|
||||
|
||||
public String getRoleDataRight() {
|
||||
return roleDataRight == null ? "" : roleDataRight.trim();
|
||||
}
|
||||
|
||||
public void setRoleDataRight(String roleDataRight) {
|
||||
this.roleDataRight = roleDataRight;
|
||||
}
|
||||
}
|
@ -3,12 +3,13 @@ package ink.wgink.common.component;
|
||||
import ink.wgink.interfaces.manager.IAppManager;
|
||||
import ink.wgink.pojo.app.AppToken;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
import ink.wgink.pojo.bos.*;
|
||||
import ink.wgink.pojo.dtos.CurrentUserIdInfoDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.bos.LoginUser;
|
||||
import ink.wgink.pojo.bos.RoleGrantedAuthorityBO;
|
||||
import ink.wgink.pojo.bos.UserInfoBO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.group.GroupSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import ink.wgink.util.ReflectUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -87,7 +88,7 @@ public class SecurityComponent {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<RolePO> listRole() {
|
||||
public List<RoleSimpleDTO> listRole() {
|
||||
UserInfoBO userInfoBO = getCurrentUser();
|
||||
return userInfoBO.getRoles();
|
||||
}
|
||||
@ -97,7 +98,7 @@ public class SecurityComponent {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<DepartmentPO> listDepartment() {
|
||||
public List<DepartmentSimpleDTO> listDepartment() {
|
||||
UserInfoBO userInfoBO = getCurrentUser();
|
||||
return userInfoBO.getDepartments();
|
||||
}
|
||||
@ -107,7 +108,7 @@ public class SecurityComponent {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<GroupPO> listGroup() {
|
||||
public List<GroupSimpleDTO> listGroup() {
|
||||
UserInfoBO userInfoBO = getCurrentUser();
|
||||
return userInfoBO.getGroups();
|
||||
}
|
||||
@ -117,7 +118,7 @@ public class SecurityComponent {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<PositionPO> listPosition() {
|
||||
public List<PositionSimpleDTO> listPosition() {
|
||||
UserInfoBO userInfoBO = getCurrentUser();
|
||||
return userInfoBO.getPositions();
|
||||
}
|
||||
@ -153,35 +154,6 @@ public class SecurityComponent {
|
||||
return (T) getExpandData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户ID信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CurrentUserIdInfoDTO getCurrentUserIdInfo() {
|
||||
UserInfoBO userInfoBO = getCurrentUser();
|
||||
CurrentUserIdInfoDTO currentUserIdInfoDTO = new CurrentUserIdInfoDTO();
|
||||
currentUserIdInfoDTO.setUserIdAndValue(new StringBuilder(userInfoBO.getUserId()).append("|").append(userInfoBO.getUserName()).toString());
|
||||
currentUserIdInfoDTO.setUserNameValue(userInfoBO.getUserName());
|
||||
|
||||
String departmentIdAndNamesValue = userInfoBO.getDepartmentIdAndNamesValue();
|
||||
currentUserIdInfoDTO.setDepartmentIdAndNamesValue(departmentIdAndNamesValue);
|
||||
currentUserIdInfoDTO.setDepartmentNamesValue(departmentIdAndNamesValue.isEmpty() ? departmentIdAndNamesValue : departmentIdAndNamesValue.split("\\|")[1]);
|
||||
|
||||
String roleIdAndNamesValue = userInfoBO.getRoleIdAndNamesValue();
|
||||
currentUserIdInfoDTO.setRoleIdAndNamesValue(roleIdAndNamesValue);
|
||||
currentUserIdInfoDTO.setRoleNamesValue(roleIdAndNamesValue.isEmpty() ? roleIdAndNamesValue : roleIdAndNamesValue.split("\\|")[1]);
|
||||
|
||||
String groupIdAndNamesValue = userInfoBO.getGroupIdAndNamesValue();
|
||||
currentUserIdInfoDTO.setGroupIdAndNamesValue(groupIdAndNamesValue);
|
||||
currentUserIdInfoDTO.setGroupNamesValue(groupIdAndNamesValue.isEmpty() ? groupIdAndNamesValue : groupIdAndNamesValue.split("\\|")[1]);
|
||||
|
||||
String positionIdAndNamesValue = userInfoBO.getPositionIdAndNamesValue();
|
||||
currentUserIdInfoDTO.setPositionIdAndNamesValue(positionIdAndNamesValue);
|
||||
currentUserIdInfoDTO.setPositionNamesValue(positionIdAndNamesValue.isEmpty() ? positionIdAndNamesValue : positionIdAndNamesValue.split("\\|")[1]);
|
||||
return currentUserIdInfoDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* AppManager
|
||||
*
|
||||
|
@ -8,7 +8,7 @@ import ink.wgink.login.base.consts.IUserCenterConst;
|
||||
import ink.wgink.login.base.manager.ConfigManager;
|
||||
import ink.wgink.pojo.bos.UserInfoBO;
|
||||
import ink.wgink.pojo.dtos.menu.MenuDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import ink.wgink.properties.ServerProperties;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -94,13 +94,13 @@ public class IndexRouteController {
|
||||
}
|
||||
} else {
|
||||
// 普通用户
|
||||
List<RolePO> rolePOs = securityComponent.getCurrentUser().getRoles();
|
||||
if (rolePOs.isEmpty()) {
|
||||
List<RoleSimpleDTO> roleSimpleDTOs = securityComponent.getCurrentUser().getRoles();
|
||||
if (roleSimpleDTOs.isEmpty()) {
|
||||
menus = new ArrayList<>();
|
||||
} else {
|
||||
List<String> roleIds = new ArrayList<>();
|
||||
for (RolePO rolePO : rolePOs) {
|
||||
roleIds.add(rolePO.getRoleId());
|
||||
for (RoleSimpleDTO roleSimpleDTO : roleSimpleDTOs) {
|
||||
roleIds.add(roleSimpleDTO.getRoleId());
|
||||
}
|
||||
List<String> menuIds = roleMenuBaseService.listMenuId(roleIds);
|
||||
menus = menuBaseService.listAllByParentIdAndIds(IMenuBaseService.MENU_UNIFIED_USER, menuIds);
|
||||
|
@ -14,6 +14,10 @@ import ink.wgink.login.base.exceptions.UserAuthenticationException;
|
||||
import ink.wgink.login.base.manager.ConfigManager;
|
||||
import ink.wgink.pojo.bos.LoginUser;
|
||||
import ink.wgink.pojo.bos.RoleGrantedAuthorityBO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.group.GroupSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
@ -113,22 +117,26 @@ public class UserDetailServiceImpl implements UserDetailsService, IUserDetailChe
|
||||
|
||||
loginUser = createUserBO(userPO, grantedAuthorities);
|
||||
if (rolePOs != null) {
|
||||
loginUser.setRoles(rolePOs);
|
||||
List<RoleSimpleDTO> roleSimpleDTOs = roleUserBaseService.listSimple(rolePOs);
|
||||
loginUser.setRoles(roleSimpleDTOs);
|
||||
}
|
||||
|
||||
LOG.debug("设置部门状态");
|
||||
List<DepartmentPO> departmentPOs = departmentUserService.listDepartmentPOByUserId(userPO.getUserId());
|
||||
loginUser.setDepartments(departmentPOs);
|
||||
List<DepartmentSimpleDTO> departmentSimpleDTOs = departmentUserService.listSimple(departmentPOs);
|
||||
loginUser.setDepartments(departmentSimpleDTOs);
|
||||
|
||||
if (groupUserBaseService != null) {
|
||||
LOG.debug("设置组信息");
|
||||
List<GroupPO> groupPOs = groupUserBaseService.listGroupPOByUserId(userPO.getUserId());
|
||||
loginUser.setGroups(groupPOs);
|
||||
List<GroupSimpleDTO> groupSimpleDTOs = groupUserBaseService.listSimple(groupPOs);
|
||||
loginUser.setGroups(groupSimpleDTOs);
|
||||
}
|
||||
if (positionUserBaseService != null) {
|
||||
LOG.debug("设置职位");
|
||||
List<PositionPO> positionBOs = positionUserBaseService.listPositionPOByUserId(userPO.getUserId());
|
||||
loginUser.setPositions(positionBOs);
|
||||
List<PositionPO> positionPOs = positionUserBaseService.listPositionPOByUserId(userPO.getUserId());
|
||||
List<PositionSimpleDTO> positionSimpleDTOs = positionUserBaseService.listSimple(positionPOs);
|
||||
loginUser.setPositions(positionSimpleDTOs);
|
||||
}
|
||||
}
|
||||
loginHandler(loginUser);
|
||||
|
@ -6,7 +6,7 @@ import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.interfaces.role.IRoleDataRightBaseService;
|
||||
import ink.wgink.login.base.service.log.ILoginLogService;
|
||||
import ink.wgink.pojo.bos.LoginUser;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import ink.wgink.service.department.service.IDepartmentService;
|
||||
import ink.wgink.service.department.service.IDepartmentUserService;
|
||||
import ink.wgink.service.user.service.IUserService;
|
||||
@ -141,18 +141,18 @@ public class UserLoginService {
|
||||
* @return
|
||||
*/
|
||||
|
||||
public String getDataRight(List<RolePO> roles) {
|
||||
public String getDataRight(List<RoleSimpleDTO> roles) {
|
||||
String roleDataAuthority = RoleDataRightEnum.SELF.getValue();
|
||||
for (RolePO rolePO : roles) {
|
||||
if (StringUtils.equals(RoleDataRightEnum.ALL.getValue(), rolePO.getRoleDataRight())) {
|
||||
for (RoleSimpleDTO roleSimplePO : roles) {
|
||||
if (StringUtils.equals(RoleDataRightEnum.ALL.getValue(), roleSimplePO.getRoleDataRight())) {
|
||||
roleDataAuthority = RoleDataRightEnum.ALL.getValue();
|
||||
break;
|
||||
}
|
||||
if (StringUtils.equals(RoleDataRightEnum.DEPARTMENT.getValue(), rolePO.getRoleDataRight())) {
|
||||
if (StringUtils.equals(RoleDataRightEnum.DEPARTMENT.getValue(), roleSimplePO.getRoleDataRight())) {
|
||||
roleDataAuthority = RoleDataRightEnum.DEPARTMENT.getValue();
|
||||
break;
|
||||
}
|
||||
if (StringUtils.equals(RoleDataRightEnum.CUSTOM.getValue(), rolePO.getRoleDataRight())) {
|
||||
if (StringUtils.equals(RoleDataRightEnum.CUSTOM.getValue(), roleSimplePO.getRoleDataRight())) {
|
||||
roleDataAuthority = RoleDataRightEnum.CUSTOM.getValue();
|
||||
break;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ink.wgink.service.department.service;
|
||||
|
||||
import ink.wgink.interfaces.department.IDepartmentUserBaseService;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.service.department.pojo.vos.DepartmentUserSortVO;
|
||||
|
||||
@ -76,4 +77,12 @@ public interface IDepartmentUserService extends IDepartmentUserBaseService {
|
||||
*/
|
||||
List<DepartmentPO> listDepartmentPOByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 部门列表(简单)
|
||||
*
|
||||
* @param departmentPOs
|
||||
* @return
|
||||
*/
|
||||
List<DepartmentSimpleDTO> listSimple(List<DepartmentPO> departmentPOs);
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import ink.wgink.module.file.service.IFileService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.pojo.result.UploadExcelResultDTO;
|
||||
import ink.wgink.service.department.dao.IDepartmentDao;
|
||||
@ -266,32 +266,32 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listRootId(List<DepartmentPO> departmentPOS) {
|
||||
public List<String> listRootId(List<DepartmentSimpleDTO> departmentSimpleDTOs) {
|
||||
List<String> departmentIds = new ArrayList<>();
|
||||
if (Objects.isNull(departmentPOS) || departmentPOS.isEmpty()) {
|
||||
if (Objects.isNull(departmentSimpleDTOs) || departmentSimpleDTOs.isEmpty()) {
|
||||
return departmentIds;
|
||||
}
|
||||
List<DepartmentPO> departmentList = new ArrayList<>(departmentPOS);
|
||||
List<DepartmentPO> departmentTempList = new ArrayList<>(departmentPOS);
|
||||
List<DepartmentSimpleDTO> departmentList = new ArrayList<>(departmentSimpleDTOs);
|
||||
List<DepartmentSimpleDTO> departmentTempList = new ArrayList<>(departmentSimpleDTOs);
|
||||
for (int i = 0; i < departmentList.size(); i++) {
|
||||
DepartmentPO departmentPO = null;
|
||||
DepartmentSimpleDTO departmentSimpleDTO = null;
|
||||
// 找出CODE
|
||||
for (DepartmentPO department : departmentList) {
|
||||
DepartmentPO higherDepartmentPO = getHigherLevel(departmentList.get(i), department);
|
||||
if (higherDepartmentPO != null) {
|
||||
departmentPO = higherDepartmentPO;
|
||||
for (DepartmentSimpleDTO department : departmentList) {
|
||||
DepartmentSimpleDTO higherDepartmentSimpleDTO = getHigherLevel(departmentList.get(i), department);
|
||||
if (higherDepartmentSimpleDTO != null) {
|
||||
departmentSimpleDTO = higherDepartmentSimpleDTO;
|
||||
}
|
||||
}
|
||||
departmentIds.add(departmentPO.getDepartmentId());
|
||||
departmentIds.add(departmentSimpleDTO.getDepartmentId());
|
||||
// 删除包含关系的内容
|
||||
for (int j = 0; j < departmentList.size(); j++) {
|
||||
if (StringUtils.startsWith(departmentList.get(j).getDepartmentCode(), departmentPO.getDepartmentCode())) {
|
||||
if (StringUtils.startsWith(departmentList.get(j).getDepartmentCode(), departmentSimpleDTO.getDepartmentCode())) {
|
||||
departmentList.remove(j);
|
||||
j--;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < departmentTempList.size(); j++) {
|
||||
if (StringUtils.startsWith(departmentTempList.get(j).getDepartmentCode(), departmentPO.getDepartmentCode())) {
|
||||
if (StringUtils.startsWith(departmentTempList.get(j).getDepartmentCode(), departmentSimpleDTO.getDepartmentCode())) {
|
||||
departmentTempList.remove(j);
|
||||
j--;
|
||||
}
|
||||
@ -302,11 +302,11 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
}
|
||||
|
||||
@Override
|
||||
public DepartmentPO getHigherLevel(DepartmentPO departmentPO1, DepartmentPO departmentPO2) {
|
||||
if (StringUtils.startsWith(departmentPO1.getDepartmentCode(), departmentPO2.getDepartmentCode())) {
|
||||
return departmentPO2;
|
||||
} else if (StringUtils.startsWith(departmentPO2.getDepartmentCode(), departmentPO1.getDepartmentCode())) {
|
||||
return departmentPO1;
|
||||
public DepartmentSimpleDTO getHigherLevel(DepartmentSimpleDTO departmentSimpleDTO1, DepartmentSimpleDTO departmentSimpleDTO2) {
|
||||
if (StringUtils.startsWith(departmentSimpleDTO1.getDepartmentCode(), departmentSimpleDTO2.getDepartmentCode())) {
|
||||
return departmentSimpleDTO2;
|
||||
} else if (StringUtils.startsWith(departmentSimpleDTO2.getDepartmentCode(), departmentSimpleDTO1.getDepartmentCode())) {
|
||||
return departmentSimpleDTO1;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.interfaces.user.IUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.DepartmentPO;
|
||||
@ -133,6 +134,23 @@ public class DepartmentUserServiceImpl extends DefaultBaseService implements IDe
|
||||
return departmentService.listPO(departmentIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DepartmentSimpleDTO> listSimple(List<DepartmentPO> departmentPOs) {
|
||||
if (departmentPOs == null || departmentPOs.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<DepartmentSimpleDTO> departmentSimpleDTOs = new ArrayList<>();
|
||||
departmentPOs.forEach(departmentPO -> {
|
||||
DepartmentSimpleDTO departmentSimpleDTO = new DepartmentSimpleDTO();
|
||||
departmentSimpleDTO.setDepartmentId(departmentPO.getDepartmentId());
|
||||
departmentSimpleDTO.setDepartmentParentId(departmentPO.getDepartmentParentId());
|
||||
departmentSimpleDTO.setDepartmentName(departmentPO.getDepartmentName());
|
||||
departmentSimpleDTO.setDepartmentCode(departmentPO.getDepartmentCode());
|
||||
departmentSimpleDTOs.add(departmentSimpleDTO);
|
||||
});
|
||||
return departmentSimpleDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DepartmentUserDTO> list(Map<String, Object> params) {
|
||||
return departmentUserDao.list(params);
|
||||
|
@ -4,6 +4,7 @@ import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.interfaces.user.IUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.group.GroupSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.group.GroupUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
@ -103,6 +104,23 @@ public class GroupUserServiceImpl extends DefaultBaseService implements IGroupUs
|
||||
return groupService.listPO(groupIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GroupSimpleDTO> listSimple(List<GroupPO> groupPOs) {
|
||||
if (groupPOs == null || groupPOs.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<GroupSimpleDTO> groupSimpleDTOs = new ArrayList<>();
|
||||
groupPOs.forEach(groupPO -> {
|
||||
GroupSimpleDTO groupSimpleDTO = new GroupSimpleDTO();
|
||||
groupSimpleDTO.setGroupId(groupPO.getGroupId());
|
||||
groupSimpleDTO.setGroupParentId(groupPO.getGroupParentId());
|
||||
groupSimpleDTO.setGroupName(groupPO.getGroupName());
|
||||
groupSimpleDTO.setGroupCode(groupPO.getGroupCode());
|
||||
groupSimpleDTOs.add(groupSimpleDTO);
|
||||
});
|
||||
return groupSimpleDTOs;
|
||||
}
|
||||
|
||||
|
||||
private List<String> listGroupUserId(Map<String, Object> params) {
|
||||
return groupUserDao.listGroupUserId(params);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package ink.wgink.module.menu.service;
|
||||
|
||||
import ink.wgink.interfaces.menu.IMenuBaseService;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.module.menu.pojo.vos.MenuVO;
|
||||
|
||||
import java.util.List;
|
||||
@ -21,7 +20,14 @@ public interface IMenuService extends IMenuBaseService {
|
||||
* @param menuVO
|
||||
* @return
|
||||
*/
|
||||
SuccessResult save(MenuVO menuVO);
|
||||
void save(MenuVO menuVO);
|
||||
|
||||
/**
|
||||
* 保存菜单
|
||||
*
|
||||
* @param menuVO
|
||||
*/
|
||||
String saveAndReturnId(MenuVO menuVO);
|
||||
|
||||
/**
|
||||
* 修改菜单
|
||||
@ -30,7 +36,7 @@ public interface IMenuService extends IMenuBaseService {
|
||||
* @param menuVO
|
||||
* @return
|
||||
*/
|
||||
SuccessResult update(String menuId, MenuVO menuVO);
|
||||
void update(String menuId, MenuVO menuVO);
|
||||
|
||||
/**
|
||||
* 菜单删除
|
||||
@ -38,7 +44,7 @@ public interface IMenuService extends IMenuBaseService {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
SuccessResult remove(List<String> ids);
|
||||
void remove(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过clientId获取菜单
|
||||
|
@ -5,21 +5,21 @@ import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.menu.MenuDTO;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.module.menu.dao.IMenuDao;
|
||||
import ink.wgink.module.menu.pojo.vos.MenuVO;
|
||||
import ink.wgink.module.menu.service.IMenuService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.dtos.menu.MenuDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.ArrayListUtil;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: MenuServiceImpl
|
||||
@ -109,8 +109,14 @@ public class MenuServiceImpl extends DefaultBaseService implements IMenuService
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized SuccessResult save(MenuVO menuVO) {
|
||||
public synchronized void save(MenuVO menuVO) {
|
||||
saveAndReturnId(menuVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveAndReturnId(MenuVO menuVO) {
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(menuVO);
|
||||
String menuId = UUIDUtil.getUUID();
|
||||
String parentCode = null;
|
||||
String menuParentId = params.get("menuParentId").toString();
|
||||
if (!ISystemConstant.TREE_ROOT_ID.equals(menuParentId)) {
|
||||
@ -120,28 +126,26 @@ public class MenuServiceImpl extends DefaultBaseService implements IMenuService
|
||||
}
|
||||
String menuCode = getCode(parentCode, menuParentId);
|
||||
params.put("menuCode", menuCode);
|
||||
params.put("menuId", UUIDUtil.getUUID());
|
||||
params.put("menuId", menuId);
|
||||
setSaveInfo(params);
|
||||
menuDao.save(params);
|
||||
return new SuccessResult();
|
||||
return menuId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult remove(List<String> ids) {
|
||||
public void remove(List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("menuIds", ids);
|
||||
setUpdateInfo(params);
|
||||
menuDao.remove(params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult update(String menuId, MenuVO menuVO) {
|
||||
public void update(String menuId, MenuVO menuVO) {
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(menuVO);
|
||||
params.put("menuId", menuId);
|
||||
setUpdateInfo(params);
|
||||
menuDao.update(params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,6 +4,7 @@ import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.interfaces.user.IUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.position.PositionSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.position.PositionUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
@ -114,6 +115,23 @@ public class PositionUserServiceImpl extends DefaultBaseService implements IPosi
|
||||
return positionService.listPO(positionIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionSimpleDTO> listSimple(List<PositionPO> positionPOs) {
|
||||
if (positionPOs == null || positionPOs.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<PositionSimpleDTO> positionSimpleDTOs = new ArrayList<>();
|
||||
positionPOs.forEach(positionPO -> {
|
||||
PositionSimpleDTO positionSimpleDTO = new PositionSimpleDTO();
|
||||
positionSimpleDTO.setPositionId(positionPO.getPositionId());
|
||||
positionSimpleDTO.setPositionParentId(positionPO.getPositionParentId());
|
||||
positionSimpleDTO.setPositionName(positionPO.getPositionName());
|
||||
positionSimpleDTO.setPositionCode(positionPO.getPositionCode());
|
||||
positionSimpleDTOs.add(positionSimpleDTO);
|
||||
});
|
||||
return positionSimpleDTOs;
|
||||
}
|
||||
|
||||
private List<String> listGroupUserId(Map<String, Object> params) {
|
||||
return positionUserDao.listGroupUserId(params);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.interfaces.user.IUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.role.RoleSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
@ -103,6 +104,24 @@ public class RoleUserServiceImpl extends DefaultBaseService implements IRoleUser
|
||||
return roleService.listPO(roleIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RoleSimpleDTO> listSimple(List<RolePO> rolePOs) {
|
||||
if (rolePOs == null || rolePOs.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<RoleSimpleDTO> roleSimpleDTOs = new ArrayList<>();
|
||||
rolePOs.forEach(rolePO -> {
|
||||
RoleSimpleDTO roleSimpleDTO = new RoleSimpleDTO();
|
||||
roleSimpleDTO.setRoleId(rolePO.getRoleId());
|
||||
roleSimpleDTO.setRoleParentId(rolePO.getRoleParentId());
|
||||
roleSimpleDTO.setRoleName(rolePO.getRoleName());
|
||||
roleSimpleDTO.setRoleCode(rolePO.getRoleCode());
|
||||
roleSimpleDTO.setRoleDataRight(rolePO.getRoleDataRight());
|
||||
roleSimpleDTOs.add(roleSimpleDTO);
|
||||
});
|
||||
return roleSimpleDTOs;
|
||||
}
|
||||
|
||||
|
||||
private List<String> listGroupUserId(Map<String, Object> params) {
|
||||
return roleUserDao.listGroupUserId(params);
|
||||
@ -133,5 +152,5 @@ public class RoleUserServiceImpl extends DefaultBaseService implements IRoleUser
|
||||
}
|
||||
return userBaseService.listPageByIds(userIds, page);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user