Commit de202341754fe03b77975dcf3b58bc82b6d55e91

Authored by 廖磊
2 parents 1f99ffe5 25878614

Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control

into pudong
Showing 21 changed files with 750 additions and 64 deletions
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
@@ -111,6 +111,15 @@ public class TrafficManageController { @@ -111,6 +111,15 @@ public class TrafficManageController {
111 } 111 }
112 } 112 }
113 113
  114 + @RequestMapping(value = "/setJHBCByDate", method = RequestMethod.GET)
  115 + public String setJHBCByDate(@RequestParam("theDate") String theDate) throws Exception {
  116 + try {
  117 + return trManageService.setJHBC(theDate);
  118 + } catch (Exception exp) {
  119 + throw new Exception(exp.getCause());
  120 + }
  121 + }
  122 +
114 @RequestMapping(value = "/setSKB", method = RequestMethod.GET) 123 @RequestMapping(value = "/setSKB", method = RequestMethod.GET)
115 public String setSKB(@RequestParam("ids") String ids) throws Exception { 124 public String setSKB(@RequestParam("ids") String ids) throws Exception {
116 try { 125 try {
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,36 @@ public class DirectivePushQueue implements ApplicationContextAware { @@ -36,21 +49,36 @@ 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 + if(null == sch)
  76 + return;
  77 + int state = 0;//营运状态
  78 + if(DayOfSchedule.emptyService(sch))
  79 + state = 1;
  80 +
  81 + put6003(sch.getClZbh(), state, Integer.parseInt(sch.getXlDir()), sender);
54 } 82 }
55 83
56 public static void put64(String nbbm, String lineCode, String sender){ 84 public static void put64(String nbbm, String lineCode, String sender){
@@ -64,10 +92,6 @@ public class DirectivePushQueue implements ApplicationContextAware { @@ -64,10 +92,6 @@ public class DirectivePushQueue implements ApplicationContextAware {
64 linkedList.add(qd64); 92 linkedList.add(qd64);
65 } 93 }
66 94
67 - public static boolean isIdle(){  
68 - return System.currentTimeMillis() - t > IDLE_TIME;  
69 - }  
70 -  
71 public static void start(){ 95 public static void start(){
72 if(thread != null){ 96 if(thread != null){
73 thread.interrupt(); 97 thread.interrupt();
@@ -108,7 +132,7 @@ public class DirectivePushQueue implements ApplicationContextAware { @@ -108,7 +132,7 @@ public class DirectivePushQueue implements ApplicationContextAware {
108 code = qd.getCode(); 132 code = qd.getCode();
109 133
110 if(code.equals("60_02")){ 134 if(code.equals("60_02")){
111 - directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender()); 135 + directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender(), qd.getTxtPrefix());
112 log.info("directive 60_02 sch id: " + qd.getSch().getId()); 136 log.info("directive 60_02 sch id: " + qd.getSch().getId());
113 } 137 }
114 else if(code.equals("60_03")){ 138 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/TrafficManageService.java
@@ -70,6 +70,8 @@ public interface TrafficManageService { @@ -70,6 +70,8 @@ public interface TrafficManageService {
70 */ 70 */
71 String setJHBC(); 71 String setJHBC();
72 72
  73 + String setJHBC(String theDate);
  74 +
73 String setLD(String theDate); 75 String setLD(String theDate);
74 76
75 String setLD(); 77 String setLD();
src/main/java/com/bsth/service/directive/DirectiveService.java
@@ -32,7 +32,7 @@ public interface DirectiveService extends BaseService&lt;D60, Integer&gt;{ @@ -32,7 +32,7 @@ public interface DirectiveService extends BaseService&lt;D60, Integer&gt;{
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&lt;D60, Integer&gt; implemen @@ -78,6 +79,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; 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&lt;D60, Integer&gt; implemen @@ -105,7 +108,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; 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&lt;D60, Integer&gt; implemen @@ -129,8 +132,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; 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&lt;D60, Integer&gt; implemen @@ -170,6 +180,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; 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&lt;D60, Integer&gt; implemen @@ -196,7 +207,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; 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/java/com/bsth/service/impl/TrafficManageServiceImpl.java
@@ -812,10 +812,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -812,10 +812,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{
812 } 812 }
813 813
814 /** 814 /**
  815 + * 上传计划班次 指定日期 yyyy-MM-dd
  816 + * @param theDate
  817 + * @return
  818 + */
  819 + public String setJHBC(String theDate){
  820 + return uploadJHBC(theDate);
  821 + }
  822 +
  823 + /**
  824 + * 上传计划班次
  825 + * @return
  826 + */
  827 + public String setJHBC(){
  828 + return uploadJHBC(null);
  829 + }
  830 + /**
815 * 上传线路计划班次表 831 * 上传线路计划班次表
816 */ 832 */
817 - @Override  
818 - public String setJHBC() { 833 +
  834 + private String uploadJHBC(String theDate) {
819 String result = "failure"; 835 String result = "failure";
820 Line line; 836 Line line;
821 StringBuffer sBuffer =new StringBuffer(); 837 StringBuffer sBuffer =new StringBuffer();
@@ -825,8 +841,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -825,8 +841,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
825 SchedulePlanInfo schedulePlanInfo; 841 SchedulePlanInfo schedulePlanInfo;
826 String xlbm,zbh = ""; 842 String xlbm,zbh = "";
827 Long lp = 0L; 843 Long lp = 0L;
828 - // 取明天的日期  
829 - String tomorrow = sdfnyr.format(DateUtils.addDays(new Date(), +1)); 844 + // 取得计划班次时间
  845 + String tomorrow = theDate == null ? sdfnyr.format(DateUtils.addDays(new Date(), +1)) : theDate;
830 // 查询所有班次 846 // 查询所有班次
831 List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow); 847 List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow);
832 int j = 0; // 初始化标识 848 int j = 0; // 初始化标识
src/main/java/com/bsth/websocket/dto/WsScheduleRealInfo.java 0 → 100644
  1 +package com.bsth.websocket.dto;
  2 +
  3 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  4 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  5 +
  6 +import javax.persistence.FetchType;
  7 +import javax.persistence.OneToMany;
  8 +import javax.persistence.Transient;
  9 +import java.util.ArrayList;
  10 +import java.util.HashSet;
  11 +import java.util.List;
  12 +import java.util.Set;
  13 +
  14 +/**
  15 + * 精简字段的实际排班 entity
  16 + * webSocket 传输用,去掉了页面不需要的一些字段
  17 + * Created by panzhao on 2017/11/14.
  18 + */
  19 +public class WsScheduleRealInfo {
  20 +
  21 + public static WsScheduleRealInfo getInstance(ScheduleRealInfo sch){
  22 + if(null == sch)
  23 + return null;
  24 + WsScheduleRealInfo wss = new WsScheduleRealInfo();
  25 + wss.id = sch.getId();
  26 + wss.scheduleDateStr = sch.getScheduleDateStr();
  27 + wss.realExecDate = sch.getRealExecDate();
  28 + wss.xlName = sch.getXlName();
  29 + wss.xlBm = sch.getXlBm();
  30 + wss.lpName = sch.getLpName();
  31 + wss.clZbh = sch.getClZbh();
  32 + wss.jGh = sch.getjGh();
  33 + wss.jName = sch.getjName();
  34 + wss.sGh = sch.getsGh();
  35 + wss.sName = sch.getsName();
  36 + wss.xlDir = sch.getXlDir();
  37 + wss.qdzCode = sch.getQdzCode();
  38 + wss.qdzName = sch.getQdzName();
  39 + wss.zdzCode = sch.getZdzCode();
  40 + wss.zdzName = sch.getZdzName();
  41 + wss.fcsj = sch.getFcsj();
  42 + wss.fcsjT = sch.getFcsjT();
  43 + wss.zdsj = sch.getZdsj();
  44 + wss.zdsjT = sch.getZdsjT();
  45 + wss.jhlc = sch.getJhlc();
  46 + wss.jhlcOrig = sch.getJhlcOrig();
  47 + wss.bcsj = sch.getBcsj();
  48 + wss.bcType = sch.getBcType();
  49 + wss.majorStationName = sch.getMajorStationName();
  50 + wss.fcsjActual = sch.getFcsjActual();
  51 + wss.fcsjActualTime = sch.getFcsjActualTime();
  52 + wss.zdsjActual = sch.getZdsjActual();
  53 + wss.zdsjActualTime = sch.getZdsjActualTime();
  54 + wss.status = sch.getStatus();
  55 + wss.adjustExps = sch.getAdjustExps();
  56 + wss.sflj = sch.isSflj();
  57 + wss.late = sch.isLate();
  58 + wss.late2 = sch.isLate2();
  59 + wss.lateMinute = sch.getLateMinute();
  60 + wss.remarks = sch.getRemarks();
  61 + wss.dfsj = sch.getDfsj();
  62 + wss.dfsjT = sch.getDfsjT();
  63 + wss.directiveState = sch.getDirectiveState();
  64 + wss.qdzArrDatejh = sch.getQdzArrDatejh();
  65 + wss.qdzArrDatesj = sch.getQdzArrDatesj();
  66 + wss.cTasks = sch.getcTasks();
  67 + wss.gsName = sch.getGsName();
  68 + wss.gsBm = sch.getGsBm();
  69 + wss.fgsName = sch.getFgsName();
  70 + wss.fgsBm = sch.getFgsBm();
  71 + wss.ccService = sch.isCcService();
  72 + return wss;
  73 + }
  74 +
  75 +
  76 + public static List<WsScheduleRealInfo> getMultiInstance(List<ScheduleRealInfo> list){
  77 + List<WsScheduleRealInfo> rs = new ArrayList<>();
  78 + for(ScheduleRealInfo sch : list){
  79 + rs.add(getInstance(sch));
  80 + }
  81 + return rs;
  82 + }
  83 +
  84 + /** 主键Id */
  85 + private Long id;
  86 +
  87 + /** 排班日期字符串 YYYY-MM-DD */
  88 + private String scheduleDateStr;
  89 +
  90 + /** 真实执行时间 yyyy-MM-dd */
  91 + private String realExecDate;
  92 +
  93 + /** 线路名称 */
  94 + private String xlName;
  95 + /** 线路编码 */
  96 + private String xlBm;
  97 +
  98 + /** 路牌名称 */
  99 + private String lpName;
  100 +
  101 + /** 车辆自编号 */
  102 + private String clZbh;
  103 +
  104 + /** 驾驶员工号 */
  105 + private String jGh;
  106 + /** 驾驶员名字 */
  107 + private String jName;
  108 + /** 售票员工号 */
  109 + private String sGh;
  110 + /** 售票员名字 */
  111 + private String sName;
  112 +
  113 + /** 线路方向 */
  114 + private String xlDir;
  115 + /** 起点站code*/
  116 + private String qdzCode;
  117 + /** 起点站名字 */
  118 + private String qdzName;
  119 +
  120 + /** 终点站code*/
  121 + private String zdzCode;
  122 + /** 终点站名字 */
  123 + private String zdzName;
  124 +
  125 + /** 计划发车时间(格式 HH:mm) */
  126 + private String fcsj;
  127 + /** 计划发车时间戳*/
  128 + @Transient
  129 + private Long fcsjT;
  130 +
  131 + /** 计划终点时间(格式 HH:mm) */
  132 + private String zdsj;
  133 + /** 计划终点时间戳*/
  134 + @Transient
  135 + private Long zdsjT;
  136 +
  137 + /** 计划里程 */
  138 + private Double jhlc;
  139 +
  140 + /** 原始计划里程 (原计调的数据) */
  141 + private Double jhlcOrig;
  142 + /** 班次历时 */
  143 + private Integer bcsj;
  144 +
  145 + /**
  146 + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
  147 + */
  148 + private String bcType;
  149 +
  150 + //放站班次 站点名称
  151 + private String majorStationName;
  152 +
  153 + /** 实际发车时间*/
  154 + private String fcsjActual;
  155 + /** 实际发车时间戳*/
  156 + @Transient
  157 + private Long fcsjActualTime;
  158 + /**实际终点时间 */
  159 + private String zdsjActual;
  160 + /** 实际终点时间戳*/
  161 + @Transient
  162 + private Long zdsjActualTime;
  163 +
  164 + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
  165 + private int status;
  166 +
  167 + private String adjustExps;
  168 +
  169 + /** 是否是临加班次 */
  170 + private boolean sflj;
  171 +
  172 + /** 是否误点 (应发未发)*/
  173 + @Transient
  174 + private boolean late;
  175 +
  176 + /** 是否误点 (应发未到) */
  177 + @Transient
  178 + private boolean late2;
  179 + /** 误点停靠时间 */
  180 + @Transient
  181 + private float lateMinute;
  182 +
  183 + /** 备注*/
  184 + private String remarks;
  185 +
  186 + /**待发时间(格式 HH:mm) */
  187 + private String dfsj;
  188 +
  189 + /**待发时间戳 */
  190 + @Transient
  191 + private Long dfsjT;
  192 +
  193 + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
  194 + private Integer directiveState = -1;
  195 +
  196 + /** 起点站计划到达时间 */
  197 + @Transient
  198 + private String qdzArrDatejh;
  199 +
  200 + /** 起点站实际到达时间 */
  201 + @Transient
  202 + private String qdzArrDatesj;
  203 +
  204 + /** 子任务 */
  205 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
  206 + private Set<ChildTaskPlan> cTasks = new HashSet<>();
  207 +
  208 + /** 关联的公司名称 */
  209 + private String gsName;
  210 + /** 关联的公司编码 */
  211 + private String gsBm;
  212 + /** 关联的分公司名称 */
  213 + private String fgsName;
  214 + /** 关联的分公司编码 */
  215 + private String fgsBm;
  216 +
  217 + /**
  218 + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
  219 + */
  220 + private boolean ccService;
  221 +
  222 + public Long getId() {
  223 + return id;
  224 + }
  225 +
  226 + public void setId(Long id) {
  227 + this.id = id;
  228 + }
  229 +
  230 + public String getScheduleDateStr() {
  231 + return scheduleDateStr;
  232 + }
  233 +
  234 + public void setScheduleDateStr(String scheduleDateStr) {
  235 + this.scheduleDateStr = scheduleDateStr;
  236 + }
  237 +
  238 + public String getRealExecDate() {
  239 + return realExecDate;
  240 + }
  241 +
  242 + public void setRealExecDate(String realExecDate) {
  243 + this.realExecDate = realExecDate;
  244 + }
  245 +
  246 + public String getXlName() {
  247 + return xlName;
  248 + }
  249 +
  250 + public void setXlName(String xlName) {
  251 + this.xlName = xlName;
  252 + }
  253 +
  254 + public String getXlBm() {
  255 + return xlBm;
  256 + }
  257 +
  258 + public void setXlBm(String xlBm) {
  259 + this.xlBm = xlBm;
  260 + }
  261 +
  262 + public String getLpName() {
  263 + return lpName;
  264 + }
  265 +
  266 + public void setLpName(String lpName) {
  267 + this.lpName = lpName;
  268 + }
  269 +
  270 + public String getClZbh() {
  271 + return clZbh;
  272 + }
  273 +
  274 + public void setClZbh(String clZbh) {
  275 + this.clZbh = clZbh;
  276 + }
  277 +
  278 + public String getjGh() {
  279 + return jGh;
  280 + }
  281 +
  282 + public void setjGh(String jGh) {
  283 + this.jGh = jGh;
  284 + }
  285 +
  286 + public String getjName() {
  287 + return jName;
  288 + }
  289 +
  290 + public void setjName(String jName) {
  291 + this.jName = jName;
  292 + }
  293 +
  294 + public String getsGh() {
  295 + return sGh;
  296 + }
  297 +
  298 + public void setsGh(String sGh) {
  299 + this.sGh = sGh;
  300 + }
  301 +
  302 + public String getsName() {
  303 + return sName;
  304 + }
  305 +
  306 + public void setsName(String sName) {
  307 + this.sName = sName;
  308 + }
  309 +
  310 + public String getXlDir() {
  311 + return xlDir;
  312 + }
  313 +
  314 + public void setXlDir(String xlDir) {
  315 + this.xlDir = xlDir;
  316 + }
  317 +
  318 + public String getQdzCode() {
  319 + return qdzCode;
  320 + }
  321 +
  322 + public void setQdzCode(String qdzCode) {
  323 + this.qdzCode = qdzCode;
  324 + }
  325 +
  326 + public String getQdzName() {
  327 + return qdzName;
  328 + }
  329 +
  330 + public void setQdzName(String qdzName) {
  331 + this.qdzName = qdzName;
  332 + }
  333 +
  334 + public String getZdzCode() {
  335 + return zdzCode;
  336 + }
  337 +
  338 + public void setZdzCode(String zdzCode) {
  339 + this.zdzCode = zdzCode;
  340 + }
  341 +
  342 + public String getZdzName() {
  343 + return zdzName;
  344 + }
  345 +
  346 + public void setZdzName(String zdzName) {
  347 + this.zdzName = zdzName;
  348 + }
  349 +
  350 + public String getFcsj() {
  351 + return fcsj;
  352 + }
  353 +
  354 + public void setFcsj(String fcsj) {
  355 + this.fcsj = fcsj;
  356 + }
  357 +
  358 + public Long getFcsjT() {
  359 + return fcsjT;
  360 + }
  361 +
  362 + public void setFcsjT(Long fcsjT) {
  363 + this.fcsjT = fcsjT;
  364 + }
  365 +
  366 + public String getZdsj() {
  367 + return zdsj;
  368 + }
  369 +
  370 + public void setZdsj(String zdsj) {
  371 + this.zdsj = zdsj;
  372 + }
  373 +
  374 + public Long getZdsjT() {
  375 + return zdsjT;
  376 + }
  377 +
  378 + public void setZdsjT(Long zdsjT) {
  379 + this.zdsjT = zdsjT;
  380 + }
  381 +
  382 + public Double getJhlc() {
  383 + return jhlc;
  384 + }
  385 +
  386 + public void setJhlc(Double jhlc) {
  387 + this.jhlc = jhlc;
  388 + }
  389 +
  390 + public Double getJhlcOrig() {
  391 + return jhlcOrig;
  392 + }
  393 +
  394 + public void setJhlcOrig(Double jhlcOrig) {
  395 + this.jhlcOrig = jhlcOrig;
  396 + }
  397 +
  398 + public Integer getBcsj() {
  399 + return bcsj;
  400 + }
  401 +
  402 + public void setBcsj(Integer bcsj) {
  403 + this.bcsj = bcsj;
  404 + }
  405 +
  406 + public String getBcType() {
  407 + return bcType;
  408 + }
  409 +
  410 + public void setBcType(String bcType) {
  411 + this.bcType = bcType;
  412 + }
  413 +
  414 + public String getMajorStationName() {
  415 + return majorStationName;
  416 + }
  417 +
  418 + public void setMajorStationName(String majorStationName) {
  419 + this.majorStationName = majorStationName;
  420 + }
  421 +
  422 + public String getFcsjActual() {
  423 + return fcsjActual;
  424 + }
  425 +
  426 + public void setFcsjActual(String fcsjActual) {
  427 + this.fcsjActual = fcsjActual;
  428 + }
  429 +
  430 + public Long getFcsjActualTime() {
  431 + return fcsjActualTime;
  432 + }
  433 +
  434 + public void setFcsjActualTime(Long fcsjActualTime) {
  435 + this.fcsjActualTime = fcsjActualTime;
  436 + }
  437 +
  438 + public String getZdsjActual() {
  439 + return zdsjActual;
  440 + }
  441 +
  442 + public void setZdsjActual(String zdsjActual) {
  443 + this.zdsjActual = zdsjActual;
  444 + }
  445 +
  446 + public Long getZdsjActualTime() {
  447 + return zdsjActualTime;
  448 + }
  449 +
  450 + public void setZdsjActualTime(Long zdsjActualTime) {
  451 + this.zdsjActualTime = zdsjActualTime;
  452 + }
  453 +
  454 + public int getStatus() {
  455 + return status;
  456 + }
  457 +
  458 + public void setStatus(int status) {
  459 + this.status = status;
  460 + }
  461 +
  462 + public String getAdjustExps() {
  463 + return adjustExps;
  464 + }
  465 +
  466 + public void setAdjustExps(String adjustExps) {
  467 + this.adjustExps = adjustExps;
  468 + }
  469 +
  470 + public boolean isSflj() {
  471 + return sflj;
  472 + }
  473 +
  474 + public void setSflj(boolean sflj) {
  475 + this.sflj = sflj;
  476 + }
  477 +
  478 + public boolean isLate() {
  479 + return late;
  480 + }
  481 +
  482 + public void setLate(boolean late) {
  483 + this.late = late;
  484 + }
  485 +
  486 + public boolean isLate2() {
  487 + return late2;
  488 + }
  489 +
  490 + public void setLate2(boolean late2) {
  491 + this.late2 = late2;
  492 + }
  493 +
  494 + public float getLateMinute() {
  495 + return lateMinute;
  496 + }
  497 +
  498 + public void setLateMinute(float lateMinute) {
  499 + this.lateMinute = lateMinute;
  500 + }
  501 +
  502 + public String getRemarks() {
  503 + return remarks;
  504 + }
  505 +
  506 + public void setRemarks(String remarks) {
  507 + this.remarks = remarks;
  508 + }
  509 +
  510 + public String getDfsj() {
  511 + return dfsj;
  512 + }
  513 +
  514 + public void setDfsj(String dfsj) {
  515 + this.dfsj = dfsj;
  516 + }
  517 +
  518 + public Long getDfsjT() {
  519 + return dfsjT;
  520 + }
  521 +
  522 + public void setDfsjT(Long dfsjT) {
  523 + this.dfsjT = dfsjT;
  524 + }
  525 +
  526 + public Integer getDirectiveState() {
  527 + return directiveState;
  528 + }
  529 +
  530 + public void setDirectiveState(Integer directiveState) {
  531 + this.directiveState = directiveState;
  532 + }
  533 +
  534 + public String getQdzArrDatejh() {
  535 + return qdzArrDatejh;
  536 + }
  537 +
  538 + public void setQdzArrDatejh(String qdzArrDatejh) {
  539 + this.qdzArrDatejh = qdzArrDatejh;
  540 + }
  541 +
  542 + public String getQdzArrDatesj() {
  543 + return qdzArrDatesj;
  544 + }
  545 +
  546 + public void setQdzArrDatesj(String qdzArrDatesj) {
  547 + this.qdzArrDatesj = qdzArrDatesj;
  548 + }
  549 +
  550 + public Set<ChildTaskPlan> getcTasks() {
  551 + return cTasks;
  552 + }
  553 +
  554 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  555 + this.cTasks = cTasks;
  556 + }
  557 +
  558 + public String getGsName() {
  559 + return gsName;
  560 + }
  561 +
  562 + public void setGsName(String gsName) {
  563 + this.gsName = gsName;
  564 + }
  565 +
  566 + public String getGsBm() {
  567 + return gsBm;
  568 + }
  569 +
  570 + public void setGsBm(String gsBm) {
  571 + this.gsBm = gsBm;
  572 + }
  573 +
  574 + public String getFgsName() {
  575 + return fgsName;
  576 + }
  577 +
  578 + public void setFgsName(String fgsName) {
  579 + this.fgsName = fgsName;
  580 + }
  581 +
  582 + public String getFgsBm() {
  583 + return fgsBm;
  584 + }
  585 +
  586 + public void setFgsBm(String fgsBm) {
  587 + this.fgsBm = fgsBm;
  588 + }
  589 +
  590 + public boolean isCcService() {
  591 + return ccService;
  592 + }
  593 +
  594 + public void setCcService(boolean ccService) {
  595 + this.ccService = ccService;
  596 + }
  597 +}
src/main/java/com/bsth/websocket/handler/SendUtils.java
@@ -7,6 +7,7 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity; @@ -7,6 +7,7 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity;
7 import com.bsth.data.safe_driv.SafeDriv; 7 import com.bsth.data.safe_driv.SafeDriv;
8 import com.bsth.entity.directive.D80; 8 import com.bsth.entity.directive.D80;
9 import com.bsth.entity.realcontrol.ScheduleRealInfo; 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  10 +import com.bsth.websocket.dto.WsScheduleRealInfo;
10 import com.fasterxml.jackson.core.JsonProcessingException; 11 import com.fasterxml.jackson.core.JsonProcessingException;
11 import com.fasterxml.jackson.databind.ObjectMapper; 12 import com.fasterxml.jackson.databind.ObjectMapper;
12 import org.slf4j.Logger; 13 import org.slf4j.Logger;
@@ -38,7 +39,7 @@ public class SendUtils{ @@ -38,7 +39,7 @@ public class SendUtils{
38 39
39 Map<String, Object> map = new HashMap<>(); 40 Map<String, Object> map = new HashMap<>();
40 map.put("fn", "faChe"); 41 map.put("fn", "faChe");
41 - map.put("t", sch); 42 + map.put("t", WsScheduleRealInfo.getInstance(sch));
42 map.put("dataStr", sdf.format(new Date())); 43 map.put("dataStr", sdf.format(new Date()));
43 44
44 ObjectMapper mapper = new ObjectMapper(); 45 ObjectMapper mapper = new ObjectMapper();
@@ -62,7 +63,7 @@ public class SendUtils{ @@ -62,7 +63,7 @@ public class SendUtils{
62 63
63 Map<String, Object> map = new HashMap<>(); 64 Map<String, Object> map = new HashMap<>();
64 map.put("fn", "refreshSch"); 65 map.put("fn", "refreshSch");
65 - map.put("ts", list); 66 + map.put("ts", WsScheduleRealInfo.getMultiInstance(list));
66 67
67 ObjectMapper mapper = new ObjectMapper(); 68 ObjectMapper mapper = new ObjectMapper();
68 69
@@ -82,8 +83,8 @@ public class SendUtils{ @@ -82,8 +83,8 @@ public class SendUtils{
82 83
83 Map<String, Object> map = new HashMap<>(); 84 Map<String, Object> map = new HashMap<>();
84 map.put("fn", "zhongDian"); 85 map.put("fn", "zhongDian");
85 - map.put("t", sch);  
86 - map.put("nt", nextSch); 86 + map.put("t", WsScheduleRealInfo.getInstance(sch));
  87 + map.put("nt", WsScheduleRealInfo.getInstance(nextSch));
87 map.put("finish", finish); 88 map.put("finish", finish);
88 map.put("dataStr", sdf.format(new Date())); 89 map.put("dataStr", sdf.format(new Date()));
89 90
@@ -123,7 +124,7 @@ public class SendUtils{ @@ -123,7 +124,7 @@ public class SendUtils{
123 124
124 Map<String, Object> map = new HashMap<>(); 125 Map<String, Object> map = new HashMap<>();
125 map.put("fn", "directive"); 126 map.put("fn", "directive");
126 - map.put("t", sch);; 127 + map.put("t", WsScheduleRealInfo.getInstance(sch));;
127 128
128 ObjectMapper mapper = new ObjectMapper(); 129 ObjectMapper mapper = new ObjectMapper();
129 130
src/main/resources/static/pages/base/carpark/add.html
@@ -208,7 +208,7 @@ @@ -208,7 +208,7 @@
208 <!-- 所属公司 --> 208 <!-- 所属公司 -->
209 <div class="form-body"> 209 <div class="form-body">
210 <div class="form-group"> 210 <div class="form-group">
211 - <label class="col-md-3 control-label">所属公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label> 211 + <label class="col-md-3 control-label"><span class="required"> * </span>所属公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
212 <div class="col-md-6"> 212 <div class="col-md-6">
213 <select name="company" class="form-control" style="width:100%" id="companySelect"></select> 213 <select name="company" class="form-control" style="width:100%" id="companySelect"></select>
214 </div> 214 </div>
@@ -217,7 +217,7 @@ @@ -217,7 +217,7 @@
217 <!-- 所属分公司 --> 217 <!-- 所属分公司 -->
218 <div class="form-body"> 218 <div class="form-body">
219 <div class="form-group"> 219 <div class="form-group">
220 - <label class="col-md-3 control-label">所属分公司&nbsp;&nbsp;&nbsp;:</label> 220 + <label class="col-md-3 control-label"><span class="required"> * </span>所属分公司&nbsp;&nbsp;&nbsp;:</label>
221 <div class="col-md-6"> 221 <div class="col-md-6">
222 <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> 222 <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect">
223 </select> 223 </select>
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
@@ -33,6 +33,8 @@ var FormWizard = function() { @@ -33,6 +33,8 @@ var FormWizard = function() {
33 data : {'parkCode' : function() { return $("#parkCodeInput").val(); }}, 33 data : {'parkCode' : function() { return $("#parkCodeInput").val(); }},
34 }},// 停车场编码 必填项 34 }},// 停车场编码 必填项
35 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项 35 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项
  36 + 'company' : {required : true,},// 必填项
  37 + 'brancheCompany' : {required : true,},// 必填项
36 'shapesType' : {required : true,},// 几何图形类型 必填项 38 'shapesType' : {required : true,},// 几何图形类型 必填项
37 'radius' : {required : true,digits:true},// 圆形半径 必填项 39 'radius' : {required : true,digits:true},// 圆形半径 必填项
38 'destroy' : {required : true,},// 是否撤销 必填项 40 'destroy' : {required : true,},// 是否撤销 必填项
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
@@ -204,7 +204,7 @@ $(function(){ @@ -204,7 +204,7 @@ $(function(){
204 if (params.line) { 204 if (params.line) {
205 205
206 // 添加数据 206 // 添加数据
207 - $post('/lineInformation1', params, function(result) { 207 + $post('/lineInformation', params, function(result) {
208 208
209 // 如果返回结果不为空 209 // 如果返回结果不为空
210 if(result){ 210 if(result){
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>
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/layout.html
@@ -118,15 +118,14 @@ @@ -118,15 +118,14 @@
118 {{/if}} 118 {{/if}}
119 </script> 119 </script>
120 <script id="pbv3_park_dropdown-temp" type="text/html"> 120 <script id="pbv3_park_dropdown-temp" type="text/html">
121 - <li style="text-align: center;"> 121 + <div style="text-align: center;border-bottom: 1px solid #e2e2e2;padding-bottom: 9px;margin-bottom: 9px;">
122 <form class="uk-form" data-uk-margin> 122 <form class="uk-form" data-uk-margin>
123 <div class="uk-form-icon"> 123 <div class="uk-form-icon">
124 <i class="uk-icon-search"></i> 124 <i class="uk-icon-search"></i>
125 - <input type="text" placeholder="搜索" > 125 + <input type="text" placeholder="搜索" class="park_list_search_input">
126 </div> 126 </div>
127 </form> 127 </form>
128 - </li>  
129 - <li class="uk-nav-divider"></li> 128 + </div>
130 {{each list as p i}} 129 {{each list as p i}}
131 <li data-code="{{p.parkCode}}" ><a>{{p.parkName}}</a></li> 130 <li data-code="{{p.parkCode}}" ><a>{{p.parkName}}</a></li>
132 {{/each}} 131 {{/each}}
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/right.html
@@ -649,22 +649,37 @@ @@ -649,22 +649,37 @@
649 (function (lineCode) { 649 (function (lineCode) {
650 //从地图模块获取停车场数据 650 //从地图模块获取停车场数据
651 var parks = gb_map_spatial_data.carparkArray(); 651 var parks = gb_map_spatial_data.carparkArray();
652 - /* //将线路标准停车场排在第一个  
653 - var information = gb_data_basic.getLineInformation(lineCode);  
654 - if(information){  
655 - var index;  
656 - for(var i = 0,p; p=parks[i++];){  
657 - if(p.parkCode == information.carPark){  
658 - index = i - 1;  
659 - break;  
660 - }  
661 - }  
662 - parks[index] = parks.splice(0, 1 , parks[index])[0];  
663 - }*/  
664 //渲染 652 //渲染
665 var htmlStr = template('pbv3_park_dropdown-temp', {list: parks}); 653 var htmlStr = template('pbv3_park_dropdown-temp', {list: parks});
666 $('.buffer_area_form .parks_list', rightWrap).html(htmlStr); 654 $('.buffer_area_form .parks_list', rightWrap).html(htmlStr);
667 655
  656 + console.log('parksparks', parks);
  657 + //拼音映射
  658 + var searchData=[];
  659 + for(var i=0,p;p=parks[i++];){
  660 + searchData.push({
  661 + code: p.parkCode,
  662 + name: p.parkName,
  663 + fullChars: pinyin.getFullChars(p.parkName).toUpperCase(),
  664 + camelChars: pinyin.getCamelChars(p.parkName).toUpperCase()
  665 + })
  666 + }
  667 + //搜索
  668 + var listWrap = $('.buffer_area_form .parks_list', rightWrap);
  669 + $('.park_list_search_input', rightWrap).on('input', function () {
  670 + var v = $(this).val();
  671 + if(!v){
  672 + $('li', listWrap).show();
  673 + return;
  674 + }
  675 + v = v.toUpperCase();
  676 + $('li', listWrap).hide();
  677 + for(var i=0,obj;obj=searchData[i++];){
  678 + if(obj.name.indexOf(v)!=-1 || obj.fullChars.indexOf(v)!=-1 || obj.camelChars.indexOf(v)!=-1)
  679 + $('li[data-code="'+obj.code+'"]', listWrap).show();
  680 + }
  681 + });
  682 +
668 //停车场点击 683 //停车场点击
669 $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () { 684 $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () {
670 var code = $(this).data('code'); 685 var code = $(this).data('code');