package com.iformall.service;

import com.iformall.common.ResultData;
import com.iformall.domain.po.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author gongbiao
 */
public interface WxRentContractService {

	/**
     * 根据实体查询分页列表
     *
     * @param offset
     * @param limit
     * @param record
     * @return
     */
	Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize);
	
	/**
     * 根据Id获得实体
     *
     * @param id
     * @return
     */
    Map<String, Object> getById(Long id);

    /**
     * 保存或更新实体
     * @param record
     * @param userId
     * @param userName
     * @return
     */
    ResultData save(WxRentContract record,Long userId,String userName,Date oldRentStartDate);

    ResultData update(WxRentContract record, Long userId,String userName,int from,Date oldRentStartDate);

    /**
     * 根据Id删除实体
     *
     * @param id
     */
    ResultData deleteById(String id);


    void download(HttpServletRequest request, HttpServletResponse response, String tenantId);

    Object getRentContractStatusInfo(WxRentContract record);

    ResultData endRentContract(Long id, Integer status);

    ResultData updateMerchant(WxRentContract wxRentContract);

    Object getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize);

    void exportContract(HttpServletRequest request, HttpServletResponse response, String tenantId, Long id);

    ResultData updateFile(WxRentContract wxRentContract, Long userId,String userName,Date oldRentStartDate);

    ResultData updateRentContractStatus(Long id);

    List<Long> getShopIds(WxRentContract record) ;

    void updateApplyStatus(WxRentContract wxRentContract);

    List<WxBillRent> buildRent(WxMerchant wxMerchant, Long userId,WxRentContract rentContract,Integer isPreview,boolean saveDb);

    void buildDeposit(WxMerchant wxMerchant, Long userId,Long rentContractId);

    Object getMerchants(WxRentContract wxRentContract);

    void updateInvalidContract(Long rentContractId);

    ResultData hasRentStatus(WxRentContract wxRentContract);

    ResultData hasContractNumber(WxRentContract wxRentContract);

    Integer getShopType(WxRentContract wxRentContract);

    void endContract(WxRentContract wxRentContract);

    void updatePropertyPreviewBill(WxRentContract record);

    Map<String, Object> updateStatus(WxRentContract record);

    WxRentContract getByBill(WxBillRent billRent);

    Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp,String tenantId);

    int selectContractCountByShopId(WxRentContract wxRentContract);
}
