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

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.jpsoft.shinestar.modules.base.entity.BusinessOut;
import com.github.pagehelper.Page;
import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
import com.jpsoft.shinestar.modules.base.entity.PersonPopedom;
import com.jpsoft.shinestar.modules.common.dto.Sort;

public interface BusinessOutService {
	BusinessOut get(String id);
	boolean exist(String id);
	int insert(BusinessOut model);
	int update(BusinessOut model);
	int delete(String id);
	List<BusinessOut> list();
	Page<BusinessOut> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
    void approvalBusinessOut(PersonInfo personInfo, String ids, String status, String approvalContent,String nextApprovalId) throws Exception;
    void updatePersonWorkStatus(BusinessOut businessOut);
    BusinessOut findLastActiveByPersonId(Long personId);

	List<BusinessOut> findByPersonPopedomAndEndTimeIsNull(String personPopedomId);

    List<BusinessOut> findByPersonIdAndDate(Long personId, Date attendanceDate);

    String submitBusiness(PersonPopedom personPopedom, String type, String destination, String startTime,String endTime,String days, String estimatedTime, String content,String formId,String ids,String draft) throws Exception;

    void logic(BusinessOut businessOut) throws Exception;

    List<BusinessOut> listSearch(Map<String, Object> searchParams2, List<Sort> sortList2);

    List<BusinessOut> findByGreaterEndTime(Date date,String personPopedomId);

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