UserVO
This commit is contained in:
parent
2ff9840e97
commit
beab3775c7
|
@ -93,22 +93,6 @@ public class User extends BaseEntity
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginDate;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||
})
|
||||
private Dept dept;
|
||||
|
||||
/** 角色对象 */
|
||||
private List<Role> roles;
|
||||
|
||||
/** 角色组 */
|
||||
private Long[] roleIds;
|
||||
|
||||
/** 岗位组 */
|
||||
private Long[] postIds;
|
||||
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain.model;
|
|||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
|
@ -71,19 +72,19 @@ public class LoginUser implements UserDetails
|
|||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
private User user;
|
||||
private UserVO user;
|
||||
|
||||
public LoginUser()
|
||||
{
|
||||
}
|
||||
|
||||
public LoginUser(User user, Set<String> permissions)
|
||||
public LoginUser(UserVO user, Set<String> permissions)
|
||||
{
|
||||
this.user = user;
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public LoginUser(Long userId, Long deptId, User user, Set<String> permissions)
|
||||
public LoginUser(Long userId, Long deptId, UserVO user, Set<String> permissions)
|
||||
{
|
||||
this.userId = userId;
|
||||
this.deptId = deptId;
|
||||
|
@ -254,12 +255,12 @@ public class LoginUser implements UserDetails
|
|||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public User getUser()
|
||||
public UserVO getUser()
|
||||
{
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user)
|
||||
public void setUser(UserVO user)
|
||||
{
|
||||
this.user = user;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package com.ruoyi.common.core.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excels;
|
||||
import com.ruoyi.common.core.domain.entity.Dept;
|
||||
import com.ruoyi.common.core.domain.entity.Role;
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserVO extends User {
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
@Excel(name = "部门名称", type = Excel.Type.IMPORT)
|
||||
private String deptName;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
|
||||
})
|
||||
private Dept dept;
|
||||
|
||||
/** 角色对象 */
|
||||
private List<Role> roles;
|
||||
|
||||
/** 角色组 */
|
||||
private Long[] roleIds;
|
||||
|
||||
/** 岗位组 */
|
||||
private Long[] postIds;
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.framework.aspectj;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
|
@ -42,7 +43,7 @@ public class DataScopeAspect
|
|||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (StringUtils.isNotNull(loginUser))
|
||||
{
|
||||
User currentUser = loginUser.getUser();
|
||||
UserVO currentUser = loginUser.getUser();
|
||||
// 如果是超级管理员,则不过滤数据
|
||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
||||
{
|
||||
|
@ -60,7 +61,7 @@ public class DataScopeAspect
|
|||
* @param scope 注解
|
||||
* @param permission 权限字符
|
||||
*/
|
||||
public static void dataScopeFilter(JoinPoint joinPoint, User user, DataScope scope, String permission)
|
||||
public static void dataScopeFilter(JoinPoint joinPoint, UserVO user, DataScope scope, String permission)
|
||||
{
|
||||
StringBuilder sqlString = DataScopeUtil.getSqlString(
|
||||
user,
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.common.core.interfaces.LogBizParam;
|
||||
import com.ruoyi.common.enums.BusinessStatus;
|
||||
import com.ruoyi.common.enums.HttpMethod;
|
||||
|
@ -181,7 +182,7 @@ public class LogAspect
|
|||
if (loginUser != null)
|
||||
{
|
||||
operLog.setOperName(loginUser.getUsername());
|
||||
User currentUser = loginUser.getUser();
|
||||
UserVO currentUser = loginUser.getUser();
|
||||
if (StringUtils.isNotNull(currentUser) && StringUtils.isNotNull(currentUser.getDept()))
|
||||
{
|
||||
operLog.setDeptName(currentUser.getDept().getDeptName());
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
import com.ruoyi.common.core.domain.entity.Role;
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
@ -75,7 +76,7 @@ public class DataScopeUtil {
|
|||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (StringUtils.isNotNull(loginUser))
|
||||
{
|
||||
User currentUser = loginUser.getUser();
|
||||
UserVO currentUser = loginUser.getUser();
|
||||
// 如果是超级管理员,则不过滤数据
|
||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
||||
{
|
||||
|
@ -89,7 +90,7 @@ public class DataScopeUtil {
|
|||
return "";
|
||||
}
|
||||
|
||||
public static StringBuilder getSqlString(User user, String deptAlias, String userAlias, String deptSetAlias, String userSetAlias, String permission) {
|
||||
public static StringBuilder getSqlString(UserVO user, String deptAlias, String userAlias, String deptSetAlias, String userSetAlias, String permission) {
|
||||
List<String> deptAliasList = StringUtils.hasText(deptAlias) ? Arrays.asList(deptAlias.split(",")) : new ArrayList<>();
|
||||
List<String> userAliasList = StringUtils.hasText(userAlias) ? Arrays.asList(userAlias.split(",")) : new ArrayList<>();
|
||||
List<String> deptSetAliasList = StringUtils.hasText(deptSetAlias) ? Arrays.asList(deptSetAlias.split(",")) : new ArrayList<>();
|
||||
|
@ -98,8 +99,9 @@ public class DataScopeUtil {
|
|||
List<String> conditions = new ArrayList<String>();
|
||||
List<String> scopeCustomIds = new ArrayList<String>();
|
||||
user.getRoles().forEach(role -> {
|
||||
if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
||||
{
|
||||
if (DATA_SCOPE_CUSTOM.equals(role.getDataScope())
|
||||
&& StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL)
|
||||
&& StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))) {
|
||||
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.framework.web.service;
|
|||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.Role;
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.menu.service.MenuService;
|
||||
import com.ruoyi.system.role.service.RoleService;
|
||||
|
@ -55,7 +56,7 @@ public class SysPermissionService
|
|||
* @param user 用户信息
|
||||
* @return 菜单权限信息
|
||||
*/
|
||||
public Set<String> getMenuPermission(User user)
|
||||
public Set<String> getMenuPermission(UserVO user)
|
||||
{
|
||||
Set<String> perms = new HashSet<String>();
|
||||
// 管理员拥有所有权限
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -42,7 +43,7 @@ public class SysRegisterService
|
|||
public String register(RegisterBody registerBody)
|
||||
{
|
||||
String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
|
||||
User user = new User();
|
||||
UserVO user = new UserVO();
|
||||
user.setUserName(username);
|
||||
|
||||
// 验证码开关
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -48,12 +49,12 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|||
ServiceUtil.assertion(StringUtils.isBlank(loginType), "用户登录方式未正常获取");
|
||||
|
||||
if (Constants.LOGIN_TYPE_PASSWORD.equals(loginType)) {
|
||||
User user = userService.selectUserByUserName(username);
|
||||
UserVO user = userService.selectUserByUserName(username);
|
||||
this.checkUser(user, username);
|
||||
passwordService.validate(user);
|
||||
return createLoginUser(user);
|
||||
} else if (Constants.LOGIN_TYPE_WX.equals(loginType)) {
|
||||
User user = userService.selectUserById(Long.valueOf(username));
|
||||
UserVO user = userService.selectUserById(Long.valueOf(username));
|
||||
this.checkUser(user, username);
|
||||
return createLoginUser(user);
|
||||
} else {
|
||||
|
@ -80,7 +81,7 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|||
}
|
||||
}
|
||||
|
||||
public UserDetails createLoginUser(User user)
|
||||
public UserDetails createLoginUser(UserVO user)
|
||||
{
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.user.domain;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package com.ruoyi.system.user.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserVO extends User {
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
@Excel(name = "部门名称", type = Excel.Type.IMPORT)
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("项目数")
|
||||
private Integer projectCount;
|
||||
|
||||
@ApiModelProperty("任务数")
|
||||
private Integer taskCount;
|
||||
|
||||
}
|
|
@ -6,8 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
|||
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
import com.ruoyi.system.user.domain.UserQuery;
|
||||
import com.ruoyi.system.user.domain.SysUserShiftQuery;
|
||||
import com.ruoyi.system.user.domain.UserVO;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.system.user.domain.vo.UserNameVO;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +30,7 @@ public interface UserMapper
|
|||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<User> selectAllocatedList(User user);
|
||||
public List<UserVO> selectAllocatedList(User user);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询未分配用户角色列表
|
||||
|
@ -39,7 +38,7 @@ public interface UserMapper
|
|||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<User> selectUnallocatedList(User user);
|
||||
public List<UserVO> selectUnallocatedList(User user);
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
|
@ -47,7 +46,7 @@ public interface UserMapper
|
|||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public User selectUserByUserName(String userName);
|
||||
public UserVO selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
|
@ -55,7 +54,7 @@ public interface UserMapper
|
|||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public User selectUserById(Long userId);
|
||||
public UserVO selectUserById(Long userId);
|
||||
|
||||
/**
|
||||
* 新增用户信息
|
||||
|
@ -146,11 +145,6 @@ public interface UserMapper
|
|||
*/
|
||||
int unbindWxOpenId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户列表(含调班)
|
||||
*/
|
||||
List<UserVO> selectUserWithShiftList(SysUserShiftQuery query);
|
||||
|
||||
/**
|
||||
* 查询用户名称列表
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
import com.ruoyi.system.user.domain.UserQuery;
|
||||
import com.ruoyi.system.user.domain.UserVO;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.system.user.domain.vo.UserNameVO;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ public interface UserService
|
|||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<User> selectAllocatedList(User user);
|
||||
public List<UserVO> selectAllocatedList(User user);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询未分配用户角色列表
|
||||
|
@ -36,7 +36,7 @@ public interface UserService
|
|||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<User> selectUnallocatedList(User user);
|
||||
public List<UserVO> selectUnallocatedList(User user);
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
|
@ -44,7 +44,7 @@ public interface UserService
|
|||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public User selectUserByUserName(String userName);
|
||||
public UserVO selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
|
@ -52,7 +52,7 @@ public interface UserService
|
|||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public User selectUserById(Long userId);
|
||||
public UserVO selectUserById(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询用户所属角色组
|
||||
|
@ -106,7 +106,7 @@ public interface UserService
|
|||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUser(User user);
|
||||
public int insertUser(UserVO user);
|
||||
|
||||
/**
|
||||
* 注册用户信息
|
||||
|
@ -114,7 +114,7 @@ public interface UserService
|
|||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean registerUser(User user);
|
||||
public boolean registerUser(UserVO user);
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
|
@ -122,7 +122,7 @@ public interface UserService
|
|||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUser(User user);
|
||||
public int updateUser(UserVO user);
|
||||
|
||||
/**
|
||||
* 用户授权角色
|
||||
|
|
|
@ -42,7 +42,7 @@ import com.ruoyi.system.userRole.mapper.UserRoleMapper;
|
|||
import com.ruoyi.system.config.service.ConfigService;
|
||||
import com.ruoyi.system.role.service.RoleService;
|
||||
import com.ruoyi.system.user.domain.UserQuery;
|
||||
import com.ruoyi.system.user.domain.UserVO;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.system.user.domain.vo.UserNameVO;
|
||||
import com.ruoyi.system.user.mapper.UserMapper;
|
||||
import com.ruoyi.system.user.service.UserService;
|
||||
|
@ -116,7 +116,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 用户信息集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<User> selectAllocatedList(User user)
|
||||
public List<UserVO> selectAllocatedList(User user)
|
||||
{
|
||||
return userMapper.selectAllocatedList(user);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 用户信息集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<User> selectUnallocatedList(User user)
|
||||
public List<UserVO> selectUnallocatedList(User user)
|
||||
{
|
||||
return userMapper.selectUnallocatedList(user);
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 用户对象信息
|
||||
*/
|
||||
@Override
|
||||
public User selectUserByUserName(String userName)
|
||||
public UserVO selectUserByUserName(String userName)
|
||||
{
|
||||
return userMapper.selectUserByUserName(userName);
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 用户对象信息
|
||||
*/
|
||||
@Override
|
||||
public User selectUserById(Long userId)
|
||||
public UserVO selectUserById(Long userId)
|
||||
{
|
||||
return userMapper.selectUserById(userId);
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUser(User user)
|
||||
public int insertUser(UserVO user)
|
||||
{
|
||||
// 校验
|
||||
userValidator.checkUserNoUnique(user.getUserId(), user.getUserNo());
|
||||
|
@ -313,7 +313,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean registerUser(User user)
|
||||
public boolean registerUser(UserVO user)
|
||||
{
|
||||
int rows = this.insertUser(user);
|
||||
|
||||
|
@ -330,7 +330,7 @@ public class UserServiceImpl implements UserService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUser(User user) {
|
||||
public int updateUser(UserVO user) {
|
||||
// 校验
|
||||
Long userId = user.getUserId();
|
||||
userValidator.checkUserNoUnique(user.getUserId(), user.getUserNo());
|
||||
|
@ -463,7 +463,7 @@ public class UserServiceImpl implements UserService
|
|||
*
|
||||
* @param user 用户对象
|
||||
*/
|
||||
public void insertUserRole(User user)
|
||||
public void insertUserRole(UserVO user)
|
||||
{
|
||||
this.insertUserRole(user.getUserId(), user.getRoleIds());
|
||||
}
|
||||
|
@ -473,7 +473,7 @@ public class UserServiceImpl implements UserService
|
|||
*
|
||||
* @param user 用户对象
|
||||
*/
|
||||
public void insertUserPost(User user)
|
||||
public void insertUserPost(UserVO user)
|
||||
{
|
||||
Long[] posts = user.getPostIds();
|
||||
if (StringUtils.isNotEmpty(posts))
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.system;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
@ -65,7 +66,7 @@ public class SysLoginController
|
|||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo()
|
||||
{
|
||||
User user = userService.selectUserById(SecurityUtils.getUserId());
|
||||
UserVO user = userService.selectUserById(SecurityUtils.getUserId());
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
// 权限集合
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -200,7 +201,7 @@ public class SysRoleController extends BaseController
|
|||
public TableDataInfo allocatedList(User user)
|
||||
{
|
||||
startPage();
|
||||
List<User> list = userService.selectAllocatedList(user);
|
||||
List<UserVO> list = userService.selectAllocatedList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -212,7 +213,7 @@ public class SysRoleController extends BaseController
|
|||
public TableDataInfo unallocatedList(User user)
|
||||
{
|
||||
startPage();
|
||||
List<User> list = userService.selectUnallocatedList(user);
|
||||
List<UserVO> list = userService.selectUnallocatedList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import com.ruoyi.system.dept.service.DeptService;
|
|||
import com.ruoyi.system.post.service.PostService;
|
||||
import com.ruoyi.system.role.service.RoleService;
|
||||
import com.ruoyi.system.user.domain.UserQuery;
|
||||
import com.ruoyi.system.user.domain.UserVO;
|
||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||
import com.ruoyi.system.user.service.UserAssembler;
|
||||
import com.ruoyi.system.user.service.UserService;
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class SysUserController extends BaseController
|
|||
ajax.put("posts", postService.selectPostAll());
|
||||
if (StringUtils.isNotNull(userId))
|
||||
{
|
||||
User user = userService.selectUserById(userId);
|
||||
UserVO user = userService.selectUserById(userId);
|
||||
ajax.put(AjaxResult.DATA_TAG, user);
|
||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||
ajax.put("roleIds", user.getRoles().stream().map(Role::getRoleId).collect(Collectors.toList()));
|
||||
|
@ -156,7 +156,7 @@ public class SysUserController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated(ValidGroup.Create.class) @RequestBody User user) {
|
||||
public AjaxResult add(@Validated(ValidGroup.Create.class) @RequestBody UserVO user) {
|
||||
user.setCreateBy(getUsername());
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ public class SysUserController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated(ValidGroup.Update.class) @RequestBody User user) {
|
||||
public AjaxResult edit(@Validated(ValidGroup.Update.class) @RequestBody UserVO user) {
|
||||
user.setUpdateBy(getUsername());
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user