Commit 3c77c0da4e5e9585edc97c45ba1b78e1fe9f54ce

Authored by 潘钊
1 parent 8723dd64

update...

src/main/java/com/bsth/data/gpsdata/GpsRealData.java
1 package com.bsth.data.gpsdata; 1 package com.bsth.data.gpsdata;
2 2
  3 +import com.bsth.Application;
3 import com.bsth.data.BasicData; 4 import com.bsth.data.BasicData;
4 import com.bsth.data.forecast.ForecastRealServer; 5 import com.bsth.data.forecast.ForecastRealServer;
5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; 6 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
@@ -18,6 +19,7 @@ import org.springframework.stereotype.Component; @@ -18,6 +19,7 @@ import org.springframework.stereotype.Component;
18 import java.util.*; 19 import java.util.*;
19 import java.util.concurrent.ConcurrentHashMap; 20 import java.util.concurrent.ConcurrentHashMap;
20 import java.util.concurrent.ConcurrentMap; 21 import java.util.concurrent.ConcurrentMap;
  22 +import java.util.concurrent.TimeUnit;
21 23
22 /** 24 /**
23 * @author PanZhao 25 * @author PanZhao
@@ -62,7 +64,7 @@ public class GpsRealData implements CommandLineRunner { @@ -62,7 +64,7 @@ public class GpsRealData implements CommandLineRunner {
62 public void run(String... arg0) throws Exception { 64 public void run(String... arg0) throws Exception {
63 logger.info("gpsDataLoader,20,3"); 65 logger.info("gpsDataLoader,20,3");
64 //http形式获取GPS数据 66 //http形式获取GPS数据
65 - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 2, TimeUnit.SECONDS); 67 + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 2, TimeUnit.SECONDS);
66 //定时扫描掉离线 68 //定时扫描掉离线
67 //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); 69 //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
68 70
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -146,7 +146,7 @@ public class DayOfSchedule implements CommandLineRunner { @@ -146,7 +146,7 @@ public class DayOfSchedule implements CommandLineRunner {
146 basicDataLoader.loadAllData(); 146 basicDataLoader.loadAllData();
147 147
148 //翻班线程 148 //翻班线程
149 -// Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 149 + Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
150 //入库 150 //入库
151 // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS); 151 // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS);
152 //班次误点扫描 152 //班次误点扫描
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen @@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen
132 // 发送指令 132 // 发送指令
133 int code = GatewayHttpUtils.postJson(jObj.toJSONString()); 133 int code = GatewayHttpUtils.postJson(jObj.toJSONString());
134 134
135 - // 添加到缓存,等待入库  
136 d60.setDispatch(true); 135 d60.setDispatch(true);
137 d60.setSch(sch); 136 d60.setSch(sch);
138 d60.setHttpCode(code); 137 d60.setHttpCode(code);
139 - dayOfDirectives.put60(d60);  
140 138
141 if (code == 0) { 139 if (code == 0) {
142 sch.setDirectiveState(60); 140 sch.setDirectiveState(60);
  141 + // 添加到缓存,延迟入库
  142 + dayOfDirectives.put60(d60);
143 // 通知页面 143 // 通知页面
144 sendD60ToPage(sch); 144 sendD60ToPage(sch);
145 } 145 }
src/main/resources/application-dev.properties
@@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 spring.jpa.show-sql= true 9 spring.jpa.show-sql= true
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 -spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 +spring.datasource.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 -spring.datasource.password= 13 +spring.datasource.password= panzhao
14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
15 #spring.datasource.username= root 15 #spring.datasource.username= root
16 #spring.datasource.password= root 16 #spring.datasource.password= root
@@ -32,4 +32,4 @@ spring.datasource.validation-query=select 1 @@ -32,4 +32,4 @@ spring.datasource.validation-query=select 1
32 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ 32 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ 33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/
34 ##\u6D88\u606F\u4E0B\u53D1 34 ##\u6D88\u606F\u4E0B\u53D1
35 -http.send.directive = http://192.168.168.201:9090/transport_server/message/  
36 \ No newline at end of file 35 \ No newline at end of file
  36 +http.send.directive = http://192.168.168.201:9090/transport_server/message/