Commit 642d634ea84bce47b36ee33cc34b07174a4dade6
Merge branch 'pudong' of http://222.66.0.204:8090//panzhaov5/bsth_control into pudong
Showing
18 changed files
with
102 additions
and
35 deletions
src/main/java/com/bsth/XDApplication.java
| @@ -154,7 +154,7 @@ public class XDApplication implements CommandLineRunner { | @@ -154,7 +154,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 154 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 154 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| 155 | 155 | ||
| 156 | /** 线调为其他程序提供的数据 --写入数据库 */ | 156 | /** 线调为其他程序提供的数据 --写入数据库 */ |
| 157 | - sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 40, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) | 157 | + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) |
| 158 | //线路首末班数据(网关用,班次更新时写入) | 158 | //线路首末班数据(网关用,班次更新时写入) |
| 159 | //com.bsth.data.schedule.f_a_l.FirstAndLastHandler | 159 | //com.bsth.data.schedule.f_a_l.FirstAndLastHandler |
| 160 | sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) | 160 | sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) |
src/main/java/com/bsth/common/Constants.java
| @@ -33,6 +33,8 @@ public class Constants { | @@ -33,6 +33,8 @@ public class Constants { | ||
| 33 | 33 | ||
| 34 | //车载网关上行接口 | 34 | //车载网关上行接口 |
| 35 | public static final String UPSTREAM_URL = "/control/upstream"; | 35 | public static final String UPSTREAM_URL = "/control/upstream"; |
| 36 | + //rfid 上传入口 | ||
| 37 | + public static final String UP_RFID_URL = "/rfid/**"; | ||
| 36 | 38 | ||
| 37 | public static final String SESSION_USERNAME = "sessionUserName"; | 39 | public static final String SESSION_USERNAME = "sessionUserName"; |
| 38 | public static final String COMPANY_AUTHORITYS = "cmyAuths"; | 40 | public static final String COMPANY_AUTHORITYS = "cmyAuths"; |
src/main/java/com/bsth/data/gpsdata_v2/DataHandleProcess.java
| @@ -97,6 +97,9 @@ public class DataHandleProcess { | @@ -97,6 +97,9 @@ public class DataHandleProcess { | ||
| 97 | try { | 97 | try { |
| 98 | for (GpsEntity gps : list) { | 98 | for (GpsEntity gps : list) { |
| 99 | try{ | 99 | try{ |
| 100 | + if(Math.abs(gps.getTimestamp() - gps.getServerTimestamp()) > 1000 * 60 * 20) | ||
| 101 | + continue; | ||
| 102 | + | ||
| 100 | gpsStateProcess.process(gps);//状态处理 | 103 | gpsStateProcess.process(gps);//状态处理 |
| 101 | stationInsideProcess.process(gps);//场站内外判定 | 104 | stationInsideProcess.process(gps);//场站内外判定 |
| 102 | reverseRouteProcess.process(gps);//反向路由处理 | 105 | reverseRouteProcess.process(gps);//反向路由处理 |
src/main/java/com/bsth/data/gpsdata_v2/cache/GeoCacheData.java
| @@ -297,6 +297,19 @@ public class GeoCacheData { | @@ -297,6 +297,19 @@ public class GeoCacheData { | ||
| 297 | } | 297 | } |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | + /** | ||
| 301 | + * 是否是环线 | ||
| 302 | + * @param lineId | ||
| 303 | + * @return | ||
| 304 | + */ | ||
| 305 | + public static boolean isLoopLine(String lineId) { | ||
| 306 | + List<StationRoute> srs = getStationRoute(lineId , 0); | ||
| 307 | + if(srs.get(0).getName().equals(srs.get(srs.size()- 1).getName()) | ||
| 308 | + && getStationRoute(lineId , 1).size()==2) | ||
| 309 | + return true; | ||
| 310 | + return false; | ||
| 311 | + } | ||
| 312 | + | ||
| 300 | private static class PreconditionGeoComp implements Comparator<PreconditionGeo>{ | 313 | private static class PreconditionGeoComp implements Comparator<PreconditionGeo>{ |
| 301 | 314 | ||
| 302 | @Override | 315 | @Override |
src/main/java/com/bsth/data/gpsdata_v2/cache/GpsCacheData.java
| @@ -33,6 +33,15 @@ public class GpsCacheData { | @@ -33,6 +33,15 @@ public class GpsCacheData { | ||
| 33 | return gpsCacheMap.get(device); | 33 | return gpsCacheMap.get(device); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | + /** | ||
| 37 | + * 清除车辆的轨迹数据 | ||
| 38 | + * @param nbbm | ||
| 39 | + */ | ||
| 40 | + public static void remove(String nbbm){ | ||
| 41 | + logger.info("清除车辆到离站轨迹, " + nbbm); | ||
| 42 | + trailListMultimap.removeAll(nbbm); | ||
| 43 | + } | ||
| 44 | + | ||
| 36 | public static GpsExecTrail gpsExecTrail(String nbbm){ | 45 | public static GpsExecTrail gpsExecTrail(String nbbm){ |
| 37 | List<GpsExecTrail> list = trailListMultimap.get(nbbm); | 46 | List<GpsExecTrail> list = trailListMultimap.get(nbbm); |
| 38 | 47 | ||
| @@ -104,6 +113,29 @@ public class GpsCacheData { | @@ -104,6 +113,29 @@ public class GpsCacheData { | ||
| 104 | return null; | 113 | return null; |
| 105 | } | 114 | } |
| 106 | 115 | ||
| 116 | + /** | ||
| 117 | + * 最后一段轨迹 | ||
| 118 | + * @param gps | ||
| 119 | + * @return | ||
| 120 | + */ | ||
| 121 | + public static int lastInTrailsSize(GpsEntity gps) { | ||
| 122 | + //int size = 0; | ||
| 123 | + List<GpsExecTrail> trails = trailListMultimap.get(gps.getNbbm()); | ||
| 124 | + if(null == trails || trails.size() == 0) | ||
| 125 | + return 0; | ||
| 126 | + | ||
| 127 | + GpsExecTrail gs = trails.get(trails.size() - 1); | ||
| 128 | + if(gs.isEnd()) | ||
| 129 | + return 0; | ||
| 130 | + | ||
| 131 | + Set<String> set = new HashSet<>(); | ||
| 132 | + for(GpsEntity g : gs.getSrs()){ | ||
| 133 | + if(g.getInstation() == 1) | ||
| 134 | + set.add(g.getStation().getName()); | ||
| 135 | + } | ||
| 136 | + return set.size(); | ||
| 137 | + } | ||
| 138 | + | ||
| 107 | public static List<StationRoute> prevMultiStation(GpsEntity gps) { | 139 | public static List<StationRoute> prevMultiStation(GpsEntity gps) { |
| 108 | List<StationRoute> rs = new ArrayList<>(); | 140 | List<StationRoute> rs = new ArrayList<>(); |
| 109 | List<GpsExecTrail> trails = trailListMultimap.get(gps.getNbbm()); | 141 | List<GpsExecTrail> trails = trailListMultimap.get(gps.getNbbm()); |
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| @@ -76,18 +76,17 @@ public class InStationProcess { | @@ -76,18 +76,17 @@ public class InStationProcess { | ||
| 76 | * @param prev | 76 | * @param prev |
| 77 | */ | 77 | */ |
| 78 | private void inStation(GpsEntity gps, GpsEntity prev) { | 78 | private void inStation(GpsEntity gps, GpsEntity prev) { |
| 79 | + ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | ||
| 79 | boolean flow = true; | 80 | boolean flow = true; |
| 80 | - //要经过一个中途站才能进 | ||
| 81 | - StationRoute s = GpsCacheData.prevStation(gps); | 81 | + //要经过2个中途站才能进 |
| 82 | + int count = GpsCacheData.lastInTrailsSize(gps); | ||
| 82 | List<StationRoute> routes = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown()); | 83 | List<StationRoute> routes = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown()); |
| 83 | - if (gps.getInstation() == 1 && routes.size() > 3 | ||
| 84 | - && null != s && s.getName().equals(gps.getStation().getName())) { | 84 | + if (isNotInOut(sch) && gps.getInstation() == 1 && routes.size() > 4 |
| 85 | + && count < 2) { | ||
| 85 | logger.info("没有进中途站,拒绝进站... -" + gps.getNbbm() + " -time:" + gps.getTimestamp()); | 86 | logger.info("没有进中途站,拒绝进站... -" + gps.getNbbm() + " -time:" + gps.getTimestamp()); |
| 86 | flow = false; | 87 | flow = false; |
| 87 | } | 88 | } |
| 88 | 89 | ||
| 89 | - | ||
| 90 | - ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | ||
| 91 | boolean isEnd = false; | 90 | boolean isEnd = false; |
| 92 | 91 | ||
| 93 | //进终点 | 92 | //进终点 |
| @@ -99,6 +98,10 @@ public class InStationProcess { | @@ -99,6 +98,10 @@ public class InStationProcess { | ||
| 99 | GpsCacheData.in(gps, isEnd); | 98 | GpsCacheData.in(gps, isEnd); |
| 100 | } | 99 | } |
| 101 | 100 | ||
| 101 | + private boolean isNotInOut(ScheduleRealInfo sch) { | ||
| 102 | + return !sch.getBcType().equals("in") && !sch.getBcType().equals("out"); | ||
| 103 | + } | ||
| 104 | + | ||
| 102 | /** | 105 | /** |
| 103 | * 进班次终点 | 106 | * 进班次终点 |
| 104 | * | 107 | * |
| @@ -159,12 +162,11 @@ public class InStationProcess { | @@ -159,12 +162,11 @@ public class InStationProcess { | ||
| 159 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); | 162 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); |
| 160 | } | 163 | } |
| 161 | 164 | ||
| 162 | - if(null == next){ | ||
| 163 | - if (gps.isService()) | ||
| 164 | - nonService(sch, "结束@系统");//班次结束 | ||
| 165 | - else if (dayOfSchedule.emptyService(next)) | ||
| 166 | - nonService(sch, "空驶@系统");//下一班非营运 | ||
| 167 | - } | 165 | + |
| 166 | + if (null == next && gps.isService()) | ||
| 167 | + nonService(sch, "结束@系统");//班次结束 | ||
| 168 | + else if (null != next && dayOfSchedule.emptyService(next)) | ||
| 169 | + nonService(sch, "空驶@系统");//下一班非营运 | ||
| 168 | } | 170 | } |
| 169 | 171 | ||
| 170 | /** | 172 | /** |
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
| @@ -73,7 +73,7 @@ public class OutStationProcess { | @@ -73,7 +73,7 @@ public class OutStationProcess { | ||
| 73 | (sch.getQdzCode().equals(prev.getStopNo()) || sch.getQdzCode().equals(prev.getCarparkNo()))){ | 73 | (sch.getQdzCode().equals(prev.getStopNo()) || sch.getQdzCode().equals(prev.getCarparkNo()))){ |
| 74 | //发车班次匹配 | 74 | //发车班次匹配 |
| 75 | if(!signalSchPlanMatcher.outMatch(gps, sch)){ | 75 | if(!signalSchPlanMatcher.outMatch(gps, sch)){ |
| 76 | - //outStation(gps); | 76 | + outStation(gps, prev); |
| 77 | return; | 77 | return; |
| 78 | } | 78 | } |
| 79 | 79 |
src/main/java/com/bsth/data/gpsdata_v2/handlers/ReverseRouteProcess.java
| 1 | package com.bsth.data.gpsdata_v2.handlers; | 1 | package com.bsth.data.gpsdata_v2.handlers; |
| 2 | 2 | ||
| 3 | +import com.bsth.data.gpsdata_v2.cache.GeoCacheData; | ||
| 3 | import com.bsth.data.gpsdata_v2.cache.GpsCacheData; | 4 | import com.bsth.data.gpsdata_v2.cache.GpsCacheData; |
| 4 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; | 5 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| 5 | import com.bsth.data.gpsdata_v2.entity.StationRoute; | 6 | import com.bsth.data.gpsdata_v2.entity.StationRoute; |
| @@ -25,7 +26,7 @@ public class ReverseRouteProcess { | @@ -25,7 +26,7 @@ public class ReverseRouteProcess { | ||
| 25 | DayOfSchedule dayOfSchedule; | 26 | DayOfSchedule dayOfSchedule; |
| 26 | 27 | ||
| 27 | public void process(GpsEntity gps){ | 28 | public void process(GpsEntity gps){ |
| 28 | - if(reversRoute(gps)){ | 29 | + if(reversRoute(gps) && !GeoCacheData.isLoopLine(gps.getLineId())){ |
| 29 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | 30 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); |
| 30 | if(isInOut(sch) || !sch.getXlBm().equals(gps.getLineId())) | 31 | if(isInOut(sch) || !sch.getXlBm().equals(gps.getLineId())) |
| 31 | return; | 32 | return; |
src/main/java/com/bsth/data/gpsdata_v2/rfid/UploadRfidDataService.java
| @@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory; | @@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.web.bind.annotation.RequestBody; | 9 | import org.springframework.web.bind.annotation.RequestBody; |
| 10 | import org.springframework.web.bind.annotation.RequestMapping; | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 11 | import org.springframework.web.bind.annotation.RestController; | 12 | import org.springframework.web.bind.annotation.RestController; |
| 12 | 13 | ||
| 13 | import java.util.List; | 14 | import java.util.List; |
| @@ -17,7 +18,7 @@ import java.util.List; | @@ -17,7 +18,7 @@ import java.util.List; | ||
| 17 | * Created by panzhao on 2017/11/22. | 18 | * Created by panzhao on 2017/11/22. |
| 18 | */ | 19 | */ |
| 19 | @RestController | 20 | @RestController |
| 20 | -@RequestMapping("/up/rfid") | 21 | +@RequestMapping("/rfid") |
| 21 | public class UploadRfidDataService { | 22 | public class UploadRfidDataService { |
| 22 | 23 | ||
| 23 | @Autowired | 24 | @Autowired |
| @@ -25,9 +26,14 @@ public class UploadRfidDataService { | @@ -25,9 +26,14 @@ public class UploadRfidDataService { | ||
| 25 | 26 | ||
| 26 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 27 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 27 | 28 | ||
| 28 | - @RequestMapping("inside") | 29 | + @RequestMapping(value = "inside", method = RequestMethod.POST) |
| 29 | public void inside(@RequestBody List<RfidInoutStation> list) { | 30 | public void inside(@RequestBody List<RfidInoutStation> list) { |
| 30 | logger.info("up rfid: " + JSON.toJSONString(list)); | 31 | logger.info("up rfid: " + JSON.toJSONString(list)); |
| 31 | rfidSignalHandle.handle(list); | 32 | rfidSignalHandle.handle(list); |
| 32 | } | 33 | } |
| 34 | + | ||
| 35 | + @RequestMapping(value = "test") | ||
| 36 | + public int test() { | ||
| 37 | + return 1; | ||
| 38 | + } | ||
| 33 | } | 39 | } |
| 34 | \ No newline at end of file | 40 | \ No newline at end of file |
src/main/java/com/bsth/data/gpsdata_v2/rfid/entity/RfidInoutStation.java
src/main/java/com/bsth/data/gpsdata_v2/rfid/handle/RfidSignalHandle.java
| @@ -36,9 +36,9 @@ public class RfidSignalHandle { | @@ -36,9 +36,9 @@ public class RfidSignalHandle { | ||
| 36 | 36 | ||
| 37 | public void handle(List<RfidInoutStation> list){ | 37 | public void handle(List<RfidInoutStation> list){ |
| 38 | for(RfidInoutStation signal : list){ | 38 | for(RfidInoutStation signal : list){ |
| 39 | - if(signal.getType()==0) | 39 | + if(signal.getType()==2) |
| 40 | in(signal); | 40 | in(signal); |
| 41 | - else if(signal.getType()==1) | 41 | + else if(signal.getType()==4) |
| 42 | out(signal); | 42 | out(signal); |
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| @@ -106,7 +106,6 @@ public class RfidSignalHandle { | @@ -106,7 +106,6 @@ public class RfidSignalHandle { | ||
| 106 | ScheduleRealInfo next = dayOfSchedule.next(sch); | 106 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| 107 | if(next != null){ | 107 | if(next != null){ |
| 108 | dayOfSchedule.addExecPlan(next); | 108 | dayOfSchedule.addExecPlan(next); |
| 109 | - //inStationAndInPark(sch, next);//进站既进场 | ||
| 110 | } | 109 | } |
| 111 | 110 | ||
| 112 | //路牌的下一个班次,页面显示起点实际到达时间 | 111 | //路牌的下一个班次,页面显示起点实际到达时间 |
| @@ -133,7 +132,7 @@ public class RfidSignalHandle { | @@ -133,7 +132,7 @@ public class RfidSignalHandle { | ||
| 133 | 132 | ||
| 134 | if(null == next) | 133 | if(null == next) |
| 135 | nonService(sch, "rfid1@系统");//班次结束 | 134 | nonService(sch, "rfid1@系统");//班次结束 |
| 136 | - else if(dayOfSchedule.emptyService(next)) | 135 | + else if(null != next && dayOfSchedule.emptyService(next)) |
| 137 | nonService(sch, "rfid2@系统");//下一班非营运 | 136 | nonService(sch, "rfid2@系统");//下一班非营运 |
| 138 | } | 137 | } |
| 139 | }catch (Exception e){ | 138 | }catch (Exception e){ |
src/main/java/com/bsth/data/gpsdata_v2/utils/GpsDataRecovery.java
| @@ -40,6 +40,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -40,6 +40,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 40 | static InStationProcess inStationProcess; | 40 | static InStationProcess inStationProcess; |
| 41 | static OutStationProcess outStationProcess; | 41 | static OutStationProcess outStationProcess; |
| 42 | static AbnormalStateProcess abnormalStateProcess; | 42 | static AbnormalStateProcess abnormalStateProcess; |
| 43 | + static ReverseRouteProcess reverseRouteProcess; | ||
| 43 | 44 | ||
| 44 | public void recovery() { | 45 | public void recovery() { |
| 45 | List<GpsEntity> list = loadData(); | 46 | List<GpsEntity> list = loadData(); |
| @@ -59,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -59,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 59 | for (String nbbm : keys) { | 60 | for (String nbbm : keys) { |
| 60 | Collections.sort(listMap.get(nbbm), comp); | 61 | Collections.sort(listMap.get(nbbm), comp); |
| 61 | threadPool.submit(new RecoveryThread(listMap.get(nbbm), count)); | 62 | threadPool.submit(new RecoveryThread(listMap.get(nbbm), count)); |
| 62 | - /*if(nbbm.equals("S0L-065")) | 63 | + /*if(nbbm.equals("W7C-035")) |
| 63 | new RecoveryThread(listMap.get(nbbm), count).run();*/ | 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ |
| 64 | /*if(lineId.equals("60028")) | 65 | /*if(lineId.equals("60028")) |
| 65 | new RecoveryThread(listMap.get(lineId), count).run();*/ | 66 | new RecoveryThread(listMap.get(lineId), count).run();*/ |
| @@ -83,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -83,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 83 | Calendar calendar = Calendar.getInstance(); | 84 | Calendar calendar = Calendar.getInstance(); |
| 84 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); | 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); |
| 85 | 86 | ||
| 86 | - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=" + dayOfYear; | 87 | + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE,SERVER_TS from bsth_c_gps_info where days_year=327"; //+ dayOfYear; |
| 87 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 88 | 89 | ||
| 89 | List<GpsEntity> list = | 90 | List<GpsEntity> list = |
| @@ -100,6 +101,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -100,6 +101,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 100 | gps.setLineId(rs.getString("LINE_ID")); | 101 | gps.setLineId(rs.getString("LINE_ID")); |
| 101 | gps.setTimestamp(rs.getLong("TS")); | 102 | gps.setTimestamp(rs.getLong("TS")); |
| 102 | gps.setUpDown((byte) getUpOrDown(rs.getLong("SERVICE_STATE"))); | 103 | gps.setUpDown((byte) getUpOrDown(rs.getLong("SERVICE_STATE"))); |
| 104 | + gps.setServerTimestamp(rs.getLong("SERVER_TS")); | ||
| 103 | return gps; | 105 | return gps; |
| 104 | } | 106 | } |
| 105 | }); | 107 | }); |
| @@ -125,6 +127,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -125,6 +127,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 125 | inStationProcess = applicationContext.getBean(InStationProcess.class); | 127 | inStationProcess = applicationContext.getBean(InStationProcess.class); |
| 126 | outStationProcess = applicationContext.getBean(OutStationProcess.class); | 128 | outStationProcess = applicationContext.getBean(OutStationProcess.class); |
| 127 | abnormalStateProcess = applicationContext.getBean(AbnormalStateProcess.class); | 129 | abnormalStateProcess = applicationContext.getBean(AbnormalStateProcess.class); |
| 130 | + reverseRouteProcess = applicationContext.getBean(ReverseRouteProcess.class); | ||
| 128 | } | 131 | } |
| 129 | 132 | ||
| 130 | public static class GpsComp implements Comparator<GpsEntity> { | 133 | public static class GpsComp implements Comparator<GpsEntity> { |
| @@ -151,12 +154,15 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -151,12 +154,15 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 151 | for (GpsEntity gps : list) { | 154 | for (GpsEntity gps : list) { |
| 152 | try { | 155 | try { |
| 153 | 156 | ||
| 154 | - /*if(gps.getTimestamp() >= 1511386080000L) | 157 | + /*if(gps.getTimestamp() >= 1511396220000L) |
| 155 | System.out.println("aaa");*/ | 158 | System.out.println("aaa");*/ |
| 156 | 159 | ||
| 160 | + if(Math.abs(gps.getTimestamp() - gps.getServerTimestamp()) > 1000 * 60 * 20) | ||
| 161 | + continue; | ||
| 162 | + | ||
| 157 | gpsStateProcess.process(gps);//状态处理 | 163 | gpsStateProcess.process(gps);//状态处理 |
| 158 | stationInsideProcess.process(gps);//场站内外判定 | 164 | stationInsideProcess.process(gps);//场站内外判定 |
| 159 | - | 165 | + reverseRouteProcess.process(gps);//反向路由处理 |
| 160 | 166 | ||
| 161 | abnormalStateProcess.process(gps);//超速越界 | 167 | abnormalStateProcess.process(gps);//超速越界 |
| 162 | 168 |
src/main/java/com/bsth/data/gpsdata_v2/utils/GpsDataUtils.java
| @@ -25,7 +25,7 @@ public class GpsDataUtils { | @@ -25,7 +25,7 @@ public class GpsDataUtils { | ||
| 25 | 25 | ||
| 26 | try { | 26 | try { |
| 27 | for (GpsEntity gps : list) { | 27 | for (GpsEntity gps : list) { |
| 28 | - if (gps.getValid() == 0) | 28 | + if (gps.getValid() == 0 && Math.abs(gps.getTimestamp() - gps.getServerTimestamp()) > 1000 * 60 * 20) |
| 29 | rs.add(gps); | 29 | rs.add(gps); |
| 30 | } | 30 | } |
| 31 | 31 |
src/main/java/com/bsth/data/gpsdata_v2/utils/SignalSchPlanMatcher.java
| @@ -39,8 +39,8 @@ public class SignalSchPlanMatcher { | @@ -39,8 +39,8 @@ public class SignalSchPlanMatcher { | ||
| 39 | return true; | 39 | return true; |
| 40 | 40 | ||
| 41 | try{ | 41 | try{ |
| 42 | - //晚于待发时间 半小时 ,匹配一下最佳的班次 | ||
| 43 | - if(t - sch.getDfsjT() > 1000 * 60 * 30){ | 42 | + //晚于待发时间 10 分钟 ,匹配一下最佳的班次 |
| 43 | + if(t - sch.getDfsjT() > 1000 * 60 * 10){ | ||
| 44 | ScheduleRealInfo near = searchNearOut(gps); | 44 | ScheduleRealInfo near = searchNearOut(gps); |
| 45 | 45 | ||
| 46 | if(null != near && !near.getId().equals(sch.getId())){ | 46 | if(null != near && !near.getId().equals(sch.getId())){ |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| @@ -3,6 +3,7 @@ package com.bsth.data.schedule.thread; | @@ -3,6 +3,7 @@ package com.bsth.data.schedule.thread; | ||
| 3 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 4 | import com.bsth.data.LineConfigData; | 4 | import com.bsth.data.LineConfigData; |
| 5 | import com.bsth.data.directive.DayOfDirectives; | 5 | import com.bsth.data.directive.DayOfDirectives; |
| 6 | +import com.bsth.data.gpsdata_v2.cache.GpsCacheData; | ||
| 6 | import com.bsth.data.pilot80.PilotReport; | 7 | import com.bsth.data.pilot80.PilotReport; |
| 7 | import com.bsth.data.schedule.DayOfSchedule; | 8 | import com.bsth.data.schedule.DayOfSchedule; |
| 8 | import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; | 9 | import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; |
| @@ -60,8 +61,10 @@ public class ScheduleRefreshThread extends Thread{ | @@ -60,8 +61,10 @@ public class ScheduleRefreshThread extends Thread{ | ||
| 60 | try{ | 61 | try{ |
| 61 | //清除指令数据 | 62 | //清除指令数据 |
| 62 | Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); | 63 | Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); |
| 63 | - for(String car : cars) | 64 | + for(String car : cars){ |
| 64 | dayOfDirectives.clear(BasicData.deviceId2NbbmMap.inverse().get(car)); | 65 | dayOfDirectives.clear(BasicData.deviceId2NbbmMap.inverse().get(car)); |
| 66 | + GpsCacheData.remove(car); | ||
| 67 | + } | ||
| 65 | //清除驾驶员上报数据 | 68 | //清除驾驶员上报数据 |
| 66 | pilotReport.clear(lineCode); | 69 | pilotReport.clear(lineCode); |
| 67 | }catch (Exception e){ | 70 | }catch (Exception e){ |
src/main/java/com/bsth/filter/BaseFilter.java
| @@ -17,7 +17,7 @@ public abstract class BaseFilter implements Filter { | @@ -17,7 +17,7 @@ public abstract class BaseFilter implements Filter { | ||
| 17 | * 白名单 | 17 | * 白名单 |
| 18 | */ | 18 | */ |
| 19 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE, | 19 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE, |
| 20 | - Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS }; | 20 | + Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL }; |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | public void destroy() { | 23 | public void destroy() { |
src/main/java/com/bsth/security/filter/LoginInterceptor.java
| @@ -33,7 +33,7 @@ public class LoginInterceptor implements Filter { | @@ -33,7 +33,7 @@ public class LoginInterceptor implements Filter { | ||
| 33 | * 相比于 BaseFilter,此处对线调GPS请求进行了拦截验证 | 33 | * 相比于 BaseFilter,此处对线调GPS请求进行了拦截验证 |
| 34 | */ | 34 | */ |
| 35 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE, | 35 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE, |
| 36 | - Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES }; | 36 | + Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.UP_RFID_URL }; |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | @Override | 39 | @Override |
src/main/resources/static/real_control_v2/js/main.js
| @@ -168,8 +168,8 @@ var disabled_submit_btn = function (form) { | @@ -168,8 +168,8 @@ var disabled_submit_btn = function (form) { | ||
| 168 | function showUpdateDescription() { | 168 | function showUpdateDescription() { |
| 169 | //更新说明 | 169 | //更新说明 |
| 170 | var updateDescription = { | 170 | var updateDescription = { |
| 171 | - date: '2017-11-23', | ||
| 172 | - text: '<h5>1、蒽... 更新了一些东西,,, 明天再写更新说明。</h5>' | 171 | + date: '2017-11-24', |
| 172 | + text: '<h5>1、修复23号下午更新后出现的部分线路班次执行问题。</h5><h5>2、尝试接入成山路停车场的RFID信号,以弥补成山路停车场高峰时GPS信号弱的问题。</h5><h5>3、报表管理里加入 “班次车辆人员日统计”</h5><h5>4、现在“历史班次调整”里可以修改烂班原因和售票员</h5>' | ||
| 173 | }; | 173 | }; |
| 174 | 174 | ||
| 175 | var storage = window.localStorage | 175 | var storage = window.localStorage |