|  |  | 
 |  |  | import com.zy.asrs.wcs.system.service.DeptService; | 
 |  |  | import com.zy.asrs.wcs.utils.ExcelUtil; | 
 |  |  | import com.zy.asrs.wcs.utils.NodeUtils; | 
 |  |  | import com.zy.asrs.wcs.utils.Utils; | 
 |  |  | import com.zy.asrs.wcs.utils.CommonUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  | 
 |  |  | //        PageParam<Dept, BaseParam> param = new PageParam<>(buildParam(map, BaseParam.class), Dept.class); | 
 |  |  | //        QueryWrapper<Dept> wrapper = param.buildWrapper(true, queryWrapper -> queryWrapper.orderByAsc("sort")); | 
 |  |  |         List<Dept> deptList = deptService.list(new LambdaQueryWrapper<Dept>().orderByAsc(Dept::getSort)); | 
 |  |  |         List<Dept> treeData = Utils.toTreeData(deptList, 0L, Dept::getParentId, Dept::getId, Dept::setChildren); | 
 |  |  |         List<Dept> treeData = CommonUtils.toTreeData(deptList, 0L, Dept::getParentId, Dept::getId, Dept::setChildren); | 
 |  |  |         if (!Cools.isEmpty(map.get("condition"))) { | 
 |  |  |             treeData = Utils.treeRemove(deptList, String.valueOf(map.get("condition")), Dept::getName, Dept::getChildren, Dept::setChildren); | 
 |  |  |             CommonUtils.treeRemove(treeData, String.valueOf(map.get("condition")), Dept::getName, Dept::getChildren); | 
 |  |  |             CommonUtils.treeRemove(treeData, String.valueOf(map.get("condition")), Dept::getName, Dept::getChildren); | 
 |  |  |         } | 
 |  |  |         return R.ok().add(treeData); | 
 |  |  |     } |