package com.huatek.frame.base.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.huatek.frame.base.dto.ModelComponentDataDTO;
import com.huatek.frame.base.dto.ModelDTO;
import com.huatek.frame.base.entity.*;
import com.huatek.frame.base.mapper.*;
import com.huatek.frame.base.service.ModelService;
import com.huatek.frame.base.util.*;
import com.huatek.frame.base.vo.*;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;
import com.huatek.torch.sql.beans.WherePrams;
import com.huatek.torch.util.uuid.Uuid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toMap;

/**
 * 模型 ServiceImpl
 *
 * @date 2023-2-8 14:03:46
 */
@Component
@Service(interfaceClass = ModelService.class)
@Transactional(rollbackFor = Exception.class)
public class ModelServiceImpl implements ModelService {

	@Autowired
	private ModelMapper modelMapper;

	@Autowired
	private ModelComponentDataDao modelComponentDataDao;

	@Autowired
	private ModelComponentDataMapper modelComponentDataMapper;

	@Autowired
	private SysModelDao sysModelDao;

	@Autowired
	private BusiSiteTreeDao busiSiteTreeDao;

	@Override
	public Map<String, Object> updateModelList(List<String> originalNameList) {
		List<ModelDTO> list = Lists.newArrayList();

		originalNameList.forEach(var->{
			ModelDTO dto = new ModelDTO();
			dto.setModelId(Uuid.getUUID());
			dto.setOriginalName(var);
			list.add(dto);
		});
		modelMapper.updateModelList(list);
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS,"MODEL.UPDATE.SUCCESS",null);
	}

	@Override
	public Map<String, Object> selectModelList(ModelDTO dto) {
		if(dto.getPage() != null && dto.getLimit() != null){
			PageHelper.startPage(dto.getPage(), dto.getLimit());
		}
		Page<ModelVO> page = modelMapper.selectModelList(dto);
		return  ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, page.getTotal(), "MODEL.QUERY.SUCCESS", page.getResult());
	}

	@Override
	public Map<String, Object> selectModelTypeList() {
		return  ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", BusinessConstants.MainEquipEnum.getModelList());
	}

	@Override
	public Map<String, Object> updateModel(ModelDTO dto) {
		if (ObjectUtils.isEmpty(dto.getModelId())) {
			return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "模型id不存在");
		}
		if (ObjectUtils.isEmpty(dto.getModelType())) {
			return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "模型类型不存在");
		}
		if (ObjectUtils.isEmpty(dto.getStatus())) {
			return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "启用状态不存在");
		}
		if (ObjectUtils.isEmpty(dto.getSiteId())) {
			return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "站点id不存在");
		}
		// todo 校验
//		SysModel model = modelMapper.selectModelById();
		if (Constants.DEFAULT_YES.equals(dto.getStatus())) {
			ModelDTO param = new ModelDTO();
			param.setModelType(dto.getModelType());
			param.setStatus(Constants.DEFAULT_YES);
			param.setModelId(dto.getModelId());
			param.setSiteId(dto.getSiteId());
			List<ModelVO> modelVOList =  modelMapper.selectModelListRemoveSelf(param);
			if (!ObjectUtils.isEmpty(modelVOList)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "操作失败，当前站点的同一模型类型下已经存在启用的模型！");
			}
		}
		modelMapper.updateModel(dto);
		return ReplyUtil.put(ConstantUtil.REQUEST_SUCCESS);
	}

	@Override
	public Map<String, Object> updateModelParams(ModelDTO dto) {

		modelMapper.updateModelParams(dto);
		return ReplyUtil.put(ConstantUtil.REQUEST_SUCCESS);
	}

	@Override
	public Map<String, Object> selectDeviceListList(String modelType) {
		List<SysModelDevice> deviceList = new ArrayList<>();
		if (BusinessConstants.MainEquipEnum.BYQ.getValue().equals(modelType)) {
			deviceList =  BusinessConstants.TransformerEqmEnum.getDeviceList();
		}
		else if (BusinessConstants.MainEquipEnum.GIS.getValue().equals(modelType)) {
			deviceList = BusinessConstants.GisEqmEnum.getDeviceList();
		}
		else if (BusinessConstants.MainEquipEnum.BLQ.getValue().equals(modelType)) {
			deviceList = BusinessConstants.ArresterEqmEnum.getDeviceList();
		}
		else if (BusinessConstants.MainEquipEnum.CW.getValue().equals(modelType)) {
			deviceList = BusinessConstants.CabinetEqmEnum.getDeviceList();
		}
		else if (BusinessConstants.MainEquipEnum.DL.getValue().equals(modelType)) {
			deviceList = BusinessConstants.CableEqmEnum.getDeviceList();
		}
		else if (BusinessConstants.MainEquipEnum.GEN.getValue().equals(modelType)) {
			deviceList = BusinessConstants.GeneratorEqmEnum.getDeviceList();
		}

		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS,"",deviceList);
	}

	@Override
	public Map<String, Object> selectDataItemsByDeviceCode(String deviceCode, String amplType) {
		List<DataItem> deviceDataItemList = new ArrayList<>();
		if (BusinessConstants.GeneratorEqmEnum.ZD_EQM.getCode().equals(deviceCode)) {
			if (ObjectUtils.isEmpty(amplType)) {
				ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "振动类型不存在");
			}
			if (BusinessConstants.GeneratorAmplTypeEnum.kqjxx.getValue().equals(amplType)
					|| BusinessConstants.GeneratorAmplTypeEnum.kqjxs.getValue().equals(amplType)) {
				deviceDataItemList = BusinessConstants.dataItemListMap.get("genjx");
			}
			else {
				deviceDataItemList = BusinessConstants.dataItemListMap.get("genzd");
			}
		} else {
			deviceDataItemList = BusinessConstants.dataItemListMap.get(deviceCode);
		}
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS,"",deviceDataItemList);
	}

	@Override
	public Map<String, Object> selectStationList() {
		List<SiteVo> stationList = modelMapper.selectStationList();
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS,"",stationList);
	}

	@Override
	public Map<String, Object> settingModelComponentData(ModelComponentDataDTO dto) {
		String dataItems = JSON.toJSONString(dto.getDataItems());
		ModelComponentData entity = new ModelComponentData();
		BeanUtils.copyProperties(dto, entity);
		entity.setDataItems(dataItems);
		LocalDateTime now = LocalDateTime.now();
		// 新增
		if (ObjectUtils.isEmpty(dto.getId())) {
			entity.setCreateTime(now);
			entity.setDelFlag(Constants.DEFAULT_NO);
		}
		entity.setUpdateTime(now);
		modelComponentDataDao.saveOrUpdate(entity);
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", null);
	}

	@Override
	public Map<String, Object> selectComponentDataList(ModelComponentDataDTO dto) {
		if(dto.getPage() != null && dto.getLimit() != null){
			PageHelper.startPage(dto.getPage(), dto.getLimit());
		}
		Page<ModelComponentDataVOOriginal> page = modelComponentDataMapper.selectPages(dto);
		List<ModelComponentDataVO> result = new ArrayList<>();
		Map<String, String> map = BusinessConstants.MasterStationEqmEnum.getDeviceList().stream().collect(Collectors.toMap(SysModelDevice::getModelType, SysModelDevice::getDeviceName));
		page.getResult().forEach(item -> {
			ModelComponentDataVO vo = new ModelComponentDataVO();
			BeanUtils.copyProperties(item, vo);
			List<DataItem> dataItemList = JSON.parseArray(item.getDataItems(), DataItem.class);
			vo.setDataItems(dataItemList);
//			vo.setMainTreeName(map.get(item.getMainTreeId()));
			result.add(vo);
		});
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, page.getTotal(), "", result);
	}

	@Transactional(rollbackFor = Exception.class)
	@Override
	public Map<String, Object> deleteModelComponentData(String[] ids) {
		for (String id : ids) {
			ModelComponentData modelComponentData = modelComponentDataDao.get(id);
			if (Constants.DEFAULT_YES.equals(modelComponentData.getStatus())) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "启用中不允许删除！");
			} else {
				modelComponentDataDao.del(id);
			}
		}
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", null);
	}

	@Override
	public Map<String, Object> selectMainEquipmentListByModelType(String siteId, String modelType) {
		if (BusinessConstants.MainEquipEnum.ZZ.getValue().equals(modelType)){
			List<SysModelDevice> deviceList = BusinessConstants.MasterStationEqmEnum.getDeviceList();
			List<BusiSiteTree> list = deviceList.stream().map(item -> {
				BusiSiteTree siteTree = new BusiSiteTree();
				siteTree.setSiteId(siteId);
				siteTree.setEquipmentType(modelType);
				siteTree.setId(item.getModelType());
				siteTree.setName(item.getDeviceName());
				return siteTree;
			}).collect(Collectors.toList());
			return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", list);
		}else {
			List<BusiSiteTree> list = busiSiteTreeDao.list(new WherePrams().where("site_id", siteId).
					and("equipment_type", modelType).and("status", "1"));
			return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", list);
		}


	}

	/**
	 * 查找传感器列表
	 */
	@Override
	public Map<String, Object> selectSensors(String modelType, String mainTreeId, String deviceCode) {
		List<BusiSensorVo> all = new ArrayList<>();
		String deviceType = "";
		// 变压器 √
		if (BusinessConstants.MainEquipEnum.BYQ.getValue().equals(modelType)) {
			// 油色谱
			if (BusinessConstants.DeviceCodeEnum.YSP.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.YSP_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.JF.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.JF_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.TX.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.TX_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.HW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.HW_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.TP.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.TP_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.RX.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.RX_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.QX.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.QX_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.JJ.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.JJ_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.RZCW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.RZCW_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.CW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.TransformerEqmEnum.CW_EQM.getValue();
			}

			if (ObjectUtils.isEmpty(deviceType)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "装置类型不存在");
			}
			List<BusiTransfromerSubTree> subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, deviceType);
			if (!ObjectUtils.isEmpty(subTreeList)) {
				for (BusiTransfromerSubTree subTree : subTreeList) {
					// sensorNameDetail显示这个字段
					List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
					all.addAll(busiSensorVoList);
				}
			}
		}
		// GIS √
		else if (BusinessConstants.MainEquipEnum.GIS.getValue().equals(modelType)) {
			if (BusinessConstants.DeviceCodeEnum.JF.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GisEqmEnum.JF_EQM.getValue();
			}
			if (BusinessConstants.DeviceCodeEnum.SF6.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GisEqmEnum.SF6_EQM.getValue();
			}
			if (BusinessConstants.DeviceCodeEnum.QX.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GisEqmEnum.QX_EQM.getValue();
			}
			if (BusinessConstants.DeviceCodeEnum.HW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GisEqmEnum.HW_EQM.getValue();
			}
			if (BusinessConstants.DeviceCodeEnum.TP.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GisEqmEnum.TP_EQM.getValue();
			}
			 if (BusinessConstants.DeviceCodeEnum.SF6ENV.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GisEqmEnum.SF6_ENV_EQM.getValue();
			}
			if (ObjectUtils.isEmpty(deviceType)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "装置类型不存在");
			}
			List<BusiGisSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, deviceType);
			if (!ObjectUtils.isEmpty(subTreeList)) {
				for (BusiGisSubTree subTree : subTreeList) {
					// sensorNameDetail显示这个字段
					List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
					all.addAll(busiSensorVoList);
				}
			}

		}
		// 开关柜
		else if (BusinessConstants.MainEquipEnum.CW.getValue().equals(modelType)) {
			if (BusinessConstants.DeviceCodeEnum.CW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.CabinetEqmEnum.CW_EQM.getValue();
			}
			if (ObjectUtils.isEmpty(deviceType)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "装置类型不存在");
			}
			List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdCw(mainTreeId);
				// sensorNameDetail显示这个字段
				all.addAll(busiSensorVoList);
		}
		// 避雷器
		else if (BusinessConstants.MainEquipEnum.BLQ.getValue().equals(modelType)) {
			if (BusinessConstants.DeviceCodeEnum.JY.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.ArresterEqmEnum.JY_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.HW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.ArresterEqmEnum.HW_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.RX.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.ArresterEqmEnum.RX_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.QX.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.ArresterEqmEnum.QX_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.TP.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.ArresterEqmEnum.TP_EQM.getValue();
			}
			if (ObjectUtils.isEmpty(deviceType)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "装置类型不存在");
			}
			List<BusiArresterSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeBlq(mainTreeId, deviceType);
			if (!ObjectUtils.isEmpty(subTreeList)) {
				for (BusiArresterSubTree subTree : subTreeList) {
					// sensorNameDetail显示这个字段
					List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdBlq(subTree.getId());
					all.addAll(busiSensorVoList);
				}
			}
		}
		// 电缆
		else if (BusinessConstants.MainEquipEnum.DL.getValue().equals(modelType)) {
			if (BusinessConstants.DeviceCodeEnum.JF.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.CableEqmEnum.DLJF_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.DLHL.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.CableEqmEnum.DLHL_EQM.getValue();
			}
//			else if (BusinessConstants.DeviceCodeEnum.DLG.getValue().equals(deviceCode)) {
//				deviceType = BusinessConstants.CableEqmEnum.DLG_EQM.getValue();
//			}
			else if (BusinessConstants.DeviceCodeEnum.HW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.CableEqmEnum.HW_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.CW.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.CableEqmEnum.CW_EQM.getValue();
			}
			else if (ObjectUtils.isEmpty(deviceType)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "装置类型不存在");
			}
			List<BusiCableSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeDl(mainTreeId, deviceType);
			if (!ObjectUtils.isEmpty(subTreeList)) {
				for (BusiCableSubTree subTree : subTreeList) {
					// sensorNameDetail显示这个字段
					List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdDl(subTree.getId());
					all.addAll(busiSensorVoList);
				}
			}
		}
		// 发电机
		else if (BusinessConstants.MainEquipEnum.GEN.getValue().equals(modelType)) {
			if (BusinessConstants.DeviceCodeEnum.ZD.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GeneratorEqmEnum.ZD_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.GENJF.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GeneratorEqmEnum.JF_EQM.getValue();
			}
			else if (BusinessConstants.DeviceCodeEnum.YL.getValue().equals(deviceCode)) {
				deviceType = BusinessConstants.GeneratorEqmEnum.YL_EQM.getValue();
			}
			else if (ObjectUtils.isEmpty(deviceType)) {
				return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "装置类型不存在");
			}
			List<BusiGeneratorSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeGen(mainTreeId, deviceType);
			if (!ObjectUtils.isEmpty(subTreeList)) {
				for (BusiGeneratorSubTree subTree : subTreeList) {
					// sensorNameDetail显示这个字段
					List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGen(subTree.getId());
					all.addAll(busiSensorVoList);
				}
			}
		}
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", all);
	}

	/**
	 * 实时数据列表
	 */
	@Override
	public Map<String, Object> selectRecentlyData(String mainEquipmentType, String mainTreeId) {
		List<SensorRecentlyDataVo> sensorRecentlyDataVoList = new ArrayList<>();
		// 变压器
		if (BusinessConstants.MainEquipEnum.BYQ.getValue().equals(mainEquipmentType)) {
			getRecentlyDataByq(mainTreeId, sensorRecentlyDataVoList);
		}
		// GIS
		else if (BusinessConstants.MainEquipEnum.GIS.getValue().equals(mainEquipmentType)) {
			getRecentlyDataGis(mainTreeId, sensorRecentlyDataVoList);
		}
		// 开关柜
		else if (BusinessConstants.MainEquipEnum.CW.getValue().equals(mainEquipmentType)) {
			getRecentlyDataCw(mainTreeId, sensorRecentlyDataVoList);
		}
		// 避雷器
		else if (BusinessConstants.MainEquipEnum.BLQ.getValue().equals(mainEquipmentType)) {
			getRecentlyDataBlq(mainTreeId, sensorRecentlyDataVoList);
		}
		// 电缆
		else if (BusinessConstants.MainEquipEnum.DL.getValue().equals(mainEquipmentType)) {
			getRecentlyDataDl(mainTreeId, sensorRecentlyDataVoList);
		}
		// 发电机
		else if (BusinessConstants.MainEquipEnum.GEN.getValue().equals(mainEquipmentType)) {
			getRecentlyDataGen(mainTreeId, sensorRecentlyDataVoList);
		}
		return ReplyUtil.put(ConstantUtil.REQUEST_SUCCESS, "", sensorRecentlyDataVoList);
	}

	@Override
	public Map<String, Object> enableModelComponentData(String enableType, String[] ids) {
		if ("0".equals(enableType)) {
			modelMapper.enableModelComponentData(enableType, ids);
			return ReplyUtil.put(ConstantUtil.REQUEST_SUCCESS, "禁用成功");
		} else if ("1".equals(enableType)) {
			modelMapper.enableModelComponentData(enableType, ids);
			return ReplyUtil.put(ConstantUtil.REQUEST_SUCCESS, "启用成功");
		} else {
			return ReplyUtil.put(ConstantUtil.REQUEST_FAIL, "请求参数错误");
		}
	}

	/**
	 *  实时数据列表-变压器
	 */
	private List<SensorRecentlyDataVo> getRecentlyDataByq(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
		// 油色谱
		List<BusiSensorVo> allSensor = new ArrayList<>();
		List<BusiTransfromerSubTree> subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.YSP_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectYspRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 局放
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.JF_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectJfRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 铁芯
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.TX_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectTxRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 红外(实时数据+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.HW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectHwRecentlyData(busiSensorVo.getSensorCode());
				SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
				sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
				sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
				sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
				String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(http_url)) {
					if (ObjectUtils.isEmpty(fieldValueMap)) {
						fieldValueMap = new HashMap<>();
					}
					fieldValueMap.put("http_url", http_url);
				}
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 图片数据(实时数据+图片+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.TP_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				List<Map<String, Object>> fieldValueMapList = modelMapper.selectTpRecentlyDataList(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMapList)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					for (Map<String, Object> fieldValueMap : fieldValueMapList) {
						String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
						if (ObjectUtils.isEmpty(http_url)) {
							http_url = "";
						}
						fieldValueMap.put("http_url", http_url);
					}
					sensorRecentlyDataVo.setFieldValueMapList(fieldValueMapList);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 容性设备
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.RX_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectRxRecentlyData(busiSensorVo.getSensorCode(), "1");
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 气象装置
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.QX_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectQxRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 夹件装置
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.JJ_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectTxRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		//测温装置
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.CW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectCwzzRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 绕组测温
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndType(mainTreeId, BusinessConstants.TransformerEqmEnum.RZCW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiTransfromerSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentId(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectRzcwRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		return sensorRecentlyDataVoList;
	}

	/**
	 * 实时数据列表-GIS
	 */
	private List<SensorRecentlyDataVo> getRecentlyDataGis(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
		// 局放
		List<BusiSensorVo> allSensor = new ArrayList<>();
		List<BusiGisSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, BusinessConstants.GisEqmEnum.JF_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGisSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectJfRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// SF6
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, BusinessConstants.GisEqmEnum.SF6_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGisSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectSf6RecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 气象装置
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, BusinessConstants.GisEqmEnum.QX_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGisSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectQxRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 红外(实时数据+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, BusinessConstants.GisEqmEnum.HW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGisSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectHwRecentlyData(busiSensorVo.getSensorCode());
				SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
				sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
				sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
				sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
				String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(http_url)) {
					if (ObjectUtils.isEmpty(fieldValueMap)) {
						fieldValueMap = new HashMap<>();
					}
					fieldValueMap.put("http_url", http_url);
				}
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 图片数据(实时数据+图片+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, BusinessConstants.GisEqmEnum.TP_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGisSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectTpRecentlyDataGis(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
					if (ObjectUtils.isEmpty(http_url)) {
						http_url = "";
					}
					fieldValueMap.put("http_url", http_url);
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}

		//SF6环境监测
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGis(mainTreeId, BusinessConstants.GisEqmEnum.SF6_ENV_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGisSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGis(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectSf6EnvRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
					if (ObjectUtils.isEmpty(http_url)) {
						http_url = "";
					}
					fieldValueMap.put("http_url", http_url);
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		return sensorRecentlyDataVoList;
	}

//	/**
//	 * 实时数据列表-开关柜
//	 */
//	private List<SensorRecentlyDataVo>getRecentlyDataCw(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
//		// 测温
//		List<BusiSensorVo> allSensor = modelMapper.querySensorByEquipmentIdCw(mainTreeId);
//		if (!ObjectUtils.isEmpty(allSensor)) {
//			for (BusiSensorVo busiSensorVo : allSensor) {
//				// 查询最近一条上报的数据
//				Map<String, Object> fieldValueMap = modelMapper.selectCwRecentlyData(busiSensorVo.getSensorCode());
//				if (!ObjectUtils.isEmpty(fieldValueMap)) {
//					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
//					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
//					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
//					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
//					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
//					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
//				}
//			}
//		}
//		return sensorRecentlyDataVoList;
//	}

	/**
	 * 实时数据列表-开关柜
	 */
	private List<SensorRecentlyDataVo>getRecentlyDataCw(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
		// 测温
		List<BusiSensorNewVo> allSensor = modelMapper.querySensorByEquipmentIdCwNew(mainTreeId);
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorNewVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
				sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
				sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
				sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
				Map<String,Object> fieldValueMap = new HashMap<>();
				fieldValueMap.put("d_time",busiSensorVo.getDTime());
				fieldValueMap.put("tmp",busiSensorVo.getTmp());
				sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
				sensorRecentlyDataVoList.add(sensorRecentlyDataVo);

			}
		}
		return sensorRecentlyDataVoList;
	}

	/**
	 * 实时数据列表-避雷器
	 */
	private List<SensorRecentlyDataVo> getRecentlyDataBlq(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
		// 绝缘监测
		List<BusiSensorVo> allSensor = new ArrayList<>();
		List<BusiArresterSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeBlq(mainTreeId, BusinessConstants.ArresterEqmEnum.JY_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiArresterSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdBlq(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectJyRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}

		// 红外(实时数据+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeBlq(mainTreeId, BusinessConstants.ArresterEqmEnum.HW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiArresterSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdBlq(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectHwRecentlyData(busiSensorVo.getSensorCode());
				SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
				sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
				sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
				sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
				String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(http_url)) {
					if (ObjectUtils.isEmpty(fieldValueMap)) {
						fieldValueMap = new HashMap<>();
					}
					fieldValueMap.put("http_url", http_url);
				}
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 容性设备
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeBlq(mainTreeId, BusinessConstants.ArresterEqmEnum.RX_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiArresterSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdBlq(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectRxRecentlyData(busiSensorVo.getSensorCode(), "4");
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 气象装置
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeBlq(mainTreeId, BusinessConstants.ArresterEqmEnum.QX_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiArresterSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdBlq(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectQxRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 图片数据(实时数据+图片+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeBlq(mainTreeId, BusinessConstants.TransformerEqmEnum.TP_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiArresterSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdBlq(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectTpRecentlyDataBlq(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
					if (ObjectUtils.isEmpty(http_url)) {
						http_url = "";
					}
					fieldValueMap.put("http_url", http_url);
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		return sensorRecentlyDataVoList;
	}

	/**
	 * 实时数据列表-电缆
	 */
	private List<SensorRecentlyDataVo> getRecentlyDataDl(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
		// 局放信号
		List<BusiSensorVo> allSensor = new ArrayList<>();
		List<BusiCableSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeDl(mainTreeId, BusinessConstants.CableEqmEnum.DLJF_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiCableSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdDl(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectJfRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}

		// 电缆环流
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeDl(mainTreeId, BusinessConstants.CableEqmEnum.DLHL_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiCableSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdDl(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectDlhlRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}

		// todo 电缆沟环境
//		allSensor = new ArrayList<>();
//		subTreeList = modelMapper.findListByEquipmentIdAndTypeDl(mainTreeId, BusinessConstants.CableEqmEnum.DLG_EQM.getValue());
//		if (!ObjectUtils.isEmpty(subTreeList)) {
//			for (BusiCableSubTree subTree : subTreeList) {
//				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdDl(subTree.getId());
//				allSensor.addAll(busiSensorVoList);
//			}
//		}
//		if (!ObjectUtils.isEmpty(allSensor)) {
//			for (BusiSensorVo busiSensorVo : allSensor) {
//				// 查询最近一条上报的数据
//				Map<String, Object> fieldValueMap = modelMapper.selectDlgRecentlyData(busiSensorVo.getSensorCode());
//				if (!ObjectUtils.isEmpty(fieldValueMap)) {
//					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
//					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
//					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
//					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
//					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
//					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
//				}
//			}
//		}

		// 红外监测(实时数据+视频)
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeDl(mainTreeId, BusinessConstants.CableEqmEnum.HW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiCableSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdDl(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectHwRecentlyData(busiSensorVo.getSensorCode());
				SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
				sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
				sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
				sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
				String http_url = modelMapper.selectVideoUrl(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(http_url)) {
					if (ObjectUtils.isEmpty(fieldValueMap)) {
						fieldValueMap = new HashMap<>();
					}
					fieldValueMap.put("http_url", http_url);
				}
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 测温装置
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeDl(mainTreeId, BusinessConstants.CableEqmEnum.CW_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiCableSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdDl(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectCwzzRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		return sensorRecentlyDataVoList;
	}

	/**
	 * 实时数据列表-发电机
	 */
	private List<SensorRecentlyDataVo> getRecentlyDataGen(String mainTreeId, List<SensorRecentlyDataVo> sensorRecentlyDataVoList) {
		// 振动
		List<BusiSensorVo> allSensor = new ArrayList<>();
		List<BusiGeneratorSubTree> subTreeList = modelMapper.findListByEquipmentIdAndTypeGen(mainTreeId, BusinessConstants.GeneratorEqmEnum.ZD_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGeneratorSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGen(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectZdRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setAmplType(busiSensorVo.getAmplType());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 局放
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGen(mainTreeId, BusinessConstants.GeneratorEqmEnum.JF_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGeneratorSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGen(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectGenJfRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}
		// 压力
		allSensor = new ArrayList<>();
		subTreeList = modelMapper.findListByEquipmentIdAndTypeGen(mainTreeId, BusinessConstants.GeneratorEqmEnum.YL_EQM.getValue());
		if (!ObjectUtils.isEmpty(subTreeList)) {
			for (BusiGeneratorSubTree subTree : subTreeList) {
				List<BusiSensorVo> busiSensorVoList = modelMapper.querySensorByEquipmentIdGen(subTree.getId());
				allSensor.addAll(busiSensorVoList);
			}
		}
		if (!ObjectUtils.isEmpty(allSensor)) {
			for (BusiSensorVo busiSensorVo : allSensor) {
				// 查询最近一条上报的数据
				Map<String, Object> fieldValueMap = modelMapper.selectYlRecentlyData(busiSensorVo.getSensorCode());
				if (!ObjectUtils.isEmpty(fieldValueMap)) {
					SensorRecentlyDataVo sensorRecentlyDataVo = new SensorRecentlyDataVo();
					sensorRecentlyDataVo.setSensorId(busiSensorVo.getId());
					sensorRecentlyDataVo.setSensorCode(busiSensorVo.getSensorCode());
					sensorRecentlyDataVo.setSensorName(busiSensorVo.getSensorName());
					sensorRecentlyDataVo.setFieldValueMap(fieldValueMap);
					sensorRecentlyDataVoList.add(sensorRecentlyDataVo);
				}
			}
		}

		return sensorRecentlyDataVoList;
	}

	@Override
	public Map<String, Object> selectMasterStationDeviceListByModelType(String equipmentType, String id) {
		List<SysModelDevice> deviceList = new ArrayList<>();
		if (BusinessConstants.MainEquipEnum.ZZ.getValue().equals(equipmentType)) {
			deviceList =  BusinessConstants.MasterStationDeviceTypeEnum.getDeviceList().stream().filter(item->item.getModelType().startsWith(id)).collect(Collectors.toList());
		}
		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS,"",deviceList);
	}

	@Override
	public Map<String, Object> selectMasterStation(String modelId) {
		List<MasterStationDeviceVO> deviceVOS = new ArrayList<>();
		List<MasterStationPartVO> list = modelMapper.selectMasterStation(modelId);
		Map<String, String> stringMap = BusinessConstants.MasterStationEqmEnum.getDeviceList().stream().collect(toMap(SysModelDevice::getModelType, SysModelDevice::getDeviceName));
		Map<String, String> typeMap = BusinessConstants.MasterStationDeviceTypeEnum.getDeviceList().stream().collect(toMap(SysModelDevice::getDeviceCode, SysModelDevice::getDeviceName));
		if (!CollectionUtils.isEmpty(list)){
			Map<String, List<MasterStationPartVO>> listMap = list.stream().collect(groupingBy(MasterStationPartVO::getMainTreeId));
			listMap.forEach((key,value)->{
				buildMasterStationDeviceJson(deviceVOS,key,stringMap,typeMap,value);
			});
		}

		return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS,"",deviceVOS);
	}

	private void buildMasterStationDeviceJson(List<MasterStationDeviceVO> deviceVOS,String key,Map<String, String> stringMap,Map<String, String> typeMap,List<MasterStationPartVO> list){
		MasterStationDeviceVO deviceVO = new MasterStationDeviceVO();
		deviceVO.setTitle(stringMap.get(key));
		deviceVO.setName("");
		deviceVO.setPositionX(list.get(0).getPositionX());
		deviceVO.setPositionY(list.get(0).getPositionY());
		deviceVO.setPositionZ(list.get(0).getPositionZ());
		List<String> codes = list.stream().map(MasterStationPartVO::getDeviceCode).collect(Collectors.toList());
		List<DeviceTypeVO> typeVOS = new ArrayList<>();
		for (String code : codes) {
			DeviceTypeVO typeVO = new DeviceTypeVO();
			typeVO.setSecondTitle(typeMap.get(code));
			typeVO.setDeviceCode("");
			typeVO.setMainTreeId("");
			typeVO.setMainTreeName("");
			typeVO.setName("");
			typeVO.setSensorCode("");
			typeVO.setTime("");
			typeVO.setHttp_url("");
			typeVO.setPicpath(new ArrayList());
			List<DeviceInfoVO> infoVOS = new ArrayList<>();
			infoVOS.add(new DeviceInfoVO("总数","0"));
			infoVOS.add(new DeviceInfoVO("在线率","0%"));
			typeVO.setList(infoVOS);
			typeVOS.add(typeVO);
		}
		deviceVO.setDataList(typeVOS);
		deviceVOS.add(deviceVO);
	}
}