Commit 617a41f814ab5fc54a69078aef556b5712b1b564
1 parent
530d9354
1.调度系统加入进出场私自绕改道提示
Showing
8 changed files
with
155 additions
and
1 deletions
src/main/java/com/bsth/data/BasicData.java
| @@ -73,6 +73,9 @@ public class BasicData { | @@ -73,6 +73,9 @@ public class BasicData { | ||
| 73 | //线路编码和名称对照 | 73 | //线路编码和名称对照 |
| 74 | public static Map<String, String> lineCode2NameMap; | 74 | public static Map<String, String> lineCode2NameMap; |
| 75 | 75 | ||
| 76 | + //名称和线路编码对照 | ||
| 77 | + public static Map<String, String> lineName2CodeMap; | ||
| 78 | + | ||
| 76 | public static Map<String, String> lineCodeAllNameMap; | 79 | public static Map<String, String> lineCodeAllNameMap; |
| 77 | //停车场 | 80 | //停车场 |
| 78 | public static List<String> parkCodeList; | 81 | public static List<String> parkCodeList; |
| @@ -331,6 +334,7 @@ public class BasicData { | @@ -331,6 +334,7 @@ public class BasicData { | ||
| 331 | Line line; | 334 | Line line; |
| 332 | BiMap<Integer, String> biMap = HashBiMap.create(); | 335 | BiMap<Integer, String> biMap = HashBiMap.create(); |
| 333 | Map<String, String> code2name = new HashMap<>(); | 336 | Map<String, String> code2name = new HashMap<>(); |
| 337 | + Map<String, String> name2code = new HashMap<>(); | ||
| 334 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); | 338 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); |
| 335 | Map<String, String> code2SHcode = new HashMap<String, String>(); | 339 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 336 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | 340 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); |
| @@ -364,6 +368,7 @@ public class BasicData { | @@ -364,6 +368,7 @@ public class BasicData { | ||
| 364 | line = iterator.next(); | 368 | line = iterator.next(); |
| 365 | biMap.put(line.getId(), line.getLineCode()); | 369 | biMap.put(line.getId(), line.getLineCode()); |
| 366 | code2name.put(line.getLineCode(), line.getName()); | 370 | code2name.put(line.getLineCode(), line.getName()); |
| 371 | + name2code.put(line.getName(), line.getLineCode()); | ||
| 367 | id2SHcode.put(line.getId(), line.getShanghaiLinecode()); | 372 | id2SHcode.put(line.getId(), line.getShanghaiLinecode()); |
| 368 | code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); | 373 | code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); |
| 369 | } | 374 | } |
| @@ -374,6 +379,7 @@ public class BasicData { | @@ -374,6 +379,7 @@ public class BasicData { | ||
| 374 | 379 | ||
| 375 | lineId2CodeMap = biMap; | 380 | lineId2CodeMap = biMap; |
| 376 | lineCode2NameMap = code2name; | 381 | lineCode2NameMap = code2name; |
| 382 | + lineName2CodeMap = name2code; | ||
| 377 | lineId2ShangHaiCodeMap = id2SHcode; | 383 | lineId2ShangHaiCodeMap = id2SHcode; |
| 378 | lineCode2ShangHaiCodeMap = code2SHcode; | 384 | lineCode2ShangHaiCodeMap = code2SHcode; |
| 379 | stationName2YgcNumber = tempStationName2YgcNumber; | 385 | stationName2YgcNumber = tempStationName2YgcNumber; |
src/main/java/com/bsth/message/entity/InoutPark.java
0 → 100644
| 1 | +package com.bsth.message.entity; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @author Hill | ||
| 8 | + */ | ||
| 9 | +@JsonIgnoreProperties(ignoreUnknown = true) | ||
| 10 | +public class InoutPark { | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * 线路名 | ||
| 14 | + */ | ||
| 15 | + private String line; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 线路代码 | ||
| 19 | + */ | ||
| 20 | + private String lineId; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 车辆编码 | ||
| 24 | + */ | ||
| 25 | + private String nbbm; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 发现时间(或发车时间) | ||
| 29 | + */ | ||
| 30 | + private String findTime; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 进场/出场(绕改道) | ||
| 34 | + */ | ||
| 35 | + private String errType; | ||
| 36 | + | ||
| 37 | + public String getLine() { | ||
| 38 | + return line; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public void setLine(String line) { | ||
| 42 | + this.line = line; | ||
| 43 | + this.lineId = BasicData.lineName2CodeMap.get(line); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public String getLineId() { | ||
| 47 | + return lineId; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public String getNbbm() { | ||
| 51 | + return nbbm; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public void setNbbm(String nbbm) { | ||
| 55 | + this.nbbm = nbbm; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public String getFindTime() { | ||
| 59 | + return findTime; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public void setFindTime(String findTime) { | ||
| 63 | + this.findTime = findTime; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + public String getErrType() { | ||
| 67 | + return errType; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public void setErrType(String errType) { | ||
| 71 | + this.errType = errType; | ||
| 72 | + } | ||
| 73 | +} |
src/main/java/com/bsth/message/handler/MessageHandler.java
| @@ -3,6 +3,7 @@ package com.bsth.message.handler; | @@ -3,6 +3,7 @@ package com.bsth.message.handler; | ||
| 3 | import com.bsth.message.buffer.CarEnergyBuffer; | 3 | import com.bsth.message.buffer.CarEnergyBuffer; |
| 4 | import com.bsth.message.entity.CarEnergy; | 4 | import com.bsth.message.entity.CarEnergy; |
| 5 | import com.bsth.message.entity.CarErrorStop; | 5 | import com.bsth.message.entity.CarErrorStop; |
| 6 | +import com.bsth.message.entity.InoutPark; | ||
| 6 | import com.bsth.websocket.handler.SendUtils; | 7 | import com.bsth.websocket.handler.SendUtils; |
| 7 | import com.fasterxml.jackson.databind.ObjectMapper; | 8 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -50,4 +51,16 @@ public class MessageHandler { | @@ -50,4 +51,16 @@ public class MessageHandler { | ||
| 50 | e.printStackTrace(); | 51 | e.printStackTrace(); |
| 51 | } | 52 | } |
| 52 | } | 53 | } |
| 54 | + | ||
| 55 | + @KafkaListener(topics="schedule-mainsys-inoutpark") | ||
| 56 | + public void receivedInoutPark(Message<String> message) { | ||
| 57 | + try { | ||
| 58 | + List<InoutPark> inoutParkList = mapper.readValue(message.getPayload(), mapper.getTypeFactory().constructParametricType(List.class, InoutPark.class)); | ||
| 59 | + for (InoutPark inoutPark : inoutParkList) { | ||
| 60 | + sendUtils.sendInoutPark(inoutPark); | ||
| 61 | + } | ||
| 62 | + } catch (IOException e) { | ||
| 63 | + e.printStackTrace(); | ||
| 64 | + } | ||
| 65 | + } | ||
| 53 | } | 66 | } |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| @@ -9,6 +9,7 @@ import com.bsth.data.safe_driv.SafeDriv; | @@ -9,6 +9,7 @@ import com.bsth.data.safe_driv.SafeDriv; | ||
| 9 | import com.bsth.entity.directive.D80; | 9 | import com.bsth.entity.directive.D80; |
| 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 11 | import com.bsth.message.entity.CarErrorStop; | 11 | import com.bsth.message.entity.CarErrorStop; |
| 12 | +import com.bsth.message.entity.InoutPark; | ||
| 12 | import com.bsth.websocket.dto.WsScheduleRealInfo; | 13 | import com.bsth.websocket.dto.WsScheduleRealInfo; |
| 13 | import com.fasterxml.jackson.core.JsonProcessingException; | 14 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 14 | import com.fasterxml.jackson.databind.ObjectMapper; | 15 | import com.fasterxml.jackson.databind.ObjectMapper; |
| @@ -287,4 +288,22 @@ public class SendUtils{ | @@ -287,4 +288,22 @@ public class SendUtils{ | ||
| 287 | logger.error("sendCarErrorStop", e); | 288 | logger.error("sendCarErrorStop", e); |
| 288 | } | 289 | } |
| 289 | } | 290 | } |
| 291 | + | ||
| 292 | + /** | ||
| 293 | + * 将车辆进出场私自绕改道发送至线调页面 | ||
| 294 | + */ | ||
| 295 | + public void sendInoutPark(InoutPark inoutPark) { | ||
| 296 | + Map<String, Object> map = new HashMap<>(); | ||
| 297 | + map.put("fn", "inoutPark"); | ||
| 298 | + map.put("data", inoutPark); | ||
| 299 | + ObjectMapper mapper = new ObjectMapper(); | ||
| 300 | + | ||
| 301 | + try { | ||
| 302 | + if (inoutPark.getLineId() != null) { | ||
| 303 | + socketHandler.sendMessageToLine(inoutPark.getLineId(), mapper.writeValueAsString(map)); | ||
| 304 | + } | ||
| 305 | + } catch (JsonProcessingException e) { | ||
| 306 | + logger.error("sendInoutPark", e); | ||
| 307 | + } | ||
| 308 | + } | ||
| 290 | } | 309 | } |
src/main/resources/static/real_control_v2/js/platform/inoutPark.js
0 → 100644
| 1 | +/** | ||
| 2 | + * 车辆异常停车相关 | ||
| 3 | + */ | ||
| 4 | +var gb_inoutpark = (function () { | ||
| 5 | + var $wrap = $('.multi_plat_msg_pop_wrap'); | ||
| 6 | + var max = 5; | ||
| 7 | + | ||
| 8 | + var pop = function (data) { | ||
| 9 | + //时间格式化 | ||
| 10 | + data.type = 'inoutpark'; | ||
| 11 | + | ||
| 12 | + var htmlStr = template('inoutpark_plat_msg_template', data); | ||
| 13 | + var items = $wrap.find('.multi_plat_msg_pop'), len = items.length; | ||
| 14 | + if (len >= max) | ||
| 15 | + $wrap.find('.multi_plat_msg_pop:lt(' + (len - max) + ')').remove(); | ||
| 16 | + | ||
| 17 | + $wrap.append(htmlStr); | ||
| 18 | + }; | ||
| 19 | + | ||
| 20 | + return { | ||
| 21 | + pop: pop | ||
| 22 | + } | ||
| 23 | +})(); | ||
| 0 | \ No newline at end of file | 24 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
| @@ -100,6 +100,10 @@ var gb_safe_driv = (function () { | @@ -100,6 +100,10 @@ var gb_safe_driv = (function () { | ||
| 100 | gb_map_play_back.setParam(data); | 100 | gb_map_play_back.setParam(data); |
| 101 | } | 101 | } |
| 102 | break; | 102 | break; |
| 103 | + // 运管中心进出场绕改道 | ||
| 104 | + case 'inoutpark': | ||
| 105 | + $(this).remove(); | ||
| 106 | + break; | ||
| 103 | default: | 107 | default: |
| 104 | break; | 108 | break; |
| 105 | } | 109 | } |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
| @@ -204,6 +204,10 @@ var gb_sch_websocket = (function () { | @@ -204,6 +204,10 @@ var gb_sch_websocket = (function () { | ||
| 204 | gb_carerrorstop.pop(msg.data); | 204 | gb_carerrorstop.pop(msg.data); |
| 205 | }; | 205 | }; |
| 206 | 206 | ||
| 207 | + var inoutPark = function (msg) { | ||
| 208 | + gb_inoutpark.pop(msg.data); | ||
| 209 | + } | ||
| 210 | + | ||
| 207 | var msgHandle = { | 211 | var msgHandle = { |
| 208 | report80: report80, | 212 | report80: report80, |
| 209 | faChe: faChe, | 213 | faChe: faChe, |
| @@ -218,7 +222,8 @@ var gb_sch_websocket = (function () { | @@ -218,7 +222,8 @@ var gb_sch_websocket = (function () { | ||
| 218 | rfid: refreshRfid, | 222 | rfid: refreshRfid, |
| 219 | contingencyPlan: contingencyPlan, | 223 | contingencyPlan: contingencyPlan, |
| 220 | maintenancePlan: maintenancePlan, | 224 | maintenancePlan: maintenancePlan, |
| 221 | - carErrorStop: carErrorStop | 225 | + carErrorStop: carErrorStop, |
| 226 | + inoutPark: inoutPark | ||
| 222 | }; | 227 | }; |
| 223 | 228 | ||
| 224 | function currentSecond() { | 229 | function currentSecond() { |
src/main/resources/static/real_control_v2/main.html
| @@ -266,11 +266,22 @@ | @@ -266,11 +266,22 @@ | ||
| 266 | </div> | 266 | </div> |
| 267 | </div> | 267 | </div> |
| 268 | </script> | 268 | </script> |
| 269 | +<script id="inoutpark_plat_msg_template" type="text/html"> | ||
| 270 | + <div class="multi_plat_msg_pop uk-animation-slide-bottom" style="background-color: #FF7F24;" data-type="{{type}}" data-zbh="{{nbbm}}"> | ||
| 271 | + <div> | ||
| 272 | + <span class="title">{{errType}}私自绕改道</span> | ||
| 273 | + <br/> | ||
| 274 | + <span class="text"> {{line}} {{nbbm}} 在 {{findTime}} {{errType}}私自绕改道,<br/>请到运管中心处理</span> | ||
| 275 | + <span class="desc" style="color: #ffffff">--浦东公交运管中心管理系统</span> | ||
| 276 | + </div> | ||
| 277 | + </div> | ||
| 278 | +</script> | ||
| 269 | 279 | ||
| 270 | <script src="/real_control_v2/js/safe_driv/safeDriv.js" merge="custom_js"></script> | 280 | <script src="/real_control_v2/js/safe_driv/safeDriv.js" merge="custom_js"></script> |
| 271 | <script src="/real_control_v2/js/con_plan/conPlan.js" merge="custom_js"></script> | 281 | <script src="/real_control_v2/js/con_plan/conPlan.js" merge="custom_js"></script> |
| 272 | <script src="/real_control_v2/js/mt_plan/mtPlan.js" merge="custom_js"></script> | 282 | <script src="/real_control_v2/js/mt_plan/mtPlan.js" merge="custom_js"></script> |
| 273 | <script src="/real_control_v2/js/platform/carErrorStop.js" merge="custom_js"></script> | 283 | <script src="/real_control_v2/js/platform/carErrorStop.js" merge="custom_js"></script> |
| 284 | +<script src="/real_control_v2/js/platform/inoutPark.js" merge="custom_js"></script> | ||
| 274 | <!-- #### 安全驾驶 end ### --> | 285 | <!-- #### 安全驾驶 end ### --> |
| 275 | 286 | ||
| 276 | <!-- 打电话 --> | 287 | <!-- 打电话 --> |