package com.ruoyi.frequency.mallorder.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.controller.req.*;
import com.ruoyi.controller.resp.MallOrderPageResp;
import com.ruoyi.frequency.mallorder.entity.MallOrder;
import com.ruoyi.frequency.mallorder.model.result.MallOrderCount;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.PayVo;
import com.ruoyi.vo.UserVo;

import java.util.List;

/**
 * 订单主Service接口
 *
 * @author liwenlong
 * @date 2024-01-25
 */
public interface MallOrderService extends IService<MallOrder>
{
    /**
     * 查询订单主
     *
     * @param id 订单主主键
     * @return 订单主
     */
    public MallOrder selectMallOrderById(Long id);

    /**
     * 查询订单主列表
     *
     * @param mallOrder 订单主
     * @return 订单主集合
     */
    public List<MallOrder> selectMallOrderList(MallOrder mallOrder);

    /**
     * 新增订单主
     *
     * @param mallOrder 订单主
     * @return 结果
     */
    public int insertMallOrder(MallOrder mallOrder);

    /**
     * 修改订单主
     *
     * @param mallOrder 订单主
     * @return 结果
     */
    public int updateMallOrder(MallOrder mallOrder);

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

    /**
     * 发货
     * @param mallOrder
     * @return
     */
    AjaxResult send(MallOrder mallOrder);

    /**
     * 订单结算
     * @param req
     * @param userVo
     * @return
     */
    PayVo settlement(MallSettlementReq req, UserVo userVo);

    /**
     * 创建订单
     * @param req
     * @param userVo
     * @return
     */
    ResponseData createOrder(CreateOrderReq req, UserVo userVo);

    /**
     *  生成订单号
     * @param type
     * @return
     */
    public String generateOrderNo(Integer type);

    /**
     * 支付后操作
     * @param order
     */
    void after(MallOrder order);

    /**
     * 商城订单列表
     * @param req
     * @param userVo
     * @return
     */
    ResponseData orderPage(MallOrderPageReq req, UserVo userVo);

    List<MallOrderPageResp> orderList(List<Long> mallOrderIds, UserVo userVo);

    ResponseData orderDetail(Long orderId, UserVo userVo);

    ResponseData orderPay(MallOrderPayReq req, UserVo userVo);

    ResponseData orderCancel(Long orderId, UserVo userVo);

    ResponseData orderRefund(Long orderId, UserVo userVo);

    ResponseData orderConfirm(MallOrderConfirmReq req, UserVo userVo);

    ResponseData orderAfterApply(ApplyAfterSalesReq req, UserVo userVo);

    ResponseData orderAfterDetail(Long orderId, UserVo userVo);

    ResponseData orderAfterRevokeApply(Long refundId, UserVo userVo);

    ResponseData customerDeliverGoods(CustomerDeliverGoodsReq req);


    ResponseData evaluate(MallEvaluateReq req, UserVo userVo);

    ResponseData onceAgainCreateOrder(OnceAgainCreateOrderReq req, UserVo userVo);

    MallOrderCount statistics(MallOrder mallOrder);
}
