处理问题

This commit is contained in:
wenc000 2020-02-10 00:14:35 +08:00
parent 01adcf3e24
commit 7dc7598d08
4 changed files with 46 additions and 8 deletions

View File

@ -40,6 +40,7 @@ public class SecurityComponent {
UserBO userBO = (UserBO) user; UserBO userBO = (UserBO) user;
userInfoBO.setUserId(userBO.getUserId()); userInfoBO.setUserId(userBO.getUserId());
userInfoBO.setUserUsername(userBO.getUsername()); userInfoBO.setUserUsername(userBO.getUsername());
userInfoBO.setUserName(userBO.getUserName());
userInfoBO.setUserPhone(userBO.getUserPhone()); userInfoBO.setUserPhone(userBO.getUserPhone());
userInfoBO.setDataAuthority(userBO.getDataAuthority()); userInfoBO.setDataAuthority(userBO.getDataAuthority());
userInfoBO.setDataAuthorityUserIds(userBO.getDataAuthorityUserIds()); userInfoBO.setDataAuthorityUserIds(userBO.getDataAuthorityUserIds());

View File

@ -20,6 +20,10 @@ public interface ISystemConstant {
* APP接口前缀 * APP接口前缀
*/ */
String API_TAGS_APP_PREFIX = "APP接口-"; String API_TAGS_APP_PREFIX = "APP接口-";
/**
* APP路由接口前缀
*/
String API_TAGS_APP_ROUTE_PREFIX = "APP路由接口-";
/** /**
* 路由接口前缀 * 路由接口前缀
*/ */
@ -40,6 +44,14 @@ public interface ISystemConstant {
* APP前缀 * APP前缀
*/ */
String APP_PREFIX = "/app"; String APP_PREFIX = "/app";
/**
* APP路由前缀
*/
String APP_ROUTE_PREFIX = "/approute";
/**
* APP放行后缀
*/
String APP_RELEASE_SUFFIX = "release";
/** /**
* true * true
*/ */

View File

@ -3,6 +3,7 @@ package com.cm.common.pojo.bos;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.User;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -85,7 +86,7 @@ public class UserBO extends User {
} }
public List<String> getBaseDepartmentIds() { public List<String> getBaseDepartmentIds() {
return baseDepartmentIds; return baseDepartmentIds == null ? new ArrayList<>(0) : baseDepartmentIds;
} }
public void setBaseDepartmentIds(List<String> baseDepartmentIds) { public void setBaseDepartmentIds(List<String> baseDepartmentIds) {
@ -101,7 +102,7 @@ public class UserBO extends User {
} }
public List<String> getDataAuthorityUserIds() { public List<String> getDataAuthorityUserIds() {
return dataAuthorityUserIds; return dataAuthorityUserIds == null ? new ArrayList<>(0) : dataAuthorityUserIds;
} }
public void setDataAuthorityUserIds(List<String> dataAuthorityUserIds) { public void setDataAuthorityUserIds(List<String> dataAuthorityUserIds) {
@ -109,11 +110,14 @@ public class UserBO extends User {
} }
public List<RoleBO> getRoles() { public List<RoleBO> getRoles() {
return roles; return roles == null ? new ArrayList<>(0) : roles;
} }
public void setRoles(List<RoleBO> roles) { public void setRoles(List<RoleBO> roles) {
this.roles = roles; this.roles = roles;
if (roles == null || roles.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
roles.forEach(roleBO -> { roles.forEach(roleBO -> {
@ -128,11 +132,14 @@ public class UserBO extends User {
} }
public List<GroupBO> getGroups() { public List<GroupBO> getGroups() {
return groups; return groups == null ? new ArrayList<>(0) : groups;
} }
public void setGroups(List<GroupBO> groups) { public void setGroups(List<GroupBO> groups) {
this.groups = groups; this.groups = groups;
if (groups == null || groups.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
groups.forEach(groupBO -> { groups.forEach(groupBO -> {
@ -147,11 +154,14 @@ public class UserBO extends User {
} }
public List<DepartmentBO> getDepartments() { public List<DepartmentBO> getDepartments() {
return departments; return departments == null ? new ArrayList<>(0) : departments;
} }
public void setDepartments(List<DepartmentBO> departments) { public void setDepartments(List<DepartmentBO> departments) {
this.departments = departments; this.departments = departments;
if (departments == null || departments.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
departments.forEach(departmentBO -> { departments.forEach(departmentBO -> {
@ -166,11 +176,14 @@ public class UserBO extends User {
} }
public List<PositionBO> getPositions() { public List<PositionBO> getPositions() {
return positions; return positions == null ? new ArrayList<>(0) : positions;
} }
public void setPositions(List<PositionBO> positions) { public void setPositions(List<PositionBO> positions) {
this.positions = positions; this.positions = positions;
if (positions == null || positions.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
positions.forEach(positionBO -> { positions.forEach(positionBO -> {

View File

@ -69,7 +69,7 @@ public class UserInfoBO {
} }
public List<String> getDataAuthorityUserIds() { public List<String> getDataAuthorityUserIds() {
return dataAuthorityUserIds; return dataAuthorityUserIds == null ? new ArrayList<>(0) : dataAuthorityUserIds;
} }
public void setDataAuthorityUserIds(List<String> dataAuthorityUserIds) { public void setDataAuthorityUserIds(List<String> dataAuthorityUserIds) {
@ -77,7 +77,7 @@ public class UserInfoBO {
} }
public List<String> getBaseDepartmentIds() { public List<String> getBaseDepartmentIds() {
return baseDepartmentIds; return baseDepartmentIds == null ? new ArrayList<>(0) : baseDepartmentIds;
} }
public void setBaseDepartmentIds(List<String> baseDepartmentIds) { public void setBaseDepartmentIds(List<String> baseDepartmentIds) {
@ -90,6 +90,9 @@ public class UserInfoBO {
public void setDepartments(List<DepartmentBO> departments) { public void setDepartments(List<DepartmentBO> departments) {
this.departments = departments; this.departments = departments;
if (departments == null || departments.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
departments.forEach(departmentBO -> { departments.forEach(departmentBO -> {
@ -109,6 +112,9 @@ public class UserInfoBO {
public void setRoles(List<RoleBO> roles) { public void setRoles(List<RoleBO> roles) {
this.roles = roles; this.roles = roles;
if (roles == null || roles.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
roles.forEach(roleBO -> { roles.forEach(roleBO -> {
@ -128,6 +134,9 @@ public class UserInfoBO {
public void setGroups(List<GroupBO> groups) { public void setGroups(List<GroupBO> groups) {
this.groups = groups; this.groups = groups;
if (groups == null || groups.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
groups.forEach(groupBO -> { groups.forEach(groupBO -> {
@ -147,6 +156,9 @@ public class UserInfoBO {
public void setPositions(List<PositionBO> positions) { public void setPositions(List<PositionBO> positions) {
this.positions = positions; this.positions = positions;
if (positions == null || positions.isEmpty()) {
return;
}
StringBuilder idSB = new StringBuilder(); StringBuilder idSB = new StringBuilder();
StringBuilder nameSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder();
positions.forEach(positionBO -> { positions.forEach(positionBO -> {