Commit a99edb40ce615332e662ba7aca44c78eced7e864

Authored by 娄高锋
2 parents cfd48412 17469ee9

Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong

src/main/java/com/bsth/data/gpsdata_v2/cache/GeoCacheData.java
... ... @@ -21,6 +21,8 @@ import org.springframework.stereotype.Component;
21 21 import java.sql.ResultSet;
22 22 import java.sql.SQLException;
23 23 import java.util.*;
  24 +import java.util.concurrent.ConcurrentHashMap;
  25 +import java.util.concurrent.ConcurrentMap;
24 26  
25 27 /**
26 28 * 空间数据缓存
... ... @@ -38,7 +40,7 @@ public class GeoCacheData {
38 40 /**
39 41 * 路段编码和名称对照
40 42 */
41   - private static Map<String, String> sectionCode2Name;
  43 + private static ConcurrentMap<String, String> sectionCode2Name;
42 44 /**
43 45 * 线路站点路由
44 46 */
... ... @@ -50,15 +52,15 @@ public class GeoCacheData {
50 52 /**
51 53 * 线路_上下行_站点编码 ——> 站点
52 54 */
53   - private static Map<String, StationRoute> routeCodeMap;
  55 + private static ConcurrentMap<String, StationRoute> routeCodeMap;
54 56 /**
55 57 * 停车场
56 58 */
57   - public static Map<String, Polygon> tccMap;
  59 + public static ConcurrentMap<String, Polygon> tccMap;
58 60 /**
59 61 * 线路限速信息
60 62 */
61   - private static Map<String, Double> speedLimitMap;
  63 + private static ConcurrentMap<String, Double> speedLimitMap;
62 64  
63 65 @Autowired
64 66 JdbcTemplate jdbcTemplate;
... ... @@ -118,7 +120,7 @@ public class GeoCacheData {
118 120 //按线路和走向分组
119 121 if (routeList.size() > 0) {
120 122 ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create();
121   - Map<String, StationRoute> codeMap = new HashMap<>(routeList.size());
  123 + ConcurrentMap<String, StationRoute> codeMap = new ConcurrentHashMap<>(routeList.size());
122 124 for (StationRoute sr : routeList) {
123 125 tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr);
124 126 //站点编码 ——> 和路由顺序对照
... ... @@ -141,7 +143,7 @@ public class GeoCacheData {
141 143 //加载停车场数据
142 144 String sql = "select PARK_CODE, ST_AsText(G_PARK_POINT) as G_PARK_POINT from bsth_c_car_park where park_code is not null and b_park_point is not null and destroy=0";
143 145 List<Map<String, Object>> tccList = jdbcTemplate.queryForList(sql);
144   - Map<String, Polygon> tccTempMap = new HashMap<>();
  146 + ConcurrentMap<String, Polygon> tccTempMap = new ConcurrentHashMap<>();
145 147  
146 148 Polygon polygon;
147 149 for (Map<String, Object> tMap : tccList) {
... ... @@ -163,7 +165,7 @@ public class GeoCacheData {
163 165 //加载线路限速信息
164 166 String sql = "select l.LINE_CODE,i.SPEEDING from bsth_c_line_information i left join bsth_c_line l on i.line=l.id where i.speed_limit is not null";
165 167 List<Map<String, Object>> speedMap = jdbcTemplate.queryForList(sql);
166   - Map<String, Double> speedTempMap = new HashMap<>();
  168 + ConcurrentMap<String, Double> speedTempMap = new ConcurrentHashMap();
167 169 for (Map<String, Object> tMap : speedMap) {
168 170 try {
169 171 speedTempMap.put(tMap.get("LINE_CODE").toString(), Double.parseDouble(tMap.get("SPEEDING").toString()));
... ... @@ -208,7 +210,7 @@ public class GeoCacheData {
208 210 if(sectionCacheTempMap.size() > 0)
209 211 sectionCacheMap = sectionCacheTempMap;
210 212  
211   - Map<String, String> sectionCode2NameTemp = new HashMap<>();
  213 + ConcurrentMap<String, String> sectionCode2NameTemp = new ConcurrentHashMap<>();
212 214  
213 215 //加载全量路段编码和名称对照
214 216 sql = "select SECTION_CODE,SECTION_NAME,CROSES_ROAD from bsth_c_section";
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -38,6 +38,7 @@ import java.text.SimpleDateFormat;
38 38 import java.util.*;
39 39 import java.util.concurrent.ConcurrentHashMap;
40 40 import java.util.concurrent.ConcurrentLinkedQueue;
  41 +import java.util.concurrent.ConcurrentMap;
41 42  
42 43 /**
43 44 * @author PanZhao
... ... @@ -63,10 +64,10 @@ public class DayOfSchedule {
63 64 private static ArrayListMultimap<String, ScheduleRealInfo> lpScheduleMap;
64 65  
65 66 // 班次主键映射
66   - private static Map<Long, ScheduleRealInfo> id2SchedulMap;
  67 + private static ConcurrentMap<Long, ScheduleRealInfo> id2SchedulMap;
67 68  
68 69 //车辆 ——> 当前执行班次
69   - private static Map<String, ScheduleRealInfo> carExecutePlanMap;
  70 + private static ConcurrentMap<String, ScheduleRealInfo> carExecutePlanMap;
70 71  
71 72 // 持久化
72 73 public static ConcurrentLinkedQueue<ScheduleRealInfo> pstBuffer;
... ... @@ -1098,7 +1099,7 @@ public class DayOfSchedule {
1098 1099 */
1099 1100 public int reCalcIdMaps(){
1100 1101 Collection<ScheduleRealInfo> all = findAll();
1101   - Map<Long, ScheduleRealInfo> id2SchedulMapCopy = new ConcurrentHashMap<>();
  1102 + ConcurrentMap<Long, ScheduleRealInfo> id2SchedulMapCopy = new ConcurrentHashMap<>();
1102 1103  
1103 1104 for(ScheduleRealInfo sch : all){
1104 1105 id2SchedulMapCopy.put(sch.getId(), sch);
... ...
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
... ... @@ -68,8 +68,6 @@ public class LateAdjustHandle implements ApplicationContextAware{
68 68 //通知客户端
69 69 sch.setLate2(true);
70 70 sendUtils.sendAutoWdtz(sch, old);
71   -
72   - logger.info("【应发未到】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
73 71 }
74 72 }
75 73  
... ... @@ -84,19 +82,26 @@ public class LateAdjustHandle implements ApplicationContextAware{
84 82 * @return 返回被移除的误点班次
85 83 */
86 84 private static ScheduleRealInfo popLateSch(ScheduleRealInfo sch) {
87   - List<ScheduleRealInfo> list = lateSchMaps.get(sch.getXlBm());
  85 + List<ScheduleRealInfo> list = lateSchMaps.get(sch.getClZbh());
88 86  
89   - if(null == list || list.size() == 0)
  87 + if(null == list || list.size() == 0){
90 88 lateSchMaps.put(sch.getClZbh(), sch);
  89 + logger.info("【应发未到】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
  90 + }
91 91 else {
92 92 ScheduleRealInfo old = findExistQdz(list, sch.getQdzCode(), sch.getQdzName());
93 93  
  94 + if(null == old){
  95 + lateSchMaps.put(sch.getClZbh(), sch);
  96 + logger.info("【应发未到 -多个("+lateSchMaps.get(sch.getClZbh()).size()+")】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
  97 + }
94 98 //同一个起点,保留时间最大的班次
95   - if(null == old || old.getDfsjT() < sch.getDfsjT()){
  99 + else if(old.getDfsjT() < sch.getDfsjT()){
96 100 lateSchMaps.remove(old.getClZbh(), old);
97 101 lateSchMaps.put(sch.getClZbh(), sch);
98 102  
99 103 logger.info(sch.getClZbh() + "【应发未到】old 班次 " + old.getId() + " -被覆盖!");
  104 + logger.info("【应发未到 -多个("+lateSchMaps.get(sch.getClZbh()).size()+")】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
100 105 return old;
101 106 }
102 107 }
... ...
src/main/resources/fatso/package.json
1   -{
2   - "name": "fatso",
3   - "version": "1.0.0",
4   - "description": "子页面js检查、合并、压缩等处理",
5   - "main": "start.js",
6   - "scripts": {
7   - "test": "echo \"Error: no test specified\" && exit 1"
8   - },
9   - "author": "panzhaov5",
10   - "license": "ISC",
11   - "dependencies": {
12   - "cheerio": "^0.20.0",
13   - "clean-css": "^4.0.12",
14   - "colors": "^1.1.2",
15   - "eventproxy": "^0.3.4",
16   - "uglify-js": "^2.6.2"
17   - }
18   -}
  1 +{
  2 + "name": "fatso",
  3 + "version": "1.0.0",
  4 + "description": "子页面js检查、合并、压缩等处理",
  5 + "main": "start.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1"
  8 + },
  9 + "author": "panzhaov5",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "cheerio": "^0.20.0",
  13 + "clean-css": "^4.0.12",
  14 + "colors": "^1.1.2",
  15 + "eventproxy": "^0.3.4",
  16 + "uglify-js": "^2.6.2"
  17 + }
  18 +}
19 19 \ No newline at end of file
... ...