package com.iformall.service;

import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxCreditHistory;
import com.iformall.domain.vo.WxCreditHistoryVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

public interface WxCreditHistoryService {

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

    /**
     * 根据实体查询分页列表更多
     *
     * @param record
     * @param pageIndex
     * @param pageSize
     * @return
     */
	PageInfo<WxCreditHistoryVo> listAsPageMore(WxCreditHistory record, Integer pageIndex, Integer pageSize);

	/**
     * 根据Id获得实体
     *
     * @param id
     * @return
     */
    WxCreditHistory getById(Long id);

	/**
	 * 添加积分时，需要校验用户以及手机号是否存在
	 * 规则：有手机号增加积分，无手机号提示授权手机号
	 * @param cUserId
	 */
	void creditUsercheck(Long cUserId);

    /**
     * 保存或更新实体
     *
     * @param record
     */
    WxCreditHistory saveOrUpdate(WxCreditHistory record);

    /**
     * 积分历史回退
     *
     * @param record
     */
    int cancelCredit(WxCreditHistory record);

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

    Map<String, Integer> findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId,String tenantId);
    
    void clearCreditByYear();

    void exportData(HttpServletRequest request, HttpServletResponse response, WxCreditHistory wxCreditHistory);

    ResultData getCreditSummary(WxCreditHistory wxCreditHistory);

}
