Commit acdf9f10a14fb9ea53c2b53e9377f907eb017ffe
1 parent
6f5e02dd
1.加密
Showing
18 changed files
with
460 additions
and
521 deletions
pom.xml
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | <groupId>com.bsth</groupId> | 5 | <groupId>com.bsth</groupId> |
| 6 | <artifactId>bsth_control</artifactId> | 6 | <artifactId>bsth_control</artifactId> |
| 7 | <version>0.0.1-SNAPSHOT</version> | 7 | <version>0.0.1-SNAPSHOT</version> |
| 8 | - <packaging>war</packaging> | 8 | + <packaging>jar</packaging> |
| 9 | 9 | ||
| 10 | <parent> | 10 | <parent> |
| 11 | <groupId>org.springframework.boot</groupId> | 11 | <groupId>org.springframework.boot</groupId> |
| @@ -17,12 +17,34 @@ | @@ -17,12 +17,34 @@ | ||
| 17 | <dependency> | 17 | <dependency> |
| 18 | <groupId>org.springframework.boot</groupId> | 18 | <groupId>org.springframework.boot</groupId> |
| 19 | <artifactId>spring-boot-starter-web</artifactId> | 19 | <artifactId>spring-boot-starter-web</artifactId> |
| 20 | + <exclusions> | ||
| 21 | + <exclusion> | ||
| 22 | + <groupId>org.springframework.boot</groupId> | ||
| 23 | + <artifactId>spring-boot-starter-tomcat</artifactId> | ||
| 24 | + </exclusion> | ||
| 25 | + </exclusions> | ||
| 20 | </dependency> | 26 | </dependency> |
| 21 | 27 | ||
| 22 | <dependency> | 28 | <dependency> |
| 23 | - <groupId>org.springframework.boot</groupId> | ||
| 24 | - <artifactId>spring-boot-starter-tomcat</artifactId> | ||
| 25 | - <scope>provided</scope> | 29 | + <groupId>org.apache.tomcat.embed</groupId> |
| 30 | + <artifactId>tomcat-embed-core</artifactId> | ||
| 31 | + <version>8.5.87</version> | ||
| 32 | + <exclusions> | ||
| 33 | + <exclusion> | ||
| 34 | + <artifactId>tomcat-annotations-api</artifactId> | ||
| 35 | + <groupId>org.apache.tomcat</groupId> | ||
| 36 | + </exclusion> | ||
| 37 | + </exclusions> | ||
| 38 | + </dependency> | ||
| 39 | + <dependency> | ||
| 40 | + <groupId>org.apache.tomcat.embed</groupId> | ||
| 41 | + <artifactId>tomcat-embed-el</artifactId> | ||
| 42 | + <version>8.5.87</version> | ||
| 43 | + </dependency> | ||
| 44 | + <dependency> | ||
| 45 | + <groupId>org.apache.tomcat.embed</groupId> | ||
| 46 | + <artifactId>tomcat-embed-websocket</artifactId> | ||
| 47 | + <version>8.5.87</version> | ||
| 26 | </dependency> | 48 | </dependency> |
| 27 | <dependency> | 49 | <dependency> |
| 28 | <groupId>javax.servlet</groupId> | 50 | <groupId>javax.servlet</groupId> |
| @@ -189,6 +211,10 @@ | @@ -189,6 +211,10 @@ | ||
| 189 | <groupId>org.apache.xmlgraphics</groupId> | 211 | <groupId>org.apache.xmlgraphics</groupId> |
| 190 | <artifactId>batik-js</artifactId> | 212 | <artifactId>batik-js</artifactId> |
| 191 | </exclusion> | 213 | </exclusion> |
| 214 | + <exclusion> | ||
| 215 | + <groupId>javassist</groupId> | ||
| 216 | + <artifactId>javassist</artifactId> | ||
| 217 | + </exclusion> | ||
| 192 | </exclusions> | 218 | </exclusions> |
| 193 | </dependency> | 219 | </dependency> |
| 194 | <dependency> | 220 | <dependency> |
| @@ -405,6 +431,12 @@ | @@ -405,6 +431,12 @@ | ||
| 405 | <artifactId>jts-core</artifactId> | 431 | <artifactId>jts-core</artifactId> |
| 406 | <version>1.16.1</version> | 432 | <version>1.16.1</version> |
| 407 | </dependency> | 433 | </dependency> |
| 434 | + | ||
| 435 | + <dependency> | ||
| 436 | + <groupId>org.javassist</groupId> | ||
| 437 | + <artifactId>javassist</artifactId> | ||
| 438 | + <version>3.18.2-GA</version> | ||
| 439 | + </dependency> | ||
| 408 | </dependencies> | 440 | </dependencies> |
| 409 | 441 | ||
| 410 | <dependencyManagement> | 442 | <dependencyManagement> |
| @@ -441,6 +473,26 @@ | @@ -441,6 +473,26 @@ | ||
| 441 | <groupId>org.springframework.boot</groupId> | 473 | <groupId>org.springframework.boot</groupId> |
| 442 | <artifactId>spring-boot-maven-plugin</artifactId> | 474 | <artifactId>spring-boot-maven-plugin</artifactId> |
| 443 | </plugin> | 475 | </plugin> |
| 476 | + <plugin> | ||
| 477 | + <groupId>net.roseboy</groupId> | ||
| 478 | + <artifactId>classfinal-maven-plugin</artifactId> | ||
| 479 | + <version>1.2.1</version> | ||
| 480 | + <configuration> | ||
| 481 | + <password>bsth@369147258</password> | ||
| 482 | + <packages>com.bsth</packages> | ||
| 483 | + <cfgfiles>*.properties</cfgfiles> | ||
| 484 | + <excludes>org.spring</excludes> | ||
| 485 | + <libjars></libjars> | ||
| 486 | + </configuration> | ||
| 487 | + <executions> | ||
| 488 | + <execution> | ||
| 489 | + <phase>package</phase> | ||
| 490 | + <goals> | ||
| 491 | + <goal>classFinal</goal> | ||
| 492 | + </goals> | ||
| 493 | + </execution> | ||
| 494 | + </executions> | ||
| 495 | + </plugin> | ||
| 444 | </plugins> | 496 | </plugins> |
| 445 | <resources> | 497 | <resources> |
| 446 | <resource> | 498 | <resource> |
| @@ -450,17 +502,17 @@ | @@ -450,17 +502,17 @@ | ||
| 450 | </resources> | 502 | </resources> |
| 451 | </build> | 503 | </build> |
| 452 | <repositories> | 504 | <repositories> |
| 453 | - <repository> | ||
| 454 | - <id>spring-snapshots</id> | ||
| 455 | - <url>http://repo.spring.io/snapshot</url> | ||
| 456 | - <snapshots> | ||
| 457 | - <enabled>true</enabled> | ||
| 458 | - </snapshots> | ||
| 459 | - </repository> | ||
| 460 | - <repository> | ||
| 461 | - <id>spring-milestones</id> | ||
| 462 | - <url>http://repo.spring.io/milestone</url> | ||
| 463 | - </repository> | 505 | +<!-- <repository>--> |
| 506 | +<!-- <id>spring-snapshots</id>--> | ||
| 507 | +<!-- <url>http://repo.spring.io/snapshot</url>--> | ||
| 508 | +<!-- <snapshots>--> | ||
| 509 | +<!-- <enabled>true</enabled>--> | ||
| 510 | +<!-- </snapshots>--> | ||
| 511 | +<!-- </repository>--> | ||
| 512 | +<!-- <repository>--> | ||
| 513 | +<!-- <id>spring-milestones</id>--> | ||
| 514 | +<!-- <url>http://repo.spring.io/milestone</url>--> | ||
| 515 | +<!-- </repository>--> | ||
| 464 | <repository> | 516 | <repository> |
| 465 | <id>pentaho-public</id> | 517 | <id>pentaho-public</id> |
| 466 | <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url> | 518 | <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url> |
src/main/java/com/bsth/XDApplication.java
| @@ -28,6 +28,7 @@ import com.bsth.util.Tools; | @@ -28,6 +28,7 @@ import com.bsth.util.Tools; | ||
| 28 | import org.slf4j.Logger; | 28 | import org.slf4j.Logger; |
| 29 | import org.slf4j.LoggerFactory; | 29 | import org.slf4j.LoggerFactory; |
| 30 | import org.springframework.beans.factory.annotation.Autowired; | 30 | import org.springframework.beans.factory.annotation.Autowired; |
| 31 | +import org.springframework.beans.factory.annotation.Value; | ||
| 31 | import org.springframework.boot.CommandLineRunner; | 32 | import org.springframework.boot.CommandLineRunner; |
| 32 | import org.springframework.stereotype.Component; | 33 | import org.springframework.stereotype.Component; |
| 33 | 34 | ||
| @@ -46,8 +47,6 @@ public class XDApplication implements CommandLineRunner { | @@ -46,8 +47,6 @@ public class XDApplication implements CommandLineRunner { | ||
| 46 | @Autowired | 47 | @Autowired |
| 47 | BasicData.BasicDataLoader basicDataLoader; | 48 | BasicData.BasicDataLoader basicDataLoader; |
| 48 | @Autowired | 49 | @Autowired |
| 49 | - BasicData.WhiteIpDataLoader whiteIpDataLoader; | ||
| 50 | - @Autowired | ||
| 51 | UpdateDBThread fcxxUpdateThread; | 50 | UpdateDBThread fcxxUpdateThread; |
| 52 | @Autowired | 51 | @Autowired |
| 53 | ScheduleRefreshThread scheduleRefreshThread; | 52 | ScheduleRefreshThread scheduleRefreshThread; |
| @@ -98,6 +97,9 @@ public class XDApplication implements CommandLineRunner { | @@ -98,6 +97,9 @@ public class XDApplication implements CommandLineRunner { | ||
| 98 | private static long timeDiff; | 97 | private static long timeDiff; |
| 99 | private static long timeDiffTraffic; | 98 | private static long timeDiffTraffic; |
| 100 | 99 | ||
| 100 | + @Value("${spring.profiles.active}") | ||
| 101 | + private String environment; | ||
| 102 | + | ||
| 101 | static { | 103 | static { |
| 102 | // 早上2:20 | 104 | // 早上2:20 |
| 103 | timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); | 105 | timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); |
| @@ -112,8 +114,8 @@ public class XDApplication implements CommandLineRunner { | @@ -112,8 +114,8 @@ public class XDApplication implements CommandLineRunner { | ||
| 112 | @Override | 114 | @Override |
| 113 | public void run(String... strings) throws Exception { | 115 | public void run(String... strings) throws Exception { |
| 114 | try { | 116 | try { |
| 115 | - Tools tools = new Tools("application.properties"); | ||
| 116 | - String environment = tools.getValue("spring.profiles.active"); | 117 | + //Tools tools = new Tools("application.properties"); |
| 118 | + //String environment = tools.getValue("spring.profiles.active"); | ||
| 117 | //预先加载基础的对照数据 | 119 | //预先加载基础的对照数据 |
| 118 | basicDataLoader.loadAllData(); | 120 | basicDataLoader.loadAllData(); |
| 119 | switch (environment){ | 121 | switch (environment){ |
| @@ -164,7 +166,6 @@ public class XDApplication implements CommandLineRunner { | @@ -164,7 +166,6 @@ public class XDApplication implements CommandLineRunner { | ||
| 164 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | 166 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 165 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 | 167 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 |
| 166 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 | 168 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 |
| 167 | - sexec.scheduleWithFixedDelay(whiteIpDataLoader, 0, 1, TimeUnit.MINUTES);//IP白名单数据更新 | ||
| 168 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 | 169 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 |
| 169 | //DirectivePushQueue.start();//消息队列 -指令,系统下发的 | 170 | //DirectivePushQueue.start();//消息队列 -指令,系统下发的 |
| 170 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 171 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| @@ -210,7 +211,6 @@ public class XDApplication implements CommandLineRunner { | @@ -210,7 +211,6 @@ public class XDApplication implements CommandLineRunner { | ||
| 210 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | 211 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 211 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 | 212 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 |
| 212 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 | 213 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 |
| 213 | - sexec.scheduleWithFixedDelay(whiteIpDataLoader, 0, 1, TimeUnit.MINUTES);//IP白名单数据更新 | ||
| 214 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 | 214 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 |
| 215 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 | 215 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 |
| 216 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 216 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| @@ -222,8 +222,8 @@ public class XDApplication implements CommandLineRunner { | @@ -222,8 +222,8 @@ public class XDApplication implements CommandLineRunner { | ||
| 222 | sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) | 222 | sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) |
| 223 | 223 | ||
| 224 | //运管处静态数据提交 | 224 | //运管处静态数据提交 |
| 225 | - log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); | ||
| 226 | - sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | 225 | + //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); |
| 226 | + //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | ||
| 227 | //计算油、公里加注 | 227 | //计算油、公里加注 |
| 228 | sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | 228 | sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 229 | 229 | ||
| @@ -257,7 +257,6 @@ public class XDApplication implements CommandLineRunner { | @@ -257,7 +257,6 @@ public class XDApplication implements CommandLineRunner { | ||
| 257 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | 257 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 258 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 | 258 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 |
| 259 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 | 259 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 |
| 260 | - sexec.scheduleWithFixedDelay(whiteIpDataLoader, 0, 1, TimeUnit.MINUTES);//IP白名单数据更新 | ||
| 261 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 | 260 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 |
| 262 | //DirectivePushQueue.start();//消息队列 -指令,系统下发的 | 261 | //DirectivePushQueue.start();//消息队列 -指令,系统下发的 |
| 263 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 262 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| @@ -303,7 +302,6 @@ public class XDApplication implements CommandLineRunner { | @@ -303,7 +302,6 @@ public class XDApplication implements CommandLineRunner { | ||
| 303 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | 302 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 304 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 | 303 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 |
| 305 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 | 304 | sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 |
| 306 | - sexec.scheduleWithFixedDelay(whiteIpDataLoader, 0, 1, TimeUnit.MINUTES);//IP白名单数据更新 | ||
| 307 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 | 305 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 |
| 308 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 | 306 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 |
| 309 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 307 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
src/main/java/com/bsth/data/BasicData.java
| @@ -104,8 +104,6 @@ public class BasicData { | @@ -104,8 +104,6 @@ public class BasicData { | ||
| 104 | // 线路编码_日期 等级 | 104 | // 线路编码_日期 等级 |
| 105 | public static Map<String, String> lineDate2Level; | 105 | public static Map<String, String> lineDate2Level; |
| 106 | 106 | ||
| 107 | - public static List<WhiteIp> whiteIpList; | ||
| 108 | - | ||
| 109 | static Logger logger = LoggerFactory.getLogger(BasicData.class); | 107 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| 110 | 108 | ||
| 111 | public static String getStationNameByCode(String code, String prefix){ | 109 | public static String getStationNameByCode(String code, String prefix){ |
| @@ -452,39 +450,4 @@ public class BasicData { | @@ -452,39 +450,4 @@ public class BasicData { | ||
| 452 | lineDate2Level = result; | 450 | lineDate2Level = result; |
| 453 | } | 451 | } |
| 454 | } | 452 | } |
| 455 | - | ||
| 456 | - @Component | ||
| 457 | - public static class WhiteIpDataLoader extends Thread { | ||
| 458 | - @Autowired | ||
| 459 | - JdbcTemplate jdbcTemplate; | ||
| 460 | - | ||
| 461 | - @Override | ||
| 462 | - public void run() { | ||
| 463 | - // IP白名单 | ||
| 464 | - loadData(); | ||
| 465 | - } | ||
| 466 | - | ||
| 467 | - /** | ||
| 468 | - * @Title: loadAllData | ||
| 469 | - * @Description: TODO(加载所有数据) | ||
| 470 | - */ | ||
| 471 | - public int loadData() { | ||
| 472 | - try { | ||
| 473 | - logger.info("开始加载IP白名单数据..,"); | ||
| 474 | - loadWhiteIp(); | ||
| 475 | - logger.info("加载IP白名单数据成功!,"); | ||
| 476 | - } catch (Exception e) { | ||
| 477 | - logger.error("加载IP白名单数据时出现异常,", e); | ||
| 478 | - } | ||
| 479 | - return 0; | ||
| 480 | - } | ||
| 481 | - | ||
| 482 | - /** | ||
| 483 | - * 加载IP白名单 | ||
| 484 | - */ | ||
| 485 | - public void loadWhiteIp() { | ||
| 486 | - List<WhiteIp> result = jdbcTemplate.query("select * from control_interface.bsth_c_white_ip where valid_date > now()", BeanPropertyRowMapper.newInstance(WhiteIp.class)); | ||
| 487 | - whiteIpList = result; | ||
| 488 | - } | ||
| 489 | - } | ||
| 490 | } | 453 | } |
src/main/java/com/bsth/data/gpsdata_v2/load/GatewayHttpLoader.java
| 1 | -package com.bsth.data.gpsdata_v2.load; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | -import com.bsth.data.BasicData; | ||
| 5 | -import com.bsth.data.gpsdata_v2.GpsRealData; | ||
| 6 | -import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 7 | -import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 8 | -import com.bsth.util.ConfigUtil; | ||
| 9 | -import org.apache.commons.lang3.StringUtils; | ||
| 10 | -import org.apache.http.HttpEntity; | ||
| 11 | -import org.apache.http.client.config.RequestConfig; | ||
| 12 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 13 | -import org.apache.http.client.methods.HttpGet; | ||
| 14 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 15 | -import org.apache.http.impl.client.HttpClients; | ||
| 16 | -import org.slf4j.Logger; | ||
| 17 | -import org.slf4j.LoggerFactory; | ||
| 18 | -import org.springframework.beans.BeansException; | ||
| 19 | -import org.springframework.context.ApplicationContext; | ||
| 20 | -import org.springframework.context.ApplicationContextAware; | ||
| 21 | -import org.springframework.stereotype.Component; | ||
| 22 | - | ||
| 23 | -import java.io.BufferedReader; | ||
| 24 | -import java.io.InputStreamReader; | ||
| 25 | -import java.util.ArrayList; | ||
| 26 | -import java.util.List; | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * 从网关http 接口加载数据 | ||
| 30 | - * Created by panzhao on 2017/11/15. | ||
| 31 | - */ | ||
| 32 | -@Component | ||
| 33 | -public class GatewayHttpLoader implements ApplicationContextAware{ | ||
| 34 | - | ||
| 35 | - static Logger logger = LoggerFactory.getLogger(GatewayHttpLoader.class); | ||
| 36 | - | ||
| 37 | - static String url; | ||
| 38 | - static List<GpsEntity> list; | ||
| 39 | - static CloseableHttpClient httpClient = null; | ||
| 40 | - static HttpGet get; | ||
| 41 | - static RequestConfig requestConfig; | ||
| 42 | - static CloseableHttpResponse response; | ||
| 43 | - static HttpEntity entity; | ||
| 44 | - static BufferedReader br; | ||
| 45 | - | ||
| 46 | - static GpsRealData gpsRealData; | ||
| 47 | - | ||
| 48 | - static{ | ||
| 49 | - url = ConfigUtil.get("http.gps.real.url"); | ||
| 50 | - list = new ArrayList<>(); | ||
| 51 | - httpClient = HttpClients.createDefault(); | ||
| 52 | - get = new HttpGet(url); | ||
| 53 | - requestConfig = RequestConfig.custom() | ||
| 54 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 55 | - .setSocketTimeout(2500).build(); | ||
| 56 | - get.setConfig(requestConfig); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - public static List<GpsEntity> load(){ | ||
| 60 | - try{ | ||
| 61 | - if(list.size() > 0) | ||
| 62 | - list.clear(); | ||
| 63 | - | ||
| 64 | - response = httpClient.execute(get); | ||
| 65 | - entity = response.getEntity(); | ||
| 66 | - | ||
| 67 | - logger.info("entity:" + entity + "get:" + get); | ||
| 68 | - if(null == entity) | ||
| 69 | - return list; | ||
| 70 | - | ||
| 71 | - br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 72 | - | ||
| 73 | - StringBuilder sb = new StringBuilder(); | ||
| 74 | - String str; | ||
| 75 | - while ((str = br.readLine()) != null) | ||
| 76 | - sb.append(str); | ||
| 77 | - | ||
| 78 | - logger.debug("gps:" + sb.toString()); | ||
| 79 | - list = JSON.parseArray(JSON.parseObject(sb.toString()).getString("data"), GpsEntity.class); | ||
| 80 | - //过滤掉无效的点位 | ||
| 81 | - list = GpsDataUtils.clearInvalid(list); | ||
| 82 | - | ||
| 83 | - List<GpsEntity> ups = new ArrayList<>(); | ||
| 84 | - String nbbm; | ||
| 85 | - for (GpsEntity gps : list) { | ||
| 86 | - if (StringUtils.isBlank(gps.getDeviceId())) | ||
| 87 | - continue; | ||
| 88 | - | ||
| 89 | - if (gps_equals(gpsRealData.get(gps.getDeviceId()), gps)) | ||
| 90 | - continue; | ||
| 91 | - | ||
| 92 | - nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | ||
| 93 | - gps.setNbbm(nbbm); | ||
| 94 | - ups.add(gps); | ||
| 95 | - } | ||
| 96 | - list = ups; | ||
| 97 | - | ||
| 98 | - if (null != response) | ||
| 99 | - response.close(); | ||
| 100 | - }catch (Exception e){ | ||
| 101 | - logger.error("", e); | ||
| 102 | - } | ||
| 103 | - return list; | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - | ||
| 107 | - private static boolean gps_equals(GpsEntity old, GpsEntity gps){ | ||
| 108 | - if(old != null && | ||
| 109 | - old.getTimestamp().equals(gps.getTimestamp()) && | ||
| 110 | - old.getLat().equals(gps.getLat()) && | ||
| 111 | - old.getLon().equals(gps.getLon())) | ||
| 112 | - return true; | ||
| 113 | - return false; | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - @Override | ||
| 117 | - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 118 | - gpsRealData = applicationContext.getBean(GpsRealData.class); | ||
| 119 | - } | ||
| 120 | -} | 1 | +package com.bsth.data.gpsdata_v2.load; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.bsth.data.BasicData; | ||
| 5 | +import com.bsth.data.gpsdata_v2.GpsRealData; | ||
| 6 | +import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 7 | +import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 8 | +import com.bsth.util.ConfigUtil; | ||
| 9 | +import org.apache.commons.lang3.StringUtils; | ||
| 10 | +import org.apache.http.HttpEntity; | ||
| 11 | +import org.apache.http.client.config.RequestConfig; | ||
| 12 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 13 | +import org.apache.http.client.methods.HttpGet; | ||
| 14 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 15 | +import org.apache.http.impl.client.HttpClients; | ||
| 16 | +import org.slf4j.Logger; | ||
| 17 | +import org.slf4j.LoggerFactory; | ||
| 18 | +import org.springframework.beans.BeansException; | ||
| 19 | +import org.springframework.context.ApplicationContext; | ||
| 20 | +import org.springframework.context.ApplicationContextAware; | ||
| 21 | +import org.springframework.stereotype.Component; | ||
| 22 | + | ||
| 23 | +import java.io.BufferedReader; | ||
| 24 | +import java.io.InputStreamReader; | ||
| 25 | +import java.util.ArrayList; | ||
| 26 | +import java.util.List; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 从网关http 接口加载数据 | ||
| 30 | + * Created by panzhao on 2017/11/15. | ||
| 31 | + */ | ||
| 32 | +@Component | ||
| 33 | +public class GatewayHttpLoader implements ApplicationContextAware{ | ||
| 34 | + | ||
| 35 | + static Logger logger = LoggerFactory.getLogger(GatewayHttpLoader.class); | ||
| 36 | + | ||
| 37 | + static String url; | ||
| 38 | + static List<GpsEntity> list; | ||
| 39 | + static CloseableHttpClient httpClient = null; | ||
| 40 | + static HttpGet get; | ||
| 41 | + static RequestConfig requestConfig; | ||
| 42 | + static CloseableHttpResponse response; | ||
| 43 | + static HttpEntity entity; | ||
| 44 | + static BufferedReader br; | ||
| 45 | + | ||
| 46 | + static GpsRealData gpsRealData; | ||
| 47 | + | ||
| 48 | + static{ | ||
| 49 | + url = "http://127.0.0.1:8080/transport_server/rtgps/"; | ||
| 50 | + list = new ArrayList<>(); | ||
| 51 | + httpClient = HttpClients.createDefault(); | ||
| 52 | + get = new HttpGet(url); | ||
| 53 | + requestConfig = RequestConfig.custom() | ||
| 54 | + .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 55 | + .setSocketTimeout(2500).build(); | ||
| 56 | + get.setConfig(requestConfig); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public static List<GpsEntity> load(){ | ||
| 60 | + try{ | ||
| 61 | + if(list.size() > 0) | ||
| 62 | + list.clear(); | ||
| 63 | + | ||
| 64 | + response = httpClient.execute(get); | ||
| 65 | + entity = response.getEntity(); | ||
| 66 | + | ||
| 67 | + logger.info("entity:" + entity + "get:" + get); | ||
| 68 | + if(null == entity) | ||
| 69 | + return list; | ||
| 70 | + | ||
| 71 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 72 | + | ||
| 73 | + StringBuilder sb = new StringBuilder(); | ||
| 74 | + String str; | ||
| 75 | + while ((str = br.readLine()) != null) | ||
| 76 | + sb.append(str); | ||
| 77 | + | ||
| 78 | + logger.debug("gps:" + sb.toString()); | ||
| 79 | + list = JSON.parseArray(JSON.parseObject(sb.toString()).getString("data"), GpsEntity.class); | ||
| 80 | + //过滤掉无效的点位 | ||
| 81 | + list = GpsDataUtils.clearInvalid(list); | ||
| 82 | + | ||
| 83 | + List<GpsEntity> ups = new ArrayList<>(); | ||
| 84 | + String nbbm; | ||
| 85 | + for (GpsEntity gps : list) { | ||
| 86 | + if (StringUtils.isBlank(gps.getDeviceId())) | ||
| 87 | + continue; | ||
| 88 | + | ||
| 89 | + if (gps_equals(gpsRealData.get(gps.getDeviceId()), gps)) | ||
| 90 | + continue; | ||
| 91 | + | ||
| 92 | + nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | ||
| 93 | + gps.setNbbm(nbbm); | ||
| 94 | + ups.add(gps); | ||
| 95 | + } | ||
| 96 | + list = ups; | ||
| 97 | + | ||
| 98 | + if (null != response) | ||
| 99 | + response.close(); | ||
| 100 | + }catch (Exception e){ | ||
| 101 | + logger.error("", e); | ||
| 102 | + } | ||
| 103 | + return list; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + | ||
| 107 | + private static boolean gps_equals(GpsEntity old, GpsEntity gps){ | ||
| 108 | + if(old != null && | ||
| 109 | + old.getTimestamp().equals(gps.getTimestamp()) && | ||
| 110 | + old.getLat().equals(gps.getLat()) && | ||
| 111 | + old.getLon().equals(gps.getLon())) | ||
| 112 | + return true; | ||
| 113 | + return false; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @Override | ||
| 117 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ||
| 118 | + gpsRealData = applicationContext.getBean(GpsRealData.class); | ||
| 119 | + } | ||
| 120 | +} |
src/main/java/com/bsth/data/gpsdata_v2/load/SocketClientLoader.java
| 1 | -package com.bsth.data.gpsdata_v2.load; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | -import com.bsth.data.BasicData; | ||
| 5 | -import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 6 | -import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 7 | -import com.bsth.util.ConfigUtil; | ||
| 8 | -import org.apache.http.HttpEntity; | ||
| 9 | -import org.apache.http.client.config.RequestConfig; | ||
| 10 | -import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 11 | -import org.apache.http.client.methods.HttpGet; | ||
| 12 | -import org.apache.http.impl.client.CloseableHttpClient; | ||
| 13 | -import org.apache.http.impl.client.HttpClients; | ||
| 14 | -import org.slf4j.Logger; | ||
| 15 | -import org.slf4j.LoggerFactory; | ||
| 16 | -import org.springframework.stereotype.Component; | ||
| 17 | - | ||
| 18 | -import java.io.BufferedReader; | ||
| 19 | -import java.io.InputStreamReader; | ||
| 20 | -import java.util.ArrayList; | ||
| 21 | -import java.util.List; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * 从专用的socket client 加载数据 | ||
| 25 | - * Created by panzhao on 2017/11/15. | ||
| 26 | - */ | ||
| 27 | -@Component | ||
| 28 | -public class SocketClientLoader { | ||
| 29 | - | ||
| 30 | - static Logger logger = LoggerFactory.getLogger(SocketClientLoader.class); | ||
| 31 | - | ||
| 32 | - static String url; | ||
| 33 | - static List<GpsEntity> list; | ||
| 34 | - static CloseableHttpClient httpClient = null; | ||
| 35 | - static HttpGet get; | ||
| 36 | - static RequestConfig requestConfig; | ||
| 37 | - static CloseableHttpResponse response; | ||
| 38 | - static HttpEntity entity; | ||
| 39 | - static BufferedReader br; | ||
| 40 | - | ||
| 41 | - static { | ||
| 42 | - url = ConfigUtil.get("http.gps.real.cache.url"); | ||
| 43 | - list = new ArrayList<>(); | ||
| 44 | - httpClient = HttpClients.createDefault(); | ||
| 45 | - get = new HttpGet(url); | ||
| 46 | - requestConfig = RequestConfig.custom() | ||
| 47 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 48 | - .setSocketTimeout(2500).build(); | ||
| 49 | - get.setConfig(requestConfig); | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public static List<GpsEntity> load(){ | ||
| 53 | - try { | ||
| 54 | - if(list.size() > 0) | ||
| 55 | - list.clear(); | ||
| 56 | - logger.info("load start..."); | ||
| 57 | - response = httpClient.execute(get); | ||
| 58 | - entity = response.getEntity(); | ||
| 59 | - if(null == entity) | ||
| 60 | - return list; | ||
| 61 | - | ||
| 62 | - br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 63 | - StringBuilder sb = new StringBuilder(); | ||
| 64 | - String str; | ||
| 65 | - while ((str = br.readLine()) != null) | ||
| 66 | - sb.append(str); | ||
| 67 | - | ||
| 68 | - list = JSON.parseArray(sb.toString(), GpsEntity.class); | ||
| 69 | - | ||
| 70 | - logger.info("load end ! size: " + list.size()); | ||
| 71 | - //过滤掉无效的点位 | ||
| 72 | - list = GpsDataUtils.clearInvalid(list); | ||
| 73 | - | ||
| 74 | - for (GpsEntity gps : list) { | ||
| 75 | - gps.setNbbm(BasicData.deviceId2NbbmMap.get(gps.getDeviceId())); | ||
| 76 | - } | ||
| 77 | - | ||
| 78 | - if (null != response) | ||
| 79 | - response.close(); | ||
| 80 | - } catch (Exception e) { | ||
| 81 | - logger.error("", e); | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - return list; | ||
| 85 | - } | ||
| 86 | -} | 1 | +package com.bsth.data.gpsdata_v2.load; |
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.bsth.data.BasicData; | ||
| 5 | +import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 6 | +import com.bsth.data.gpsdata_v2.utils.GpsDataUtils; | ||
| 7 | +import com.bsth.util.ConfigUtil; | ||
| 8 | +import org.apache.http.HttpEntity; | ||
| 9 | +import org.apache.http.client.config.RequestConfig; | ||
| 10 | +import org.apache.http.client.methods.CloseableHttpResponse; | ||
| 11 | +import org.apache.http.client.methods.HttpGet; | ||
| 12 | +import org.apache.http.impl.client.CloseableHttpClient; | ||
| 13 | +import org.apache.http.impl.client.HttpClients; | ||
| 14 | +import org.slf4j.Logger; | ||
| 15 | +import org.slf4j.LoggerFactory; | ||
| 16 | +import org.springframework.stereotype.Component; | ||
| 17 | + | ||
| 18 | +import java.io.BufferedReader; | ||
| 19 | +import java.io.InputStreamReader; | ||
| 20 | +import java.util.ArrayList; | ||
| 21 | +import java.util.List; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * 从专用的socket client 加载数据 | ||
| 25 | + * Created by panzhao on 2017/11/15. | ||
| 26 | + */ | ||
| 27 | +@Component | ||
| 28 | +public class SocketClientLoader { | ||
| 29 | + | ||
| 30 | + static Logger logger = LoggerFactory.getLogger(SocketClientLoader.class); | ||
| 31 | + | ||
| 32 | + static String url; | ||
| 33 | + static List<GpsEntity> list; | ||
| 34 | + static CloseableHttpClient httpClient = null; | ||
| 35 | + static HttpGet get; | ||
| 36 | + static RequestConfig requestConfig; | ||
| 37 | + static CloseableHttpResponse response; | ||
| 38 | + static HttpEntity entity; | ||
| 39 | + static BufferedReader br; | ||
| 40 | + | ||
| 41 | + static { | ||
| 42 | + url = "http://10.10.200.79:8080/transport_server/rtgps/"; | ||
| 43 | + list = new ArrayList<>(); | ||
| 44 | + httpClient = HttpClients.createDefault(); | ||
| 45 | + get = new HttpGet(url); | ||
| 46 | + requestConfig = RequestConfig.custom() | ||
| 47 | + .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 48 | + .setSocketTimeout(2500).build(); | ||
| 49 | + get.setConfig(requestConfig); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public static List<GpsEntity> load(){ | ||
| 53 | + try { | ||
| 54 | + if(list.size() > 0) | ||
| 55 | + list.clear(); | ||
| 56 | + logger.info("load start..."); | ||
| 57 | + response = httpClient.execute(get); | ||
| 58 | + entity = response.getEntity(); | ||
| 59 | + if(null == entity) | ||
| 60 | + return list; | ||
| 61 | + | ||
| 62 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); | ||
| 63 | + StringBuilder sb = new StringBuilder(); | ||
| 64 | + String str; | ||
| 65 | + while ((str = br.readLine()) != null) | ||
| 66 | + sb.append(str); | ||
| 67 | + | ||
| 68 | + list = JSON.parseArray(sb.toString(), GpsEntity.class); | ||
| 69 | + | ||
| 70 | + logger.info("load end ! size: " + list.size()); | ||
| 71 | + //过滤掉无效的点位 | ||
| 72 | + list = GpsDataUtils.clearInvalid(list); | ||
| 73 | + | ||
| 74 | + for (GpsEntity gps : list) { | ||
| 75 | + gps.setNbbm(BasicData.deviceId2NbbmMap.get(gps.getDeviceId())); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + if (null != response) | ||
| 79 | + response.close(); | ||
| 80 | + } catch (Exception e) { | ||
| 81 | + logger.error("", e); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + return list; | ||
| 85 | + } | ||
| 86 | +} |
src/main/java/com/bsth/entity/Business.java
| @@ -43,8 +43,6 @@ public class Business { | @@ -43,8 +43,6 @@ public class Business { | ||
| 43 | 43 | ||
| 44 | // 描述 | 44 | // 描述 |
| 45 | private String descriptions; | 45 | private String descriptions; |
| 46 | - // 描述 | ||
| 47 | - private String phoneNum; | ||
| 48 | 46 | ||
| 49 | // 创建日期 | 47 | // 创建日期 |
| 50 | @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | 48 | @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") |
| @@ -108,13 +106,5 @@ public class Business { | @@ -108,13 +106,5 @@ public class Business { | ||
| 108 | public void setDescriptions(String descriptions) { | 106 | public void setDescriptions(String descriptions) { |
| 109 | this.descriptions = descriptions; | 107 | this.descriptions = descriptions; |
| 110 | } | 108 | } |
| 111 | - | ||
| 112 | - public String getPhoneNum() { | ||
| 113 | - return phoneNum; | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - public void setPhoneNum(String phoneNum) { | ||
| 117 | - this.phoneNum = phoneNum; | ||
| 118 | - } | ||
| 119 | 109 | ||
| 120 | } | 110 | } |
src/main/java/com/bsth/entity/StationRoute.java
| @@ -41,8 +41,6 @@ public class StationRoute { | @@ -41,8 +41,6 @@ public class StationRoute { | ||
| 41 | // 站点名称 | 41 | // 站点名称 |
| 42 | private String stationName; | 42 | private String stationName; |
| 43 | 43 | ||
| 44 | - // 站点名称 | ||
| 45 | - private String stationNameEn; | ||
| 46 | // 线路编码 | 44 | // 线路编码 |
| 47 | private String lineCode; | 45 | private String lineCode; |
| 48 | 46 | ||
| @@ -287,13 +285,4 @@ public class StationRoute { | @@ -287,13 +285,4 @@ public class StationRoute { | ||
| 287 | public void setLine(Line line) { | 285 | public void setLine(Line line) { |
| 288 | this.line = line; | 286 | this.line = line; |
| 289 | } | 287 | } |
| 290 | - | ||
| 291 | - public String getStationNameEn() { | ||
| 292 | - return stationNameEn; | ||
| 293 | - } | ||
| 294 | - | ||
| 295 | - public void setStationNameEn(String stationNameEn) { | ||
| 296 | - this.stationNameEn = stationNameEn; | ||
| 297 | - } | ||
| 298 | - | ||
| 299 | } | 288 | } |
| 300 | \ No newline at end of file | 289 | \ No newline at end of file |
src/main/java/com/bsth/filter/WhiteIpFilter.java deleted
100644 → 0
| 1 | -package com.bsth.filter; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | -import com.bsth.common.Setting; | ||
| 5 | -import com.bsth.data.BasicData; | ||
| 6 | -import com.bsth.entity.WhiteIp; | ||
| 7 | -import com.bsth.entity.sys.SysUser; | ||
| 8 | -import com.bsth.security.util.SecurityUtils; | ||
| 9 | -import com.bsth.util.IpUtils; | ||
| 10 | -import com.google.common.collect.Lists; | ||
| 11 | -import com.google.common.collect.Maps; | ||
| 12 | -import org.slf4j.Logger; | ||
| 13 | -import org.slf4j.LoggerFactory; | ||
| 14 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | -import org.springframework.core.annotation.Order; | ||
| 16 | -import org.springframework.stereotype.Component; | ||
| 17 | -import org.springframework.web.context.WebApplicationContext; | ||
| 18 | - | ||
| 19 | -import javax.servlet.*; | ||
| 20 | -import javax.servlet.http.HttpServletRequest; | ||
| 21 | -import javax.servlet.http.HttpServletResponse; | ||
| 22 | -import java.io.IOException; | ||
| 23 | -import java.util.Enumeration; | ||
| 24 | -import java.util.List; | ||
| 25 | -import java.util.Map; | ||
| 26 | - | ||
| 27 | -/** | ||
| 28 | - * IP白名单过滤器 | ||
| 29 | - * @author Hill | ||
| 30 | - */ | ||
| 31 | -public class WhiteIpFilter implements Filter { | ||
| 32 | - | ||
| 33 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 34 | - | ||
| 35 | - private Setting setting; | ||
| 36 | - | ||
| 37 | - public Setting getSetting() { | ||
| 38 | - return setting; | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - public void setSetting(Setting setting) { | ||
| 42 | - this.setting = setting; | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - @Override | ||
| 46 | - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { | ||
| 47 | - HttpServletRequest req = (HttpServletRequest)request; | ||
| 48 | - HttpServletResponse res = (HttpServletResponse)response; | ||
| 49 | - | ||
| 50 | - String ip = IpUtils.getIpAddr(req); | ||
| 51 | - boolean isMatch = false; | ||
| 52 | - List<WhiteIp> whiteIps = BasicData.whiteIpList; | ||
| 53 | - if (whiteIps != null) { | ||
| 54 | - for (WhiteIp whiteIp : whiteIps) { | ||
| 55 | - if (ip.equals(whiteIp.getIp())) { | ||
| 56 | - isMatch = true; | ||
| 57 | - } | ||
| 58 | - } | ||
| 59 | - } | ||
| 60 | - if (isMatch || !setting.isWhiteipEnabled()) { | ||
| 61 | - chain.doFilter(request, response); | ||
| 62 | - } else { | ||
| 63 | - logger.info(ip + "未在白名单中,不予访问"); | ||
| 64 | - res.setStatus(404); | ||
| 65 | - return; | ||
| 66 | - } | ||
| 67 | - } | ||
| 68 | -} |
src/main/java/com/bsth/security/WebSecurityConfig.java
| 1 | package com.bsth.security; | 1 | package com.bsth.security; |
| 2 | 2 | ||
| 3 | import com.bsth.common.Setting; | 3 | import com.bsth.common.Setting; |
| 4 | -import com.bsth.filter.WhiteIpFilter; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; | 5 | import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; |
| 7 | import org.springframework.context.annotation.Bean; | 6 | import org.springframework.context.annotation.Bean; |
| @@ -75,9 +74,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -75,9 +74,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 75 | .maxSessionsPreventsLogin(false)//让之前的登录过期 | 74 | .maxSessionsPreventsLogin(false)//让之前的登录过期 |
| 76 | .sessionRegistry(sessionRegistry()); | 75 | .sessionRegistry(sessionRegistry()); |
| 77 | 76 | ||
| 78 | - WhiteIpFilter whiteIpFilter = new WhiteIpFilter(); | ||
| 79 | - whiteIpFilter.setSetting(setting); | ||
| 80 | - http.addFilterBefore(whiteIpFilter, FilterSecurityInterceptor.class); | ||
| 81 | http.addFilterBefore(new LoginInterceptor(), FilterSecurityInterceptor.class); | 77 | http.addFilterBefore(new LoginInterceptor(), FilterSecurityInterceptor.class); |
| 82 | http.addFilter(filterSecurityInterceptor()); | 78 | http.addFilter(filterSecurityInterceptor()); |
| 83 | } | 79 | } |
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
| @@ -158,7 +158,7 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | @@ -158,7 +158,7 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 158 | 158 | ||
| 159 | String stationSql ="insert into bsth_c_stationroute(id,line,station,station_name,station_route_code," | 159 | String stationSql ="insert into bsth_c_stationroute(id,line,station,station_name,station_route_code," |
| 160 | + "line_code,station_code,station_mark,directions,distances,to_time,destroy,versions," | 160 | + "line_code,station_code,station_mark,directions,distances,to_time,destroy,versions," |
| 161 | - + "create_date,update_date,industry_code,station_name_en) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | 161 | + + "create_date,update_date,industry_code) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; |
| 162 | jdbcTemplate.batchUpdate(stationSql, new BatchPreparedStatementSetter() { | 162 | jdbcTemplate.batchUpdate(stationSql, new BatchPreparedStatementSetter() { |
| 163 | 163 | ||
| 164 | @Override | 164 | @Override |
| @@ -181,7 +181,6 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | @@ -181,7 +181,6 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 181 | ps.setDate(14, new java.sql.Date(sRoute.getCreateDate().getTime())); | 181 | ps.setDate(14, new java.sql.Date(sRoute.getCreateDate().getTime())); |
| 182 | ps.setDate(15, new java.sql.Date(sRoute.getUpdateDate().getTime())); | 182 | ps.setDate(15, new java.sql.Date(sRoute.getUpdateDate().getTime())); |
| 183 | ps.setString(16, sRoute.getIndustryCode()); | 183 | ps.setString(16, sRoute.getIndustryCode()); |
| 184 | - ps.setString(17, sRoute.getStationNameEn()); | ||
| 185 | } | 184 | } |
| 186 | 185 | ||
| 187 | @Override | 186 | @Override |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| @@ -936,7 +936,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -936,7 +936,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 936 | } catch (Exception e) { | 936 | } catch (Exception e) { |
| 937 | } | 937 | } |
| 938 | 938 | ||
| 939 | - String head = lineName + " " + fileVersions + " " + line.getStartStationFirstTime() + "-" + line.getStartStationEndTime() + " " + line.getEndStationFirstTime() + "-" + line.getEndStationEndTime() + " " + line.getTicketPrice() + " " + company.getBusinessName() + " " + (company.getPhoneNum()== null ? "-" : company.getPhoneNum()); | 939 | + String head = lineName + " " + fileVersions + " " + line.getStartStationFirstTime() + "-" + line.getStartStationEndTime() + " " + line.getEndStationFirstTime() + "-" + line.getEndStationEndTime() + " " + line.getTicketPrice() + " " + company.getBusinessName(); |
| 940 | 940 | ||
| 941 | textStr = head +"\r\n" + textStr; | 941 | textStr = head +"\r\n" + textStr; |
| 942 | 942 |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| @@ -938,7 +938,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -938,7 +938,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 938 | arg0.setLine(resultLine); | 938 | arg0.setLine(resultLine); |
| 939 | arg0.setLineCode(resultLine.getLineCode()); | 939 | arg0.setLineCode(resultLine.getLineCode()); |
| 940 | arg0.setIndustryCode(industryCode); | 940 | arg0.setIndustryCode(industryCode); |
| 941 | - arg0.setStationNameEn(stationNameEn); | ||
| 942 | // 站点 | 941 | // 站点 |
| 943 | arg0.setStation(station); | 942 | arg0.setStation(station); |
| 944 | // 站点路由名称 | 943 | // 站点路由名称 |
| @@ -1320,7 +1319,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1320,7 +1319,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1320 | 1319 | ||
| 1321 | StationRoute stationRoute = new StationRoute(); | 1320 | StationRoute stationRoute = new StationRoute(); |
| 1322 | stationRoute.setStationName(stationRouteName); | 1321 | stationRoute.setStationName(stationRouteName); |
| 1323 | - stationRoute.setStationNameEn(stationNameEn); | ||
| 1324 | stationRoute.setId(stationRouteId); | 1322 | stationRoute.setId(stationRouteId); |
| 1325 | stationRoute.setStationRouteCode(stationRouteCode); | 1323 | stationRoute.setStationRouteCode(stationRouteCode); |
| 1326 | stationRoute.setStation(station); | 1324 | stationRoute.setStation(station); |
src/main/java/com/bsth/util/MailUtils.java
| @@ -2,6 +2,7 @@ package com.bsth.util; | @@ -2,6 +2,7 @@ package com.bsth.util; | ||
| 2 | 2 | ||
| 3 | import com.bsth.email.SimpleMailSender; | 3 | import com.bsth.email.SimpleMailSender; |
| 4 | import com.bsth.email.entity.EmailBean; | 4 | import com.bsth.email.entity.EmailBean; |
| 5 | +import org.springframework.beans.factory.InitializingBean; | ||
| 5 | import org.springframework.beans.factory.annotation.Value; | 6 | import org.springframework.beans.factory.annotation.Value; |
| 6 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 7 | 8 | ||
| @@ -11,14 +12,20 @@ import java.util.List; | @@ -11,14 +12,20 @@ import java.util.List; | ||
| 11 | * @author Hill | 12 | * @author Hill |
| 12 | */ | 13 | */ |
| 13 | @Component | 14 | @Component |
| 14 | -public class MailUtils { | 15 | +public class MailUtils implements InitializingBean { |
| 15 | 16 | ||
| 16 | @Value("${admin.mail}") | 17 | @Value("${admin.mail}") |
| 17 | private String emailSendToAddress; | 18 | private String emailSendToAddress; |
| 18 | 19 | ||
| 20 | + @Value("${server.email.username}") | ||
| 21 | + private String emailUsername; | ||
| 22 | + | ||
| 23 | + @Value("${server.email.password}") | ||
| 24 | + private String emailPassword; | ||
| 25 | + | ||
| 19 | private Tools tools = new Tools("mailbox.properties"); | 26 | private Tools tools = new Tools("mailbox.properties"); |
| 20 | 27 | ||
| 21 | - private SimpleMailSender sms = new SimpleMailSender(tools.getValue("username"),tools.getValue("password")); | 28 | + private SimpleMailSender sms; |
| 22 | 29 | ||
| 23 | public String getEmailSendToAddress() { | 30 | public String getEmailSendToAddress() { |
| 24 | return emailSendToAddress; | 31 | return emailSendToAddress; |
| @@ -65,4 +72,9 @@ public class MailUtils { | @@ -65,4 +72,9 @@ public class MailUtils { | ||
| 65 | public int sendMail(EmailBean mail){ | 72 | public int sendMail(EmailBean mail){ |
| 66 | return sendMail(emailSendToAddress, mail); | 73 | return sendMail(emailSendToAddress, mail); |
| 67 | } | 74 | } |
| 75 | + | ||
| 76 | + @Override | ||
| 77 | + public void afterPropertiesSet() throws Exception { | ||
| 78 | + sms = new SimpleMailSender(emailUsername, emailPassword); | ||
| 79 | + } | ||
| 68 | } | 80 | } |
src/main/java/com/bsth/util/db/DBUtils_MS.java
| 1 | -package com.bsth.util.db; | ||
| 2 | - | ||
| 3 | -import com.mchange.v2.c3p0.DataSources; | ||
| 4 | -import org.apache.log4j.Logger; | ||
| 5 | - | ||
| 6 | -import javax.sql.DataSource; | ||
| 7 | -import java.io.FileNotFoundException; | ||
| 8 | -import java.io.IOException; | ||
| 9 | -import java.sql.Connection; | ||
| 10 | -import java.sql.ResultSet; | ||
| 11 | -import java.sql.SQLException; | ||
| 12 | -import java.sql.Statement; | ||
| 13 | -import java.util.HashMap; | ||
| 14 | -import java.util.Map; | ||
| 15 | -import java.util.Properties; | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * 网关ms库连接池 | ||
| 19 | - * @author PanZhao | ||
| 20 | - * | ||
| 21 | - */ | ||
| 22 | -//@Component | ||
| 23 | -public class DBUtils_MS { | ||
| 24 | - | ||
| 25 | - private static String url = null; | ||
| 26 | - | ||
| 27 | - private static String username = null; | ||
| 28 | - | ||
| 29 | - private static String pwd = null; | ||
| 30 | - | ||
| 31 | - private static DataSource ds_pooled; | ||
| 32 | - | ||
| 33 | - static Logger logger = Logger.getLogger(DBUtils_MS.class); | ||
| 34 | - | ||
| 35 | - static { | ||
| 36 | - Properties env = new Properties(); | ||
| 37 | - | ||
| 38 | - try { | ||
| 39 | - env.load(DBUtils_MS.class.getClassLoader().getResourceAsStream("ms-jdbc.properties")); | ||
| 40 | - // 1. 加载驱动类 | ||
| 41 | - Class.forName(env.getProperty("ms.mysql.driver")); | ||
| 42 | - | ||
| 43 | - url = env.getProperty("ms.mysql.url"); | ||
| 44 | - username = env.getProperty("ms.mysql.username"); | ||
| 45 | - pwd = env.getProperty("ms.mysql.password"); | ||
| 46 | - | ||
| 47 | - // 设置连接数据库的配置信息 | ||
| 48 | - DataSource ds_unpooled = DataSources.unpooledDataSource(url, | ||
| 49 | - username, pwd); | ||
| 50 | - | ||
| 51 | - Map<String, Object> pool_conf = new HashMap<String, Object>(); | ||
| 52 | - // 设置最大连接数 | ||
| 53 | - pool_conf.put("maxPoolSize", 10); | ||
| 54 | - | ||
| 55 | - pool_conf.put("testConnectionOnCheckout", false); | ||
| 56 | - //异步检测连接的有效性 | ||
| 57 | - pool_conf.put("testConnectionOnCheckin", true); | ||
| 58 | - //30秒检测一次 | ||
| 59 | - pool_conf.put("idleConnectionTestPeriod", 30); | ||
| 60 | - ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf); | ||
| 61 | - } catch (FileNotFoundException e) { | ||
| 62 | - logger.error(e.toString()); | ||
| 63 | - e.printStackTrace(); | ||
| 64 | - } catch (IOException e) { | ||
| 65 | - logger.error(e.toString()); | ||
| 66 | - e.printStackTrace(); | ||
| 67 | - } catch (ClassNotFoundException e) { | ||
| 68 | - logger.error(e.toString()); | ||
| 69 | - e.printStackTrace(); | ||
| 70 | - } catch (SQLException e) { | ||
| 71 | - logger.error(e.toString()); | ||
| 72 | - e.printStackTrace(); | ||
| 73 | - } | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | - * 获取连接对象 | ||
| 78 | - */ | ||
| 79 | - public static Connection getConnection() throws SQLException { | ||
| 80 | - return ds_pooled.getConnection(); | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - /** | ||
| 84 | - * 释放连接池资源 | ||
| 85 | - */ | ||
| 86 | - public static void clearup() { | ||
| 87 | - if (ds_pooled != null) { | ||
| 88 | - try { | ||
| 89 | - DataSources.destroy(ds_pooled); | ||
| 90 | - } catch (SQLException e) { | ||
| 91 | - logger.error(e.toString()); | ||
| 92 | - e.printStackTrace(); | ||
| 93 | - } | ||
| 94 | - } | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - /** | ||
| 98 | - * 资源关闭 | ||
| 99 | - * | ||
| 100 | - * @param rs | ||
| 101 | - * @param stmt | ||
| 102 | - * @param conn | ||
| 103 | - */ | ||
| 104 | - public static void close(ResultSet rs, Statement stmt, Connection conn) { | ||
| 105 | - if (rs != null) { | ||
| 106 | - try { | ||
| 107 | - rs.close(); | ||
| 108 | - } catch (SQLException e) { | ||
| 109 | - logger.error(e.toString()); | ||
| 110 | - e.printStackTrace(); | ||
| 111 | - } | ||
| 112 | - } | ||
| 113 | - | ||
| 114 | - if (stmt != null) { | ||
| 115 | - try { | ||
| 116 | - stmt.close(); | ||
| 117 | - } catch (SQLException e) { | ||
| 118 | - logger.error(e.toString()); | ||
| 119 | - e.printStackTrace(); | ||
| 120 | - } | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - if (conn != null) { | ||
| 124 | - try { | ||
| 125 | - conn.close(); | ||
| 126 | - } catch (SQLException e) { | ||
| 127 | - logger.error(e.toString()); | ||
| 128 | - e.printStackTrace(); | ||
| 129 | - } | ||
| 130 | - } | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | - public static DataSource getDataSource(){ | ||
| 134 | - return ds_pooled; | ||
| 135 | - } | ||
| 136 | -} | 1 | +package com.bsth.util.db; |
| 2 | + | ||
| 3 | +import com.mchange.v2.c3p0.DataSources; | ||
| 4 | +import org.apache.log4j.Logger; | ||
| 5 | +import org.springframework.beans.factory.InitializingBean; | ||
| 6 | +import org.springframework.beans.factory.annotation.Value; | ||
| 7 | +import org.springframework.stereotype.Component; | ||
| 8 | + | ||
| 9 | +import javax.sql.DataSource; | ||
| 10 | +import java.io.FileNotFoundException; | ||
| 11 | +import java.io.IOException; | ||
| 12 | +import java.sql.Connection; | ||
| 13 | +import java.sql.ResultSet; | ||
| 14 | +import java.sql.SQLException; | ||
| 15 | +import java.sql.Statement; | ||
| 16 | +import java.util.HashMap; | ||
| 17 | +import java.util.Map; | ||
| 18 | +import java.util.Properties; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * 网关ms库连接池 | ||
| 22 | + * @author PanZhao | ||
| 23 | + * | ||
| 24 | + */ | ||
| 25 | +@Component | ||
| 26 | +public class DBUtils_MS implements InitializingBean { | ||
| 27 | + | ||
| 28 | + private static String driver = null; | ||
| 29 | + | ||
| 30 | + private static String url = null; | ||
| 31 | + | ||
| 32 | + private static String username = null; | ||
| 33 | + | ||
| 34 | + private static String pwd = null; | ||
| 35 | + | ||
| 36 | + private static DataSource ds_pooled; | ||
| 37 | + | ||
| 38 | + static Logger logger = Logger.getLogger(DBUtils_MS.class); | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 获取连接对象 | ||
| 42 | + */ | ||
| 43 | + public static Connection getConnection() throws SQLException { | ||
| 44 | + return ds_pooled.getConnection(); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 释放连接池资源 | ||
| 49 | + */ | ||
| 50 | + public static void clearup() { | ||
| 51 | + if (ds_pooled != null) { | ||
| 52 | + try { | ||
| 53 | + DataSources.destroy(ds_pooled); | ||
| 54 | + } catch (SQLException e) { | ||
| 55 | + logger.error(e.toString()); | ||
| 56 | + e.printStackTrace(); | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 资源关闭 | ||
| 63 | + * | ||
| 64 | + * @param rs | ||
| 65 | + * @param stmt | ||
| 66 | + * @param conn | ||
| 67 | + */ | ||
| 68 | + public static void close(ResultSet rs, Statement stmt, Connection conn) { | ||
| 69 | + if (rs != null) { | ||
| 70 | + try { | ||
| 71 | + rs.close(); | ||
| 72 | + } catch (SQLException e) { | ||
| 73 | + logger.error(e.toString()); | ||
| 74 | + e.printStackTrace(); | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + if (stmt != null) { | ||
| 79 | + try { | ||
| 80 | + stmt.close(); | ||
| 81 | + } catch (SQLException e) { | ||
| 82 | + logger.error(e.toString()); | ||
| 83 | + e.printStackTrace(); | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + if (conn != null) { | ||
| 88 | + try { | ||
| 89 | + conn.close(); | ||
| 90 | + } catch (SQLException e) { | ||
| 91 | + logger.error(e.toString()); | ||
| 92 | + e.printStackTrace(); | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public static DataSource getDataSource(){ | ||
| 98 | + return ds_pooled; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + @Value("${ms.mysql.driver}") | ||
| 102 | + public void setDriver(String driver) { | ||
| 103 | + DBUtils_MS.driver = driver; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + @Value("${ms.mysql.url}") | ||
| 107 | + public void setUrl(String url) { | ||
| 108 | + DBUtils_MS.url = url; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + @Value("${ms.mysql.username}") | ||
| 112 | + public void setUsername(String username) { | ||
| 113 | + DBUtils_MS.username = username; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @Value("${ms.mysql.password}") | ||
| 117 | + public void setPwd(String pwd) { | ||
| 118 | + DBUtils_MS.pwd = pwd; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + @Override | ||
| 122 | + public void afterPropertiesSet() throws Exception { | ||
| 123 | + try { | ||
| 124 | + // 1. 加载驱动类 | ||
| 125 | + Class.forName(driver); | ||
| 126 | + | ||
| 127 | + // 设置连接数据库的配置信息 | ||
| 128 | + DataSource ds_unpooled = DataSources.unpooledDataSource(url, username, pwd); | ||
| 129 | + Map<String, Object> pool_conf = new HashMap<String, Object>(); | ||
| 130 | + // 设置最大连接数 | ||
| 131 | + pool_conf.put("maxPoolSize", 10); | ||
| 132 | + | ||
| 133 | + pool_conf.put("testConnectionOnCheckout", false); | ||
| 134 | + //异步检测连接的有效性 | ||
| 135 | + pool_conf.put("testConnectionOnCheckin", true); | ||
| 136 | + //30秒检测一次 | ||
| 137 | + pool_conf.put("idleConnectionTestPeriod", 30); | ||
| 138 | + ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf); | ||
| 139 | + } catch (ClassNotFoundException e) { | ||
| 140 | + logger.error(e.toString()); | ||
| 141 | + e.printStackTrace(); | ||
| 142 | + } catch (SQLException e) { | ||
| 143 | + logger.error(e.toString()); | ||
| 144 | + e.printStackTrace(); | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | +} |
src/main/resources/application-prod.properties
| @@ -13,9 +13,9 @@ spring.jpa.show-sql= false | @@ -13,9 +13,9 @@ spring.jpa.show-sql= false | ||
| 13 | 13 | ||
| 14 | #DATABASE | 14 | #DATABASE |
| 15 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 15 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 16 | -spring.datasource.url= jdbc:mysql://10.10.200.121:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai | 16 | +spring.datasource.url= jdbc:mysql://10.10.150.101/control?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai |
| 17 | spring.datasource.username= root | 17 | spring.datasource.username= root |
| 18 | -spring.datasource.password= root2jsp | 18 | +spring.datasource.password= A123456ab |
| 19 | spring.datasource.type= com.zaxxer.hikari.HikariDataSource | 19 | spring.datasource.type= com.zaxxer.hikari.HikariDataSource |
| 20 | 20 | ||
| 21 | #DATASOURCE SETTING | 21 | #DATASOURCE SETTING |
| @@ -33,9 +33,9 @@ spring.datasource.hikari.register-mbeans=true | @@ -33,9 +33,9 @@ spring.datasource.hikari.register-mbeans=true | ||
| 33 | ## gps client data | 33 | ## gps client data |
| 34 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | 34 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all |
| 35 | ## gateway real data | 35 | ## gateway real data |
| 36 | -http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | 36 | +http.gps.real.url= http://127.0.0.1:8080/transport_server/rtgps/ |
| 37 | ## gateway send directive | 37 | ## gateway send directive |
| 38 | -http.send.directive= http://10.10.200.79:8080/transport_server/message/ | 38 | +http.send.directive= http://127.0.0.1:8080/transport_server/message/ |
| 39 | ## rfid data | 39 | ## rfid data |
| 40 | http.rfid.url= http://10.10.200.82:9000/rfid | 40 | http.rfid.url= http://10.10.200.82:9000/rfid |
| 41 | ## wxsb | 41 | ## wxsb |
| @@ -59,4 +59,12 @@ cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confi | @@ -59,4 +59,12 @@ cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confi | ||
| 59 | ## admin mail | 59 | ## admin mail |
| 60 | admin.mail= 3090342880@qq.com | 60 | admin.mail= 3090342880@qq.com |
| 61 | ## enabled | 61 | ## enabled |
| 62 | -enabled.whiteip= true | ||
| 63 | \ No newline at end of file | 62 | \ No newline at end of file |
| 63 | +enabled.whiteip= false | ||
| 64 | + | ||
| 65 | +ms.mysql.driver= com.mysql.jdbc.Driver | ||
| 66 | +ms.mysql.url= jdbc:mysql://10.10.150.101/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 67 | +ms.mysql.username= root | ||
| 68 | +ms.mysql.password= A123456ab | ||
| 69 | + | ||
| 70 | +server.email.username= pdda_zhmm2014@163.COM | ||
| 71 | +server.email.password= ZHMM2014_PDDA | ||
| 64 | \ No newline at end of file | 72 | \ No newline at end of file |
src/main/resources/application.properties
src/main/resources/datatools/config-prod.properties
| @@ -5,13 +5,13 @@ datatools.kettle_properties=/datatools/kettle.properties | @@ -5,13 +5,13 @@ datatools.kettle_properties=/datatools/kettle.properties | ||
| 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) | 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) |
| 6 | 6 | ||
| 7 | #数据库ip地址 | 7 | #数据库ip地址 |
| 8 | -datatools.kvars_dbip=10.10.200.121 | 8 | +datatools.kvars_dbip=192.168.168.241 |
| 9 | #数据库用户名 | 9 | #数据库用户名 |
| 10 | datatools.kvars_dbuname=root | 10 | datatools.kvars_dbuname=root |
| 11 | #数据库密码 | 11 | #数据库密码 |
| 12 | datatools.kvars_dbpwd=root2jsp | 12 | datatools.kvars_dbpwd=root2jsp |
| 13 | #数据库库名 | 13 | #数据库库名 |
| 14 | -datatools.kvars_dbdname=control | 14 | +datatools.kvars_dbdname=pd_control |
| 15 | 15 | ||
| 16 | # 3、上传数据配置信息 | 16 | # 3、上传数据配置信息 |
| 17 | # 上传文件目录配置(根据不同的环境需要修正) | 17 | # 上传文件目录配置(根据不同的环境需要修正) |
src/main/resources/ms-jdbc.properties deleted
100644 → 0
| 1 | -#ms.mysql.driver= com.mysql.jdbc.Driver | ||
| 2 | -#ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 3 | -#ms.mysql.username= root | ||
| 4 | -#ms.mysql.password= 123456 | ||
| 5 | - | ||
| 6 | -ms.mysql.driver= com.mysql.jdbc.Driver | ||
| 7 | -ms.mysql.url= jdbc:mysql://192.170.100.63/ms?useUnicode=true&characterEncoding=utf-8 | ||
| 8 | -ms.mysql.username= root | ||
| 9 | -ms.mysql.password= root2jsp | ||
| 10 | \ No newline at end of file | 0 | \ No newline at end of file |