#
luxiaotao1123
2024-04-12 d6201c37c34681b11d6eeb5d3fa2008991d9f370
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/DeptController.java
@@ -12,7 +12,7 @@
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.*;
@@ -47,10 +47,10 @@
//        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"))) {
            Utils.treeRemove(treeData, String.valueOf(map.get("condition")), Dept::getName, Dept::getChildren);
            Utils.treeRemove(treeData, String.valueOf(map.get("condition")), Dept::getName, Dept::getChildren);
            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);
    }