package com.zm.order.tool.server.service;

import com.zm.order.tool.server.dto.OrderCreateDTO;
import com.zm.order.tool.server.model.Order;
import com.zm.order.tool.server.request.*;
import com.zm.util.dto.Result;

import java.util.List;

/**
 * 订单写服务实现
 * @author NianChang
 * @ClassName OrderWriteService
 * @date 2021/02/19 1:40 下午
 */
public interface OrderWriteService {

    /**
     * 更新订单中商品快照
     * @param
     * @return:
     * @Date: 2021/2/19 1:41 下午
     */
    Result updateOrderItemInfo();

    /**
     * 更新订单中商品快照
     * @param
     * @return:
     * @Date: 2021/2/19 1:41 下午
     */
    Result updateOrderItemInfoTemp();

    /**
     * 跟新退款单
     * @param
     * @return:
     * @Date: 2023-04-26 13:44:29
     */
    Result updateOrderRefund(UpdateRefundsRequest request);

    /**
     * 更新退款单商品
     * @param
     * @return:
     * @Date: 2023-04-26 13:44:29
     */
    Result updateOrderRefundItem(UpdateRefundItemRequest request);

    /**
     * 删除指定压测品牌订单
     * @param
     * @return:
     * @Date: 2023-04-26 13:44:29
     */
    Result delTestOrder(DelTestOrderRequest request);

    /**
      * 更新订单信息
      * @date 2021/8/12 14:50
      * @param request
      * @return Result
     **/
    Result updateOrderByOrderNoList(BusinessOrderUpdateRequest request);

    /**
      * 更新订单信息
      * @date 2021/8/12 14:50
      * @param request
      * @return Result
     **/
    Result updateNewOrderByOrderNo(BusinessOrderUpdateRequest request);
    Result updateNewOrderByOrderNoTemp();

    void updateOrderByOrderNoListTemp(CreateOrderRequest request);

    /**
      * 更新订单信息
      * @date 2021/8/12 14:50
      * @param request
      * @return Result
     **/
    void fixOrderMergeFeature();
    void fixOrderMergeFeatureSellerId();
    void fixOrderMergeFeatureSellerIdRefund();

    /**
      * 更新订单信息
      * @date 2021/8/12 14:50
      * @param orderCreateDTO
      * @return Result
     **/
    Result createOrder(OrderCreateDTO orderCreateDTO);

    /**
     * 更新订单商品信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result updateOrderItemByOrderNo(BusinessOrderUpdateRequest request);

    /**
     * 删除订单商品的加料
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result delOrderItemBatch(DelItemBatchRequest request);


    /**
     * 更新订单商品信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result insertOrderItem(BusinessItemInsertRequest request);

    /**
     * 删除订单评论
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result delOrderComment(DelOrderCommentRequest request);

    /**
     * 删除订单重复评论
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result delDuplicateOrderComment(DelOrderCommentRequest request);

    /**
     * 更新订单支付明细信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result updateOrderPayByOrderNo(BusinessOrderUpdatePayDetailsRequest request);

    /**
     * 更新订单地址
     * @param request
     * @return
     */
    Result updateAddrOrderNo(BusinessOrderUpdateAddrRequest request);

    /**
     * 更新订单支付明细信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result addOrderPayByOrderNo(BusinessAddPayDetailsRequest request);

    /**
     * 更新订单支付明细信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result<List<Order>> orderBaseList (OrderBaseListRequest request);

    /**
     * 删除订单支付明细信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result delOrderPayByOrderNo(BusinessOrderUpdatePayDetailsRequest request);

    /**
     * 更新订单支付明细信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result updateOrderDiscountByOrderNo(BusinessOrderUpdateDiscountRequest request);

    /**
     * 更新订单支付明细信息
     * @date 2021/8/12 14:50
     * @param
     * @return Result
     **/
    void updateOrderPay();
    void syncSubOrder();

    void updateOrderAmount();

    void updateOrderPayType();

    void commentMessage();

    void updatePayDetailAmount();

    /**
     * 删除订单
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    Result deleteOrderByOrderNo(BusinessOrderUpdateRequest request);
    Result realDeleteOrderByOrderNo(BusinessOrderUpdateRequest request);
    Result deleteOrderByOrderNoTemp();
    Result delOrderFromTempDB();
    void itemUpdateTemp();

    void sellerDataAnalysis();

    void syncOrderToElasticsearch();
    void syncOrderToElasticsearch0();
    void deleteEsData();
    void updateItem();
    void customPay();


    /**
     * 更新订单商品信息
     * @date 2021/8/12 14:50
     * @param request
     * @return Result
     **/
    void updateCommentCount(UpdateCommentCountRequest request);


    void encryptOrder();
    void encryptRefund();
    void encryptOrderJolibee();
    void checkEncryptOrder();

    Result fixLineUpCount(FixLineUpCountRequest request);
}
