| | |
| | | package com.fzzy.gateway.hx2023.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.api.data.DepotType; |
| | | import com.fzzy.api.data.GatewayDeviceType; |
| | |
| | | weightInfo.setWeightUnit("KG"); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("weightInfo", weightInfo); |
| | | jsonObject.put("weightInfo", JSON.toJSONString(weightInfo)); |
| | | |
| | | packet.setProperties(jsonObject); |
| | | |
| | |
| | | outPut.setTemperature(temperature); |
| | | List<GrainTH> ths = new ArrayList<>(); |
| | | |
| | | ths.add(new GrainTH(weather.getTem() != null ? weather.getTem() + "" : "", weather.getHumidity() != null ? weather.getHumidity() + "" : "", "1")); |
| | | ths.add(new GrainTH(weather.getTem() != null ? weather.getTem() + "" : "", weather.getHumidity() != null ? weather.getHumidity().replaceAll("%","") + "" : "", "1")); |
| | | outPut.setTemperatureAndhumidity(ths); |
| | | |
| | | grain.setOutput(JSONObject.toJSONString(outPut)); |
| | |
| | | weatherStation.setId(device.getDeviceId()); |
| | | } |
| | | weatherStation.setAirPressure(weather.getPressure()); |
| | | weatherStation.setHumidity(weather.getHumidity()); |
| | | weatherStation.setHumidity(weather.getHumidity().replaceAll("%","")); |
| | | weatherStation.setPm(weather.getAir_pm25()); |
| | | weatherStation.setRadiation("0"); |
| | | weatherStation.setRainfallAmount(weather.getWea()); |