package com.fs.his.service;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.fs.common.core.domain.R;
import com.fs.company.param.FsStoreStatisticsParam;
import com.fs.company.vo.FsStoreOrderStatisticsVO;
import com.fs.company.vo.FsStoreProductStatisticsVO;
import com.fs.his.domain.*;
import com.fs.his.dto.ExpressNotifyDTO;
import com.fs.his.dto.ExpressResultDTO;
import com.fs.his.dto.StoreOrderExpressExportDTO;
import com.fs.his.param.*;
import com.fs.his.vo.*;

/**
 * 订单Service接口
 *
 * @author fs
 * @date 2023-06-13
 */
public interface IFsStoreOrderService
{
    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    public FsStoreOrder selectFsStoreOrderByOrderId(Long orderId);

    /**
     * 查询订单列表
     *
     * @param fsStoreOrder 订单
     * @return 订单集合
     */
    public List<FsStoreOrder> selectFsStoreOrderList(FsStoreOrder fsStoreOrder);

    /**
     * 新增订单
     *
     * @param fsStoreOrder 订单
     * @return 结果
     */
    public int insertFsStoreOrder(FsStoreOrder fsStoreOrder);

    /**
     * 修改订单
     *
     * @param fsStoreOrder 订单
     * @return 结果
     */
    public int updateFsStoreOrder(FsStoreOrder fsStoreOrder);

    /**
     * 批量删除订单
     *
     * @param orderIds 需要删除的订单主键集合
     * @return 结果
     */
    public int deleteFsStoreOrderByOrderIds(String[] orderIds);

    /**
     * 删除订单信息
     *
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteFsStoreOrderByOrderId(String orderId);

    List<FsStoreOrderListVO> selectFsStoreOrderListVO(FsStoreOrderParam param);

    List<FsStoreOrderItem> selectFsStoreOrderItemList(String orderId);

    List<FsStoreOrderLogs> selectFsStoreOrderLogsList(String orderId);


    int sendGoods(FsStoreOrder fsStoreOrder);

    int getGoods(Long orderId);

    int updateMoney(FsStoreOrder fsStoreOrder);

    R cancelOrder(Long orderId);

    List<FsStoreOrderListUVO> selectFsStoreOrderListUVO(FsStoreOrderListUParam param);

    R createOrder(Long prescribeId);

    R createOrderByPackageOrder(FsPackageOrder packageOrder);

    R payConfirm(String orderCode,String payCode, String tradeNo,String payType,Integer type);

    List<FsStoreOrderExcelVO> selectFsStoreOrderExcelListVO(FsStoreOrderParam fsStoreOrder);

    String importSroreOrder(List<FsStoreProductDeliverExcelVO> list, Long storeId,Long companyId);

    FsStoreOrderVO selectFsStoreOrderByOrderIdVO(Long orderId);

    List<FsStorePayment> selectFsStorePaymentByOrderId(Long orderId);

    int tuiOrder(Long orderId);

    FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId);

    List<FsStoreOrderSVO> selectFsStoreOrderListSVO(FsStoreOrderListSParam fsStoreOrder);

    R computeOrder(FsStoreOrderComputeParam param);

    R payOrder(FsStoreOrderPayParam param);

    List<JSONObject> selectFsStoreOrderCounts(Map<String, Object> toMap);

    List<FsStoreOrderStatisticsVO> selectFsStoreOrderStatisticsList(FsStoreStatisticsParam param);

    List<FsStoreOrderListDVO> selectFsStoreOrderListDVO(FsStoreOrderListDParam param);

//    List<FsStoreOrderListDVO> selectFsStoreOrderListDocVO(FsStoreOrderListDParam param);

    List<FsStoreOrderVO> selectFsStoreOrderCusListVO(FsStoreOrderParam param);


    void createOmsOrder(Long orderId) throws ParseException;

    Long selectFsStoreOrderTotalCount(int i, Long companyId);


    void deliveryOrder(String orderCode, String mailNo, String expressCode, String expressName);

    int afterSales(FsStoreOrderSalesParam fsStoreOrder);

    ExpressResultDTO updateDeliveryItem(ExpressNotifyDTO notifyDTO);

    R syncExpress(Long id);

    R updateExpress(Long id);

    R editTuiMoney(Long id);

    String importExpress(List<StoreOrderExpressExportDTO> list);

    R getExpress(FsStoreOrder order);

    R finishOrder(Long orderId);

    void addFsFollowByStoreOrder(FsStoreOrder order);

    List<FsStoreOrderExportVO> selectFsStoreOrderListVOByExport(FsStoreOrderParam param);

    List<FsInquiryOrderMsg> selectFsInquiryOrderMsgByStoreOrderId(FsFollowMsgParam fsFollowMsgParam);

    FsFollowVO selectFsFollowVOByFollowId(Long followId);

    void addIntegralAndShareByStoreOrder(FsStoreOrder fsStoreOrder);

    void endFollow();

    void updateDeliveryOrder(Long orderId, String mailNo, String expressCode, String expressName);

    void endDeliveryOrder();

    R returnCost(Long orderId);

    String sendStartMsg(Long orderId);

    List<FsStoreOrderExcelVO> selectFsStoreOrderExcelListSVO(FsStoreOrderParam fsStoreOrder);

    List<FsStoreOrderStatisticsVO> selectFsPackageOrderStatisticsList(FsStoreStatisticsParam param);

    List<JSONObject> selectFsPackageOrderCounts(Map<String, Object> map);

    List<FsStoreOrderStatisticsVO> selectFsInquiryOrderStatisticsList(FsStoreStatisticsParam param);

    List<JSONObject> selectFsInquiryOrderCounts(Map<String, Object> map);

    List<FsStoreProductStatisticsVO> selescChartProdVOStatisticsList(FsStoreStatisticsParam param);

    R payment(FsStoreOrderDoPayParam param);

    R zfbPayment(FsStoreOrderDoPayParam param);

    Boolean isEntityNull(FsStoreOrderParam param);


    FsStoreOrderExportDataVO selectFsStoreOrderExportDataVOByOrderId(long orderId);

    Long selectFsStoreOrderExcelListVOCount(FsStoreOrderParam fsStoreOrder);

    Long selectFsStoreOrderListVOByExportCount(FsStoreOrderParam param);

    void addOrderEatMsg(FsStoreOrder fsStoreOrder);


    List<FsStoreOrder> selectFsStoreOrderByOrderIdIn(List<Long> longs);

    List<FsStoreOrder> selectFsStoreOrderStatisticsByUserId(List<Long> fsUserIdList);
}
