Browse Source

modify:

1. 过滤掉无角色用户;
tags/24110601
WendyYang 4 weeks ago
parent
commit
28bdc7b17a
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/user/manage/MhUnitManage.java

+ 4
- 2
hz-pm-api/src/main/java/com/hz/pm/api/user/manage/MhUnitManage.java View File

@@ -9,6 +9,7 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hz.pm.api.common.model.constant.ExistsSqlConst;
import com.hz.pm.api.common.model.constant.MhUnitConst;
import com.hz.pm.api.common.util.StrUtils;
import com.hz.pm.api.external.model.enumeration.MhUnitTypeEnum;
@@ -190,11 +191,12 @@ public class MhUnitManage {
LambdaQueryWrapper<UserInfo> userQuery = Wrappers.lambdaQuery(UserInfo.class)
.select(UserInfo::getMhUnitId, UserInfo::getId, UserInfo::getRealName)
.in(!viewUnitIds.isEmpty(), UserInfo::getMhUnitId, viewUnitIds)
.exists(ExistsSqlConst.USER_EXISTS_ROLE)
.gt(UserInfo::getMhUnitId, 0);
if (hasName) {
// 查询满足名字的
userQuery.like(UserInfo::getRealName, req.getName())
.last("limit 500");
.last("limit 50");
} else if (hasId) {
List<UnitDTO> units = mhUnitCache.listByIds(viewUnitIds);
selectedUnits.addAll(CollUtils.convert(units, this::getMhUnitUserTree));
@@ -224,7 +226,7 @@ public class MhUnitManage {
MhUnitUserTreeDTO node = new MhUnitUserTreeDTO();
node.setSort(unit.getSort());
node.setName(unit.getName());
node.setName(unit.getShortName());
node.setShortName(unit.getShortName());
node.setBizId(unit.getId());
node.setParentId(UnitUserNodeType.UNIT.name() + "#" + unit.getParentId());
node.setId(UnitUserNodeType.UNIT.name() + "#" + unit.getId());


Loading…
Cancel
Save