package com.ssm.manage.service;

import com.github.pagehelper.PageInfo;
import com.ssm.core.service.BaseService;
import com.ssm.manage.entity.*;
import com.ssm.manage.query.RechargeAccountRequest;
import com.ssm.manage.query.RechargeListRequest;
import com.ssm.manage.query.RepayAccountListRequest;
import com.ssm.manage.query.RepayTradeRequest;
import com.ssm.manage.response.RechargeAccountResponse;

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

public interface SsmRechargeAccountService extends BaseService<RechargeAccount> {
    List<RechargeAccount> selectList(RechargeAccountRequest rechargeAccountRequest);
    List<RechargeAccount> cashSelectList(RechargeAccountRequest rechargeAccountRequest) throws SmsException;
    List<RechargeAccount> cashSelectListByStore(RechargeAccountRequest rechargeAccountRequest) throws SmsException;
    List<RechargeAccount> cashSelectListall(RechargeAccountRequest rechargeAccountRequest) throws SmsException;
    List<RechargeAccount> delay(RechargeAccountRequest rechargeAccountRequest) throws SmsException;
    List<RechargeAccount> newcashSelectList(RechargeAccountRequest rechargeAccountRequest);
    RechargeAccount selectOne(RechargeAccountRequest rechargeAccountRequest);
    int addRechargeAccount(RechargeAccount rechargeAccount) throws SmsException;
    int repayRechargeAccount(RepayAccountListRequest rechargeAccount, RepayTradeRequest repayTradeRequest,RepayList repayList) throws SmsException;
    int cancelRepayRechargeAccount(RepayAccountListRequest rechargeAccount, RepayTradeRequest repayTradeRequest,RepayList repayList) throws SmsException;
    RechargeAccount setRechargeAccount(RechargeType rechargeType, RechargeList rechargeList, RechargeAccount rechargeAccount, StoreParament storeParament);
    //充值账户添加金额
    RechargeAccount addMoney(RechargeAccount rechargeAccount, RechargeList rechargeList, RechargeType rechargeType, StoreParament storeParament) throws SmsException;
    RechargeAccount addMoney(RechargeAccount rechargeAccount) throws SmsException;
    RechargeAccount addMoneyGrouponCard(RechargeAccount rechargeAccount) throws SmsException;
    //充值账户扣减金额
    RechargeAccount subMoney(RechargeAccount rechargeAccount, RechargeList rechargeList,RechargeType rechargeType) throws SmsException;
    RechargeAccount subMoney(RechargeAccount rechargeAccount) throws SmsException;
    //充值账户购买疗程作废添加金额
    int addMoney(List<RechargeAccountRequest> rechargeAccountList, CourseList courseList) throws SmsException;
    //充值账户购买疗程扣减金额
    int subMoney(List<RechargeAccountRequest> rechargeAccountList, CourseList courseList) throws SmsException;
//    int subMoney(List<RechargeAccount> list, CourseList courseList) throws SmsException;

    //充值账户消费收银添加金额
    int addMoney(List<RechargeAccountRequest> rechargeAccountList, CashList cashList) throws SmsException;
    int addMoney(List<RechargeAccountRequest> rechargeAccountList, ServiceOrders serviceOrders) throws SmsException;
    //充值账户消费收银作废扣减金额
    List<AccountTradeRecord> subMoney(List<RechargeAccountRequest> rechargeAccountList, CashList cashList, List<AccountTradeRecord> list) throws SmsException;
    List<AccountTradeRecord> subMoney(List<RechargeAccountRequest> rechargeAccountList, ServiceOrders serviceOrders, List<AccountTradeRecord> list) throws SmsException;

    int repay(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList) throws SmsException;
    int repayNew(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList) throws SmsException;
    int repayNewPromotionRecharge(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList) throws SmsException;
    int repay(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList,BigDecimal CardPayMoney) throws SmsException;

    int repayCancel(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList) throws SmsException;
    int repayCancelNew(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList) throws SmsException;
    int repayCancelNewPromotionRecharge(RepayTradeList repayTradeList, RepayList repayList, DebtList debtList) throws SmsException;

    int updateState(Long id, int state);
    //充值账户退款反审核扣减金额
    RechargeAccount subMoney(RefundRecharge refundRecharge) throws SmsException;
    //充值账户退款审核添加金额
    RechargeAccount addMoney(RefundRecharge refundRecharge) throws SmsException;
    //充值账户消费退审核添加金额
    RechargeAccount addMoney(CashAccountList cashAccountList,Long storeId) throws SmsException;
    //充值账户消费退反审核扣减金额
    RechargeAccount subMoney(CashAccountList cashAccountList,Long storeId) throws SmsException;

    //促销活动购买扣减金额
    int subMoney(List<RechargeAccountRequest> rechargeAccountList, DocPromotion docPromotion) throws SmsException;
    //促销活动购买作废添加金额
    int addMoney(List<RechargeAccountRequest> rechargeAccountList, DocPromotion docPromotion) throws SmsException;

    int update(RechargeAccountRequest rechargeAccountRequest, String phone);
    int updates(RechargeAccountRequest rechargeAccountRequest, String phone);

    int insertBatch(List<RechargeAccount> list, Long storeId, String storeName);
    //会员排行榜查询会员总充值金额
    List<RechargeAccountResponse> memberRecharge(RechargeAccountRequest rechargeAccountRequest);

    List<RechargeAccount> selectByPrimaryKeyList(List<Long> rechargeAccountIdList);

    List<RechargeAccount> selectByIds(List<Long> rechargeAccountIdList);

    RechargeAccount selectByMemberIdAndRechargeTypeIdAndMoney(RechargeAccount rechargeAccount);

    List<RechargeAccount> exportachi(RechargeAccountRequest rechargeAccountRequest);

    PageInfo<RechargeAccount> exportachiByPage(RechargeAccountRequest rechargeAccountRequest);
}
