Commit 82e7e545276961d8545216d9f16d745383a22dd3
1 parent
7a7c9b2a
update...
Showing
11 changed files
with
79 additions
and
36 deletions
src/main/java/com/bsth/data/gpsdata_v2/DataHandleProcess.java
| @@ -67,6 +67,8 @@ public class DataHandleProcess { | @@ -67,6 +67,8 @@ public class DataHandleProcess { | ||
| 67 | //数据均分给线程 | 67 | //数据均分给线程 |
| 68 | ArrayListMultimap dataListMap = ArrayListMultimap.create(); | 68 | ArrayListMultimap dataListMap = ArrayListMultimap.create(); |
| 69 | int size = deviceList.size(), threadIndex = 0, threadSize = size / POOL_SIZE; | 69 | int size = deviceList.size(), threadIndex = 0, threadSize = size / POOL_SIZE; |
| 70 | + if(threadSize==0) | ||
| 71 | + threadSize = size; | ||
| 70 | for (int i = 0; i < size; i++) { | 72 | for (int i = 0; i < size; i++) { |
| 71 | if (i % threadSize == 0) | 73 | if (i % threadSize == 0) |
| 72 | threadIndex++; | 74 | threadIndex++; |
| @@ -78,7 +80,6 @@ public class DataHandleProcess { | @@ -78,7 +80,6 @@ public class DataHandleProcess { | ||
| 78 | 80 | ||
| 79 | logger.info(JSON.toJSONString(ks)); | 81 | logger.info(JSON.toJSONString(ks)); |
| 80 | for (Integer index : ks) { | 82 | for (Integer index : ks) { |
| 81 | - //logger.info("execute index: " + index); | ||
| 82 | threadPool.execute(new SignalHandleThread(dataListMap.get(index), count)); | 83 | threadPool.execute(new SignalHandleThread(dataListMap.get(index), count)); |
| 83 | } | 84 | } |
| 84 | 85 | ||
| @@ -112,20 +113,17 @@ public class DataHandleProcess { | @@ -112,20 +113,17 @@ public class DataHandleProcess { | ||
| 112 | public void run() { | 113 | public void run() { |
| 113 | try { | 114 | try { |
| 114 | Collections.sort(list, comp); | 115 | Collections.sort(list, comp); |
| 115 | - //logger.info("sort end --" + Thread.currentThread().getName() + " -list size: " + list.size()); | ||
| 116 | - | ||
| 117 | GpsEntity gps; | 116 | GpsEntity gps; |
| 118 | for(int i = 0,len = list.size(); i< len ;i ++){ | 117 | for(int i = 0,len = list.size(); i< len ;i ++){ |
| 119 | gps = list.get(i); | 118 | gps = list.get(i); |
| 120 | 119 | ||
| 121 | - //logger.info("run |--" + Thread.currentThread().getName() + " -i: " + i); | ||
| 122 | try { | 120 | try { |
| 123 | if (StringUtils.isEmpty(gps.getNbbm())) | 121 | if (StringUtils.isEmpty(gps.getNbbm())) |
| 124 | continue; | 122 | continue; |
| 125 | if (Math.abs(gps.getTimestamp() - gps.getServerTimestamp()) > 1000 * 60 * 20) | 123 | if (Math.abs(gps.getTimestamp() - gps.getServerTimestamp()) > 1000 * 60 * 20) |
| 126 | continue; | 124 | continue; |
| 127 | 125 | ||
| 128 | - gpsStateProcess.process(gps);//状态处理 | 126 | + //gpsStateProcess.process(gps);//状态处理 |
| 129 | stationInsideProcess.process(gps);//场站内外判定 | 127 | stationInsideProcess.process(gps);//场站内外判定 |
| 130 | reverseRouteProcess.process(gps);//反向路由处理 | 128 | reverseRouteProcess.process(gps);//反向路由处理 |
| 131 | abnormalStateProcess.process(gps);//超速越界 | 129 | abnormalStateProcess.process(gps);//超速越界 |
| @@ -134,20 +132,14 @@ public class DataHandleProcess { | @@ -134,20 +132,14 @@ public class DataHandleProcess { | ||
| 134 | outStationProcess.process(gps);//出站 | 132 | outStationProcess.process(gps);//出站 |
| 135 | 133 | ||
| 136 | 134 | ||
| 137 | - //logger.info("put start --" + Thread.currentThread().getName() + " -i: " + i); | ||
| 138 | GpsCacheData.putGps(gps);//历史gps缓存 | 135 | GpsCacheData.putGps(gps);//历史gps缓存 |
| 139 | - //logger.info("put end --" + Thread.currentThread().getName() + " -i: " + i); | ||
| 140 | } catch (Throwable e) { | 136 | } catch (Throwable e) { |
| 141 | logger.error("", e); | 137 | logger.error("", e); |
| 142 | } | 138 | } |
| 143 | } | 139 | } |
| 144 | - | ||
| 145 | - //logger.info("for end --" + Thread.currentThread().getName() + " -list size: " + list.size()); | ||
| 146 | - | ||
| 147 | } finally { | 140 | } finally { |
| 148 | if (count != null) | 141 | if (count != null) |
| 149 | count.countDown(); | 142 | count.countDown(); |
| 150 | - //logger.info(Thread.currentThread().getName() + " -countDown : " + count.getCount()); | ||
| 151 | } | 143 | } |
| 152 | } | 144 | } |
| 153 | } | 145 | } |
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| @@ -164,19 +164,23 @@ public class InStationProcess { | @@ -164,19 +164,23 @@ public class InStationProcess { | ||
| 164 | //将gps转换成下一个班次走向的站内信号(应对只有一个站内信号 即 发出时) | 164 | //将gps转换成下一个班次走向的站内信号(应对只有一个站内信号 即 发出时) |
| 165 | transformUpDown(gps, next); | 165 | transformUpDown(gps, next); |
| 166 | 166 | ||
| 167 | - //下发调度指令 | ||
| 168 | - DirectivePushQueue.put6002(next, doneSum, "到站@系统"); | ||
| 169 | - | ||
| 170 | //套跑 -下发线路切换指令 | 167 | //套跑 -下发线路切换指令 |
| 171 | if (null != next && !next.getXlBm().equals(sch.getXlBm())) { | 168 | if (null != next && !next.getXlBm().equals(sch.getXlBm())) { |
| 172 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); | 169 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 172 | + /** | ||
| 173 | + * 注意: | ||
| 174 | + * 要先发运营指令,再发调度指令 | ||
| 175 | + */ | ||
| 176 | + if(null == next && gps.isService()){ | ||
| 177 | + nonService(sch, "结束@系统");//营运结束 | ||
| 178 | + } | ||
| 179 | + //下发运营指令 | ||
| 180 | + DirectivePushQueue.put6003(next, "到站@系统"); | ||
| 175 | 181 | ||
| 176 | - if (null == next && gps.isService()) | ||
| 177 | - nonService(sch, "结束@系统");//班次结束 | ||
| 178 | - else if (null != next && dayOfSchedule.emptyService(next)) | ||
| 179 | - nonService(sch, "空驶@系统");//下一班非营运 | 182 | + //下发调度指令 |
| 183 | + DirectivePushQueue.put6002(next, doneSum, "到站@系统", ""); | ||
| 180 | } | 184 | } |
| 181 | 185 | ||
| 182 | /** | 186 | /** |
src/main/java/com/bsth/data/gpsdata_v2/rfid/handle/RfidSignalHandle.java
| @@ -123,7 +123,7 @@ public class RfidSignalHandle { | @@ -123,7 +123,7 @@ public class RfidSignalHandle { | ||
| 123 | logger.info("RFID; 车辆:" + nbbm + " 班次:" + sch.getDfsj() + "到终点, 时间:" + sch.getZdsjActual()); | 123 | logger.info("RFID; 车辆:" + nbbm + " 班次:" + sch.getDfsj() + "到终点, 时间:" + sch.getZdsjActual()); |
| 124 | 124 | ||
| 125 | //下发调度指令 | 125 | //下发调度指令 |
| 126 | - DirectivePushQueue.put6002(next, doneSum, "rfid@系统"); | 126 | + DirectivePushQueue.put6002(next, doneSum, "rfid@系统", ""); |
| 127 | 127 | ||
| 128 | //套跑 -下发线路切换指令 | 128 | //套跑 -下发线路切换指令 |
| 129 | if(null != next && !next.getXlBm().equals(sch.getXlBm())){ | 129 | if(null != next && !next.getXlBm().equals(sch.getXlBm())){ |
src/main/java/com/bsth/data/gpsdata_v2/status_manager/gps_service_state/ServiceStateHandle.java
| @@ -11,6 +11,7 @@ import org.springframework.stereotype.Component; | @@ -11,6 +11,7 @@ import org.springframework.stereotype.Component; | ||
| 11 | 11 | ||
| 12 | import java.util.Collection; | 12 | import java.util.Collection; |
| 13 | import java.util.concurrent.ConcurrentHashMap; | 13 | import java.util.concurrent.ConcurrentHashMap; |
| 14 | +import java.util.concurrent.ConcurrentMap; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * 设备营运状态/上下行 处理 | 17 | * 设备营运状态/上下行 处理 |
| @@ -19,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap; | @@ -19,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap; | ||
| 19 | @Component | 20 | @Component |
| 20 | public class ServiceStateHandle { | 21 | public class ServiceStateHandle { |
| 21 | 22 | ||
| 22 | - private static ConcurrentHashMap<String, StateBean> map; | 23 | + private static ConcurrentMap<String, StateBean> map; |
| 23 | 24 | ||
| 24 | @Autowired | 25 | @Autowired |
| 25 | DirectiveService directiveService; | 26 | DirectiveService directiveService; |
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java
| 1 | package com.bsth.data.msg_queue; | 1 | package com.bsth.data.msg_queue; |
| 2 | 2 | ||
| 3 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 3 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 4 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 4 | import com.bsth.service.directive.DirectiveService; | 5 | import com.bsth.service.directive.DirectiveService; |
| 5 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| @@ -9,7 +10,9 @@ import org.springframework.context.ApplicationContext; | @@ -9,7 +10,9 @@ import org.springframework.context.ApplicationContext; | ||
| 9 | import org.springframework.context.ApplicationContextAware; | 10 | import org.springframework.context.ApplicationContextAware; |
| 10 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
| 11 | 12 | ||
| 13 | +import java.util.concurrent.ConcurrentHashMap; | ||
| 12 | import java.util.concurrent.ConcurrentLinkedQueue; | 14 | import java.util.concurrent.ConcurrentLinkedQueue; |
| 15 | +import java.util.concurrent.ConcurrentMap; | ||
| 13 | 16 | ||
| 14 | /** | 17 | /** |
| 15 | * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里) | 18 | * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里) |
| @@ -22,13 +25,23 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -22,13 +25,23 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 22 | static DataPushThread thread; | 25 | static DataPushThread thread; |
| 23 | static DirectiveService directiveService; | 26 | static DirectiveService directiveService; |
| 24 | static long t; | 27 | static long t; |
| 25 | - static final int IDLE_TIME = 1000 * 30; | 28 | + |
| 29 | + /** | ||
| 30 | + * 下发运营指令6003的最小间隔时间 | ||
| 31 | + */ | ||
| 32 | + static final int MIN_SEND6003_SPACE = 1000 * 60; | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 车辆 ——> 上次下发6003的时间 | ||
| 36 | + */ | ||
| 37 | + static ConcurrentMap<String, Long> lastSend6003Map; | ||
| 26 | 38 | ||
| 27 | static { | 39 | static { |
| 28 | linkedList = new ConcurrentLinkedQueue<>(); | 40 | linkedList = new ConcurrentLinkedQueue<>(); |
| 41 | + lastSend6003Map = new ConcurrentHashMap<>(); | ||
| 29 | } | 42 | } |
| 30 | 43 | ||
| 31 | - public static void put6002(ScheduleRealInfo sch, int finish, String sender){ | 44 | + public static void put6002(ScheduleRealInfo sch, int finish, String sender, String txtPrefix){ |
| 32 | if(null == sch) | 45 | if(null == sch) |
| 33 | return; | 46 | return; |
| 34 | QueueData_Directive qd6002 = new QueueData_Directive(); | 47 | QueueData_Directive qd6002 = new QueueData_Directive(); |
| @@ -36,21 +49,34 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -36,21 +49,34 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 36 | qd6002.setFinish(finish); | 49 | qd6002.setFinish(finish); |
| 37 | qd6002.setSender(sender); | 50 | qd6002.setSender(sender); |
| 38 | qd6002.setCode("60_02"); | 51 | qd6002.setCode("60_02"); |
| 52 | + qd6002.setTxtPrefix(txtPrefix); | ||
| 39 | 53 | ||
| 40 | linkedList.add(qd6002); | 54 | linkedList.add(qd6002); |
| 41 | } | 55 | } |
| 42 | 56 | ||
| 43 | public static void put6003(String nbbm, int state, int upDown, String sender){ | 57 | public static void put6003(String nbbm, int state, int upDown, String sender){ |
| 58 | + long t = System.currentTimeMillis(); | ||
| 59 | + if(lastSend6003Map.containsKey(nbbm) | ||
| 60 | + && t - lastSend6003Map.get(nbbm) < MIN_SEND6003_SPACE) | ||
| 61 | + return; //最短下发间隔 | ||
| 62 | + | ||
| 44 | QueueData_Directive qd6003 = new QueueData_Directive(); | 63 | QueueData_Directive qd6003 = new QueueData_Directive(); |
| 45 | qd6003.setNbbm(nbbm); | 64 | qd6003.setNbbm(nbbm); |
| 46 | qd6003.setState(state); | 65 | qd6003.setState(state); |
| 47 | qd6003.setUpDown(upDown); | 66 | qd6003.setUpDown(upDown); |
| 48 | - //qd6003.setSch(sch); | ||
| 49 | qd6003.setSender(sender); | 67 | qd6003.setSender(sender); |
| 50 | - | ||
| 51 | qd6003.setCode("60_03"); | 68 | qd6003.setCode("60_03"); |
| 52 | 69 | ||
| 53 | linkedList.add(qd6003); | 70 | linkedList.add(qd6003); |
| 71 | + lastSend6003Map.put(nbbm, t); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public static void put6003(ScheduleRealInfo sch, String sender){ | ||
| 75 | + int state = 0;//营运状态 | ||
| 76 | + if(DayOfSchedule.emptyService(sch)) | ||
| 77 | + state = 1; | ||
| 78 | + | ||
| 79 | + put6003(sch.getClZbh(), state, Integer.parseInt(sch.getXlDir()), sender); | ||
| 54 | } | 80 | } |
| 55 | 81 | ||
| 56 | public static void put64(String nbbm, String lineCode, String sender){ | 82 | public static void put64(String nbbm, String lineCode, String sender){ |
| @@ -64,10 +90,6 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -64,10 +90,6 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 64 | linkedList.add(qd64); | 90 | linkedList.add(qd64); |
| 65 | } | 91 | } |
| 66 | 92 | ||
| 67 | - public static boolean isIdle(){ | ||
| 68 | - return System.currentTimeMillis() - t > IDLE_TIME; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | public static void start(){ | 93 | public static void start(){ |
| 72 | if(thread != null){ | 94 | if(thread != null){ |
| 73 | thread.interrupt(); | 95 | thread.interrupt(); |
| @@ -108,7 +130,7 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -108,7 +130,7 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 108 | code = qd.getCode(); | 130 | code = qd.getCode(); |
| 109 | 131 | ||
| 110 | if(code.equals("60_02")){ | 132 | if(code.equals("60_02")){ |
| 111 | - directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender()); | 133 | + directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender(), qd.getTxtPrefix()); |
| 112 | log.info("directive 60_02 sch id: " + qd.getSch().getId()); | 134 | log.info("directive 60_02 sch id: " + qd.getSch().getId()); |
| 113 | } | 135 | } |
| 114 | else if(code.equals("60_03")){ | 136 | else if(code.equals("60_03")){ |
src/main/java/com/bsth/data/msg_queue/QueueData_Directive.java
| @@ -29,6 +29,8 @@ public class QueueData_Directive { | @@ -29,6 +29,8 @@ public class QueueData_Directive { | ||
| 29 | 29 | ||
| 30 | private String sender; | 30 | private String sender; |
| 31 | 31 | ||
| 32 | + private String txtPrefix; | ||
| 33 | + | ||
| 32 | 34 | ||
| 33 | public ScheduleRealInfo getSch() { | 35 | public ScheduleRealInfo getSch() { |
| 34 | return sch; | 36 | return sch; |
| @@ -93,4 +95,12 @@ public class QueueData_Directive { | @@ -93,4 +95,12 @@ public class QueueData_Directive { | ||
| 93 | public void setLineCode(String lineCode) { | 95 | public void setLineCode(String lineCode) { |
| 94 | this.lineCode = lineCode; | 96 | this.lineCode = lineCode; |
| 95 | } | 97 | } |
| 98 | + | ||
| 99 | + public String getTxtPrefix() { | ||
| 100 | + return txtPrefix; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + public void setTxtPrefix(String txtPrefix) { | ||
| 104 | + this.txtPrefix = txtPrefix; | ||
| 105 | + } | ||
| 96 | } | 106 | } |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -93,7 +93,7 @@ public class PilotReport { | @@ -93,7 +93,7 @@ public class PilotReport { | ||
| 93 | if (outSch.getJhlc() == null) | 93 | if (outSch.getJhlc() == null) |
| 94 | outSch = dayOfSchedule.next(outSch); | 94 | outSch = dayOfSchedule.next(outSch); |
| 95 | //下发调度指令 | 95 | //下发调度指令 |
| 96 | - DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); | 96 | + DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统", "同意出场;"); |
| 97 | } | 97 | } |
| 98 | break; | 98 | break; |
| 99 | } | 99 | } |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -904,6 +904,7 @@ public class DayOfSchedule { | @@ -904,6 +904,7 @@ public class DayOfSchedule { | ||
| 904 | public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch, String newClZbh) { | 904 | public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch, String newClZbh) { |
| 905 | List<ScheduleRealInfo> ups = new ArrayList<>(); | 905 | List<ScheduleRealInfo> ups = new ArrayList<>(); |
| 906 | 906 | ||
| 907 | + String oldClZbh = sch.getClZbh(); | ||
| 907 | //变更相关映射信息 | 908 | //变更相关映射信息 |
| 908 | nbbmScheduleMap.remove(sch.getClZbh(), sch); | 909 | nbbmScheduleMap.remove(sch.getClZbh(), sch); |
| 909 | 910 | ||
| @@ -914,7 +915,7 @@ public class DayOfSchedule { | @@ -914,7 +915,7 @@ public class DayOfSchedule { | ||
| 914 | 915 | ||
| 915 | //重新计算车辆当前执行班次 | 916 | //重新计算车辆当前执行班次 |
| 916 | reCalcExecPlan(newClZbh); | 917 | reCalcExecPlan(newClZbh); |
| 917 | - reCalcExecPlan(sch.getClZbh()); | 918 | + reCalcExecPlan(oldClZbh); |
| 918 | //重新分组计划用车 | 919 | //重新分组计划用车 |
| 919 | reCalcLineNbbms(); | 920 | reCalcLineNbbms(); |
| 920 | return ups; | 921 | return ups; |
| @@ -935,6 +936,8 @@ public class DayOfSchedule { | @@ -935,6 +936,8 @@ public class DayOfSchedule { | ||
| 935 | ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); | 936 | ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); |
| 936 | if(null != sch) | 937 | if(null != sch) |
| 937 | carExecutePlanMap.put(nbbm, sch); | 938 | carExecutePlanMap.put(nbbm, sch); |
| 939 | + else | ||
| 940 | + carExecutePlanMap.remove(nbbm); | ||
| 938 | } | 941 | } |
| 939 | 942 | ||
| 940 | /** | 943 | /** |
src/main/java/com/bsth/service/directive/DirectiveService.java
| @@ -32,7 +32,7 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | @@ -32,7 +32,7 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | ||
| 32 | * @param @param finish 已完成的班次数 | 32 | * @param @param finish 已完成的班次数 |
| 33 | * @throws | 33 | * @throws |
| 34 | */ | 34 | */ |
| 35 | - int send60Dispatch(ScheduleRealInfo sch, int finish, String sender); | 35 | + int send60Dispatch(ScheduleRealInfo sch, int finish, String sender,String txtPrefix); |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * | 38 | * |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| @@ -26,6 +26,7 @@ import com.bsth.websocket.handler.RealControlSocketHandler; | @@ -26,6 +26,7 @@ import com.bsth.websocket.handler.RealControlSocketHandler; | ||
| 26 | import com.fasterxml.jackson.core.JsonProcessingException; | 26 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 27 | import com.fasterxml.jackson.databind.ObjectMapper; | 27 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 28 | import com.google.common.base.Splitter; | 28 | import com.google.common.base.Splitter; |
| 29 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 29 | import org.apache.commons.lang3.StringUtils; | 30 | import org.apache.commons.lang3.StringUtils; |
| 30 | import org.joda.time.format.DateTimeFormat; | 31 | import org.joda.time.format.DateTimeFormat; |
| 31 | import org.joda.time.format.DateTimeFormatter; | 32 | import org.joda.time.format.DateTimeFormatter; |
| @@ -78,6 +79,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -78,6 +79,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 78 | public int send60Phrase(String nbbm, String text, String sender) { | 79 | public int send60Phrase(String nbbm, String text, String sender) { |
| 79 | D60 d60 = null; | 80 | D60 d60 = null; |
| 80 | try { | 81 | try { |
| 82 | + text = StringEscapeUtils.unescapeHtml4(text); | ||
| 83 | + text = text.replaceAll("#", ""); | ||
| 81 | d60 = create60Data(nbbm, text, (short) 0x00, null); | 84 | d60 = create60Data(nbbm, text, (short) 0x00, null); |
| 82 | } catch (Exception e) { | 85 | } catch (Exception e) { |
| 83 | logger.error("发送消息短语出现异常", e); | 86 | logger.error("发送消息短语出现异常", e); |
| @@ -105,7 +108,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -105,7 +108,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 105 | } | 108 | } |
| 106 | 109 | ||
| 107 | @Override | 110 | @Override |
| 108 | - public int send60Dispatch(ScheduleRealInfo sch, int finish, String sender) { | 111 | + public int send60Dispatch(ScheduleRealInfo sch, int finish, String sender, String txtPrefix) { |
| 109 | D60 d60 = null; | 112 | D60 d60 = null; |
| 110 | try { | 113 | try { |
| 111 | if (sch.isDestroy()) { | 114 | if (sch.isDestroy()) { |
| @@ -129,8 +132,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -129,8 +132,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 129 | long t = System.currentTimeMillis() + 1000 * 30, | 132 | long t = System.currentTimeMillis() + 1000 * 30, |
| 130 | alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT(); | 133 | alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT(); |
| 131 | 134 | ||
| 135 | + if(StringUtils.isNotEmpty(txtPrefix)){ | ||
| 136 | + text = txtPrefix + text; | ||
| 137 | + } | ||
| 138 | + text = StringEscapeUtils.unescapeHtml4(text); | ||
| 139 | + int state = 0;//营运状态 | ||
| 140 | + if(dayOfSchedule.emptyService(sch)) | ||
| 141 | + state = 1; | ||
| 132 | d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) | 142 | d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) |
| 133 | - , 0, new Date(alarmTime)); | 143 | + , state, new Date(alarmTime)); |
| 134 | 144 | ||
| 135 | d60.setLineCode(sch.getXlBm()); | 145 | d60.setLineCode(sch.getXlBm()); |
| 136 | } catch (Exception e) { | 146 | } catch (Exception e) { |
| @@ -170,6 +180,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -170,6 +180,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 170 | dayOfDirectives.put60(d60, false); | 180 | dayOfDirectives.put60(d60, false); |
| 171 | d60Repository.save(d60); | 181 | d60Repository.save(d60); |
| 172 | } | 182 | } |
| 183 | + | ||
| 173 | return code; | 184 | return code; |
| 174 | } | 185 | } |
| 175 | 186 | ||
| @@ -196,7 +207,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -196,7 +207,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 196 | ScheduleRealInfo sch = dayOfSchedule.get(id); | 207 | ScheduleRealInfo sch = dayOfSchedule.get(id); |
| 197 | // 车辆已完成班次 | 208 | // 车辆已完成班次 |
| 198 | int finish = dayOfSchedule.doneSum(sch.getClZbh()); | 209 | int finish = dayOfSchedule.doneSum(sch.getClZbh()); |
| 199 | - return send60Dispatch(sch, finish, sender); | 210 | + return send60Dispatch(sch, finish, sender, ""); |
| 200 | } | 211 | } |
| 201 | 212 | ||
| 202 | @Override | 213 | @Override |
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | <select name="dType"> | 17 | <select name="dType"> |
| 18 | <option value="-1">全部</option> | 18 | <option value="-1">全部</option> |
| 19 | <option value="3">消息短语</option> | 19 | <option value="3">消息短语</option> |
| 20 | - <option value="0">调度指令</option> | 20 | + <option value="0" selected>调度指令</option> |
| 21 | <option value="1">运营指令</option> | 21 | <option value="1">运营指令</option> |
| 22 | <option value="2">线路切换指令</option> | 22 | <option value="2">线路切换指令</option> |
| 23 | </select> | 23 | </select> |