package com.ruoyi.mall.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.ApiResult;
import com.ruoyi.mall.domain.MallOrderBack;
import com.ruoyi.mall.domain.MallOrderOrder;

/**
 * 订单Service接口
 *
 * @author chang
 * @date 2021-11-25
 */
public interface IMallOrderOrderService
{
    /**
     * 查询订单
     *
     * @param id 订单主键
     * @return 订单
     */
    public MallOrderOrder selectMallOrderOrderById(Long id);

    /**
     * 查询订单列表
     *
     * @param mallOrderOrder 订单
     * @return 订单集合
     */
    public List<MallOrderOrder> selectMallOrderOrderList(MallOrderOrder mallOrderOrder);

    /**
     * 新增订单
     *
     * @param mallOrderOrder 订单
     * @return 结果
     */
    public int insertMallOrderOrder(MallOrderOrder mallOrderOrder);

    /**
     * 修改订单
     *
     * @param mallOrderOrder 订单
     * @return 结果
     */
    public int updateMallOrderOrder(MallOrderOrder mallOrderOrder);

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

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

    /**
     * 商品生成订单
     *
     */
    public MallOrderOrder creatOrderByGoods(Map<String, Object> params);

    /**
     * 购物车生成订单
     *
     */
    public MallOrderOrder creatOrderByCartIds(Map<String, Object> params);

    /*
    * 订单编号 查询订单
    * */
    public MallOrderOrder queryByOrderSn(String orderNo);

    //修改订单状态前，查看之前的订单状态是否异常
    public Boolean orderStatusRoute(int i, String orderId);

    public Boolean refundStatusRoute(int i, String refundId);

    public PageInfo<MallOrderOrder>  selectOrdersByType(String pageNum, String pageSize, String type, String userId);

    public void cancelOrder();

    public void updateRefundRestlt(MallOrderBack orderBack, MallOrderOrder orderOrder);

    public ApiResult updateMallOrderOrderByCancle(MallOrderOrder order);

    public int checkTotleCount();

    public BigDecimal checkTotlePrice();

    public BigDecimal checkYearDate(String year);

    public BigDecimal checkYearAndMonth(String year, String month, String day);

    public int checkCountYearAndMonth(String year, String month, String day);
}
