package com.gic.haoban.manage.service.service.content;

import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO;
import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerStaticsBO;
import com.gic.haoban.manage.service.pojo.bo.potential.MemberLastInteractBO;
import com.gic.haoban.manage.service.pojo.qo.content.InteractRecordQO;

import java.util.Date;
import java.util.List;

/**
 * 互动记录明细(TabHaobanInteractRecord)表服务接口
 *
 * @author makejava
 * @since 2023-03-28 10:32:48
 */
public interface InteractRecordService {

    /**
     * 查询互动记录
     * @param enterpriseId
     * @param traceId
     * @return
     */
    InteractRecordBO queryWithInteractInfo(String enterpriseId, String traceId);

    /**
     * 互动记录查询
     * @param interactRecordQO
     * @return
     */
    Page<InteractRecordBO> queryInteractRecordPage(InteractRecordQO interactRecordQO);

    /**
     * 统计总数
     * @param interactRecordQO
     * @return
     */
    Integer countInteractRecord(InteractRecordQO interactRecordQO);

    /**
     * 保存互动记录
     * @param interactRecordBO
     * @return
     */
    Long saveOrUpdateInteractRecord(InteractRecordBO interactRecordBO);

    /**
     * 统计导购的互动记录总数
     * @param interactRecordQO
     * @return
     */
    List<PotentialCustomerStaticsBO> staticsClerkNewInteractRecord(InteractRecordQO interactRecordQO);

    /**
     * 会员合并操作
     * @param mergeMemberId
     * @param memberId
     */
    void mergeMember(String mergeMemberId, String memberId);

    /**
     * 会员授权事件
     * @param memberId
     * @param unionId
     */
    void memberAuthorized(String memberId, String unionId);

    /**
     * 查询最新的一条互动记录
     * @param clerkId
     * @param bizId
     * @param memberId
     * @return
     */
    InteractRecordBO queryLeastRecord(String enterpriseId, String clerkId, String bizId, String memberId);

//    void modifyFollowTime(String enterpriseId,String clerkId, String memberId);

    /**
     * 更新unionId
     * @param enterpriseId
     * @param oldUnionId
     * @param newUnionId
     */
    void modifyUnionId(String enterpriseId, String oldUnionId, String newUnionId);

    /**
     * 查询会员对应时间后最新的互动记录
     * @param enterpriseId
     * @param clerkId
     * @param list
     * @return
     */
    List<InteractRecordBO> lastInteractRecord(String enterpriseId, String clerkId, List<MemberLastInteractBO> list);

    /**
     * 查询对应时间后会员最新的互动记录
     * @param clerkId
     * @param lastAccessTime
     * @return
     */
    List<MemberLastInteractBO> queryMemberIdsByTime(String clerkId, Date lastAccessTime);

}
