Commit 40eb8840 authored by 董天德's avatar 董天德

用户信息新增机构权限

parent 68dd0cdd
...@@ -160,6 +160,8 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu ...@@ -160,6 +160,8 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu
map.put("avatar", user.getAvatar()); map.put("avatar", user.getAvatar());
map.put("userId", user.getUserId()); map.put("userId", user.getUserId());
map.put("account", user.getUsername()); map.put("account", user.getUsername());
map.put("organId", user.getOrganId());
map.put("srvOrganId", user.getSrvOrganId());
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(map); ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(map);
return accessToken; return accessToken;
}; };
......
...@@ -27,5 +27,7 @@ public class SystemUser { ...@@ -27,5 +27,7 @@ public class SystemUser {
private Integer userStatus; private Integer userStatus;
private Date createdTime; private Date createdTime;
private Date updatedTime; private Date updatedTime;
private Long organId;
private Long srvOrganId;
} }
...@@ -20,5 +20,7 @@ public class ReqUserInfo { ...@@ -20,5 +20,7 @@ public class ReqUserInfo {
private String marketerCode; private String marketerCode;
private List<Long> roleIds; private List<Long> roleIds;
private Long organId;
private Long srvOrganId;
} }
...@@ -23,6 +23,8 @@ public class UserLoginInfoVO implements UserDetails { ...@@ -23,6 +23,8 @@ public class UserLoginInfoVO implements UserDetails {
private final Long userId; private final Long userId;
private String avatar; private String avatar;
private final Boolean enable; private final Boolean enable;
private Long organId;
private Long srvOrganId;
public UserLoginInfoVO(SystemUser user) { public UserLoginInfoVO(SystemUser user) {
this.username = user.getAccount(); this.username = user.getAccount();
...@@ -30,6 +32,8 @@ public class UserLoginInfoVO implements UserDetails { ...@@ -30,6 +32,8 @@ public class UserLoginInfoVO implements UserDetails {
this.name = user.getRealName(); this.name = user.getRealName();
this.userId = user.getUserId(); this.userId = user.getUserId();
this.enable = user.getUserStatus() == 1; this.enable = user.getUserStatus() == 1;
this.organId = user.getOrganId();
this.srvOrganId = user.getSrvOrganId();
} }
public void setAuthorities(List<Long> roles) { public void setAuthorities(List<Long> roles) {
......
...@@ -110,6 +110,8 @@ public class UserController { ...@@ -110,6 +110,8 @@ public class UserController {
user.setRealName(reqUserInfo.getName()); user.setRealName(reqUserInfo.getName());
user.setUserStatus(reqUserInfo.getEnable()); user.setUserStatus(reqUserInfo.getEnable());
user.setCreatedTime(new Date()); user.setCreatedTime(new Date());
user.setOrganId(reqUserInfo.getOrganId());
user.setSrvOrganId(reqUserInfo.getSrvOrganId());
userInfoService.save(user); userInfoService.save(user);
Long userId = user.getUserId(); Long userId = user.getUserId();
//初始化权限 //初始化权限
...@@ -192,6 +194,8 @@ public class UserController { ...@@ -192,6 +194,8 @@ public class UserController {
userInfo.setEnable(user.getUserStatus()); userInfo.setEnable(user.getUserStatus());
userInfo.setAvatar(user.getAvatar()); userInfo.setAvatar(user.getAvatar());
userInfo.setGender(Gender.MAN.getCode().equals(user.getGender()) ? Gender.MAN.getDesc() : Gender.WOMAN.getDesc()); userInfo.setGender(Gender.MAN.getCode().equals(user.getGender()) ? Gender.MAN.getDesc() : Gender.WOMAN.getDesc());
userInfo.setOrganId(user.getOrganId());
userInfo.setSrvOrganId(user.getSrvOrganId());
return userInfo; return userInfo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return Result.success(resUsers); return Result.success(resUsers);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment