shjung 3 years ago
parent
commit
a4d36a7b9e

+ 4 - 2
src/main/java/com/its/wthr/rss/RSSFeedParser.java

@@ -94,7 +94,7 @@ public class RSSFeedParser {
                     }
                 }
                 else if (event.isEndElement()) {
-                    if (event.asEndElement().getName().getLocalPart() == (ITEM)) {
+                    if ((ITEM).equals(event.asEndElement().getName().getLocalPart())) {
                         FeedMessage message = new FeedMessage();
                         message.setAuthor(author);
                         message.setDescription(description);
@@ -102,7 +102,9 @@ public class RSSFeedParser {
                         message.setLink(link);
                         message.setTitle(title);
                         message.setPubdate(pubdate);
-                        feed.getMessages().add(message);
+                        if (feed != null) {
+                            feed.getMessages().add(message);
+                        }
                         event = eventReader.nextEvent();
                     }
                 }

+ 1 - 1
src/main/java/com/its/wthr/scheduler/SchedulerTask.java

@@ -40,7 +40,7 @@ public class SchedulerTask {
         log.info("UnitSystSchedule :: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
     }
 
-    @Scheduled(cron = "${application.atmp.crontab:0 10 * * * *}")
+    @Scheduled(cron = "${application.atmp.crontab:0 15 * * * *}")
     public void atmpSchedule() {
         if (!this.serverConfig.isStartSchedule()) {
             return;

+ 1 - 1
src/main/java/com/its/wthr/service/AtmpService.java

@@ -158,7 +158,7 @@ public class AtmpService extends AbstractXmlService {
                 AppRepository.getInstance().getAtmpPltnMap().get(obj.getATMP_STTN_NMBR()).setRequestTime(SysUtils.getSysTimeStr());
 
                 stts = getAtmpInfo(obj.getATMP_STTN_NM(), obj.getATMP_STTN_NMBR());
-                if (stts != null && stts.getATMP_STTN_NMBR() == obj.getATMP_STTN_NMBR()) {
+                if (stts != null && stts.getATMP_STTN_NMBR().equals(obj.getATMP_STTN_NMBR())) {
                     stts.setATMP_STTN_NMBR(obj.getATMP_STTN_NMBR());
                     AppRepository.getInstance().getAtmpPltnMap().get(obj.getATMP_STTN_NMBR()).setRequestResult(1);
                     AppRepository.getInstance().getAtmpPltnMap().get(obj.getATMP_STTN_NMBR()).setRequestValue(stts.toString());

+ 24 - 7
src/main/java/com/its/wthr/webapp/controller/WebAppController.java

@@ -5,6 +5,8 @@ import com.its.wthr.config.ServerConfig;
 import com.its.wthr.repository.AppRepository;
 import com.its.wthr.service.AtmpService;
 import com.its.wthr.service.FrcsService;
+import com.its.wthr.vo.AtmpPltnVo;
+import com.its.wthr.vo.FrcsZoneVo;
 import com.its.wthr.webapp.config.service.FileService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.core.io.ResourceLoader;
@@ -16,6 +18,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
 
 @Slf4j
 @Controller
@@ -34,13 +39,16 @@ public class WebAppController {
     @RequestMapping(value = {"/atmp"})
     public String atmp(Model model, HttpServletRequest request) {
         String result = "atmp";
-        /*SortedMap<Integer, voAtmpPltn> ctlrMap = new TreeMap<>();
-        for (Map.Entry<String, voAtmpPltn> e : AppRepository.getInstance().getAtmpPltnMap().entrySet()) {
-            voAtmpPltn obj = e.getValue();
-            ctlrMap.put(Integer.valueOf(obj.getATMP_STTN_NMBR()), obj);
-        }*/
+        SortedMap<Integer, AtmpPltnVo> ctlrMap = new TreeMap<>();
+        for (Map.Entry<String, AtmpPltnVo> e : AppRepository.getInstance().getAtmpPltnMap().entrySet()) {
+            AtmpPltnVo obj = e.getValue();
+            if (obj.getDEL_YN().equals("N")) {
+                ctlrMap.put(Integer.valueOf(obj.getATMP_STTN_NMBR()), obj);
+            }
+        }
         model.addAttribute("ServerConfig", this.serverConfig);
-        model.addAttribute("list", AppRepository.getInstance().getAtmpPltnMap());
+        //model.addAttribute("list", AppRepository.getInstance().getAtmpPltnMap());
+        model.addAttribute("list", ctlrMap);
         model.addAttribute("ServerTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
         return result;
     }
@@ -70,8 +78,17 @@ public class WebAppController {
     @RequestMapping(value = {"/frcs"})
     public String frcs(Model model, HttpServletRequest request) {
         String result = "frcs";
+        SortedMap<Long, FrcsZoneVo> ctlrMap = new TreeMap<>();
+        for (Map.Entry<String, FrcsZoneVo> e : AppRepository.getInstance().getFrcsZoneMap().entrySet()) {
+            FrcsZoneVo obj = e.getValue();
+            if (obj.getDEL_YN().equals("N")) {
+                ctlrMap.put(Long.valueOf(obj.getVILG_FRCS_ZONE_CD()), obj);
+            }
+        }
+
         model.addAttribute("ServerConfig", this.serverConfig);
-        model.addAttribute("list", AppRepository.getInstance().getFrcsZoneMap());
+        //model.addAttribute("list", AppRepository.getInstance().getFrcsZoneMap());
+        model.addAttribute("list", ctlrMap);
         model.addAttribute("ServerTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
         return result;
     }

+ 20 - 10
src/main/resources/application.yml

@@ -4,12 +4,12 @@ application:
     name: Weather(Open API) Communication Server
     history: true
   user:
-    id: 1
-    pswd: 1
+    id: admin
+    pswd: 1234
 
   atmp:
     enabled: true
-    crontab: 10 0/5 * * * *
+    crontab: 30 0/15 * * * *
     api-key: 2y3qwo%2BwhlG6E%2BZfcyDKLMCr5Lp4gy%2BNgGuvWmgAdq7O%2Bf%2Fs4DPQz2ZD1rzDLowBq%2F6pfSi5F6UWlyM5meRiaw%3D%3D
     api-ver: 1.3
     start-hour: 0
@@ -17,7 +17,7 @@ application:
 
   frcs:
     enabled: true
-    crontab: 10 0/5 * * * *
+    crontab: 10 0/15 * * * *
     api-key: 2y3qwo%2BwhlG6E%2BZfcyDKLMCr5Lp4gy%2BNgGuvWmgAdq7O%2Bf%2Fs4DPQz2ZD1rzDLowBq%2F6pfSi5F6UWlyM5meRiaw%3D%3D
     start-hour: 0
     end-hour: 23
@@ -37,6 +37,10 @@ server:
 spring:
   application:
     name: wthr-comm-server
+  profiles:
+    active: prod
+  main:
+    banner-mode: off
   mvc:
     view:
       prefix: /WEB-INF/jsp/
@@ -48,8 +52,8 @@ spring:
   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:@192.168.20.99:8629:tibero
+      jdbc-url: jdbc:tibero:thin:@115.91.94.42:8629:tibero
+      #jdbc-url: jdbc:tibero:thin:@192.168.20.99:8629:tibero
       username: yiits
       password: yiits
       minimumIdle: 5
@@ -63,8 +67,14 @@ spring:
   profiles: prod
   datasource:
     hikari:
-      driver-class-name: oracle.jdbc.OracleDriver
-      jdbc-url: jdbc:oracle:thin:@172.16.1.110:1521:mpits
-      username: mpits
-      password: mpits
+      driver-class-name: com.tmax.tibero.jdbc.TbDriver
+      #jdbc-url: jdbc:tibero:thin:@172.16.11.52:8800:new_yiitsdb
+      jdbc-url: jdbc:tibero:thin:@(DESCRIPTION=(FAILOVER=ON)(LOAD_BALANCE=ON)(ADDRESS_LIST=(ADDRESS=(HOST=172.16.11.52)(PORT=8800))(ADDRESS=(HOST=172.16.11.62)(PORT=8800)))(DATABASE_NAME=new_yiitsdb))
+      username: yiits
+      password: yiits
+      minimumIdle: 5
+      maximumIdle: 10
+      maximumPoolSize: 20
+      idleTimeout: 30000
+      connectTimeout: 10000