shjung 2 years ago
parent
commit
af2986b0a6

+ 32 - 32
src/main/java/com/its/wthr/WthrCommServerApplication.java

@@ -84,35 +84,6 @@ public class WthrCommServerApplication implements CommandLineRunner, Application
     @Override
     public void run(String... args) throws Exception {
 
-        ServerConfig serverConfig = (ServerConfig) AppUtils.getBean(ServerConfig.class);
-        log.info("");
-        log.info("");
-        log.info("************************************************************************************");
-        log.info("**                                                                                **");
-        log.info("**                         Intelligent Traffic System                             **");
-        log.info("**                  Weather(Open API) Communication Server.                       **");
-        log.info("**                                                                                **");
-        log.info("**                                                                   [ver.1.0]    **");
-        log.info("**          {}", serverConfig.getProcessId());
-        log.info("** startup: {}", serverConfig.getBootingDateTime());
-        log.info("************************************************************************************");
-
-        // init application
-        DbmsJobProcess dbmsJobProcess = (DbmsJobProcess)AppUtils.getBean(DbmsJobProcess.class);
-        dbmsJobProcess.run();
-
-        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
-        unitSystService.loadMaster();
-        unitSystService.updateUnitSyst(true);
-
-//        if (!OS.isWindows()) {
-//            AtmpService atmpService = (AtmpService) AppUtils.getBean(AtmpService.class);
-//            atmpService.doJob();
-//
-//            FrcsService frcsService = (FrcsService) AppUtils.getBean(FrcsService.class);
-//            frcsService.doJob();
-//        }
-
         if (OS.isWindows()) {
             SwingUtilities.invokeLater(() -> {
                 String sysTime = SysUtils.getSysTimeStr();
@@ -149,18 +120,47 @@ public class WthrCommServerApplication implements CommandLineRunner, Application
                 JTextAreaOutputStream out = new JTextAreaOutputStream(logArea);
                 System.setOut(new PrintStream(out));
 
-                UI.LoadControllerInfo();
+                //UI.LoadControllerInfo();
             });
         }
 
-        AtmpService atmpService = (AtmpService) AppUtils.getBean(AtmpService.class);
-        atmpService.doJob();
+        ServerConfig serverConfig = (ServerConfig) AppUtils.getBean(ServerConfig.class);
+        log.info("");
+        log.info("");
+        log.info("************************************************************************************");
+        log.info("**                                                                                **");
+        log.info("**                         Intelligent Traffic System                             **");
+        log.info("**                  Weather(Open API) Communication Server.                       **");
+        log.info("**                                                                                **");
+        log.info("**                                                                   [ver.1.0]    **");
+        log.info("**          {}", serverConfig.getProcessId());
+        log.info("** startup: {}", serverConfig.getBootingDateTime());
+        log.info("************************************************************************************");
+
+        // init application
+        DbmsJobProcess dbmsJobProcess = (DbmsJobProcess)AppUtils.getBean(DbmsJobProcess.class);
+        dbmsJobProcess.run();
 
+        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
+        unitSystService.loadMaster();
+        unitSystService.updateUnitSyst(true);
+
+        AtmpService atmpService = (AtmpService) AppUtils.getBean(AtmpService.class);
         FrcsService frcsService = (FrcsService) AppUtils.getBean(FrcsService.class);
+
+        atmpService.doJob();
         frcsService.doJob();
 
         // schedule enable
         serverConfig.setStartSchedule(true);
+
+        if (OS.isWindows()) {
+            MainUI UI = MainUI.getInstance();
+            if (UI != null) {
+                UI.LoadControllerInfo();
+            }
+        }
+
     }
 
     public void terminateApplication() {

+ 1 - 1
src/main/resources/application.yml

@@ -38,7 +38,7 @@ spring:
   application:
     name: wthr-comm-server
   profiles:
-    active: dev
+    active: prod
   main:
     web-application-type: none
     log-startup-info: true