package com.keao.edu.user.service;

import com.keao.edu.common.page.PageInfo;
import com.keao.edu.common.service.BaseService;
import com.keao.edu.user.dto.ExamPaymentInfo;
import com.keao.edu.user.dto.ExamRegistrationPaymentDto;
import com.keao.edu.user.entity.ExamRegistrationPayment;
import com.keao.edu.user.page.ExamRegistrationPaymentQueryInfo;

import java.util.Map;

public interface ExamRegistrationPaymentService extends BaseService<Long, ExamRegistrationPayment> {

    /**
     * 获取用户未支付的订单
     *
     * @param examinationBasicId
     * @param userId
     * @return
     */
    ExamRegistrationPayment getExamIngOrder(Long examinationBasicId, Integer userId);

    /**
     * 根据订单号获取订单
     *
     * @param orderNo
     * @return
     */
    ExamRegistrationPayment getByOrderNo(String orderNo);


    /**
     * 获取订单信息
     * @param orderNo
     * @return
     */
    ExamPaymentInfo getExamOrderInfo(String orderNo);

    /**
     * 更新订单信息
     *
     * @param rpMap
     * @return
     */
    ExamRegistrationPayment updateOrder(Map<String,String> rpMap);


    /**
     * 获取缴费列表
     * @param queryInfo
     * @return
     */
    PageInfo<ExamRegistrationPaymentDto> pageList(ExamRegistrationPaymentQueryInfo queryInfo);


    /**
     * 查询订单订单状态
     *
     * @throws Exception
     */
    void queryPaymentStatus() throws Exception;


    /**
     * 关闭支付中订单
     * @param orderNo 订单编号
     * @return
     */
    Boolean closeOrder(String orderNo);

}
