|
|
@@ -2,6 +2,7 @@ package com.jzg.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -20,6 +21,8 @@ import com.jzg.mapper.SysRoleMapper;
|
|
|
import com.jzg.mapper.SysUserPlateInfoMapper;
|
|
|
import com.jzg.service.SysUserService;
|
|
|
import com.jzg.commons.util.PasswordUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -39,6 +42,8 @@ import java.util.stream.Collectors;
|
|
|
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
|
|
implements SysUserService {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private SysRoleMapper sysRoleMapper;
|
|
|
@Autowired
|
|
|
@@ -48,10 +53,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
|
|
|
|
|
@Override
|
|
|
public Page<SysUserVo> queryPage(Page page, SysUserParam param) {
|
|
|
+ log.info("查询成员信息:param=[{}]", JSONUtil.toJsonStr(param));
|
|
|
Page<SysUserVo> userPage = baseMapper.queryPage(page, param);
|
|
|
List<SysUserVo> userList = userPage.getRecords();
|
|
|
if (!userList.isEmpty()) {
|
|
|
- List<String> userIdList = userList.stream().map(user -> user.getId()).collect(Collectors.toList());
|
|
|
+ List<String> userIdList = userList.stream().map(SysUserVo::getId).collect(Collectors.toList());
|
|
|
// 批量查询 角色信息
|
|
|
List<SysUserRole> roleIds = sysRoleMapper.queryByUserIds(userIdList);
|
|
|
Map<String,List<SysUserRole>> nameMap = roleIds.stream()
|
|
|
@@ -73,12 +79,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public SysUserVo queryById(String id) {
|
|
|
- SysUser user = this.baseMapper.selectById(id);
|
|
|
+ public SysUserVo queryById(String userId) {
|
|
|
+ log.info("根据用户序号查询平台用户[{}]",userId);
|
|
|
+ SysUser user = this.baseMapper.selectById(userId);
|
|
|
SysUserVo vo = new SysUserVo();
|
|
|
BeanUtils.copyProperties(user, vo);
|
|
|
List<SysUserPlateInfo> infos = sysUserPlateInfoMapper.selectList(new LambdaQueryWrapper<SysUserPlateInfo>()
|
|
|
- .eq(SysUserPlateInfo::getUserId, id));
|
|
|
+ .eq(SysUserPlateInfo::getUserId, userId));
|
|
|
if(CollUtil.isNotEmpty(infos)){
|
|
|
vo.setIsEnable(infos.get(0).getIsEnable());
|
|
|
}
|