package org.jeecg.modules.system.app.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.app.vo.ScanCodeQueryOrderVO;
import org.jeecg.modules.quartz.vo.JobClassNoticeVo;
import org.jeecg.modules.quartz.vo.JobReservationSiteVo;
import org.jeecg.modules.system.app.dto.AppOrderDTO;
import org.jeecg.modules.system.app.dto.ExportConditionDTO;
import org.jeecg.modules.system.app.entity.AppGame;
import org.jeecg.modules.system.app.entity.AppOrder;
import org.jeecg.modules.system.app.form.AppOrderPageForm;
import org.jeecg.modules.system.app.form.PriceChangeForm;
import org.jeecg.modules.system.app.form.RefundOrderPageForm;
import org.jeecg.modules.system.app.vo.AppOrderInfoVO;
import org.jeecg.modules.system.app.vo.ExportConditionVO;
import org.jeecg.modules.system.app.vo.OrderPageVO;
import org.jeecg.modules.system.app.vo.RefundOrderPageVO;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;
import java.util.List;

/**
 * @Description: 订单表
 * @Author: jeecg-boot
 * @Date:   2025-07-03
 * @Version: V1.0
 */
public interface IAppOrderService extends IService<AppOrder> {
    /**
     * 添加订单表
     * @param appOrderDTO
     * @return
     */
    Boolean saveWitchProduct(AppOrderDTO appOrderDTO);

    /**
     * 修改订单表
     * @param appOrderDTO
     * @return
     */
    Boolean editWitchProduct(AppOrderDTO appOrderDTO);

    /**
     * 删除订单表
     * @param id
     * @return
     */
    Boolean deleteWitchProductById(String id);

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    AppOrderDTO queryWitchProductById(String id);

    Page<OrderPageVO> queryPage(AppOrderPageForm appOrderPageForm);

    AppOrderInfoVO queryInfoById(String orderId);

    ScanCodeQueryOrderVO scanCodeQueryOrder(String orderId);

    Boolean scanCodeVerification(List<String> orderProInfoIds);


    List<JobClassNoticeVo> findByJob(Integer hoursBefore,Date date, int maxRetry);

    List<JobReservationSiteVo> findBySite(LocalDate currentDate, LocalTime localTime);

    /**
     * @description 赛事条件导出-查询赛事
     * params
     * @author SheepHy
     * @date 2025/9/17
     * return   {@link }
     **/
    List<ExportConditionVO> exportConditionByName(String name);

    /**
     * @description 赛事条件导出-查询项目
     * params
     * @author SheepHy
     * @date 2025/9/17
     * return   {@link }
     **/
    List<ExportConditionVO> exportConditionByProjectName(String projectName, String gameId);

    /**
     * @description 赛事条件导出
     * params
     * @author SheepHy
     * @date 2025/9/17
     * return   {@link }
     **/
    byte[] exportCondition(ExportConditionDTO exportConditionDTO) throws IOException;

    IPage<RefundOrderPageVO> refundOrderPageList(RefundOrderPageForm refundOrderPageForm);

    String priceChange(PriceChangeForm priceChangeForm);
}
