Browse Source

调整获取添加获取参数

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
1a4119542a
2 changed files with 21 additions and 5 deletions
  1. +5
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/utils/AirWeatherUtil.java
  2. +16
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/AirWeatherVO.java

+ 5
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/utils/AirWeatherUtil.java View File

public class AirWeatherUtil { public class AirWeatherUtil {


public static String getWeather(AirWeatherVO airWeather) { public static String getWeather(AirWeatherVO airWeather) {
if(ObjectUtil.isEmpty(airWeather) ||ObjectUtil.isEmpty(airWeather.getWth())){
if (ObjectUtil.isEmpty(airWeather) || ObjectUtil.isEmpty(airWeather.getWth())) {
return ""; return "";
} }
return "气温:" + new BigDecimal(airWeather.getWth().getParm().getTmp()).divide(new BigDecimal(10))+"℃"
+ ";湿度:" + new BigDecimal(airWeather.getWth().getParm().getHum()).divide(new BigDecimal(10))+"RH"
+ ";风速:" + new BigDecimal(airWeather.getWth().getParm().getWspd()).divide(new BigDecimal(10))+"M/S"
+ ";风向:" + airWeather.getWth().getParm().getWdir() + "°";
return "气温:" + airWeather.getWth().getParmNew().getTmp() + "℃"
+ ";湿度:" + airWeather.getWth().getParmNew().getHum() + "RH"
+ ";风速:" + airWeather.getWth().getParmNew().getWspd() + "M/S"
+ ";风向:" + airWeather.getWth().getParmNew().getWdirname();
} }
} }

+ 16
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/AirWeatherVO.java View File

@Data @Data
public static class WTHDTO { public static class WTHDTO {
private ParmDTO parm; private ParmDTO parm;
private ParmNewDTO parmNew;
private Integer mid; private Integer mid;
private String deviceid; private String deviceid;
private Integer timestamp; private Integer timestamp;
private Integer pm10; private Integer pm10;
private Integer wdir; private Integer wdir;
} }

@NoArgsConstructor
@Data
public static class ParmNewDTO {
private Double hum;
private Double noise;
private Double rainfull;
private Double tmp;
private String wdirname;
private Double dew;
private Double wspd;
private Double hpa;
private Double wdir;
private Double lux;
}
} }


@NoArgsConstructor @NoArgsConstructor

Loading…
Cancel
Save