src/main/java/com/fzzy/gateway/hx2023/data/GrainWeather.java
@@ -15,13 +15,13 @@ private String pm; private String radiation; private String radiation = "0"; private String rainfallAmount; private String temperature; private String windAngle; private String windAngle="0"; private String windDirection; src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java
@@ -135,7 +135,6 @@ //根号 cableNum = (i / cableZ) + 1; temperature.add(new GrainTemp(cableNum + "", z + "", curTemp + "", position + "")); } @@ -143,6 +142,20 @@ grain.setOutPut(outPut); //气象信息 GrainWeather weatherStation = new GrainWeather(); weatherStation.setMessageId(ScConstant.getMessageId()); weatherStation.setId(device.getDeviceId()); weatherStation.setAirPressure(weather.getPressure()); weatherStation.setHumidity(weather.getHumidity()); weatherStation.setPm(weather.getAir_pm25()); weatherStation.setRadiation("0"); weatherStation.setRainfallAmount(weather.getWea()); weatherStation.setTemperature(weather.getTem()); weatherStation.setWindDirection(weather.getWin()); weatherStation.setWindPower(weather.getWin_meter()); weatherStation.setWindSpeed(weather.getWin_speed()); grain.setWeatherStation(weatherStation); BaseResp resp = new BaseResp(); resp.setData(JSONObject.toJSONString(grain)); src/main/java/com/fzzy/gateway/hx2023/service/OnReceiveMqttService.java
@@ -3,14 +3,13 @@ import com.alibaba.fastjson2.JSONObject; import com.fzzy.gateway.GatewayUtils; import com.fzzy.gateway.api.GatewayRemoteManager; import com.fzzy.gateway.hx2023.data.CloudSendData; import com.fzzy.gateway.data.BaseResp; import com.fzzy.gateway.entity.GatewayDevice; import com.fzzy.gateway.hx2023.ScConstant; import com.fzzy.gateway.data.BaseResp; import com.fzzy.gateway.hx2023.data.CloudSendData; import com.fzzy.gateway.hx2023.data.SyncReqData; import com.fzzy.mqtt.MqttProviderConfig; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.Resource;