|
|
@@ -97,6 +97,12 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
JSONObject wthJson = dataObject.getJSONObject("WTH"); |
|
|
|
if(Objects.nonNull(wthJson)){ |
|
|
|
JSONObject parmJson = wthJson.getJSONObject("parm"); |
|
|
|
|
|
|
|
BigDecimal hum = parmJson.getBigDecimal("Hum").divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
airportDetailDto.setHum(hum + "rh"); |
|
|
|
BigDecimal tmp = parmJson.getBigDecimal("Tmp").divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
airportDetailDto.setTmp(tmp + "℃"); |
|
|
|
|
|
|
|
airportDetailDto.setWspd(parmJson.getString("WSPD") + "m/s") |
|
|
|
.setWdir(parmJson.getString("WDIR") + "度"); |
|
|
|
//用角度表示风向,是把圆周分成360度,北风(N)是0度(即360度),东风(E)是90度,南风(S)是180度,西风(W)是270度 |
|
|
@@ -108,7 +114,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
} |
|
|
|
JSONObject tahJson = dataObject.getJSONObject("TAH"); |
|
|
|
if(Objects.nonNull(tahJson)){ |
|
|
|
JSONObject parmJson = wthJson.getJSONObject("parm"); |
|
|
|
JSONObject parmJson = tahJson.getJSONObject("parm"); |
|
|
|
BigDecimal hum = parmJson.getBigDecimal("Hum").divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
airportDetailDto.setHum(hum + "rh"); |
|
|
|
BigDecimal tmp = parmJson.getBigDecimal("Tmp").divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |