/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.service.sysmgr.service;

import com.crunii.micro.common.dto.PageReq;
import com.crunii.micro.common.dto.PageRsp;
import com.crunii.micro.common.dto.Result;
import com.crunii.micro.common.dto.PageReq;
import com.crunii.micro.common.dto.PageRsp;
import com.crunii.micro.common.dto.PageReq;
import com.crunii.micro.common.dto.PageRsp;
import com.crunii.micro.common.dto.Result;
import com.crunii.micro.domain.dto.Worker;
import com.crunii.micro.domain.entity.main.TsmOrg;
import com.crunii.micro.service.sysmgr.api.domain.dto.OrgNode;
import com.crunii.micro.service.sysmgr.api.domain.dto.OrgSimpleVO;
import com.crunii.micro.service.sysmgr.dto.ChildrenStatisticsRspVO;
import com.crunii.micro.service.sysmgr.dto.org.*;
import com.crunii.micro.service.sysmgr.dto.sysmgr.OrgDto;
import com.crunii.micro.service.sysmgr.dto.sysmgr.OrgTabulationDto;
import com.crunii.micro.service.sysmgr.dto.sysmgr.YcqLeagueTreeVo;
import com.crunii.micro.service.sysmgr.dto.sysmgr.OrgTabulationDto;

import java.util.List;
import java.util.Set;

/**
 * @author 田平 create 2021/4/25 14:23
 */
public interface OrgService {

	TsmOrg getTsmOrg(Long orgId);

	/**
	 * 修改组织
	 * @param orgU
	 * @return
	 */
	public void updateOrg(OrgU orgU);

	/**
	 * 创建组织
	 * @param orgC
	 * @return
	 */
	Long createOrg(OrgC orgC);

	/**
	 * 校验组织编码是否存在
	 * @param orgCode
	 * @return
	 */
	boolean checkOrgCode(String orgCode);

	/**
	 * 通过父组织Id获取子组织
	 * @param parentOrgId
	 * @return
	 */
	List<OrgNode> getOrgChildren(Long parentOrgId, Integer registrationSystemType);

	/**
	 * 通过父组织Ids获取子组织
	 * @param parentOrgIds
	 * @return
	 */
	List<OrgSimpleVO> getChildrenByParentOrgIds(List<Long> parentOrgIds);


	/**
	 * 通过父组织Id获取子组织(数据权限过滤)
	 * @param parentOrgId
	 * @return
	 */
	List<OrgNode> getOrgChildrenByParentOrgId(Long parentOrgId);

	/**
	 * 模糊查询组织
	 * @param orgDto 查询条件
	 * @return data
	 */
	List<OrgNode> findOrg(OrgDto orgDto);

	/**
	 * 获取所有子组织
	 * @param parentOrgId
	 * @return
	 */
	Set<OrgNode> getAllOrgChildren(Long parentOrgId);

	List<OrgTreeDto> getOrgChildrenTree(Worker worker, OrgTreeReqDto param);

	List<OrgTreeDto> getOrgTreeAuthority(Worker worker, OrgTreeAuthorityReqDto req);

	List<TsmOrg> getOrgByZoneId(Long zoneId);

	TsmOrg getOrgByOrgName(String orgName);

	PageRsp<ChildrenOrgRspVO> pageChildrenOrg(PageReq<ChildrenOrgReqVO> childrenOrgReqVO);

	Result<Object> deleteOrg(Long orgId);

	Result<Object> moveDataList(MoveDataListDto dto);

	Result<Object> exportOrgTabulation(OrgTabulationDto dto);

	void updateTeamOrg(Worker worker,TeamOrgC teamOrgC);

	Long createTeamOrg(Worker worker,TeamOrgC teamOrgC);

	Boolean doManagePeople(Worker worker, OrgManPeopleC orgManPeopleC);
	void orgSortData(Long orgId, Long sortId);

	Result<Object> exportAllOrg(OrgTabulationDto dto, Worker worker);

	/**
	 * 查询指定父级以及下级
	 * @return
	 */
	List<OrgTreeOneDto> getOrgByOne();

	PageRsp<ChildrenStatisticsRspVO> pageChildrenStatistics(PageReq<ChildrenOrgReqVO> childrenOrgReqVO);

	void exportChildrenStatistics(ChildrenOrgReqVO dto);

	List<OrgTreeDto> getOrgTreeAuthList(Worker worker, OrgTreeAuthorityReqDto req);

	List<OrgTreeDto> getOrgBySystem(String affiliatingSystem);

	/**
	 * 团组织统计导出
	 * @author leixb
	 * @since 2024-01-24 10:58
	 */
    void exportOrgStatistics();
	
}
