/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.security.trans.basic.service;

import org.security.trans.basic.dto.DepartmentDTO;
import org.security.ht.entity.basic.Department;
import org.security.ht.vo.basic.DepartmentVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.security.ht.vo.basic.DeptDataVO;
import org.security.ht.vo.basic.MapDeptDataVO;
import org.security.ht.vo.basic.RoleDataVO;
import org.springblade.core.tool.api.R;

import java.util.List;
import java.util.Map;

/**
 * 基础信息-组织机构 服务类
 *
 * @author BladeX
 * @since 2022-03-07
 */
public interface IDepartmentService extends IService<Department> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param department
	 * @return
	 */
	IPage<DepartmentVO> selectDepartmentPage(IPage<DepartmentVO> page, DepartmentVO department);

	/**
	 * 懒加载树
	 * @param param
	 * @param parentId
	 * @return
	 */
	List<DepartmentVO> lazyList(Map<String, Object> param, String parentId);
	/**
	 * 懒加载树for任务下发
	 * @param param
	 * @param parentId
	 * @return
	 */
	List<DepartmentVO> lazyListForTask(Map<String, Object> param, String parentId);

	/**
	 * 根据id获取详情
	 * @param id
	 * @return
	 */
	DeptDataVO getDepartmentById(Long id);

	/**
	 * 联级选择器树结构
	 * @return
	 */
	List<DepartmentVO> cascadeSelection();

	/**
	 * 部门树
	 * @param departmentDTO
	 * @return
	 */
	List<DepartmentVO> tree(DepartmentDTO departmentDTO);


	/**
	 * 完善机构资料
	 * @param departmentDTO 机构明细资料
	 * @return
	 */
	boolean updateDeptData(DepartmentDTO departmentDTO);
	/**
	 * 完善机构资料
	 * @param departmentDTO 机构明细资料
	 * @return
	 */
	R addSelfBank(DepartmentDTO departmentDTO);

	/**
	 * 根据部门id获取相关角色id
	 * @param deptId
	 */
	List<RoleDataVO> getData(String deptId);

	/**
	 * 根据topDeptId获取子级部门树
	 * @param topDeptId
	 * @return
	 */
	List<DepartmentVO> getChildDeptTree(String topDeptId);

	/**
	 * 获取机构地图数据
	 * @return
	 */
	List<MapDeptDataVO> getDeptMapDetail();

	/**
	 * 消息总线信息同步，更新机构信息
	 * @param departmentList
	 * @return
	 */
	boolean saveDepartmentData(List<Department> departmentList);

	List<DepartmentVO> getSelfBankData();

	List<Department> getBudgetDept();

}
