package com.bohuikeji.delivery.backstage.service;

import com.bohuikeji.delivery.backstage.entity.TCourier;
import com.bohuikeji.delivery.backstage.entity.TCourierWithdraw;
import com.bohuikeji.delivery.backstage.entity.TOrder;
import com.bohuikeji.frame.module.admin.base.ServiceBase;
import com.bohuikeji.frame.module.admin.entity.sys.SysUser;

import java.math.BigDecimal;
import java.util.List;

public interface ITCourierWithdrawService extends ServiceBase<TCourierWithdraw> {

    /**
     * 微信结算转账
     * @param withdraw
     * @param loginUser
     * @param num
     * @param price
     * @param payWay
     * @return
     */
    TCourierWithdraw wechatWithdrawal(TCourierWithdraw withdraw, SysUser loginUser,String num,String price,String payWay) throws Exception;

    /**
     * 支付宝结算转账
     * @param withdraw
     * @param loginUser
     * @param num
     * @param price
     * @param payWay
     * @return
     */
    TCourierWithdraw alipayWithdrawal(TCourierWithdraw withdraw, SysUser loginUser,String num,String price,String payWay);

    /**
     * 线下结算转账
     * @param withdraw
     * @param loginUser
     * @param num
     * @param price
     * @param payWay
     * @return
     */
    TCourierWithdraw offlineWithdrawal(TCourierWithdraw withdraw, SysUser loginUser,String num,String price,String payWay);

    /**
     * 支付付款到骑手支付宝账户，并生成提现记录
     * @param price 付款金额
     * @param courierId 骑手ID
     * @return
     */
    TCourierWithdraw sendToAliPay(String desc,BigDecimal price,Integer courierId);

    /**
     * 计算订单提现金额
     * @param orderList
     * @param courier
     * @param codeNum
     * @return
     */
    TCourierWithdraw saveWithdraw(List<TOrder> orderList, TCourier courier,String codeNum);


    /**
     * 打赏、奖励、惩罚提现业务处理
     * @param tCourierWithdraws
     * @return
     */
    boolean updateBusiness(List<TCourierWithdraw> tCourierWithdraws);

    /**
     * 驳回处理
     * @param tCourierWithdraws
     * @return
     */
    boolean updateReject(List<TCourierWithdraw> tCourierWithdraws);



}
