package com.jpsoft.shinestar.modules.business.service;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
import com.jpsoft.shinestar.modules.base.entity.PersonPopedom;
import com.jpsoft.shinestar.modules.business.entity.RequestForLeaveInfo;
import com.github.pagehelper.Page;
import com.jpsoft.shinestar.modules.common.dto.Sort;

public interface RequestForLeaveInfoService {
	RequestForLeaveInfo get(String id);
	boolean exist(String id);
	int insert(RequestForLeaveInfo model);
	int update(RequestForLeaveInfo model);
	int delete(String id);
	List<RequestForLeaveInfo> list();
	Page<RequestForLeaveInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
    Page<RequestForLeaveInfo> pageMobileSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
    Set<String> findHalfDaysByPersonIdAndDate(Long personId, Date startDate, Date endDate);

	List<RequestForLeaveInfo> findByPersonIdAndDate(Long personId, Date startTime, Date endTime);

	RequestForLeaveInfo findByPersonId(Long personId,String requestForLeaveTime) throws ParseException;

	List<RequestForLeaveInfo> findByPersonAndStatus(Long personId, String status);

    void approvalRequestForLeave(PersonInfo personInfo, String id, String approvalOpinions, String approvalExplain, int status) throws Exception;

    String leaveSubmit(PersonPopedom personPopedom, String type, String startTime, String endTime, String startTimeQuantum, String endTimeQuantum, String imageUrl, String reason, String days, String formId,String activityId,String draft,String id) throws Exception;

	List<RequestForLeaveInfo> findByPersonIdAndAttendanceDate(Long personId, Date attendanceDate);

    void logic(RequestForLeaveInfo requestForLeaveInfo1) throws Exception;

    List<RequestForLeaveInfo> listSearch(Map<String, Object> searchParams, List<Sort> sortList);

	String cancelLeaveSubmit(PersonPopedom personPopedom, String id, String imageUrl, String formId) throws Exception;

    BigDecimal sumDaysByPersonIdAndTimeRange(Long personId, Date startDate, Date endDate);
}