package com.iformall.service;

import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.dto.WxMerchantDto;
import com.iformall.domain.po.WxBillOtherDeposit;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.domain.vo.WxMerchantSimpleVo;
import com.iformall.domain.vo.WxMerchantTradeDetailVo;
import com.iformall.domain.vo.WxMerchantTradeVo;
import com.iformall.domain.vo.WxMerchantVo;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;

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

    /**
     * 根据实体查询分页列表
     *
     * @param record
     * @param pageIndex
     * @param pageSize
     * @return
     */
    PageInfo<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant record, Integer pageIndex, Integer pageSize);


    /**
     * 根据实体查询分页列表
     *
     * @param record
     * @param pageIndex
     * @param pageSize
     * @return
     */
    PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize);

    /**
     * 根据实体查询分页列表
     *
     * @return
     */
    void exportUserTradeList(@ModelAttribute WxMerchant record, HttpServletRequest request, HttpServletResponse response);

	/**
     * 根据实体查询分页列表
     *
     * @param record
     * @param pageIndex
     * @param pageSize
     * @return
     */
	PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize);
    PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize);
    /**
     * 根据code查询
     *
     * @param params
     * @return
     */
    WxMerchantVo getMerchantInfo(HashMap<String, String> params);

    /**
     * 根据实体查询分页列表
     *
     * @param record
     * @return
     */
    List<WxMerchant> etcpList(WxMerchant record);

    /**
     * 根据实体查询分页列表
     *
     * @param record
     * @return
     */
    List<WxMerchant> findList(WxMerchant record);

    /**
     * 查询商户列表
     * @param tenantId
     * @return
     */
    List<WxMerchantSimpleVo> findList(String tenantId);
	
	/**
     * 根据Id获得实体
     *
     * @param id
     * @return
     */
    WxMerchant getById(Long id);

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


    void disable(Long id);

    ResultData addMerchant(WxMerchant wxMerchant, Long userId);

    ResultData updateMerchant(WxMerchant wxMerchant);

    ResultData updateMerchantAccount(WxMerchant wxMerchant);

    ResultData updateMerchantAdmin(WxMerchant wxMerchant);

    ResultData updateMerchantCorp(WxMerchant wxMerchant);

    ResultData updateMerchantTax(WxMerchant wxMerchant);

    ResultData updateMerchantLevel(WxMerchant wxMerchant);

    WxMerchantVo findMerchantById(Long id);

    WxMerchant findOne(WxMerchant wxMerchant);

    void exportData(WxMerchant wxMerchant, HttpServletRequest request, HttpServletResponse response);

    ResultData top(WxMerchant wxMerchant);

    ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver);

    boolean hasMerchant(WxMerchant wxMerchant);

    Optional<WxMerchant> findByName(String name);

    PageInfo<WxMerchant> listVoAsPage(WxMerchant wxMerchant, Integer pageNum, Integer pageSize);

}
