|
|
|
@ -1,15 +1,6 @@ |
|
|
|
|
package com.ruoyi.system.service.impl; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import javax.validation.Validator; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.ruoyi.common.annotation.DataScope; |
|
|
|
|
import com.ruoyi.common.constant.UserConstants; |
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysRole; |
|
|
|
@ -22,17 +13,24 @@ import com.ruoyi.common.utils.spring.SpringUtils; |
|
|
|
|
import com.ruoyi.system.domain.SysPost; |
|
|
|
|
import com.ruoyi.system.domain.SysUserPost; |
|
|
|
|
import com.ruoyi.system.domain.SysUserRole; |
|
|
|
|
import com.ruoyi.system.mapper.SysPostMapper; |
|
|
|
|
import com.ruoyi.system.mapper.SysRoleMapper; |
|
|
|
|
import com.ruoyi.system.mapper.SysUserMapper; |
|
|
|
|
import com.ruoyi.system.mapper.SysUserPostMapper; |
|
|
|
|
import com.ruoyi.system.mapper.SysUserRoleMapper; |
|
|
|
|
import com.ruoyi.system.mapper.*; |
|
|
|
|
import com.ruoyi.system.service.ISysConfigService; |
|
|
|
|
import com.ruoyi.system.service.ISysUserService; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
import javax.validation.Validator; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 用户 业务层处理 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @author ruoyi |
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
@ -63,7 +61,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据条件分页查询用户列表 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 用户信息集合信息 |
|
|
|
|
*/ |
|
|
|
@ -76,7 +74,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据条件分页查询已分配用户角色列表 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 用户信息集合信息 |
|
|
|
|
*/ |
|
|
|
@ -89,7 +87,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据条件分页查询未分配用户角色列表 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 用户信息集合信息 |
|
|
|
|
*/ |
|
|
|
@ -102,7 +100,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过用户名查询用户 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userName 用户名 |
|
|
|
|
* @return 用户对象信息 |
|
|
|
|
*/ |
|
|
|
@ -114,7 +112,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过用户ID查询用户 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userId 用户ID |
|
|
|
|
* @return 用户对象信息 |
|
|
|
|
*/ |
|
|
|
@ -126,7 +124,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询用户所属角色组 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userName 用户名 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -143,7 +141,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询用户所属岗位组 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userName 用户名 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -160,7 +158,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 校验用户名称是否唯一 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -214,7 +212,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 校验用户是否允许操作 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
@ -228,7 +226,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 校验用户是否有数据权限 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userId 用户id |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
@ -248,7 +246,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增保存用户信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -267,7 +265,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 注册用户信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -279,7 +277,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改保存用户信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -301,7 +299,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 用户授权角色 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userId 用户ID |
|
|
|
|
* @param roleIds 角色组 |
|
|
|
|
*/ |
|
|
|
@ -315,7 +313,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改用户状态 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -327,7 +325,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改用户基本信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -339,7 +337,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改用户头像 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userName 用户名 |
|
|
|
|
* @param avatar 头像地址 |
|
|
|
|
* @return 结果 |
|
|
|
@ -352,7 +350,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 重置用户密码 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户信息 |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -364,7 +362,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 重置用户密码 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userName 用户名 |
|
|
|
|
* @param password 密码 |
|
|
|
|
* @return 结果 |
|
|
|
@ -377,7 +375,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增用户角色信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户对象 |
|
|
|
|
*/ |
|
|
|
|
public void insertUserRole(SysUser user) |
|
|
|
@ -387,7 +385,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增用户岗位信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param user 用户对象 |
|
|
|
|
*/ |
|
|
|
|
public void insertUserPost(SysUser user) |
|
|
|
@ -410,7 +408,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增用户角色信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userId 用户ID |
|
|
|
|
* @param roleIds 角色组 |
|
|
|
|
*/ |
|
|
|
@ -433,7 +431,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过用户ID删除用户 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userId 用户ID |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -450,7 +448,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除用户信息 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userIds 需要删除的用户ID |
|
|
|
|
* @return 结果 |
|
|
|
|
*/ |
|
|
|
@ -472,7 +470,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 导入用户数据 |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
* @param userList 用户数据列表 |
|
|
|
|
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 |
|
|
|
|
* @param operName 操作用户 |
|
|
|
@ -540,4 +538,11 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
|
|
} |
|
|
|
|
return successMsg.toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<SysUser> queryUserByPhone(String phonenumber) { |
|
|
|
|
LambdaQueryWrapper<SysUser> wrapper=new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.select(SysUser::getUserId,SysUser::getPhonenumber).like(SysUser::getPhonenumber,phonenumber); |
|
|
|
|
return userMapper.selectList(wrapper); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|