package com.hotent.portal.persistence.manager;

import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Map;

import com.hotent.base.manager.BaseManager;
import com.hotent.base.model.CommonResult;
import com.hotent.portal.model.PortalMeetingApply;

/**
 * 会议室申请 服务类
 *
 * @company 广州宏天软件股份有限公司
 * @author zhangxw
 * @email zhangxw@jee-soft.cn
 * @since 2021-06-25
 */
public interface PortalMeetingApplyManager extends BaseManager<PortalMeetingApply> {
	
	/**
	 * 会议室申请
	 * @param meetingApply
	 * @return
	 * @throws IOException 
	 * @throws Exception 
	 */
	CommonResult<String> apply(PortalMeetingApply meetingApply) throws IOException, Exception;
	
	/**
	 * 根据实例id更新会议申请数据状态
	 * @param instId
	 * @param status
	 * @return
	 * @throws IOException 
	 * @throws Exception 
	 */
	CommonResult<String> updateByInstId(String instId,String status,String busData) throws IOException, Exception;
	
	/**
	 * 根据实例id获取会议申请数据
	 * @param instId
	 * @return
	 */
	PortalMeetingApply getByInstId(String instId);
	
	/**
	 * 会议室申请校验
	 * @param roomId
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	CommonResult<String> verifyApply(String applyId,String roomId,LocalDateTime startTime,LocalDateTime endTime);
	
	/**
	 * 统计会议室申请数量
	 * @param ownerId
	 * @param roomId
	 * @return
	 * @throws Exception 
	 */
	Map<String,Integer> getApplyCount(String ownerId,String roomId) throws Exception;
}
