|
|
@@ -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()); |
|
|
|