package com.ruoyi.info.order.service;

import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.info.hospital.domain.vo.HospitalStatisticsVo;
import com.ruoyi.info.order.domain.Order;
import com.ruoyi.info.order.domain.bo.OrderBo;
import com.ruoyi.info.order.domain.bo.OrderReviewsBo;
import com.ruoyi.info.order.domain.vo.OrderVo;
import com.ruoyi.info.order.domain.vo.OrderWorkerSumVo;
import com.ruoyi.info.order.enums.CancellationMethod;

import java.util.Collection;
import java.util.List;

/**
 * 订单Service接口
 *
 * @author ruoyi
 * @date 2025-09-20
 */
public interface IOrderService {

    /**
     * 查询订单分页
     *
     * @param bo 订单
     * @return 订单集合
     */
    TableDataInfo<OrderVo> queryPageList(OrderBo bo, PageQuery pageQuery);

    /**
     * 查询订单列表
     *
     * @param bo 订单
     * @return 订单集合
     */
    List<OrderVo> queryList(OrderBo bo);

    /**
     * 查询订单
     *
     * @param id 订单主键
     * @return 订单
     */
    OrderVo queryById(Long id);

    /**
     * 详情订单
     *
     * @param id 订单主键
     * @return 订单
     */
    Order loadById(Long id, Boolean tw);

    /**
     * 新增订单
     *
     * @param bo 订单
     * @return 结果
     */
    Boolean insertByBo(OrderBo bo);

    /**
     * 修改订单
     *
     * @param bo 订单
     * @return 结果
     */
    Boolean updateByBo(OrderBo bo);

    /**
     * 校验并批量删除订单信息
     *
     * @param ids 需要删除的订单主键集合
     * @param isValid 是否校验,true-删除前校验,false-不校验
     * @return 结果
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    boolean cancel(Long id, Long userId, CancellationMethod cancellationMethod);

    TableDataInfo<OrderVo> queryAllPageList(OrderBo bo, PageQuery pageQuery);

    List<OrderVo> queryAllList(OrderBo bo);

    Integer querySumForHome();

    List<HospitalStatisticsVo> queryHospitalOrderStatistics();

    boolean assignWorker(OrderBo bo, Long teacherId);

    boolean startService(Long id, Long workerId);

    boolean finishService(Long id, Long workerId);

    String getManagerPhone(Long id, Long workerId);

    String getWorkerPhone(Long id, Long teacherId);

    boolean evaluate(OrderReviewsBo bo);

    List<OrderWorkerSumVo> getOrderWorkerSum();
}
