package com.yiqi.core.service;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yiqi.core.domain.SettlementStoreStatistics;
import com.yiqi.order.domain.dto.SettlementFactoryStatisticsDto;
import com.yiqi.settlement.domain.dto.StoreChargeStatistics;

/**
 * 门店每日统计Service接口
 *
 * @author douya
 * @date 2025-03-21
 */
public interface ISettlementStoreStatisticsService extends IService<SettlementStoreStatistics> {

    /**
     * 查询门店每日统计
     *
     * @param id 门店每日统计主键
     * @return 门店每日统计
     */
    public SettlementStoreStatistics selectSettlementStoreStatisticsById(Long id);


    /**
     * 查询门店每日统计列表
     *
     * @return 门店每日统计集合
     */
    List<SettlementStoreStatistics> queryStoreStatisticsByDate(Long storeId, Date start, Date end);


    /**
     * 平台每日统计列表
     *
     * @return 门店每日统计集合
     */
    List<SettlementStoreStatistics> generatePlatformStatisticsByDate(Date start, Date end);


    /**
     * 平台每日统计列表
     *
     * @return 门店每日统计集合
     */
    SettlementStoreStatistics orderStatistics(Long storeId, Date start, Date end);



    /**
     * 平台每日统计列表 （按门店）
     *
     * @return 门店每日统计集合
     */
    List<SettlementStoreStatistics> generatePlatformStatisticsByStore(Date start, Date end);

    /**
     * 生成每日统计数据*
     *
     * @param date
     * @return
     */
    void generateDayStatistics(Date date);

    /**
     * 获取门店的累计充值交易统计
     *
     * @param storeId
     * @param date
     * @return
     */
    StoreChargeStatistics chargeTotal(Long storeId);

    /**
     * 生成门店每日统计数据*
     *
     * @param date
     * @return
     */
    public SettlementStoreStatistics generateStoreStatistics(Date date, Long storeId);

    /**
     * 生成门店每日充值统计数据*
     *
     * @param date
     * @return
     */
    StoreChargeStatistics generateChargeStatistics(Date date, Long storeId);


    /**
     * 生成门店每日充值统计数据*
     *
     * @param
     * @return
     */
    List<StoreChargeStatistics> generateChargeStatisticsByDate(Long storeId, Date startDate, Date endDate);

    /**
     * @param start
     * @return
     */
    Page<StoreChargeStatistics> generateChargeStatisticsByStore(Long storeId, Integer storeType, Date start, Integer pageSize, Integer pageNum );

    /**
     * 查询门店每日统计列表
     *
     * @param settlementStoreStatistics 门店每日统计
     * @return 门店每日统计集合
     */
    public List<SettlementStoreStatistics> selectSettlementStoreStatisticsList(SettlementStoreStatistics settlementStoreStatistics);

    /**
     * 新增门店每日统计
     *
     * @param settlementStoreStatistics 门店每日统计
     * @return 结果
     */
    public int insertSettlementStoreStatistics(SettlementStoreStatistics settlementStoreStatistics);

    /**
     * 修改门店每日统计
     *
     * @param settlementStoreStatistics 门店每日统计
     * @return 结果
     */
    public int updateSettlementStoreStatistics(SettlementStoreStatistics settlementStoreStatistics);

    /**
     * 批量删除门店每日统计
     *
     * @param ids 需要删除的门店每日统计主键集合
     * @return 结果
     */
    public int deleteSettlementStoreStatisticsByIds(Long[] ids);

    /**
     * 删除门店每日统计信息
     *
     * @param id 门店每日统计主键
     * @return 结果
     */
    public int deleteSettlementStoreStatisticsById(Long id);

    /**
     * 生成门店每日统计数据*
     *
     * @param date
     * @return
     */
    List<SettlementStoreStatistics> generateStoreStatisticsByStore(Long storeId, Date start, Date end);

    /**
     * 生成门店每日统计数据*
     *
     * @param date
     * @return
     */
    List<SettlementStoreStatistics> generateStatisticsByDay(Long storeId, Date start, Date end);

    /**
     * 生成工厂每日统计数据*
     *
     * @param date
     * @return
     */
    List<SettlementFactoryStatisticsDto> generateStatisticsByFactory(Long factoryId, Date start, Date end);
}
