package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.auth.api.entity.SysUser;
import com.yonge.cooleshow.biz.dal.dto.excel.UserWithdrawalExport;
import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
import com.yonge.cooleshow.biz.dal.dto.req.WithdrawalReq;
import com.yonge.cooleshow.biz.dal.entity.UserWithdrawalCallback;
import com.yonge.cooleshow.biz.dal.vo.UserWithdrawalVo;
import com.yonge.cooleshow.biz.dal.dto.search.TeacherWithdrawalSearch;
import com.yonge.cooleshow.biz.dal.entity.UserWithdrawal;
import com.yonge.cooleshow.biz.dal.vo.res.WithdrawalInfoRes;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import com.yonge.toolset.utils.easyexcel.ExcelDataReaderProperty;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 用户账户结算表 服务类
 *
 * @author liweifan
 * @date 2022-03-30
 */
public interface UserWithdrawalService extends IService<UserWithdrawal> {

    /**
     * 查询详情
     *
     * @author liweifan
     * @date 2022-03-30
     */
    UserWithdrawalVo detail(Long id);

    UserWithdrawalVo detailByTransNo(String transNo);

    /**
     * 分页查询
     *
     * @author liweifan
     * @date 2022-03-30
     */
    IPage<UserWithdrawalVo> selectPage(IPage<UserWithdrawalVo> page, TeacherWithdrawalSearch query);

    /***
     * 查询集合
     * @author liweifan
     * @param: query
     * @updateTime 2022/4/15 18:04
     * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.UserWithdrawalVo>
     */
    List<UserWithdrawalVo> selectList(TeacherWithdrawalSearch query);

    /***
     * 查询结算页面信息
     * @author liweifan
     * @param: userId
     * @updateTime 2022/4/7 14:31
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<com.yonge.cooleshow.biz.dal.vo.res.WithdrawalInfoRes>
     */
    HttpResponseResult<WithdrawalInfoRes> getWithdrawalInfo(Long userId);

    /***
     * 用户发起结算申请
     * @author liweifan
     * @param: user
     * @param: withdrawalReq
     * @updateTime 2022/4/7 15:26
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.lang.Boolean>
     */
    HttpResponseResult<Boolean> withdrawal(SysUser user, WithdrawalReq withdrawalReq);

    /**
     * 结算回调
     *
     * @param callback
     */
    void callback(UserWithdrawalCallback callback, String jsonStr);

    /**
     * 异步回调接收-签署协议
     * @param status
     * @param serialNo
     * @param url
     * @param errMsg
     */
    void contractCallback(String status, String serialNo, String url, String errMsg);

    HttpResponseResult<Boolean> batchAuth(AuthOperaReq authOperaReq, SysUser sysUser);

    /**
     * 继续转账
     * @param authOperaReq
     * @param user
     * @return
     */
    HttpResponseResult<Boolean> transferAccount(AuthOperaReq authOperaReq, SysUser user);

    /**
     * 统计金额
     * @return
     */
    UserWithdrawalVo totalAmount();


    /***
     * 导入
     * @author liweifan
     * @param: dataList
     * @updateTime 2022/4/20 9:45
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.util.List < com.yonge.toolset.utils.easyexcel.ErrMsg>>
     */
    /*void importExcel(List<ExcelDataReaderProperty<UserWithdrawalExport>> dataList, Long userId);*/
}