package com.ho.business.service;

import cn.hutool.json.JSONObject;
import com.ho.business.entity.Device;
import com.ho.business.vo.req.device.CommonQuery;
import com.ho.business.vo.req.device.DeviceTreeReq;
import com.ho.business.vo.resp.DeviceRespVO;
import com.ho.business.vo.resp.EnvironmentalControlVo;
import com.ho.business.vo.resp.cabin.TemperatureVoltageNewResp;
import com.ho.business.vo.resp.point.ElecDataResp;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author fancl
 * @desc: 通用数据查询
 * @date 2023/5/8
 */
public interface CommonService {

    //得到真实设备信息
    JSONObject getRealInfo(Device device, List<String> cols);

    Map<Object, Object> getInfoFromRedis(Device device);
    //得到真实设备信息
    JSONObject getVirtualInfo(Device device, Device parentDevice, List<String> cols);

    //得到簇数据
    JSONObject getVirtualClusterInfo(List<DeviceRespVO> deviceList, Device parentDevice, List<String> cols);

    //PCS特殊处理
    JSONObject dealPCS(JSONObject deviceInfo, Device device);

    //BMS处理
    JSONObject dealBMS(JSONObject deviceInfo, Device device);

    JSONObject dealEMU(Device device, List<String> cols);



    //消防设备
    JSONObject dealFire(Map<Object, Object> deviceInfo, List<String> cols, Device device);

    //根据信号值生成对应的二进制结果
    JSONObject binaryDeal(String colPrefix, int len, BigDecimal inputSource);

    JSONObject dealAirCondition(Device device, List<String> cols);

    /**
     * 液冷
     * @param device
     * @param cols
     * @return
     */
    JSONObject getLiquidCooling(Device device, List<String> cols);

    Map<Object, Object> dealTransmitter(Device device);

    /**
     * 获取电池包温度电压数据
     * @return
     */
    TemperatureVoltageNewResp getTemperatureVoltageData(DeviceTreeReq vo);


    Object getMiddlePart(CommonQuery vo);


    List<EnvironmentalControlVo> getAirCondition(CommonQuery vo);

    List<ElecDataResp> getElec(CommonQuery vo);

    /**
     * 储能侧电表有功/无功功率
     * @param vo
     * @return
     */
    Object getEleMeter(CommonQuery vo);

    /**
     * 取光伏并网设备的有功功率
     * @param vo
     * @return
     */
    Object getPVElec(CommonQuery vo);
    /**
     *
     * @param vo
     * @return
     */
    Object getOpticalStorage(CommonQuery vo);

    /**
     * 获取汇总数据
     * @param vo
     * @return
     */
    Object getSummaryData(CommonQuery vo);


    /**
     * 储能侧电表	torageMeter
     * 负载侧电表	loadMeter
     * 并网侧电表	gridMeter
     */
    JSONObject getElecData(Device device, String collect);
}
