package com.ho.business.service;

import com.ho.business.entity.EarningsCalculate;
import com.ho.business.entity.EarningsCalculateSub;
import com.ho.business.entity.Station;
import com.ho.business.vo.req.bigScreen.CommonBigScreenReq;
import com.ho.business.vo.req.carbin.EarningsCalculateReq;
import com.ho.business.vo.req.pcsStation.PcsStationReq;
import com.ho.business.vo.req.report.ReportReqVO;
import com.ho.business.vo.resp.InverterResp.PowerGenerateRespVO;
import com.ho.business.vo.resp.cabin.EarningsCalculateCountResp;
import com.ho.business.vo.resp.cabin.EarningsCalculateResp;
import com.ho.business.vo.resp.income.RevenueOverview;
import com.ho.business.vo.resp.income.RevenueOverviewData;
import com.ho.business.vo.resp.pcsStation.EarningsCalculateData;
import com.ho.business.vo.resp.profit.DayProfitType;
import com.ho.business.vo.resp.profit.StationProfitType;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description 尖峰平谷电量电价
 * @Author xwz
 * @Date 2023/09/26
 */
public interface EarningsCalculateService {

    EarningsCalculateResp getTotal(EarningsCalculateReq earningsCalculateReq,Integer type);

    List<EarningsCalculate> selectList(EarningsCalculateReq earningsCalculateReq);

    //删除相同day和相同type
    int deleteByDay(String transDayStr, List<Integer> typeList);

    //碳足迹所有日冻结值设备入库
    int insertBatch(List<EarningsCalculate> emList);

    //电表冻结数据单个入库
    int insert(EarningsCalculate elecMeterValue);

    public void queryDeviceByStationId(List<Station> stations,Integer stationId,String beginTime);

    public List<EarningsCalculateSub> queryElecTemplateSubByStationId(Integer stationId, Integer templateType,String dateStr);

    public List<EarningsCalculateSub> queryElecRateTemplateSubByStationId(Integer stationId, Integer templateType,String dateStr);

    public Integer getSrcIdByStationId(Integer stationId,String deviceType);

    public Double getColCount(Integer stationId,String col);

    public void freezeMonthTotalEle(List<Station> stations);

    /**
     * 根据电站获取电站收益统计（当日，当月，当年）
     * @param stationId
     * @return
     */
    EarningsCalculateCountResp getEarningsCount(Integer stationId);

    BigDecimal selectSumByType(Integer stationId, Integer type, String beginTime, String endTime);

    List<EarningsCalculateData> getEarningsList(PcsStationReq req);

    int deleteByStationId(String transDayStr,Integer stationId, List<Integer> typeList);

    /**
     * 计算当日收益
     * @param stationId
     */
    void earningsCount(Integer stationId);

    /**
     * 按照条件汇总收益
     * @param earningsCalculateReq
     * @return
     */
    List<EarningsCalculate> totalList(EarningsCalculateReq earningsCalculateReq);
    /**
     * 查询集团总收益
     * @param beginString
     * @param endString
     * @param groupId
     * @return
     */
    BigDecimal getGroupProfit(String beginString, String endString, Integer groupId);

    /**
     * 查询电站总收益
     * @param beginString
     * @param endString
     * @param groupId
     * @return
     */
    List<StationProfitType> getStationProfit(String beginString, String endString, Integer groupId);



    /**
     * 查询集团总收益按天分组
     * @param beginString
     * @param endString
     * @param groupId
     * @return
     */
    List<DayProfitType> getDayProfit(String beginString, String endString, Integer groupId);

    //查询最早日期
    Date getFirstTime();

    List<DayProfitType> getProfit(String begin, String end, Integer groupId);

    /**
     * 根据时间查询电站充放电数据以及收益
     * @param vo
     * @return
     */
    List<RevenueOverviewData> getRevenueOverviewData(ReportReqVO vo);

    /**
     * 根据时间查询总收益数据
     * @param vo
     * @return
     */
    RevenueOverview getInvestment(ReportReqVO vo);

    /**
     * 导出数据
     * @param vo
     */
    void export(ReportReqVO vo, HttpServletResponse response);

    List<Map<String, Object>> getElecPrice(Integer stationId);


    List<DayProfitType> getEarningsByParam(CommonBigScreenReq req);

    List<PowerGenerateRespVO> getPvMonthData(EarningsCalculateReq req);
}
