package com.trade.client.trade.salesorder.service;

import com.github.pagehelper.PageInfo;
import com.trade.service.trade.salesorder.dto.*;
import com.trade.service.trade.salesorder.vo.SalesOrderDtlVO;
import com.trade.service.trade.salesorder.vo.SalesOrderSearch;
import com.trade.service.trade.salesorder.vo.SalesOrderVO;

import java.util.List;

public interface SalesOrderCService {

    /**
     * query salescontract purchaseorder list by search conditions.
     * 
     * @param search The search conditions.
     * @return PageInfo<SalesOrderVO>
     */
    PageInfo<SalesOrderVO> queryListBySearch(SalesOrderSearch search);

    /**
     * Save a new salescontract purchaseorder.
     * 
     * @param salesOrderDTO The salescontract purchaseorder to save.
     */
    void save(SalesOrderDTO salesOrderDTO, boolean isSubmit);

    void submit(SalesOrderDTO salesOrderDTO);

    /**
     * Deliver a salescontract purchaseorder.
     * 
     * @param orderDeliverDTO deliver Info.
     */
    void deliver(SalesOrderDeliverDTO orderDeliverDTO);

    SalesOrderDtlVO getDetail(Long id, boolean is4Update);

    /**
     * Delete a salescontract purchaseorder.
     * 
     * @param id The id of the salescontract purchaseorder to delete.
     * @return True if the salescontract purchaseorder is deleted successfully, false otherwise.
     */
    boolean delete(Long id);

    /**
     * 处理商品收款
     *
     * @param salesOrderReceivePayment
     * @return 勾选商品金额
     */
    Boolean processGoodsReceivePayment(SalesGoodsReceivePaymentDto salesOrderReceivePayment);

    /**
     * 处理订单收款列表
     *
     * @param receivePaymentExtendDtos
     * @return 勾选订单金额信息
     */
    List<ReceivePaymentExtendDto> processOrderReceivePaymentList(
            List<ReceivePaymentExtendDto> receivePaymentExtendDtos);

    /**
     * 处理商品收款
     *
     * @param receivePaymentSubDto
     * @param source true B端 false C端
     * @return 勾选商品金额
     */
    Boolean processOrderReceivePayment(ReceivePaymentSubDto receivePaymentSubDto, boolean source);

    /**
     * 根据订单ID查询订单列表信息
     *
     * @param salesOrderInfo
     * @return 订单列表信息
     */
    List<OrderListInfoDto> queryOrderListInfoByOrderIds(List<SalesOrderReceiveExtendDto> salesOrderInfo);

    /**
     * 提交订单列表信息
     *
     * @param salesOrderInfo salesOrderInfo
     * @param source
     * @return boolean
     */
    OrderPaymentAmountDto submitOrderListInfo(List<OrderListInfoDto> salesOrderInfo, int source);
}
