package com.huiju.estateagents.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.bo.request.HousingRaiseRequestBO;
import com.huiju.estateagents.bo.request.RaiseOrderRequestBO;
import com.huiju.estateagents.bo.request.RaiseRecordRequestBO;
import com.huiju.estateagents.entity.TaRaiseRecord;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 认筹单(认筹记录表)  服务类
 * </p>
 *
 * @author jobob
 * @since 2020-02-26
 */
public interface ITaRaiseRecordService extends IService<TaRaiseRecord> {


    /**
     * 条件查询房源认筹记录
     *
     * @param requestBO
     * @param pageNumber
     * @param pageSize
     * @return
     */
    ResponseBean listHousingRaiseByCondition(HousingRaiseRequestBO requestBO, Integer pageNumber, Integer pageSize);

    /**
     * 条件查询认筹单
     *
     * @param recordRequestBO
     * @param pageNumber
     * @param pageSize
     * @return
     */
    ResponseBean listRaiseRecordByCondition(RaiseRecordRequestBO recordRequestBO, Integer pageNumber, Integer pageSize);

    /**
     * 条件查询缴费单
     *
     * @param orderRequestBO
     * @param pageNumber
     * @param pageSize
     * @return
     */
    ResponseBean listRaiseOrderByCondition(RaiseOrderRequestBO orderRequestBO, Integer pageNumber, Integer pageSize);

    /**
     * 小程序端保存认筹单信息
     *
     * @param taRaiseRecord
     * @param orgId
     * @param personId
     * @return
     */
    TaRaiseRecord saveRaiseInfo(TaRaiseRecord taRaiseRecord, Integer orgId, String personId) throws Exception;

    /**
     * 获取用户信息
     *
     * @param orgId
     * @param raiseRecordId
     * @return
     */
    TaRaiseRecord getUserInfo(Integer orgId, Integer raiseRecordId);

    /**
     * 认筹单房源数+1
     *
     * @param raiseRecordId
     * @param orgId
     * @return
     */
    Boolean addHouseNum(Integer raiseRecordId, Integer orgId, Integer userId);

    /**
     * 发送认筹消息
     */
    void sendRaiseMsg(Integer raiseRecordId, String personId, String title, String result, String reason, String remark, Boolean isSuccess);

    /**
     * 减少房源表认筹实际热度值
     *
     * @param raiseRecordId
     * @return
     */
    Boolean updateForSubtractRaiseHeat(Integer raiseRecordId);

    /**
     * 更新房源锁定状态
     *
     * @param raiseRecordId
     * @param houseLockingStatus
     * @return
     */
    Boolean updateHouseLockingStatus(Integer raiseRecordId, String houseLockingStatus, String personId);

    /**
     * 获取认筹单详情-微信端
     *
     * @param raiseRecordId
     * @return
     */
    ResponseBean wxGetRaiseRecordById(Integer raiseRecordId, String personId,Integer orgId);
}
