package com.xhpc.order.service;

import com.xhpc.common.core.domain.R;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.order.domain.XhpcPlaceholderOrder;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author yuyang
 * @Date 2025-05-06 10:07
 */
public interface IXhpcPlaceholderOrderService {

    int insertXhpcPlaceholderOrder(XhpcPlaceholderOrder placeholderOrder );

    void getTimingPriceTime(String gunNumber);

    void getReturnGunRecord(String serialNumber,String startTime,String endTime);

    List<Map<String,Object>> getListPage(String tenantId, Long chargingStationId, Long chargingPileId, Long terminalId, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type, String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult, Double totalMoneyMin, Double totalMoneyMax,String placeholderOrderNumber);

    List<Map<String,Object>> getAbnormalListPage(String tenantId, Long chargingStationId, Long chargingPileId, Long terminalId, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type, String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult);

    void export(HttpServletResponse response, String tenantId, Long chargingStationId, Long chargingPileId, Long terminalId, String phone, String transactionNumber, Integer status, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime, Long userId, Integer type, String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult, Double totalMoneyMin, Double totalMoneyMax,String placeholderOrderNumber) throws IOException;

    R getById(Long placeholderOrderId);

    void getxhpcPlaceholderOrderTasks();

    void getAbnormal();

    void getType();

    void getOrderNum();


    R getPlaceholderIDs(String [] stationIDs);

    AjaxResult getExamine(Long placeholderOrderId, BigDecimal totalMoney, String startTime , String endTime);

    /**
     * 订单来源列表
     * @return
     */
    List<Map<String, Object>> getSumSourceList(HttpServletRequest request, String tenantId, Long operatorId, Long chargingStationId, Long chargingPileId, Long terminalId, String startTime, String endTime, String sourceIds, String chargingStationIds);

    /**
     * 订单来源统计导出
     * @return
     */
    void getSumSourceListExport(HttpServletRequest request,HttpServletResponse response,String tenantId,Long operatorId,Long chargingStationId,Long chargingPileId,Long terminalId, String startTime, String endTime, String sourceIds,String chargingStationIds) throws IOException;


    /**
     * 日期统计
     * @param chargingStationIds         电站id集合
     * @param internetUserId      流量方id
     * @param operatorId          运营商id
     * @param startTime           订单开始时间
     * @param endTime             订单结束时间
     * @param userId              用户id
     * @param type             1 平台 2 运营商 3流量方
     * @return
     */
    List<Map<String, Object>> getDateIntervalPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);

    /**
     * 日期统计导出
     * @param chargingStationIds         电站id集合
     * @param internetUserId      流量方id
     * @param operatorId          运营商id
     * @param startTime           订单开始时间
     * @param endTime             订单结束时间
     * @param userId              用户id
     * @param type             1 平台 2 运营商 3流量方
     * @return
     */
    void dateIntervalExport(HttpServletRequest request,HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException;


    /**
     * 电站统计
     * @param chargingStationIds  电站集合
     * @param operatorIds        运营集合
     * @param internetUserId      流量方id
     * @param operatorId          运营商id
     * @param startTime           订单开始时间
     * @param endTime             订单结束时间
     * @param userId              用户id
     * @param type             1 平台 2 运营商 3流量方
     * @return
     */
    List<Map<String, Object>> getStationIntervalPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);

    /**
     * 电站统计导出
     * @param chargingStationIds  电站集合
     * @param operatorIds        运营集合
     * @param internetUserId      流量方id
     * @param operatorId          运营商id
     * @param startTime           订单开始时间
     * @param endTime             订单结束时间
     * @param userId              用户id
     * @param type             1 平台 2 运营商 3流量方
     * @return
     */
    void stationIntervalExport(HttpServletRequest request,HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException;


    List<Map<String,Object>> appealPlaceholderOrderList(HttpServletRequest request);

    R applyPlaceholderOrder(HttpServletRequest request,Long placeholderOrderId,String appealUserResult);

    R applyPlaceholderOrderProcess(HttpServletRequest request,Long placeholderOrderId,BigDecimal actPrice,String refundType,String appealResult,String imgId);


    R applyPlaceholderOrderInternetProcess(HttpServletRequest request,Long placeholderOrderId,BigDecimal actPrice,String refundType,String appealResult,String imgId);


    List<Map<String,Object>> appealPlaceholderOrderListPC(HttpServletRequest request,String tenantId,Long operatorId,String name, Integer type, String serialNumber, Long chargingStationId);


    R fileUpload(HttpServletRequest request, HttpServletResponse response, String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception;


    List<Map<String,Object>> deviceMessageList(String chargeOrderNo);
}
