package com.sunxung.factoring.service.refundsManagement;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunxung.factoring.entity.ledger.LedgerFundGoodsAssign;
import com.sunxung.factoring.entity.project.vo.BusinessProcessingTaskVo;
import com.sunxung.factoring.entity.project.vo.SearchBusinessProcessingTask;
import com.sunxung.factoring.entity.refundsManagement.RefundManagement;
import com.sunxung.factoring.entity.refundsManagement.RefundsApplyDetails;
import com.sunxung.factoring.entity.refundsManagement.vo.RefundManagementVo;
import com.sunxung.factoring.entity.underlying.sop.PaymentCollectionPlanFactoring;

import java.util.List;

/**
 * <p>
 * 退款管理表 服务类
 * </p>
 *
 * @author yafan
 * @since 2024-03-04
 */
public interface IRefundManagementService extends IService<RefundManagement> {

    /**
     * 分账向退款推送数据
     * @param ledgerFundGoodsAssign
     */
    void add(LedgerFundGoodsAssign ledgerFundGoodsAssign);

    /**
     * 条件查询
     * @param search
     * @return
     */
    List<BusinessProcessingTaskVo> findBySearch(SearchBusinessProcessingTask search);

    /**
     * 根据id查询退款信息
     * @param id
     * @return
     */
    RefundManagement get(Long id);

    /**
     * 申请退款编辑
     * @param id
     * @return
     */
    RefundManagementVo edit(Long id);

    /**
     * 根据选中的金额类型获取申请内容
     *
     * @param refundManagementVo
     * @return
     */
    List<RefundsApplyDetails> findBySelectAmountType(RefundManagementVo refundManagementVo);

    /**
     * 退款提交
     *
     * @param refundManagementVo
     */
    void doEdit(RefundManagementVo refundManagementVo);

    /**
     * 从sop拉取所有主体公司
     *
     * @return
     */
    Object getAllCompanyEntityBySop();

    /**
     * 通过业务编号，合同号和批次号从sop拉取所有计划
     * @param businessNumber
     * @param contractNo
     * @param quotaDisburseBatch
     * @param refundManagement
     * @return
     */
    List<PaymentCollectionPlanFactoring> findPlanBySop(String businessNumber, String contractNo, Integer quotaDisburseBatch,
                                                              RefundManagement refundManagement);
}
