package com.yh.saas.plugin.yiliangyiyun.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
import com.baomidou.mybatisplus.service.IService;
import com.yh.saas.plugin.yiliangyiyun.exception.ServiceException;

import java.text.ParseException;

/**
 * <p>
 * 销售订单 服务类
 * </p>
 *
 * @author Gongdc
 * @since 2021-08-04
 */
public interface ISaleOrderService extends IService<SaleOrder> {
    /**
     * 成交
     * @param saleOrder
     * @return
     */
    String deal(SaleOrder saleOrder);

    /**
     * 更改状态
     * @param saleOrder
     * @return
     */
    String editStatus(SaleOrder saleOrder);

    /**
     * 平仓
     * @param saleOrder
     * @return
     */
    String closePosition(SaleOrder saleOrder);

    /**
     * 客户点价
     * @param id
     * @return
     */
    String pointPrice(String id,Float unitPrice) throws ParseException, ServiceException;

    /**
     * 销售订单列表
     * @param saleOrder
     * @return
     */
    Page<SaleOrder> selectSaleOrder(SaleOrder saleOrder);

    /**
     * 添加销售订单
     * @param saleOrder
     * @return
     */
    String insertSaleOrder(SaleOrder saleOrder);

    /**
     * 删除销售订单
     * @param id
     */
    void deleteSaleOrder(String id);
    /**
     * 编辑销售订单
     * @param saleOrder
     */
    String editSaleOrder(SaleOrder saleOrder);
    /**
     * 查看
     *
     * @param
     */
    SaleOrder getInfo(String id);

}
