package com.fs.company.service;

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

import com.fs.common.core.domain.R;
import com.fs.company.domain.Company;
import com.fs.company.domain.CompanyRecharge;
import com.fs.company.domain.CompanyRechargeOrder;
import com.fs.company.dto.RechargeDTO;
import com.fs.company.vo.CompanyRechargeExportVO;
import com.fs.company.vo.CompanyRechargeVO;

/**
 * 充值Service接口
 *
 * @author fs
 * @date 2021-10-04
 */
public interface ICompanyRechargeService
{
    /**
     * 查询充值
     *
     * @param rechargeId 充值ID
     * @return 充值
     */
    public CompanyRecharge selectCompanyRechargeById(Long rechargeId);

    /**
     * 查询充值列表
     *
     * @param companyRecharge 充值
     * @return 充值集合
     */
    public List<CompanyRecharge> selectCompanyRechargeList(CompanyRecharge companyRecharge);

    /**
     * 新增充值
     *
     * @param companyRecharge 充值
     * @return 结果
     */
    public int insertCompanyRecharge(CompanyRecharge companyRecharge);

    /**
     * 修改充值
     *
     * @param companyRecharge 充值
     * @return 结果
     */
    public int updateCompanyRecharge(CompanyRecharge companyRecharge);

    /**
     * 同步到缓存余额
     * @param company 公司
     * @param rechargeMoney 充值金额
     * @param type 同步类型，1-充值，2-扣款
     * @return 是否成功
     */
    R syncUpdateRedisCompanyRecharge(Company company, BigDecimal rechargeMoney, Integer type);

    List<CompanyRechargeVO> selectCompanyRechargeListVO(CompanyRechargeVO companyRecharge);
    /**
     * 批量删除充值
     *
     * @param rechargeIds 需要删除的充值ID
     * @return 结果
     */
    public int deleteCompanyRechargeByIds(Long[] rechargeIds);

    /**
     * 删除充值信息
     *
     * @param rechargeId 充值ID
     * @return 结果
     */
    public int deleteCompanyRechargeById(Long rechargeId);


    List<CompanyRechargeVO> selectCompanyRechargeVOList(CompanyRecharge companyRecharge);

    CompanyRecharge selectCompanyRechargeByNo(String s);

    R payNotify(CompanyRecharge recharge);
    R payNotify(String orderNo,String transactionId);

    BigDecimal selectCompanyRechargeMoney();

    /**
     * 查询导出充值列表
     *
     * @param companyRecharge 充值
     * @return 充值集合
     */
    List<CompanyRechargeExportVO> selectCompanyRechargeExportList(CompanyRecharge companyRecharge);

    /**
     * 充值
     * @param dto 参数
     * @return 地址
     */
    CompanyRechargeOrder recharge(RechargeDTO dto) throws Exception;

    /**
     * 查询订单
     * @param orderNo 订单号
     * @return CompanyRechargeOrder
     */
    CompanyRechargeOrder queryOrder(String orderNo);
}
