|
|
@@ -3,7 +3,6 @@ package com.hz.pm.api.user.manage; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hz.pm.api.common.model.constant.BizConst; |
|
|
|
import com.hz.pm.api.user.model.dto.MhUnitTreeDTO; |
|
|
|
import com.hz.pm.api.user.model.entity.MhUnit; |
|
|
|
import com.hz.pm.api.user.service.IMhUnitService; |
|
|
@@ -29,7 +28,7 @@ public class MhUnitManage { |
|
|
|
|
|
|
|
public List<MhUnitTreeDTO> getMhUnitTree() { |
|
|
|
LambdaQueryWrapper<MhUnit> query = Wrappers.lambdaQuery(MhUnit.class) |
|
|
|
.select(MhUnit::getSort, MhUnit::getId, MhUnit::getParentId, MhUnit::getName); |
|
|
|
.select(MhUnit::getId, MhUnit::getName, MhUnit::getParentId, MhUnit::getSort); |
|
|
|
List<MhUnit> units = mhUnitService.list(query); |
|
|
|
List<MhUnitTreeDTO> nodes = BeanUtil.copyToList(units, MhUnitTreeDTO.class); |
|
|
|
return TreeUtil.convertToTree(nodes, 0L); |
|
|
|