|
|
|
@ -8,12 +8,12 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.supervision.knowsub.domain.UserInfo;
|
|
|
|
|
import com.supervision.knowsub.dto.role.UserRoleDTO;
|
|
|
|
|
import com.supervision.knowsub.dto.user.UserPageQuery;
|
|
|
|
|
import com.supervision.knowsub.exception.BusinessException;
|
|
|
|
|
import com.supervision.knowsub.model.SystemDept;
|
|
|
|
|
import com.supervision.knowsub.model.SystemRole;
|
|
|
|
|
import com.supervision.knowsub.model.SystemUser;
|
|
|
|
|
import com.supervision.knowsub.service.SystemDeptService;
|
|
|
|
|
import com.supervision.knowsub.service.UserManageService;
|
|
|
|
@ -66,7 +66,7 @@ public class UserManageServiceImpl implements UserManageService {
|
|
|
|
|
LoginResVO loginResVO = BeanUtil.toBean(user.get(), LoginResVO.class);
|
|
|
|
|
loginResVO.setToken(token);
|
|
|
|
|
loginResVO.setUsername(user.get().getUsername());
|
|
|
|
|
List<UserRoleDTO> userRoleDTOS = userRoleRelationManageService.listUserRole(user.get().getId(),null);
|
|
|
|
|
List<UserRoleDTO> userRoleDTOS = userRoleRelationManageService.listUserRole(user.get().getId(),null,null);
|
|
|
|
|
loginResVO.setUserRoleDTOList(userRoleDTOS);
|
|
|
|
|
// 获取用户的部门
|
|
|
|
|
Optional<SystemDept> optById = systemDeptService.getOptById(user.get().getDeptId());
|
|
|
|
@ -155,11 +155,14 @@ public class UserManageServiceImpl implements UserManageService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IPage<UserInfoDTO> list(String userName, String deptId, String roleId, Integer pageNum, Integer pageSize) {
|
|
|
|
|
public IPage<UserInfoDTO> list(String userName, String deptId, String roleId,String roleName, Integer pageNum, Integer pageSize) {
|
|
|
|
|
|
|
|
|
|
List<UserRoleDTO> userRoleDTOS = new ArrayList<>();
|
|
|
|
|
if (StrUtil.isNotEmpty(roleId)){
|
|
|
|
|
userRoleDTOS = userRoleRelationManageService.listUserRole(null, roleId);
|
|
|
|
|
if (StrUtil.isNotEmpty(roleId) || StrUtil.isNotEmpty(roleName)){
|
|
|
|
|
userRoleDTOS = userRoleRelationManageService.listUserRole(null, roleId, roleName);
|
|
|
|
|
if (CollUtil.isEmpty(userRoleDTOS)){
|
|
|
|
|
return Page.of(pageNum, pageSize, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//构建查询条件
|
|
|
|
|
UserPageQuery userPageQuery = UserPageQuery.builder().userName(userName).deptId(deptId)
|
|
|
|
|