package com.engine.organization.service;

import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.department.param.*;
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.page.PageInfo;

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

/**
 * @Author weaver_cl
 * @description:
 * @Date 2022/5/20
 * @Version V1.0
 **/
public interface DepartmentService {

    /**
     * 根据分部id获取部门tree
     * 联查部门
     *
     * @param param
     * @return
     */
    PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param);

    /**
     * 部门联查岗位
     *
     * @param param
     * @return
     */
    PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param);


    /**
     * 列表左侧树
     *
     * @return
     */
    Map<String, Object> getSearchTree(SearchTreeParams params);

    /**
     * 列表数据展示
     *
     * @param param
     * @return
     */
    Map<String, Object> listPage(DeptSearchParam param);

    /**
     * 保存部门基础信息
     *
     * @param params
     * @return
     */
    Long saveBaseForm(Map<String, Object> params);

    /**
     * 更新禁用标记
     *
     * @param params
     */
    int updateForbiddenTagById(DeptSearchParam params);


    /**
     * 更新分部主表、拓展表、明细表
     *
     * @param params
     * @return
     */
    Long updateForm(Map<String, Object> params);


    /**
     * 根据ID批量删除
     *
     * @param ids
     */
    int deleteByIds(Collection<Long> ids);

    /**
     * 获取搜索条件
     *
     * @param params
     * @return
     */
    Map<String, Object> getSearchCondition(Map<String, Object> params);

    /**
     * 获取列表页面按钮信息
     *
     * @return
     */
    Map<String, List<MenuBtn>> getHasRight();

    /**
     * 获取基本信息表单
     *
     * @param params
     * @return
     */
    Map<String, Object> getDeptBaseForm(Map<String, Object> params);


    /**
     * 获取新增表单
     *
     * @return
     */
    Map<String, Object> getSaveForm(DeptSearchParam param);

    /**
     * 复制表单
     *
     * @return
     */
    List<SearchConditionGroup> getCopyForm();

    /**
     * 复制岗位到指定部门
     *
     * @param copyParam
     * @return
     */
    int copyDepartment(DeptCopyParam copyParam);

    /**
     * 获取合并表单
     *
     * @return
     */
    List<SearchConditionGroup> getMergeForm(Long id);

    /**
     * 合并到指定部门
     *
     * @param mergeParam
     * @return
     */
    int mergeDepartment(DepartmentMergeParam mergeParam);

    /**
     * 获取转移表单
     *
     * @return
     */
    List<SearchConditionGroup> getMoveForm();

    /**
     * 转移到指定分部或部门
     *
     * @param moveParam
     * @return
     */
    int moveDepartment(DepartmentMoveParam moveParam);

}
