package com.njcn.user.controller;


import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.system.pojo.dto.AreaTreeDTO;
import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.user.pojo.param.DeptParam;
import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.po.Role;
import com.njcn.user.pojo.vo.DeptAllTreeVO;
import com.njcn.user.pojo.vo.DeptTreeVO;
import com.njcn.user.pojo.vo.DeptVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.user.service.IDeptService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * <p>
 * 前端控制器(部门信息)
 * </p>
 *
 * @author hongawen
 * @since 2021-12-13
 */
@Validated
@Slf4j
@RestController
@RequestMapping("/dept")
@Api(tags = "部门管理")
@AllArgsConstructor
public class DeptController extends BaseController {

    private final IDeptService deptService;

    /**
     * 分页查询部门信息
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/list")
    @ApiOperation("查询部门信息")
    @ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
    public HttpResult<Page<DeptVO>> list(@RequestBody @Validated DeptParam.QueryParam queryParam) {
        String methodDescribe = getMethodDescribe("list");
        LogUtil.njcnDebug(log, "{}，查询数据为：{}", methodDescribe, queryParam);
        Page<DeptVO> result = deptService.listDept(queryParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/getAreaTree")
    @ApiOperation("查询区域树")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "区域id",required = false),
            @ApiImplicitParam(name = "type", value = "区域类型", required = true)
    })
    public HttpResult<Object> getAreaTree(@RequestParam(required = false)@ApiParam("id")String id , @RequestParam("type") Integer type) {
        String methodDescribe = getMethodDescribe("getAreaTree");
        List<AreaTreeDTO> result = deptService.getAreaTree(id,type);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);

    }

    /**
     * 根据部门区域id获取父级部门下级所有区域
     * @author cdf
     * @date 2023/10/25
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/getPidAreaByAreaId")
    @ApiOperation("查询区域树")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "区域id"),
            @ApiImplicitParam(name = "type", value = "区域类型", required = true)
    })
    public HttpResult<List<AreaTreeDTO>> getPidAreaByAreaId(@RequestParam(required = false)@ApiParam("id")String id , @RequestParam("type") Integer type) {
        String methodDescribe = getMethodDescribe("getAreaTree");
        List<AreaTreeDTO> result = deptService.getPidAreaByAreaId(id,type);
        if (!result.isEmpty()) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
        }
    }


    /**
     * 新增部门
     *
     * @param deptParam 部门信息
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
    @PostMapping("/add")
    @ApiOperation("新增部门信息")
    @ApiImplicitParam(name = "deptParam", value = "部门信息数据", required = true)
    public HttpResult<Object> add(@RequestBody @Validated DeptParam deptParam) {
        String methodDescribe = getMethodDescribe("add");
        LogUtil.njcnDebug(log, "{}，部门信息数据为：{}", methodDescribe, deptParam);
        boolean result = deptService.addDept(deptParam);
        if (result) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
        }
    }

    /**
     * 修改部门信息
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
    @PostMapping("/update")
    @ApiOperation("修改部门信息")
    @ApiImplicitParam(name = "updateParam", value = "部门信息", required = true)
    public HttpResult<Object> update(@RequestBody @Validated DeptParam.DeptUpdateParam updateParam) {
        String methodDescribe = getMethodDescribe("update");
        LogUtil.njcnDebug(log, "{}，字典数据为：{}", methodDescribe, updateParam);
        boolean result = deptService.updateDept(updateParam);
        if (result) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
        }
    }

    /**
     * 批量删除部门信息
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
    @PostMapping("/delete")
    @ApiOperation("删除部门信息")
    @ApiImplicitParam(name = "ids", value = "部门索引", required = true)
    public HttpResult<Object> delete(@RequestBody List<String> ids) {
        String methodDescribe = getMethodDescribe("delete");
        LogUtil.njcnDebug(log, "{}，部门信息数据为：{}", methodDescribe, ids);
        boolean result = deptService.deleteDept(ids);
        if (result) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
        }
    }

    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/getDeptListByIds")
    @ApiOperation("根据部门id集合查询部门信息")
    @ApiImplicitParam(name = "ids", value = "部门id集合", required = true)
    public HttpResult<List<Dept>> getDeptListByIds(@RequestBody List<String> ids) {
        String methodDescribe = getMethodDescribe("getDeptListByIds");
        List<Dept> users = deptService.list((new LambdaQueryWrapper<Dept>().in(CollUtil.isNotEmpty(ids), Dept::getId, ids)));
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
    }


    /**
     * 判断是否有关联信息
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/selectPid")
    @ApiOperation("是否有关联信息")
    @ApiImplicitParam(name = "ids", value = "部门索引", required = true)
    public HttpResult<Object> selectPid(@RequestBody List<String> ids) {
        String methodDescribe = getMethodDescribe("selectPid");
        LogUtil.njcnDebug(log, "{}，查询数据为：{}", methodDescribe, ids);
        boolean result = deptService.selectPid(ids);
        if (result) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_EXIST, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
        }
    }

    /**
     * 获取部门树
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/deptTree")
    @ApiOperation("部门信息树")
    public HttpResult<Object> deptTree() {
        String methodDescribe = getMethodDescribe("deptTree");
        List<DeptTreeVO> result = deptService.deptTree();
         //删除返回失败，查不到数据返回空数组，兼容治理项目没有部门直接报错的bug
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);

    }

    /**
     * 获取部门树
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/deptTreeSelector")
    @ApiOperation("部门信息树")
    public HttpResult<List<Tree<String>>> deptTreeSelector() {
        String methodDescribe = getMethodDescribe("deptTreeSelector");
        List<Tree<String>> result = deptService.orgTreeSelector();
        //删除返回失败，查不到数据返回空数组，兼容治理项目没有部门直接报错的bug
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);

    }

    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/existMonitorDeptTree")
    @ApiOperation("获取部门树（存在监测点的）")
    public HttpResult<List<DeptTreeVO>> existMonitorDeptTree(){
        String methodDescribe = getMethodDescribe("deptTree");
        List<DeptTreeVO> result = deptService.existMonitorDeptTree();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }


    /**
     * 根据条件获取后代部门索引
     *
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/getDeptDescendantIndexes")
    @ApiOperation("获取后代部门索引")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "部门id", required = true),
            @ApiImplicitParam(name = "type", value = "部门类型", required = true)
    })
    public HttpResult<List<DeptDTO>> getDeptDescendantIndexes(@RequestParam("id") String id, @RequestParam("type") List<Integer> type) {
        String methodDescribe = getMethodDescribe("getDeptDescendantIndexes");
        List<DeptDTO> deptInfos = deptService.getDeptDescendantIndexes(id,type);
        if (CollectionUtil.isEmpty(deptInfos)) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptInfos, methodDescribe);
        }
    }

    /**
     * 功能描述: 根据区域索引获取部门索引
     *
     * @author xy
     * @date 2022/2/14 15:04
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDeptIdByArea")
    @ApiOperation("根据区域索引获取部门索引")
    @ApiIgnore
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "区域id", required = true)
    })
    public HttpResult<String> getDeptIdByArea(@RequestParam("area") String area) {
        String methodDescribe = getMethodDescribe("getDeptIdByArea");
        String deptId = deptService.getDeptIdByArea(area);
        if (Objects.isNull(deptId)) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptId, methodDescribe);
        }
    }

    /**
     * 功能描述: 根据区域索引获取部门索引
     *
     * @author denghuajun
     * @date 2022/2/24 15:04
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getAreaIdByDeptId")
    @ApiOperation("根据区域索引获取部门索引")
    @ApiImplicitParam(name = "deptId", value = "部门id", required = true)
    public HttpResult<String> getAreaIdByDeptId(@RequestParam("deptId") String deptId) {
        String methodDescribe = getMethodDescribe("getAreaIdByDeptId");
        String areaId = deptService.getAreaIdByDeptId(deptId);
        if (Objects.isNull(areaId)) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
        } else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, areaId, methodDescribe);
        }
    }


    /**
     * 根据登录用户获取部门树
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/loginDeptTree")
    @ApiOperation("根据登录用户获取部门树")
    public HttpResult<Object> loginDeptTree() {
        String methodDescribe = getMethodDescribe("loginDeptTree");
        List<DeptAllTreeVO> result = deptService.loginDeptTree();
        if (!result.isEmpty()) {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
        } else {

            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
        }
    }

    /**
     * 获取所有的部门
     * @author cdf
     * @date 2022/7/12
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/allDeptList")
    @ApiOperation("获取所有单位")
    public HttpResult<List<PvTerminalTreeVO>> allDeptList() {
        String methodDescribe = getMethodDescribe("allDeptList");
        List<PvTerminalTreeVO> result = deptService.allDeptList();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

    /**
     * 根据部门Id获取部门信息
     * @author cdf
     * @date 2022/7/12
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDeptById")
    @ApiOperation("根据部门Id获取部门信息")
    public HttpResult<Dept> getDeptById(@RequestParam("deptId")String deptId) {
        String methodDescribe = getMethodDescribe("getDeptById");
        Dept result = deptService.getDeptById(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

    /**
     * 根据部门code获取部门信息
     * @author cdf
     * @date 2022/7/12
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDeptByCode")
    @ApiOperation("根据部门code获取部门信息")
    public HttpResult<Dept> getDeptByCode(@RequestParam("deptCode")String deptCode) {
        String methodDescribe = getMethodDescribe("getDeptByCode");
        Dept result = deptService.getDeptByCode(deptCode);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }


    /**
     * 根据部门id获取所有子部门ids包含自身
     * @author cdf
     * @date 2022/7/26
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDepSonIdtByDeptId")
    @ApiOperation("根据部门id获取所有子部门ids")
    public HttpResult<List<String>> getDepSonIdtByDeptId(@RequestParam("deptId")String deptId) {
        String methodDescribe = getMethodDescribe("getDepSonIdtByDeptId");
        List<String> deptList = deptService.getDepSonIdtByDeptId(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
    }

    /**
     * 根据部门id获取所有子部门的code(pms项目专用)
     * @author cdf
     * @date 2022/11/25
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDepSonSelfCodetByDeptId")
    @ApiOperation("根据部门id获取所有子部门以及自身的code")
    public HttpResult<List<String>> getDepSonSelfCodetByDeptId(@RequestParam("deptId")String deptId) {
        String methodDescribe = getMethodDescribe("getDepSonSelfCodetByDeptId");
        List<String> deptList = deptService.getDepSonSelfCodetByDeptId(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
    }

    /**
     * 根据部门id获取子部门ids
     * @author dhj
     * @date 2022/10/09
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDepSonIdByDeptId")
    @ApiOperation("根据部门id获取子部门ids")
    public HttpResult<List<String>> getDepSonIdByDeptId(@RequestParam("deptId")String deptId) {
        String methodDescribe = getMethodDescribe("getDepSonIdByDeptId");
        List<String> deptList = deptService.getDepSonIdByDeptId(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
    }


    /**
     * 根据部门id获取直接子部门及自身
     * @param deptId 部门编号
     * @author cdf
     * @date 2022/12/1
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDirectSonSelf")
    @ApiOperation("根据部门id获取直接子部门及自身")
    public HttpResult<List<Dept>> getDirectSonSelf(@RequestParam("deptId")String deptId){
        String methodDescribe = getMethodDescribe("getDirectSonSelf");
        List<Dept> deptList = deptService.getDirectSonSelf(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);

    }


    /**
     * 获取所有本部单位
     * @author cdf
     * @date 2022/12/8
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getSpecialDeptList")
    @ApiOperation("获取所有本部单位")
    public HttpResult<List<Dept>> getSpecialDeptList(){
        String methodDescribe = getMethodDescribe("getSpecialDeptList");
        List<Dept> deptList = deptService.getSpecialDeptList();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);

    }


    /**
     * 获取最高级部门
     * @author cdf
     * @date 2023/1/6
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getRootDept")
    @ApiOperation("获取根部门")
    public HttpResult<Dept> getRootDept(){
        String methodDescribe = getMethodDescribe("getRootDept");
        Dept dept = deptService.getRootDept();
        if(Objects.nonNull(dept)){
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dept, methodDescribe);
        }else {
            return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
        }
    }
    /**
    * @Description: "获取当前部门的的下级子部门list，如果没子部门就是返回当前部门
    * @Author: clam
    * @Date: 2023/1/10
    */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDepSonDetailIdByDeptId")
    @ApiOperation("获取当前部门的的下级子部门list，如果没子部门就是返回当前部门")
    public HttpResult<List<DeptDTO>> getDepSonDetailByDeptId(@RequestParam("deptId")String deptId) {
        String methodDescribe = getMethodDescribe("getDepSonDetailByDeptId");
        List<DeptDTO> deptList = deptService.getDepSonDetailByDeptId(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
    }


    /**
     * 根据部code获取所有子部门以及自身的code
     * @author cdf
     * @date 2023/2/21
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getDepSonSelfCodetByCode")
    @ApiOperation("根据部门code获取所有子部门以及自身的code")
    public HttpResult<List<String>> getDepSonSelfCodetByCode(@RequestParam("code")String code) {
        String methodDescribe = getMethodDescribe("getDepSonSelfCodetByCode");
        List<String> deptList = deptService.getDepSonSelfCodetByCode(code);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
    }


    /**
     * 根据部门id查询当前部门所有父级部门id
     * @param deptId 部门id
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getUpByDeptIds")
    @ApiOperation("根据部门id查询当前部门所有父级部门id")
    @ApiImplicitParam(name = "deptId", value = "用户部门id", required = true)
    public HttpResult<List<String>> getUpByDeptIds(@RequestParam("deptId") String deptId) {
        String methodDescribe = getMethodDescribe("getUpByDeptIds");
        List<String> users = deptService.getUpByDeptIds(deptId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
    }
    /*++++++++++++++++++++++++++++++++pms专用+++++++++++++++++++++++++++++++begin*/

    /**
     * 根据单位集合查询对应部门
     * @param list code集合
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/getDeptByCodeList")
    @ApiOperation("根据单位集合查询对应部门")
    @ApiImplicitParam(name = "list", value = "code集合", required = true)
    public HttpResult<List<Dept>> getDeptByCodeList(@RequestBody List<String> list) {
        String methodDescribe = getMethodDescribe("getDeptByCodeList");
        List<Dept> result = deptService.getDeptByCodeList(list);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }


    /**
     * 根据部门ids获取部门集合
     * @author cdf
     * @date 2024/2/29
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @PostMapping("/getDeptInfoListByIds")
    @ApiOperation("根据部门ids获取部门集合")
    @ApiImplicitParam(name = "deptIds", value = "code集合", required = true)
    public HttpResult<List<Dept>> getDeptInfoListByIds(@RequestBody List<String> deptIds) {
        String methodDescribe = getMethodDescribe("getDeptInfoListByIds");
        List<Dept> result = deptService.getDeptInfoListByIds(deptIds);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

    /**
     * 获取所有的部门集合
     * @author xy
     * @date 2023/12/11
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getAllDept")
    @ApiOperation("获取所有单位")
    public HttpResult<List<Dept>> getAllDept() {
        String methodDescribe = getMethodDescribe("getAllDept");
        List<Dept> result = deptService.getAllDept();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

    /**
     * 获取所有的部门集合
     * @author xy
     * @date 2023/12/11
     */
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/orgTreeSelector")
    @ApiOperation("获取所有单位树")
    public HttpResult<List<Tree<String>>> orgTreeSelector() {
        String methodDescribe = getMethodDescribe("orgTreeSelector");
        List<Tree<String>> result = deptService.orgTreeSelector();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }
    /*++++++++++++++++++++++++++++++++pms专用+++++++++++++++++++++++++++++++end*/

}

