shjung 2 years ago
parent
commit
57eec2c467

+ 11 - 0
src/main/java/com/its/vms/scheduler/SchedulerTask.java

@@ -43,6 +43,17 @@ public class SchedulerTask {
         log.info("scheduleUnitSystStts: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
     }
 
+    @Scheduled(cron = "10 * * * * *")  // 1분주기 작업 실행
+    public void scheduleVmsStatusRequest() {
+        if (!this.config.isStartSchedule()) {
+            return;
+        }
+        Elapsed elapsed = new Elapsed();
+        log.info("scheduleVmsStatusRequest: start. {}", Thread.currentThread().getName());
+        this.vmsManageService.requestStatus();
+        log.info("scheduleVmsStatusRequest: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
+    }
+
     @Scheduled(cron = "15 * * * * *")  // 1분주기 작업 실행
     public void scheduleVmsOnOffControl() {
         if (!this.config.isStartSchedule()) {

+ 12 - 0
src/main/java/com/its/vms/service/VmsManageService.java

@@ -1746,4 +1746,16 @@ public class VmsManageService {
         }
         return eVmsColor.color_green.getValue();
     }
+
+    /**
+     * 제어기 상태정보 요청
+     */
+    public void requestStatus() {
+        this.repoService.getCtlrMap().forEach((ctlrNmbr, vmsObj) -> {
+            if ("Y".equals(vmsObj.getDelYn())) {
+                return;
+            }
+            vmsObj.addRequestData(new TcpServerSendData(eVmsOpCode.OP_VMS_STATUS_REQ, null));
+        });
+    }
 }