use of vip.mate.system.entity.SysUser in project matecloud by matevip.
the class SysUserServiceImpl method export.
@Override
public List<SysUserPOI> export() {
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysUser::getIsDeleted, "0");
List<SysUser> sysUsers = this.baseMapper.selectList(queryWrapper);
return sysUsers.stream().map(sysUser -> {
SysUserPOI sysUserPoi = new SysUserPOI();
BeanUtils.copyProperties(sysUser, sysUserPoi);
sysUserPoi.setDepartName(sysDepartService.getById(sysUser.getDepartId()).getName());
sysUserPoi.setRoleName(sysRoleService.getById(sysUser.getRoleId()).getRoleName());
sysUserPoi.setStatusName(dictService.getValue("status", sysUser.getStatus()).getData());
return sysUserPoi;
}).collect(Collectors.toList());
}
use of vip.mate.system.entity.SysUser in project matecloud by matevip.
the class SysUserServiceImpl method status.
@Override
public boolean status(String ids, String status) {
Collection<? extends Serializable> collection = CollectionUtil.stringToCollection(ids);
if (ObjectUtils.isEmpty(collection)) {
throw new BaseException("传入的ID值不能为空!");
}
collection.forEach(id -> {
SysUser sysUser = this.baseMapper.selectById(CollectionUtil.objectToLong(id, 0L));
sysUser.setStatus(status);
this.baseMapper.updateById(sysUser);
});
return true;
}
use of vip.mate.system.entity.SysUser in project matecloud by matevip.
the class SysUserProvider method getUserById.
@Override
@GetMapping(ProviderConstant.PROVIDER_USER_ID)
@Log(value = "用户ID查询", exception = "用户ID查询请求失败")
@ApiOperation(value = "用户ID查询", notes = "用户ID查询")
public Result<SysUser> getUserById(Long id) {
SysUser sysUser = sysUserService.getById(id);
// 测试日志埋点
TrackUtil.info(SysUserProvider.class.getName(), "userInfoById", JSON.toJSONString(sysUser));
return Result.data(sysUser);
}
use of vip.mate.system.entity.SysUser in project matecloud by matevip.
the class UserDetailsServiceImpl method getUserDetails.
private UserDetails getUserDetails(UserInfo userInfo) {
if (ObjectUtils.isEmpty(userInfo)) {
log.info("该用户:{} 不存在!", userInfo.getUserName());
throw new TokenException("该用户:" + userInfo.getUserName() + "不存在");
} else if (DISABLE.equals(userInfo.getSysUser().getStatus())) {
log.info("该用户:{} 已被停用!", userInfo.getUserName());
throw new TokenException("对不起,您的账号:" + userInfo.getUserName() + " 已停用");
}
SysUser user = userInfo.getSysUser();
log.info("用户名:{}", userInfo.getSysUser().getAccount());
Collection<? extends GrantedAuthority> authorities = AuthorityUtils.createAuthorityList(Convert.toStrArray(userInfo.getRoleIds()));
log.info("authorities: {}", authorities);
return new MateUser(user.getId(), userInfo.getType(), user.getDepartId(), user.getRoleId(), user.getTelephone(), user.getAvatar(), user.getTenantId(), userInfo.getUserName(), user.getPassword(), ENABLE.equals(user.getStatus()), true, true, true, authorities);
}
Aggregations