소스 검색

Merge branch 'develop' into release

tags/v1.2.0^2
wanghaoran 1 년 전
부모
커밋
aaae64bbff
2개의 변경된 파일15개의 추가작업 그리고 3개의 파일을 삭제
  1. +10
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/dto/index/AirportDetailDto.java
  2. +5
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/IndexServiceImpl.java

+ 10
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/dto/index/AirportDetailDto.java 파일 보기

@@ -26,6 +26,11 @@ public class AirportDetailDto {
*/
private String wdir;

/**
* 风向名称
*/
private String wdirName;

/**
* 大气压力
*/
@@ -51,4 +56,9 @@ public class AirportDetailDto {
*/
private String mountName;

/**
* 降雨量
*/
private String rainfull;

}

+ 5
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/IndexServiceImpl.java 파일 보기

@@ -98,7 +98,7 @@ public class IndexServiceImpl implements IndexService {
JSONObject dataObject = (JSONObject) JSONObject.toJSON(jsonResult.getData());
JSONObject wthJson = dataObject.getJSONObject("WTH");
if(Objects.nonNull(wthJson)){
JSONObject parmJson = wthJson.getJSONObject("parm");
JSONObject parmJson = wthJson.getJSONObject("parmNew");

BigDecimal hum = parmJson.getBigDecimal("Hum").divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP);
airportDetailDto.setHum(hum + "rh");
@@ -106,7 +106,9 @@ public class IndexServiceImpl implements IndexService {
airportDetailDto.setTmp(tmp + "℃");

airportDetailDto.setWspd(parmJson.getString("WSPD") + "m/s")
.setWdir(parmJson.getString("WDIR") + "度");
.setWdir(parmJson.getString("WDIR") + "度")
.setRainfull(parmJson.getString("Rainfull") + "mm")
.setWdirName(parmJson.getString("WDIRNAME"));
//用角度表示风向,是把圆周分成360度,北风(N)是0度(即360度),东风(E)是90度,南风(S)是180度,西风(W)是270度
BigDecimal hpa = parmJson.getBigDecimal("Hpa");
if(hpa != null){
@@ -116,7 +118,7 @@ public class IndexServiceImpl implements IndexService {
}
JSONObject tahJson = dataObject.getJSONObject("TAH");
if(Objects.nonNull(tahJson)){
JSONObject parmJson = tahJson.getJSONObject("parm");
JSONObject parmJson = tahJson.getJSONObject("parmNew");
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);

Loading…
취소
저장