package com.ym.mec.biz.service;


import com.ym.mec.biz.dal.entity.MusicGroup;
import com.ym.mec.biz.dal.entity.SellOrder;
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
import com.ym.mec.common.service.BaseService;

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


public interface SellOrderService extends BaseService<Integer, SellOrder> {

    /**
     * 添加销售订单
     *
     * @param goodsIds
     * @param totalAmount
     * @param balance
     * @return
     */
    List<SellOrder> addSellOrder(Long orderId, String musicGroupId, List<Integer> goodsIds, BigDecimal totalAmount, BigDecimal balance);

    /**
     * 将订单详情加入销售列表
     *
     * @param orderDetails
     * @param studentPaymentOrder
     * @return
     */
    List<SellOrder> addOrderDetail2SellOrder(List<StudentPaymentOrderDetail> orderDetails, StudentPaymentOrder studentPaymentOrder, MusicGroup musicGroup);

    void batchInsert(List<SellOrder> sellOrders);


    /**
     * 获取组合商品的相关商品
     *
     * @param orderId
     * @param parentGoodsId
     * @return
     */
    List<SellOrder> getSellOrderByParentGoodsId(Long orderId, Integer parentGoodsId);

    /**
     * 退货
     *
     * @param sellOrders
     * @param reBackFee  是否退费
     * @return
     */
    List<SellOrder> refund(List<SellOrder> sellOrders, Boolean reBackFee);

    /**
     * 根据订单id退货
     *
     * @param orderId
     * @param reBackFee 是否退费
     * @return
     */
    List<SellOrder> refundByOrderId(Long orderId, Boolean reBackFee);

    /**
     * 获取订单退货的sellOrder
     * @param orderId
     * @return
     */
    List<SellOrder> getRefundSellOrder(Long orderId);


    /**
     * 获取订单的实际销售金额（除去余额部分）
     * @param orderNo
     * @return
     */
    Map<String,BigDecimal> getSellAmount(String orderNo);

}
