package com.ruoyi.frequency.order.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.page.PageResult;
import com.ruoyi.controller.req.*;
import com.ruoyi.controller.resp.OrderDataResp;
import com.ruoyi.controller.resp.MallOrderDetailResp;
import com.ruoyi.controller.resp.OrderDetailResp;
import com.ruoyi.controller.resp.OrderPageResp;
import com.ruoyi.frequency.order.model.result.OrderCount;
import com.ruoyi.vo.BodyIdReq;
import com.ruoyi.vo.PayVo;
import com.ruoyi.frequency.order.entity.Order;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 订单主Service接口
 *
 * @author zj
 * @date 2023-10-13
 */
public interface OrderService extends IService<Order>
{
    /**
     * 查询订单主
     *
     * @param id 订单主主键
     * @return 订单主
     */
    public Order selectOrderById(Long id);

    /**
     * 查询订单主列表
     *
     * @param order 订单主
     * @return 订单主集合
     */
    public List<Order> selectOrderList(Order order);

    /**
     * 新增订单主
     *
     * @param order 订单主
     * @return 结果
     */
    public int insertOrder(Order order);

    /**
     * 修改订单主
     *
     * @param order 订单主
     * @return 结果
     */
    public int updateOrder(Order order);

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

    /**
     * 删除订单主信息
     *
     * @param id 订单主主键
     * @return 结果
     */
    public int deleteOrderById(Long id);

    /**
     * 订单发布
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderRelease(OrderReleaseReq req, UserVo userVo);


    /**
     * 表现师发布订单--设计师支付
     * @param req
     * @param userVo
     * @return
     */
    ResponseData customerPay(CustomerPayReq req, UserVo userVo);

    /**
     * 订单列表
     * @param req
     * @param userVo
     * @return
     */
    ResponseData<PageResult<Page<OrderPageResp>>> orderPage(OrderPageReq req, UserVo userVo);

    /**
     * 订单详情
     * @param id
     * @param userVo
     * @return
     */
    ResponseData<OrderDetailResp> orderDetail(Long id, UserVo userVo);

    /**
     * 表现师接单
     * @param id
     * @param userVo
     * @return
     */
    ResponseData storeOrderReceiving(Long id, UserVo userVo);

    /**
     * 取消订单
     * @param orderId
     * @param userVo
     * @return
     */
    ResponseData orderCancel(Long orderId, UserVo userVo);


    /**
     * 确认师傅(表现师)
     * @param req
     * @param userVo
     * @return
     */
    ResponseData confirmStore(ConfirmStoreReq req, UserVo userVo);

    /**
     * 订单申诉
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderAppeal(OrderAppealReq req, UserVo userVo);

    /**
     * 订单调价
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderAdjustPrice(OrderAdjustPriceReq req, UserVo userVo);


    /**
     * 计算订单调价支付定金金额(超出现在价格)
     * @param req
     * @param userVo
     * @return
     */
    ResponseData<PayVo> orderAdjustPricePayCount(OrderAdjustPricePayCountReq req, UserVo userVo);

    /**
     * 订单调价确认
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderAdjustPriceConfirm(OrderAdjustPriceConfirmReq req, UserVo userVo);


    /**
     * 订单调价拒绝
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderAdjustPriceRefuse(RefuseReq req, UserVo userVo);

    /**
     * 订单延期
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderExtension(OrderExtensionReq req, UserVo userVo);

    /**
     * 订单延期取消
     * @param orderId
     * @return
     */
    ResponseData orderExtensionCancel(Long orderId);

    /**
     * 订单延期确认
     * @param orderId
     * @param userVo
     * @return
     */
    ResponseData orderExtensionConfirm(Long orderId, UserVo userVo);

    /**
     * 订单延期拒绝
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderExtensionRefuse(RefuseReq req, UserVo userVo);

    /**
     * 样图上传
     * @param req
     * @param userVo
     * @return
     */
    ResponseData sampleImagesUpload(SampleImagesUploadReq req, UserVo userVo);

    /**
     * 收图并支付
     * @param req
     * @param userVo
     * @return
     */
    ResponseData receiveDrawingsAndPay(ReceiveDrawingsAndPayReq req, UserVo userVo);

    /**
     * 评价
     * @param req
     * @param userVo
     * @return
     */
    ResponseData evaluate(EvaluateReq req, UserVo userVo);

    /**
     * 评价计算评分
     * @param req
     * @param userVo
     * @return
     */
    ResponseData evaluateCountStar(EvaluateReq req, UserVo userVo);


    /**
     * 订单列表上方统计
     * @param orderPageReq
     * @param userVo
     * @return
     */
    ResponseData<OrderDataResp> orderData(OrderPageReq orderPageReq,UserVo userVo);


    /**
     * 订单首款支付宝回调
     * @param request
     * @param response
     * @return
     */
    ResponseData orderAliNotify(HttpServletRequest request, HttpServletResponse response);


    /**
     * 订单首款微信回调
     * @param request
     * @param response
     * @return
     */
    ResponseData orderWxNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 订单尾款支付宝回调
     * @param request
     * @param response
     * @return
     */
    ResponseData secondOrderAliNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 订单尾款微信回调
     * @param request
     * @param response
     * @return
     */
    ResponseData secondOrderWxNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 设计师调价支付宝回调地址
     * @param request
     * @param response
     * @return
     */
    ResponseData orderAdjustPricePayAliNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 设计师调价微信回调地址
     * @param request
     * @param response
     * @return
     */
    ResponseData orderAdjustPricePayWxNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 表现师调价设计师确认支付宝回调地址
     * @param request
     * @param response
     * @return
     */
    ResponseData orderAdjustPriceConfirmPayAliNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 表现师调价设计师确认微信回调地址
     * @param request
     * @param response
     * @return
     */
    ResponseData orderAdjustPriceConfirmPayWxNotify(HttpServletRequest request, HttpServletResponse response);

    /**
     * 后台列表统计
     * @param order
     * @return
     */
    OrderCount statistics(Order order);

    ResponseData orderLakalaNotify(Map<String, String> paramMap);

    ResponseData secondOrderLakalaNotify(Map<String, String> paramMap);

    ResponseData orderAdjustPricePayLakalaNotify(Map<String, String> paramMap);

    ResponseData orderAdjustPriceConfirmPayLakalaNotify(Map<String, String> paramMap);

    ResponseData<Boolean> isNeedGetOrderDetail(IsNeedGetOrderDetailReq req);

    ResponseData cancelOrderAppeal(BodyIdReq req, UserVo userVo);

    ResponseData getLakalaPaySuccess(LakalaPaySuccessReq req);

    ResponseData sampleImagesAddendum(SampleImagesUploadReq req, UserVo userVo);
}
