package com.huiju.estateagents.redpack.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.redpack.entity.TaRedPacket;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 红包助力活动  服务类
 * </p>
 *
 * @author fxf
 * @since 2020-06-03
 */
public interface ITaRedPacketService extends IService<TaRedPacket> {

    /**
     * 初始化红包信息
     *
     * @param record
     * @return
     */
    @Transactional
    ResponseBean initializeRedPacket(TaRedPacket record,Integer orgId);


    /**
     * 更新红包信息
     *
     * @param taRedPacket
     * @return
     */
    ResponseBean updateRedPacket(TaRedPacket taRedPacket,Integer orgId);

    /**
     * 根据ID查询红包图片信息
     *
     * @param record
     * @return
     */
    TaRedPacket getRedPacketImages(TaRedPacket record);


    /**
     * 查询客户访问记录
     *
     * @param pageNum
     * @param pageSize
     * @param startTime
     * @param endTime
     * @param drainageId
     * @param phone
     * @param sharePersonPhone
     * @param orgId
     * @return
     */
    ResponseBean listVisitRecordByCondition(Integer pageNum, Integer pageSize, LocalDateTime startTime, LocalDateTime endTime, String drainageId, String phone, String sharePersonPhone, Integer orgId);

    /**
     * 导出客户访问记录
     *
     * @param startTime
     * @param endTime
     * @param drainageId
     * @param phone
     * @param sharePersonPhone
     * @param orgId
     */
    void exportVisitRecordByCondition(LocalDateTime startTime, LocalDateTime endTime, String drainageId, String phone, String sharePersonPhone, Integer orgId, HttpServletResponse response) throws Exception;


}
