| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Data |
| | | @Component |
| | | @Service |
| | | public class HxGatewaySyncGrainImpl implements GatewaySyncGranService { |
| | | |
| | | |
| | |
| | | //根号 |
| | | cableNum = (i / cableZ) + 1; |
| | | |
| | | |
| | | temperature.add(new GrainTemp(cableNum + "", z + "", curTemp + "", position + "")); |
| | | } |
| | | |
| | |
| | | |
| | | 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)); |