|
@ -1,9 +1,11 @@ |
|
|
package com.zc.business.message.device.listener; |
|
|
package com.zc.business.message.device.listener; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.google.gson.JsonObject; |
|
|
import com.google.gson.JsonObject; |
|
|
import com.zc.business.domain.DcDevice; |
|
|
import com.zc.business.domain.DcDevice; |
|
|
import com.zc.business.domain.DcMeteorologicalDetectorData; |
|
|
import com.zc.business.domain.DcMeteorologicalDetectorData; |
|
|
|
|
|
import com.zc.business.domain.MdDeviceData; |
|
|
import com.zc.business.enums.IotProductEnum; |
|
|
import com.zc.business.enums.IotProductEnum; |
|
|
import com.zc.business.service.IDcMeteorologicalDetectorDataService; |
|
|
import com.zc.business.service.IDcMeteorologicalDetectorDataService; |
|
|
import com.zc.common.core.redis.stream.RedisStream; |
|
|
import com.zc.common.core.redis.stream.RedisStream; |
|
@ -17,6 +19,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
@ -53,8 +56,31 @@ public class DevicePropertyReportListener implements StreamListener<String, Obje |
|
|
meteorologicalDetectorData.setIotDeviceId(data.get("deviceId").toString()); |
|
|
meteorologicalDetectorData.setIotDeviceId(data.get("deviceId").toString()); |
|
|
meteorologicalDetectorDataService.insertDcMeteorologicalDetectorData(meteorologicalDetectorData); |
|
|
meteorologicalDetectorDataService.insertDcMeteorologicalDetectorData(meteorologicalDetectorData); |
|
|
|
|
|
|
|
|
//设计院中间库
|
|
|
//设计院中间库 插入设备数据
|
|
|
meteorologicalDetectorDataService.insertIntermediateWarehouseData(meteorologicalDetectorData); |
|
|
MdDeviceData mdDeviceData = new MdDeviceData(); |
|
|
|
|
|
mdDeviceData.setDevNo(meteorologicalDetectorData.getIotDeviceId()); |
|
|
|
|
|
mdDeviceData.setDevType("3"); |
|
|
|
|
|
mdDeviceData.setTimeStamp(new Date()); |
|
|
|
|
|
mdDeviceData.setCreatorUserId("自动存储"); |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> expands = new HashMap<>(); |
|
|
|
|
|
expands.put("rainFall",meteorologicalDetectorData.getRainfall()); //雨量
|
|
|
|
|
|
expands.put("windSpeed",meteorologicalDetectorData.getWindSpeed()); //风速
|
|
|
|
|
|
expands.put("windDirection",meteorologicalDetectorData.getWindDirection()); //风向
|
|
|
|
|
|
expands.put("temperature",meteorologicalDetectorData.getTemperature()); //大气温度
|
|
|
|
|
|
expands.put("humidity",meteorologicalDetectorData.getHumidity()); //大气湿度
|
|
|
|
|
|
expands.put("airPressure",meteorologicalDetectorData.getAtmosphericPressure()); //数字气压
|
|
|
|
|
|
expands.put("wet",meteorologicalDetectorData.getWetSlipperyCoefficient()); //湿滑
|
|
|
|
|
|
expands.put("rainXingTai",meteorologicalDetectorData.getPrecipitationType()); //雨量降水形态
|
|
|
|
|
|
expands.put("visibility",meteorologicalDetectorData.getVisibility()); //能见度
|
|
|
|
|
|
expands.put("pathContactLu",meteorologicalDetectorData.getRoadSurfaceTemperature()); //路面温度
|
|
|
|
|
|
expands.put("pathContactBing",meteorologicalDetectorData.getFreezingPointTemperature()); //冰点温度
|
|
|
|
|
|
expands.put("pathContactYan",meteorologicalDetectorData.getSalinityValue()); //路面盐度
|
|
|
|
|
|
expands.put("pathContactZhuang",meteorologicalDetectorData.getRemoteRoadSurfaceStatus()); //路面状况
|
|
|
|
|
|
|
|
|
|
|
|
mdDeviceData.setExpands(JSONObject.toJSONString(expands)); |
|
|
|
|
|
|
|
|
|
|
|
meteorologicalDetectorDataService.insertMiddleDatabaseDeviceData(mdDeviceData); |
|
|
} else if (IotProductEnum.ONE_STOP_PRODUCT.value().equals(productId)){ |
|
|
} else if (IotProductEnum.ONE_STOP_PRODUCT.value().equals(productId)){ |
|
|
//交调
|
|
|
//交调
|
|
|
|
|
|
|
|
|