Parcourir la source

dev null string correct

shjung il y a 1 an
Parent
commit
7b707388fa

+ 2 - 22
app-install/conf/application.yml

@@ -20,29 +20,9 @@ server:
   port: 8873
 
 spring:
-  profiles:
-    active: dev
-
----
-spring:
-  config:
-    activate:
-      on-profile: dev
-  datasource:
-    hikari:
-      driver-class-name: com.tmax.tibero.jdbc.TbDriver
-      jdbc-url: jdbc:tibero:thin:@115.91.94.42:8629:tibero
-      username: ENC(D/mtjX68HkE=)
-      password: ENC(D/mtjX68HkE=)
-
----
-spring:
-  config:
-    activate:
-      on-profile: prod
   datasource:
     hikari:
       driver-class-name: com.tmax.tibero.jdbc.TbDriver
-      jdbc-url: jdbc:tibero:thin:@115.91.94.42:8629:tibero
+      jdbc-url: jdbc:tibero:thin:@10.10.10.11:8629:Andong_ITS
       username: ENC(D/mtjX68HkE=)
-      password: ENC(D/mtjX68HkE=)
+      password: ENC(zQxSStMUW37QqZ+AJ4OKPg==)

+ 4 - 0
src/main/java/com/its/wthr/openApi/arpltnInforInqireService/MsrStnAcctoRltmMesureDnsty.java

@@ -21,8 +21,11 @@ public class MsrStnAcctoRltmMesureDnsty extends ArpltnInforInqire {
     private int errorCode;
     private String errorMsg;
     private AtmpItem item = null;
+//    private AtmpItem baseItem = null;
 
     public boolean getMsrStnAcctoRltmMesureDnsty(String apiServiceKey, String sttnName, String apiVersion) {
+//        this.baseItem = new AtmpItem();
+//        this.baseItem.initVal();
         this.item = null;
 
         //            https://apis.data.go.kr/B552584/ArpltnInforInqireSvc/getMsrstnAcctoRltmMesureDnsty
@@ -158,6 +161,7 @@ public class MsrStnAcctoRltmMesureDnsty extends ArpltnInforInqire {
                 }
             }
             this.item = response.getResponse().getBody().getItems().get(lastIdx);
+            this.item.correctValue();
         } catch (JsonProcessingException e) {
             this.errorMsg = "JsonProcessingException.";
             log.error("MsrStnAcctoRltmMesureDnsty.getMsrStnAcctoRltmMesureDnsty: {}, JsonProcessingException, {}", sttnName, e.getMessage());

+ 64 - 1
src/main/java/com/its/wthr/openApi/arpltnInforInqireService/entity/AtmpItem.java

@@ -18,9 +18,10 @@ public class AtmpItem {
     private String pm10Value24;      // - 미세먼지(PM10) 24시간 예측이동농도(단위: ug/m3), 55, 옵션
     private String pm25Value;        // - 초미세먼지(PM2.5) 농도(단위: ug/m3), 44, 옵션
     private String pm25Value24;      // - 초미세먼지(PM2.5) 24시간 예측이동농도(단위: ug/m3), 31, 옵션
-    private String khaiValue;        // 통합대기환경수치, 2
 
+    private String khaiValue;        // 통합대기환경수치, 2
     private String khaiGrade;        // 통합대기환경지수, 2
+
     private String so2Grade;         // 아황산가스 지수, 1
     private String coGrade;          // 일산화탄소 지수, 1
     private String o3Grade;          // 오존 지수, 2
@@ -37,4 +38,66 @@ public class AtmpItem {
     private String pm10Flag;         // 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 점검 및 교정
     private String pm25Flag;         // - 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 자료이상, 옵션
 
+    public void initVal() {
+        this.dataTime = "";         // 측정일, 오염도측정 연-월-일 시간:분, 2020-11-25 13:00
+        this.mangName = "";         // 측정망 정보, 측정망 정보(도시대기, 도로변대기, 국가배경농도, 교외대기, 항만), 도시대기
+
+        this.so2Value = "";         // 아황산가스 농도(단위: ppm), 0.007
+        this.coValue = "";          // 일산화탄소 농도(단위: ppm), 0.4
+        this.o3Value = "";          // 오존 농도(단위: ppm), 0.043
+        this.no2Value = "";         // 이산화질소 농도(단위: ppm), 0.024
+        this.pm10Value = "";        // 미세먼지(PM10) 농도(단위: ug/m3), 73
+        this.pm10Value24 = "";      // - 미세먼지(PM10) 24시간 예측이동농도(단위: ug/m3), 55, 옵션
+        this.pm25Value = "";        // - 초미세먼지(PM2.5) 농도(단위: ug/m3), 44, 옵션
+        this.pm25Value24 = "";      // - 초미세먼지(PM2.5) 24시간 예측이동농도(단위: ug/m3), 31, 옵션
+        this.khaiValue = "";        // 통합대기환경수치, 2
+
+        this.khaiGrade = "";        // 통합대기환경지수, 2
+        this.so2Grade = "";         // 아황산가스 지수, 1
+        this.coGrade = "";          // 일산화탄소 지수, 1
+        this.o3Grade = "";          // 오존 지수, 2
+        this.no2Grade = "";         // 이산화질소 지수, 1
+        this.pm10Grade = "";        // 미세먼지(PM10) 24시간 등급자료, 2
+        this.pm25Grade = "";        // - 초미세먼지(PM2.5) 24시간 등급자료, 2, 옵션
+        this.pm10Grade1h = "";      // - 미세먼지(PM10) 1시간 등급자료, 2, 옵션
+        this.pm25Grade1h = "";      // - 초미세먼지(PM2.5) 1시간 등급자료, 2, 옵션
+
+        this.so2Flag = "";          // 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 점검 및 교정
+        this.coFlag = "";           // 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 점검 및 교정
+        this.o3Flag = "";           // 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 점검 및 교정
+        this.no2Flag = "";          // 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 점검 및 교정
+        this.pm10Flag = "";         // 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 점검 및 교정
+        this.pm25Flag = "";         // - 측정자료 상태정보(점검및교정, 장비점검, 자료이상, 통신장애), 자료이상, 옵션
+    }
+
+    public String correct(String value, String defValue) {
+        if (value == null) {
+            return defValue;
+        }
+        return value;
+    }
+    public void correctValue() {
+        this.mangName = correct(this.mangName, "");
+
+        this.so2Value = correct(this.so2Value, "");
+        this.coValue = correct(this.coValue, "");
+        this.o3Value = correct(this.o3Value, "");
+        this.no2Value = correct(this.no2Value, "");
+        this.pm10Value = correct(this.pm10Value, "");
+        this.pm10Value24 = correct(this.pm10Value24, "");
+        this.pm25Value = correct(this.pm25Value, "");
+        this.pm25Value24 = correct(this.pm25Value24, "");
+
+        this.khaiValue = correct(this.khaiValue, "");
+        this.khaiGrade = correct(this.khaiGrade, "");
+
+        this.so2Grade = correct(this.so2Grade, "");
+        this.coGrade = correct(this.coGrade, "");
+        this.o3Grade = correct(this.o3Grade, "");
+        this.no2Grade = correct(this.no2Grade, "");
+        this.pm10Grade = correct(this.pm10Grade, "");
+        this.pm25Grade = correct(this.pm25Grade, "");
+        this.pm10Grade1h = correct(this.pm10Grade1h, "");
+        this.pm25Grade1h =  correct(this.pm25Grade1h, "");
+    }
 }