|
@@ -1,5 +1,7 @@
|
|
|
package org.eco.als.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.lang.tree.Tree;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
import jakarta.annotation.Resource;
|
|
@@ -13,6 +15,8 @@ import org.eco.als.mapper.AircraftMapper;
|
|
|
import org.eco.als.service.IAircraftService;
|
|
|
import org.eco.common.core.core.domain.model.LoginUser;
|
|
|
import org.eco.common.core.utils.MapstructUtils;
|
|
|
+import org.eco.common.core.utils.SpringUtils;
|
|
|
+import org.eco.common.core.utils.TreeBuildUtils;
|
|
|
import org.eco.common.excel.entity.ExcelResultRes;
|
|
|
import org.eco.common.excel.service.IExcelService;
|
|
|
import org.eco.common.orm.core.service.impl.BaseServiceImpl;
|
|
@@ -94,6 +98,24 @@ public class AircraftServiceImpl extends BaseServiceImpl<AircraftMapper, Aircraf
|
|
|
return this.listAs(queryWrapper, AircraftVo.class);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Tree<Long>> selectTree(AircraftBo aircraftBo) {
|
|
|
+ List<AircraftVo> list = SpringUtils.getAopProxy(this).selectList(aircraftBo);
|
|
|
+ return buildTree(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Tree<Long>> buildTree(List<AircraftVo> aircraftVoList) {
|
|
|
+ if (CollUtil.isEmpty(aircraftVoList)) {
|
|
|
+ return CollUtil.newArrayList();
|
|
|
+ }
|
|
|
+ return TreeBuildUtils.build(aircraftVoList, (dept, tree) ->
|
|
|
+ tree.setId(dept.getId())
|
|
|
+ .setParentId(dept.getParentId())
|
|
|
+ .setName(dept.getName())
|
|
|
+ .setWeight(dept.getOrderNum()));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 新增机型机号
|