| | |
| | | headers.setDeviceName(device.getDeviceName()); |
| | | headers.setProductId(device.getProductId()); |
| | | headers.setOrgId(device.getOrgId()); |
| | | headers.setMsgId(ScConstant.getMessageId()); |
| | | headers.setMsgId(reqData.getMessageId()); |
| | | grain.setHeaders(headers); |
| | | |
| | | GrainOutPut outPut = new GrainOutPut(); |
| | |
| | | |
| | | outPut.setTemperature(temperature); |
| | | |
| | | grain.setOutput(outPut); |
| | | grain.setOutput(JSONObject.toJSONString(outPut)); |
| | | |
| | | |
| | | GatewayDevice gatewayDeviceWeather = GatewayUtils.getCacheByDeviceTypeOne(GatewayDeviceType.TYPE_09.getCode()); |
| | |
| | | //气象信息 |
| | | GrainWeather weatherStation = new GrainWeather(); |
| | | weatherStation.setMessageId(ScConstant.getMessageId()); |
| | | weatherStation.setMessgeId(weatherStation.getMessageId()); |
| | | |
| | | if (null != gatewayDeviceWeather) { |
| | | weatherStation.setId(gatewayDeviceWeather.getDeviceId()); |
| | |
| | | weatherStation.setWindDirection(weather.getWin()); |
| | | weatherStation.setWindPower(weather.getWin_meter()); |
| | | weatherStation.setWindSpeed(weather.getWin_speed()); |
| | | grain.setWeatherStation(weatherStation); |
| | | grain.setWeatherStation(JSONObject.toJSONString(weatherStation)); |
| | | |
| | | return new BaseResp(JSONObject.toJSONString(grain)); |
| | | } |