Commit 1a9f65a2c936f62ff702c42d460d04b34a0a66f6

Authored by ljq
1 parent 7753da64

代码优化

src/main/java/com/bsth/controller/zndd/LoggerZnddController.java
1 package com.bsth.controller.zndd; 1 package com.bsth.controller.zndd;
2 2
3 import com.bsth.controller.BaseController; 3 import com.bsth.controller.BaseController;
  4 +import com.bsth.data.zndd.ZnddMessage;
4 import com.bsth.entity.realcontrol.ScheduleRealInfo; 5 import com.bsth.entity.realcontrol.ScheduleRealInfo;
5 import com.bsth.entity.zndd.LoggerZndd; 6 import com.bsth.entity.zndd.LoggerZndd;
6 import com.bsth.service.zndd.LoggerZnddService; 7 import com.bsth.service.zndd.LoggerZnddService;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.web.bind.annotation.*; 9 import org.springframework.web.bind.annotation.*;
  10 +
9 import java.util.List; 11 import java.util.List;
10 import java.util.Map; 12 import java.util.Map;
11 13
@@ -16,6 +18,9 @@ public class LoggerZnddController extends BaseController<LoggerZndd, Integer> { @@ -16,6 +18,9 @@ public class LoggerZnddController extends BaseController<LoggerZndd, Integer> {
16 @Autowired 18 @Autowired
17 LoggerZnddService loggerZnddService; 19 LoggerZnddService loggerZnddService;
18 20
  21 + @Autowired
  22 + ZnddMessage znddMessage;
  23 +
19 @RequestMapping("listall") 24 @RequestMapping("listall")
20 public List<Map<String, Object>> listAll(@RequestParam Map<String, Object> map){ 25 public List<Map<String, Object>> listAll(@RequestParam Map<String, Object> map){
21 return loggerZnddService.listAll(map); 26 return loggerZnddService.listAll(map);
@@ -67,17 +72,6 @@ public class LoggerZnddController extends BaseController&lt;LoggerZndd, Integer&gt; { @@ -67,17 +72,6 @@ public class LoggerZnddController extends BaseController&lt;LoggerZndd, Integer&gt; {
67 } 72 }
68 73
69 /** 74 /**
70 - * schDeepSeep查询班次情况  
71 - * @param  
72 - * @return  
73 - */  
74 - @RequestMapping(value = "schDeepSeep", method = RequestMethod.GET)  
75 - public Map schDeepSeep(@RequestParam String message){  
76 - return loggerZnddService.schDeepSeep(message);  
77 - }  
78 -  
79 -  
80 - /**  
81 * 时刻表 查询前一天的班次和时刻表作对比 75 * 时刻表 查询前一天的班次和时刻表作对比
82 * @param 76 * @param
83 * @return 77 * @return
@@ -86,4 +80,15 @@ public class LoggerZnddController extends BaseController&lt;LoggerZndd, Integer&gt; { @@ -86,4 +80,15 @@ public class LoggerZnddController extends BaseController&lt;LoggerZndd, Integer&gt; {
86 public List<ScheduleRealInfo> schQbc(@RequestParam String xl){ 80 public List<ScheduleRealInfo> schQbc(@RequestParam String xl){
87 return loggerZnddService.schQbc(xl); 81 return loggerZnddService.schQbc(xl);
88 } 82 }
  83 +
  84 + //大客流的时候加入后续流程
  85 + @RequestMapping(value = "addMessage", method = RequestMethod.POST)
  86 + public void addMessage(@RequestBody ScheduleRealInfo sch){
  87 + try {
  88 + znddMessage.saveSch(sch);
  89 + }catch (Exception e){
  90 + e.printStackTrace();
  91 + }
  92 +
  93 + }
89 } 94 }
src/main/java/com/bsth/data/zndd/AutomaticSch.java
@@ -442,10 +442,15 @@ public class AutomaticSch { @@ -442,10 +442,15 @@ public class AutomaticSch {
442 } 442 }
443 443
444 for (Map.Entry<String, String> t : lineMap.entrySet()) { 444 for (Map.Entry<String, String> t : lineMap.entrySet()) {
445 - List<ScheduleRealInfo> srList = dayOfSchedule.findByLineCode(t.getKey()); 445 + List<ScheduleRealInfo> mtwoList = new ArrayList<>(); //每条线路除去烂班的所有班次
  446 + List<ScheduleRealInfo> srList = dayOfSchedule.findByLineCode(t.getKey()); //每条线路所有班次
446 Map<String, List<ScheduleRealInfo>> mapType = new HashMap(); 447 Map<String, List<ScheduleRealInfo>> mapType = new HashMap();
447 //所有车辆 448 //所有车辆
448 for (ScheduleRealInfo s : srList) { 449 for (ScheduleRealInfo s : srList) {
  450 + if(s.getStatus() != -1){
  451 + mtwoList.add(s);
  452 + }
  453 +
449 if (mapType.get(s.getClZbh()) != null) 454 if (mapType.get(s.getClZbh()) != null)
450 continue; 455 continue;
451 456
@@ -459,6 +464,25 @@ public class AutomaticSch { @@ -459,6 +464,25 @@ public class AutomaticSch {
459 } 464 }
460 mapType.put(s.getClZbh(), schadd); 465 mapType.put(s.getClZbh(), schadd);
461 } 466 }
  467 +
  468 + if (snt == 0) {
  469 + //倒数第二班方法 -- 去除烂班
  470 + Collections.sort(mtwoList, new ScheduleComparator.FCSJ());
  471 + //倒数第二个班次保证数量超过两条
  472 + ScheduleRealInfo scht = mtwoList.size() >= 2 ? mtwoList.get(mtwoList.size() - 2) : null;
  473 + if (scht == null)
  474 + continue;
  475 +
  476 + if (scht.getDfsjT() > DateUtils.getTimestamp() + (1000 * 60 * 60 * 20) &&
  477 + scht.getDfsjT() - System.currentTimeMillis() < (1000 * 60 * 4) &&
  478 + scht.getDfsjT() - System.currentTimeMillis() >= (1000 * 60 * 3)) {
  479 + //推送一下
  480 + ts(addStationPeople(scht, "DESCTWO", 0l));
  481 +
  482 + LogerWait("末二班车推送", scht);
  483 + }
  484 + }
  485 +
462 //判断倒数第二个班次是否快要发车 486 //判断倒数第二个班次是否快要发车
463 for (String key : mapType.keySet()) { 487 for (String key : mapType.keySet()) {
464 List<ScheduleRealInfo> carList = mapType.get(key); 488 List<ScheduleRealInfo> carList = mapType.get(key);
@@ -477,23 +501,7 @@ public class AutomaticSch { @@ -477,23 +501,7 @@ public class AutomaticSch {
477 } 501 }
478 } 502 }
479 } 503 }
480 - if (snt == 0) {  
481 - //倒数第二班方法  
482 - Collections.sort(carList, new ScheduleComparator.FCSJ());  
483 - //倒数第二个班次保证数量超过两条  
484 - ScheduleRealInfo scht = carList.size() >= 2 ? carList.get(carList.size() - 2) : null;  
485 - if (scht == null)  
486 - continue;  
487 -  
488 - if (scht.getDfsjT() > DateUtils.getTimestamp() + (1000 * 60 * 60 * 20) &&  
489 - scht.getDfsjT() - System.currentTimeMillis() < (1000 * 60 * 4) &&  
490 - scht.getDfsjT() - System.currentTimeMillis() >= (1000 * 60 * 3)) {  
491 - //推送一下  
492 - ts(addStationPeople(scht, "DESCTWO", 0l));  
493 -  
494 - LogerWait("末二班车推送", scht);  
495 - }  
496 - } 504 +
497 } 505 }
498 } 506 }
499 507
src/main/java/com/bsth/data/zndd/OutEntrance.java
@@ -13,6 +13,7 @@ import com.bsth.entity.zndd.StationSignsLogger; @@ -13,6 +13,7 @@ import com.bsth.entity.zndd.StationSignsLogger;
13 import com.bsth.entity.zndd.znddStatus; 13 import com.bsth.entity.zndd.znddStatus;
14 import com.bsth.repository.zndd.ZnddStatusRepository; 14 import com.bsth.repository.zndd.ZnddStatusRepository;
15 import com.bsth.service.DKLInfoService; 15 import com.bsth.service.DKLInfoService;
  16 +import com.bsth.service.zndd.LoggerZnddService;
16 import com.bsth.util.HttpClientUtils; 17 import com.bsth.util.HttpClientUtils;
17 import com.bsth.util.SignUtils; 18 import com.bsth.util.SignUtils;
18 import com.bsth.websocket.handler.SendUtils; 19 import com.bsth.websocket.handler.SendUtils;
@@ -83,6 +84,9 @@ public class OutEntrance { @@ -83,6 +84,9 @@ public class OutEntrance {
83 @Autowired 84 @Autowired
84 ZnddMessage znddMessage; 85 ZnddMessage znddMessage;
85 86
  87 + @Autowired
  88 + LoggerZnddService loggerZnddService;
  89 +
86 //调度屏小程序接口。 90 //调度屏小程序接口。
87 @RequestMapping(value = "/OutCar", method = RequestMethod.POST) 91 @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
88 public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) { 92 public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) {
@@ -214,6 +218,7 @@ public class OutEntrance { @@ -214,6 +218,7 @@ public class OutEntrance {
214 String num=jsonObject.getString("num"); 218 String num=jsonObject.getString("num");
215 int count=automaticSch.getPenum("DKL","0"); 219 int count=automaticSch.getPenum("DKL","0");
216 if(Integer.parseInt(num)<count){ 220 if(Integer.parseInt(num)<count){
  221 + logger.info("大客流人数--"+num);
217 rtn.put("status",ResponseCode.SUCCESS); 222 rtn.put("status",ResponseCode.SUCCESS);
218 return rtn; 223 return rtn;
219 } 224 }
@@ -505,4 +510,18 @@ public class OutEntrance { @@ -505,4 +510,18 @@ public class OutEntrance {
505 return url; 510 return url;
506 } 511 }
507 512
  513 +
  514 +
  515 + /**
  516 + * schDeepSeep查询班次情况
  517 + * @param
  518 + * @return
  519 + */
  520 + @RequestMapping(value = "schDeepSeep", method = RequestMethod.GET)
  521 + public Map schDeepSeep(@RequestParam String message){
  522 + return loggerZnddService.schDeepSeep(message);
  523 + }
  524 +
  525 +
  526 +
508 } 527 }
src/main/java/com/bsth/data/zndd/ZnddMessage.java
1 package com.bsth.data.zndd; 1 package com.bsth.data.zndd;
2 2
  3 +import com.bsth.data.gpsdata_v2.GpsRealData;
  4 +import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
  5 +import com.bsth.data.gpsdata_v2.entity.GpsEntity;
  6 +import com.bsth.data.gpsdata_v2.entity.StationRoute;
  7 +import com.bsth.data.gpsdata_v2.utils.GeoUtils;
3 import com.bsth.entity.realcontrol.ScheduleRealInfo; 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
4 import org.slf4j.Logger; 9 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.web.bind.annotation.RequestMapping; 12 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RequestMethod; 13 import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.RestController; 14 import org.springframework.web.bind.annotation.RestController;
@@ -14,6 +20,8 @@ import java.util.*; @@ -14,6 +20,8 @@ import java.util.*;
14 @RequestMapping("/znddmessage") 20 @RequestMapping("/znddmessage")
15 public class ZnddMessage { 21 public class ZnddMessage {
16 22
  23 + @Autowired
  24 + GpsRealData gpsRealData;
17 static List<Map> LISTMAPALL= new ArrayList<>(); //返回给前台的班次情况 25 static List<Map> LISTMAPALL= new ArrayList<>(); //返回给前台的班次情况
18 26
19 Logger logger = LoggerFactory.getLogger(this.getClass()); 27 Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -55,8 +63,9 @@ public class ZnddMessage { @@ -55,8 +63,9 @@ public class ZnddMessage {
55 if (m.get("uuid") == null) 63 if (m.get("uuid") == null)
56 m.put("uuid",AutomaticSch.UUID()); 64 m.put("uuid",AutomaticSch.UUID());
57 // } 65 // }
58 -  
59 - if (sr.getMessageDKL() == 10){ 66 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  67 + //班次实到之后删除 或者显示已完结
  68 + if (!sr.getScheduleDateStr().equals(sdf.format(new Date()))){
60 LISTMAPALL.remove(m); 69 LISTMAPALL.remove(m);
61 return; 70 return;
62 } 71 }
@@ -67,24 +76,62 @@ public class ZnddMessage { @@ -67,24 +76,62 @@ public class ZnddMessage {
67 public void MessageStatus(ScheduleRealInfo sch, Map map){ 76 public void MessageStatus(ScheduleRealInfo sch, Map map){
68 77
69 switch (sch.getMessageDKL()) { 78 switch (sch.getMessageDKL()) {
70 - case 0: 79 + case 0: //下发驾驶员
71 jsy(sch,map); 80 jsy(sch,map);
72 break; 81 break;
73 - case 1: 82 + case 1: //下发车辆
74 ts_car(sch,map); 83 ts_car(sch,map);
75 break; 84 break;
76 - case 2:  
77 - 85 + case 2: //车辆行驶出发点 -- 检测到车辆信号 +2
  86 + car_new(sch,map);
78 break; 87 break;
79 case 3: 88 case 3:
80 - 89 + //车辆信号 --无方法
81 break; 90 break;
82 case 4: 91 case 4:
83 - 92 + carq_d(sch,map);
  93 + //判断车辆行驶至起点站
  94 + break;
  95 + case 5:
  96 + fcsj_sj(sch,map);
  97 + //判断车辆已经实发
  98 + break;
  99 + case 6:
  100 + //判断车辆已经实到 -完成大客流预案
  101 + zzsj_sj(sch, map);
84 break; 102 break;
85 103
86 } 104 }
87 } 105 }
  106 + //判断车辆是否到了起点站
  107 + public void carq_d(ScheduleRealInfo sch, Map map){
  108 + GpsEntity gps = gpsRealData.getByNbbm(sch.getClZbh());
  109 + List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), Integer.parseInt(sch.getXlDir()));
  110 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  111 + if (station != null) {
  112 + if (station.getMark().equals("B")){
  113 + if (map.get("carq_sj") == null)
  114 + map.put("carq_sj",sdf.format(new Date()));
  115 + }
  116 + }
  117 + }
  118 +
  119 + public void fcsj_sj(ScheduleRealInfo sch, Map map){
  120 + if (sch.getFcsjActual() != null){
  121 + if (map.get("fcsj_sj") == null)
  122 + map.put("fcsj_sj",sdf.format(new Date()));
  123 + }
  124 +
  125 + }
  126 +
  127 +
  128 + public void zzsj_sj(ScheduleRealInfo sch, Map map){
  129 + if (sch.getFcsjActual() != null){
  130 + if (map.get("zzsj_sj") == null)
  131 + map.put("zzsj_sj",sdf.format(new Date()));
  132 + }
  133 +
  134 + }
88 135
89 136
90 //下发驾驶员 137 //下发驾驶员
@@ -119,4 +166,23 @@ public class ZnddMessage { @@ -119,4 +166,23 @@ public class ZnddMessage {
119 } 166 }
120 } 167 }
121 168
  169 + //车辆行驶出发点 -- 检测到车辆信号
  170 + public void car_new (ScheduleRealInfo sch, Map map){
  171 + try {
  172 + GpsEntity gps = gpsRealData.getByNbbm(sch.getClZbh());
  173 + if(gps == null)
  174 + return;
  175 + //暂无
  176 + sch.setMessageDKL(sch.getMessageDKL() + 2);
  177 + if (map.get("car_new") == null)
  178 + map.put("car_new",sdf.format(new Date()));
  179 +
  180 + MessageStatus(sch, map);//继续下一项
  181 + }catch (Exception e){
  182 + logger.info("车辆行驶出发点检测异常---",e);
  183 + }finally {
  184 + logger.info("车辆行驶出发点检测成功");
  185 + }
  186 + }
  187 +
122 } 188 }
src/main/java/com/bsth/data/zndd/voice/UploadVideoServlet.java
@@ -163,7 +163,13 @@ public class UploadVideoServlet extends HttpServlet { @@ -163,7 +163,13 @@ public class UploadVideoServlet extends HttpServlet {
163 writer.write(text +",1,"+m.get("stationcode1")+","+m.get("stationcode2")+","+0); 163 writer.write(text +",1,"+m.get("stationcode1")+","+m.get("stationcode2")+","+0);
164 return; 164 return;
165 }*/ 165 }*/
166 - if(isSimilarity(ZL.LJCCBC,text,null)){//添加出厂班次 166 +
  167 +
  168 + if(text.contains("轨迹")){
  169 + writer.write(text+"_"+ZL.LJCCBC.getDescription()+",66");
  170 + return;
  171 + }
  172 + if(isSimilarity(ZL.LJCCBC,text,null) || text.contains("出场")){//添加出厂班次
167 writer.write(text+"_"+ZL.LJCCBC.getDescription()+",2"); 173 writer.write(text+"_"+ZL.LJCCBC.getDescription()+",2");
168 return; 174 return;
169 } 175 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -1751,7 +1751,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1751,7 +1751,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1751 //日志记录 1751 //日志记录
1752 ScheduleModifyLogger.cxsf(sch); 1752 ScheduleModifyLogger.cxsf(sch);
1753 //环线有可能把实到补上,实到存在的情况下 把实到也撤销掉 1753 //环线有可能把实到补上,实到存在的情况下 把实到也撤销掉
1754 - if (!sch.getZdsjActual().isEmpty()) { 1754 + if (sch.getZdsjActual() != null) {
1755 sch.clearZdsjActual(); 1755 sch.clearZdsjActual();
1756 //清除路牌下一班起点到达时间 1756 //清除路牌下一班起点到达时间
1757 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch); 1757 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch);
src/main/java/com/bsth/service/zndd/impl/LoggerZnddServiceImpl.java
@@ -355,7 +355,7 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt; @@ -355,7 +355,7 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
355 //获取所有线路 355 //获取所有线路
356 Map<String, String> lineMap = BasicData.lineCode2NameMap; 356 Map<String, String> lineMap = BasicData.lineCode2NameMap;
357 for (Map.Entry<String, String> t : lineMap.entrySet()){ 357 for (Map.Entry<String, String> t : lineMap.entrySet()){
358 - if (message.contains(t.getValue())){ 358 + if (message.contains(t.getValue()) || t.getValue().contains(message)){
359 xl = t.getKey(); 359 xl = t.getKey();
360 xlName = t.getValue(); 360 xlName = t.getValue();
361 } 361 }
@@ -385,17 +385,17 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt; @@ -385,17 +385,17 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
385 lbbcs = lbbcs + 1; 385 lbbcs = lbbcs + 1;
386 } 386 }
387 m.put("code","200"); 387 m.put("code","200");
388 - m.put("inbcs",inbcs);  
389 - m.put("outbcs",outbcs);  
390 - m.put("ljbcs",ljbcs);  
391 - m.put("normalbcs",normalbcs);  
392 - m.put("regionbcs",regionbcs);  
393 - m.put("wzxbcs",wzxbcs);  
394 - m.put("zzxbcs",zzxbcs);  
395 - m.put("yzxbcs",yzxbcs);  
396 - m.put("lbbcs",lbbcs);  
397 - m.put("bcs",srList.size());  
398 - m.put("xlName",xlName); 388 + m.put("进场班次数",inbcs);
  389 + m.put("出场班次数",outbcs);
  390 + m.put("临加班次数",ljbcs);
  391 + m.put("正常班次数",normalbcs);
  392 + m.put("区间班次数",regionbcs);
  393 + m.put("未执行班次数",wzxbcs);
  394 + m.put("正在执行班次数",zzxbcs);
  395 + m.put("已执行班次数",yzxbcs);
  396 + m.put("烂班班次数",lbbcs);
  397 + m.put("总班次数",srList.size());
  398 + m.put("线路名称",xlName);
399 }else { 399 }else {
400 m.put("code","100"); 400 m.put("code","100");
401 m.put("message","无法找到线路"); 401 m.put("message","无法找到线路");
src/main/resources/static/real_control_v2/css/main.css
@@ -2342,7 +2342,64 @@ g.gps-wrap rect.twinkle[updown=&quot;1&quot;] { @@ -2342,7 +2342,64 @@ g.gps-wrap rect.twinkle[updown=&quot;1&quot;] {
2342 } 2342 }
2343 2343
2344 #depsepDiv{ 2344 #depsepDiv{
2345 - width: 413px; 2345 + width: 213px;
2346 height: 300px; 2346 height: 300px;
2347 overflow-y: scroll; 2347 overflow-y: scroll;
  2348 +}
  2349 +
  2350 +.multi_plat_zndd_message {
  2351 + position: fixed;
  2352 + bottom: 0px;
  2353 + right: 400px;
  2354 + background-color: #f9f9f9;
  2355 + border: 1px solid #ccc;
  2356 + border-radius: 5px;
  2357 + box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
  2358 + width: 200px;
  2359 + transition: all 0.3s ease;
  2360 + z-index: 10;
  2361 +}
  2362 +.message-summary {
  2363 + padding: 5px;
  2364 + cursor: pointer;
  2365 + text-align: center;
  2366 + border-bottom: 1px solid #ccc;
  2367 + z-index: 9;
  2368 +}
  2369 +
  2370 +.message-details {
  2371 + display: none;
  2372 + padding: 10px;
  2373 + max-height: 200px;
  2374 + overflow-y: auto;
  2375 +}
  2376 +
  2377 +.message-details h3 {
  2378 + margin-top: 0;
  2379 +}
  2380 +
  2381 +.message-details ul {
  2382 + list-style-type: none;
  2383 + padding: 0;
  2384 + margin: 0;
  2385 +}
  2386 +
  2387 +.message-details li {
  2388 + margin: 5px 0;
  2389 +}
  2390 +
  2391 +.message-details strong {
  2392 + font-weight: bold;
  2393 +}
  2394 +
  2395 +
  2396 +.messxx_ddsk{
  2397 + background-color: #f0f0f0;
  2398 + padding: 10px;
  2399 + color: #333;
  2400 + transition: background-color 0.3s, color 0.3s; /* 可选:添加过渡效果 */
  2401 +}
  2402 +.messxx_ddsk:hover {
  2403 + background-color: rgb(37, 150, 190);
  2404 + color: #f0f0f0;
2348 } 2405 }
2349 \ No newline at end of file 2406 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 <span class="tl-xxsd">消息收到</span> 40 <span class="tl-xxsd">消息收到</span>
41 <span class="tl-xxrd">消息阅读</span> 41 <span class="tl-xxrd">消息阅读</span>
42 <span class="tl-wfyd">无发有到</span> 42 <span class="tl-wfyd">无发有到</span>
43 - <span class="tl-wd" style="width: 125px">实到-实发于实到</span> 43 + <span class="tl-wd" style="width: 125px">实到-实发于实到</span>
44 </div> 44 </div>
45 <div class="ct_title"> 45 <div class="ct_title">
46 图例(RFID) 46 图例(RFID)
src/main/resources/static/real_control_v2/js/stationcf/klyj.js
@@ -18,7 +18,7 @@ var gb_klyj = (function () { @@ -18,7 +18,7 @@ var gb_klyj = (function () {
18 } 18 }
19 19
20 20
21 - var $modal = $('#schedule-addsch-modal'); 21 + /* var $modal = $('#schedule-addsch-modal');
22 if (!$modal.hasClass('uk-open')) { 22 if (!$modal.hasClass('uk-open')) {
23 if (!gb_dataZndd.interval){ 23 if (!gb_dataZndd.interval){
24 gb_dataZndd.interval = gb_dataZndd.snt(data.ids); 24 gb_dataZndd.interval = gb_dataZndd.snt(data.ids);
@@ -26,8 +26,71 @@ var gb_klyj = (function () { @@ -26,8 +26,71 @@ var gb_klyj = (function () {
26 gb_dataZndd.setTimelist(data.uuid) //自动调度定时器 26 gb_dataZndd.setTimelist(data.uuid) //自动调度定时器
27 } 27 }
28 $wrap.append(htmlStr); 28 $wrap.append(htmlStr);
  29 +*/
  30 + TSDkl();//大客流显示
  31 +
  32 + /*let date = {
  33 + "message": "遭遇大客流之后,简介一下三种方案,并帮我推荐一种方案(临加班次)", //消息
  34 + "mode": "query" //chat聊天 query知识库查询 选一个
  35 + }
  36 +
  37 +
  38 + const apiUrl = 'http://61.169.120.202:3001/api/v1/workspace/deep/stream-chat'; // 替换为实际接口地址
  39 + let xhr = new XMLHttpRequest();
  40 + xhr.open('POST', apiUrl, true);
  41 + // 设置请求头
  42 + xhr.setRequestHeader('Content-Type', 'application/json');
  43 + xhr.setRequestHeader('Authorization', `Bearer 701MSMS-JNS4WNG-JSDY4GH-RHD93NM`);
  44 +
  45 + var ins = 0;
  46 + var tdkl = true;
  47 + // 监听数据流
  48 + xhr.onprogress = function (event) {
  49 + if (tdkl){
  50 + TSDkl();
  51 + tdkl = false;
  52 + }
  53 + // 获取当前接收的数据片段
  54 + const responseText = xhr.responseText;
  55 + const lines = responseText.split('\n').filter(line => line !== '');
  56 + try {
  57 + for (var i = 0 ; i < lines.length ; i ++) {
  58 + if (i >= ins || ins == 0) {
  59 + ins = i +1;
  60 + var line = lines[i].replace(/^data: /, '');
  61 + const data = JSON.parse(line);
  62 + $('#depsepDiv').append('<p>' + data.textResponse!= null? data.textResponse :"" + '</p>');
  63 + }
  64 + }
  65 + } catch (e) {
  66 + console.error('解析错误:', e);
  67 + }
  68 + };
  69 +
  70 + // 发送请求
  71 + const requestBody = JSON.stringify(date);
  72 + xhr.send(requestBody);
  73 +
  74 + // 错误处理
  75 + xhr.onerror = function () {
  76 + console.error('请求失败');
  77 + };*/
  78 +
  79 + function TSDkl(){
  80 + var $modal = $('#schedule-addsch-modal');
  81 + if (!$modal.hasClass('uk-open')) {
  82 + if (!gb_dataZndd.interval){
  83 + gb_dataZndd.interval = gb_dataZndd.snt(data.ids);
  84 + }
  85 + gb_dataZndd.setTimelist(data.uuid) //自动调度定时器
  86 + }
  87 + $wrap.append(htmlStr);
  88 + }
29 }; 89 };
30 90
  91 +
  92 +
  93 +
31 //临加班次 94 //临加班次
32 $wrap.on('click', '.ljbc', function () { 95 $wrap.on('click', '.ljbc', function () {
33 var that = $(this); 96 var that = $(this);
src/main/resources/static/real_control_v2/js/zndd/recorder/recorder.js
@@ -303,8 +303,27 @@ @@ -303,8 +303,27 @@
303 confirmBtn.trigger('click'); 303 confirmBtn.trigger('click');
304 }); 304 });
305 return; 305 return;
  306 + }else if(responseText[1]=="66"){
  307 + debugger
  308 + if(schId==''){
  309 + notify_err("请选择班次");
  310 + return;
  311 + }
  312 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[schId];
  313 +
  314 + var st = (sch['fcsjActualTime']?sch['fcsjActualTime']:sch['dfsjT']) - 1000 * 60 * 5,
  315 + et = (sch['zdsjActualTime']?sch['zdsjActualTime']:sch['zdsjT']) + 1000 * 60 * 5;
  316 + var pam = {
  317 + nbbm:sch.clZbh,
  318 + start:st,
  319 + end:et,
  320 + }
  321 + gb_map_play_back.initParams(pam); //弹出轨迹
  322 +
  323 + return;
306 } 324 }
307 - else if(responseText[1]=="31"){ 325 +
  326 + else if(responseText[1]=="31"){
308 notify_succ("开启智能调度"); 327 notify_succ("开启智能调度");
309 }else if(responseText[1]=="41"){ 328 }else if(responseText[1]=="41"){
310 notify_succ("关闭智能调度"); 329 notify_succ("关闭智能调度");
src/main/resources/static/real_control_v2/zndd/type/dkl.html
@@ -475,6 +475,9 @@ @@ -475,6 +475,9 @@
475 /*var folder = '/real_control_v2/zndd/yanshi'; 475 /*var folder = '/real_control_v2/zndd/yanshi';
476 open_modal(folder + '/yanshi.html', { 476 open_modal(folder + '/yanshi.html', {
477 }, {center: true, bgclose: false, modal: true});*/ 477 }, {center: true, bgclose: false, modal: true});*/
  478 + //添加成功后添加车辆监控消息
  479 + gb_common.$post('/logZndd/addMessage', rs, function (ks) {}, err);
  480 +
478 }, err); 481 }, err);
479 //手动提交的时候清除一下,防止二次提交 482 //手动提交的时候清除一下,防止二次提交
480 clearInterval(sntts); 483 clearInterval(sntts);
src/main/resources/static/real_control_v2/zndd/yanshi/static/css/sjz.css
@@ -64,8 +64,8 @@ @@ -64,8 +64,8 @@
64 } 64 }
65 .history-date ul li h3 { 65 .history-date ul li h3 {
66 float:left; 66 float:left;
67 -/* width:20%;  
68 - text-align:right;*/ 67 + width:20%;
  68 + text-align:right;
69 padding-right:19px; 69 padding-right:19px;
70 color:#c3c3c3; 70 color:#c3c3c3;
71 font:normal 18px/16px Arial; 71 font:normal 18px/16px Arial;
@@ -76,9 +76,9 @@ @@ -76,9 +76,9 @@
76 font-size:12px; 76 font-size:12px;
77 } 77 }
78 .history-date ul li dl { 78 .history-date ul li dl {
79 - /*width: 70%;*/ 79 + width: 70%;
80 float:left; 80 float:left;
81 - /*padding-left:41px;*/ 81 + padding-left:41px;
82 margin-top:-5px; 82 margin-top:-5px;
83 font-family:微软雅黑; 83 font-family:微软雅黑;
84 } 84 }
@@ -143,10 +143,147 @@ @@ -143,10 +143,147 @@
143 _background:transparent!important; 143 _background:transparent!important;
144 _font-weight:normal!important; 144 _font-weight:normal!important;
145 } 145 }
146 -.timerssn{  
147 - text-align: center;  
148 - font-size: 20px;  
149 - color: red;  
150 - position: absolute;  
151 - width: 15%; 146 +
  147 +
  148 +.demo {
  149 + width:960px;
  150 + margin:60px auto 0 auto;
  151 +}
  152 +/*history*/
  153 +.history {
  154 + background:url(../image/line04.gif) repeat-y 187px 0;
  155 + overflow:hidden;
  156 + position:relative;
  157 +}
  158 +.history-dates {
  159 + overflow:hidden;
  160 + position:relative;
  161 +}
  162 +.history-dates h2 {
  163 + background:#fff url(../image/icon06.gif) no-repeat 158px 0;
  164 + height:59px;
  165 + font-size:25px;
  166 + font-family:微软雅黑;
  167 + font-weight:normal;
  168 + padding-left:45px;
  169 + margin-bottom:74px;
  170 +}
  171 +.history-dates h2.first {
  172 + position:absolute;
  173 + left:0;
  174 + top:0;
  175 + width:500px;
  176 + z-index:99;
  177 +}
  178 +.history-dates h2 a {
  179 + color:#00bbff;
  180 + display:inline-block;
  181 + zoom:1;
  182 + background:url(../image/icon08.gif) no-repeat right 50%;
  183 + padding-right:17px;
  184 + margin:21px 97px 0 0;
  185 +}
  186 +.history-dates h2 a:hover {
  187 + text-decoration:none;
  188 +}
  189 +.history-dates h2 img {
  190 + vertical-align:-5px;
  191 +}
  192 +.history-dates h2.date02 {
  193 + background:none;
  194 +}
  195 +.history-dates ul li {
  196 + background:url(../image/yes.png) no-repeat 180px 0;
  197 + background-size: 15px 15px;
  198 + padding-bottom:10px;
  199 + zoom:1;
  200 +}
  201 +.history-dates ul li.last {
  202 + padding-bottom:0;
  203 +}
  204 +.history-dates ul li:after {
  205 + content:" ";
  206 + display:block;
  207 + height:0;
  208 + clear:both;
  209 + visibility:hidden;
  210 +}
  211 +.history-dates ul li h3 {
  212 + float:left;
  213 + /* width:20%;
  214 + text-align:right;*/
  215 + padding-right:19px;
  216 + color:#c3c3c3;
  217 + font:normal 18px/16px Arial;
  218 +}
  219 +.history-dates ul li h3 span {
  220 + display:block;
  221 + color:#d0d0d0;
  222 + font-size:12px;
  223 +}
  224 +.history-dates ul li dl {
  225 + float:left;
  226 + margin-top:-5px;
  227 + font-family:微软雅黑;
  228 +}
  229 +.history-dates ul li dl dt {
  230 + /*font:20px/22px 微软雅黑;*/
  231 + color:#737373;
  232 +}
  233 +.history-dates ul li dl dt span {
  234 + display:block;
  235 + color:#787878;
  236 + font-size:12px;
  237 +}
  238 +.history-dates ul li.green h3 {
  239 + color:#1db702;
  240 +}
  241 +.history-dates ul li.green h3 span {
  242 + color:#a8dda3;
  243 +}
  244 +.history-dates ul li.green dl {
  245 + margin-top:-8px;
  246 +}
  247 +.history-dates ul li.green dl dt {
  248 + font-size:30px;
  249 + line-height:28px;
  250 +}
  251 +.history-dates ul li.green dl dt a {
  252 + display:inline-block;
  253 + zoom:1;
  254 + overflow:hidden;
  255 + vertical-align:middle;
  256 + margin-left:12px;
  257 +}
  258 +.history-dates ul li.green dl dd {
  259 + padding-top:20px;
  260 + display:none;
  261 +}
  262 +.history-dates ul li.green dl dd img {
  263 + float:left;
  264 +}
  265 +.history-dates ul li.green dl dd p {
  266 + overflow:hidden;
  267 + zoom:1;
  268 + line-height:21px;
  269 + color:#787878;
  270 +}
  271 +.history-dates h2.first .more-history {
  272 + font-size:16px;
  273 + background:transparent;
  274 + margin-left:30px;
  275 +}
  276 +.history-dates h2.first .more-history:hover {
  277 + text-decoration:underline;
  278 +}
  279 +*body .history-dates ul li dl dt {
  280 + _font-size:12px!important;
  281 + _font-weight:bold;
  282 +}
  283 +*body .history-dates ul li dl dt span {
  284 + _font-weight:normal!important;
  285 +}
  286 +*body .history-dates ul li.green dl dt a {
  287 + _background:transparent!important;
  288 + _font-weight:normal!important;
152 } 289 }
153 \ No newline at end of file 290 \ No newline at end of file
src/main/resources/static/real_control_v2/zndd/yanshi/yanshi.html
@@ -2,83 +2,16 @@ @@ -2,83 +2,16 @@
2 <div class="uk-modal-dialog" style="width: 800px;"> 2 <div class="uk-modal-dialog" style="width: 800px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
5 - <h2>大客流預案场景演示</h2></div> 5 + <h2>大客流預案场景</h2></div>
6 6
7 <head> 7 <head>
8 <meta charset="utf-8"> 8 <meta charset="utf-8">
9 <title>jQuery疫情防控时间轴</title> 9 <title>jQuery疫情防控时间轴</title>
10 <link href="/real_control_v2/zndd/yanshi/static/css/sjz.css" type="text/css" rel="stylesheet"> 10 <link href="/real_control_v2/zndd/yanshi/static/css/sjz.css" type="text/css" rel="stylesheet">
11 </head> 11 </head>
12 - <div class="timerssn"></div>  
13 <div class="history" style="margin-top:50px;height: 400px;overflow-y: scroll" > 12 <div class="history" style="margin-top:50px;height: 400px;overflow-y: scroll" >
14 13
15 - <div class="history-date" STYLE="padding-top:10px;">  
16 - <ul>  
17 - <li>  
18 - <h3>10:00<span>10月31日</span></h3>  
19 - <dl>  
20 - <dt>驾驶收到通知 </dt>  
21 - </dl>  
22 - </li>  
23 - </ul>  
24 - <ul>  
25 - <li>  
26 - <h3>10:05<span>10月31日</span></h3>  
27 - <dl>  
28 - <dt>驾驶员抵达车辆、车辆收到行驶班次</dt>  
29 - </dl>  
30 - </li>  
31 - </ul>  
32 - <ul>  
33 - <li>  
34 - <h3>10:06<span>10月31日</span></h3>  
35 - <dl>  
36 - <dt>车辆行驶出发点</dt>  
37 - </dl>  
38 - </li>  
39 - </ul>  
40 - <ul>  
41 - <li>  
42 - <h3>10:06<span>10月31日</span></h3>  
43 - <dl>  
44 - <div id="drawer_right_map" style="height: 300px;width: 100%"></div>  
45 - </dl>  
46 - </li>  
47 - </ul>  
48 - <ul>  
49 - <li>  
50 - <h3>10:10<span>10月31日</span></h3>  
51 - <dl>  
52 - <dt>车辆抵达发车点</dt>  
53 - </dl>  
54 - </li>  
55 - </ul>  
56 -  
57 - <ul>  
58 - <li>  
59 - <h3>10:20<span>10月31日</span></h3>  
60 - <dl>  
61 - <dt>车辆运送乘客,继续监控站点是否还有大客流</dt>  
62 - </dl>  
63 - </li>  
64 - </ul>  
65 - <ul>  
66 - <li>  
67 - <h3>11:00<span>10月31日</span></h3>  
68 - <dl>  
69 - <dt>车辆送达乘客</dt>  
70 - </dl>  
71 - </li>  
72 - </ul>  
73 - <ul>  
74 - <li>  
75 - <h3>11:00<span>10月31日</span></h3>  
76 - <dl>  
77 - <dt>任务结束</dt>  
78 - </dl>  
79 - </li>  
80 - </ul>  
81 - </div> 14 +
82 </div> 15 </div>
83 </div> 16 </div>
84 17
@@ -86,43 +19,31 @@ @@ -86,43 +19,31 @@
86 <script> 19 <script>
87 20
88 $(function(){ 21 $(function(){
89 - systole(); 22 + var dataKs;
90 var nt = 0; 23 var nt = 0;
91 - function systole(){ 24 + var modal = '#schedule-dklyanshi-modal';
  25 +
  26 +
  27 + $(modal).on('init', function (e, data) {
  28 + dataKs = data.data;
  29 + e.stopPropagation();
  30 +
  31 + var formHtml = template('dkl-nr-temp', data.data);
  32 + $(".history").html(formHtml);
92 $(".history-date ul").css({display: 'none'}); 33 $(".history-date ul").css({display: 'none'});
93 - //驾驶员收到通知  
94 -  
95 -  
96 - var cctime = setInterval(function (){  
97 - time();  
98 - timent = timent - 1;  
99 - }, 1000);  
100 -  
101 - // 设置一个每2000毫秒执行一次的定时器  
102 - var intervalId = setInterval(function() {  
103 - var divs = $(".history-date ul");  
104 - divs.each(function(index,element) {  
105 - if(nt == index){  
106 - $(this).css({display: ''});  
107 -  
108 - if(index == 3){  
109 - play();  
110 - }  
111 - if(nt == divs.length - 1){  
112 - nt = 0;  
113 - clearInterval(intervalId)  
114 - clearInterval(cctime);  
115 - $(".timerssn").html("");//清空倒计时  
116 - }  
117 - nt ++;  
118 - timent = 5;  
119 - return false;  
120 - }  
121 -  
122 - });  
123 - }, 5000); 34 + var divs = $(".history-date ul");
124 35
125 - } 36 + divs.each(function(index,element) {
  37 + if(index < dataKs.sch.messageDKL) {
  38 + $(this).css({display: ''});
  39 + if (index == 3 )
  40 + carPositioning(dataKs.sch.xlBm,dataKs.sch.clZbh);
  41 + }else {
  42 +
  43 + }
  44 + });
  45 +
  46 + });
126 let date ={ 47 let date ={
127 "list": [{"bd_lon":121.90467819574694,"bd_lat":30.900545629815696,"lon":121.89413,"lat":30.896774,"deviceId":"77W1S014","ts":1730264742000,"timestamp":1730264742000,"stopNo":"126930","direction":272.0,"lineId":"80301","speed":33.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.89989041589938,"bd_lat":30.900580233328572,"lon":121.88931,"lat":30.896894,"deviceId":"77W1S014","ts":1730264850000,"timestamp":1730264850000,"stopNo":"128063","direction":277.0,"lineId":"80301","speed":35.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90069454903107,"bd_lat":30.900535838211702,"lon":121.89012,"lat":30.896835,"deviceId":"77W1S014","ts":1730264821000,"timestamp":1730264821000,"stopNo":"128063","direction":276.0,"lineId":"80301","speed":0.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路卓卉路","ts":1730264821000,"lineCode":"80301","upDown":0,"stopNo":"128063","inOut":0,"createDate":1730264825690,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264821000"},"inout_stop":0,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89525655752936,"bd_lat":30.90044660702875,"lon":121.88465,"lat":30.896847,"deviceId":"77W1S014","ts":1730264956000,"timestamp":1730264956000,"stopNo":"126932","direction":268.0,"lineId":"80301","speed":24.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路水华路","ts":1730264956000,"lineCode":"80301","upDown":0,"stopNo":"126932","inOut":0,"createDate":1730264961637,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264956000"},"inout_stop":0,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90203740623024,"bd_lat":30.900512501387293,"lon":121.89147,"lat":30.896788,"deviceId":"77W1S014","ts":1730264781000,"timestamp":1730264781000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89599210807043,"bd_lat":30.90049839119409,"lon":121.88539,"lat":30.896885,"deviceId":"77W1S014","ts":1730264917000,"timestamp":1730264917000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90650763313731,"bd_lat":30.900574422731786,"lon":121.895966,"lat":30.896772,"deviceId":"77W1S014","ts":1730264701000,"timestamp":1730264701000,"stopNo":"126930","direction":268.0,"lineId":"80301","speed":18.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.89599210466311,"bd_lat":30.90050220719686,"lon":121.88539,"lat":30.896889,"deviceId":"77W1S014","ts":1730264943000,"timestamp":1730264943000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":3.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89796373453942,"bd_lat":30.900714383979444,"lon":121.887375,"lat":30.897064,"deviceId":"77W1S014","ts":1730264889000,"timestamp":1730264889000,"stopNo":"126931","direction":270.0,"lineId":"80301","speed":38.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路建桥学院北门","ts":1730264889000,"lineCode":"80301","upDown":0,"stopNo":"126931","inOut":1,"createDate":1730264893416,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264889000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.9022270878919,"bd_lat":30.900514001354395,"lon":121.89166,"lat":30.896786,"deviceId":"77W1S014","ts":1730264768000,"timestamp":1730264768000,"stopNo":"126930","direction":270.0,"lineId":"80301","speed":18.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89600727155313,"bd_lat":30.90050248856405,"lon":121.88541,"lat":30.896889,"deviceId":"77W1S014","ts":1730264913000,"timestamp":1730264913000,"stopNo":"126931","direction":261.0,"lineId":"80301","speed":3.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89901801919352,"bd_lat":30.900690056246688,"lon":121.888435,"lat":30.89702,"deviceId":"77W1S014","ts":1730264876000,"timestamp":1730264876000,"stopNo":"126931","direction":268.0,"lineId":"80301","speed":9.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.9056877508437,"bd_lat":30.900541759662353,"lon":121.89514,"lat":30.896753,"deviceId":"77W1S014","ts":1730264729000,"timestamp":1730264729000,"stopNo":"126930","direction":268.0,"lineId":"80301","speed":22.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.9016656375683,"bd_lat":30.900515336243583,"lon":121.8911,"lat":30.896797,"deviceId":"77W1S014","ts":1730264805000,"timestamp":1730264805000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":16.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89440728696924,"bd_lat":30.900379432991862,"lon":121.8838,"lat":30.896795,"deviceId":"77W1S014","ts":1730264981000,"timestamp":1730264981000,"stopNo":"126932","direction":267.0,"lineId":"80301","speed":12.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路水华路","ts":1730264981000,"lineCode":"80301","upDown":0,"stopNo":"126932","inOut":1,"createDate":1730264986077,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264981000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90067937710931,"bd_lat":30.90053556084185,"lon":121.89011,"lat":30.896835,"deviceId":"77W1S014","ts":1730264835000,"timestamp":1730264835000,"stopNo":"128063","direction":276.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89907870115947,"bd_lat":30.900687363266552,"lon":121.8885,"lat":30.897017,"deviceId":"77W1S014","ts":1730264863000,"timestamp":1730264863000,"stopNo":"126931","direction":274.0,"lineId":"80301","speed":0.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路建桥学院北门","ts":1730264863000,"lineCode":"80301","upDown":0,"stopNo":"126931","inOut":0,"createDate":1730264867085,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264863000"},"inout_stop":0,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89967800540734,"bd_lat":30.900601124403273,"lon":121.8891,"lat":30.89692,"deviceId":"77W1S014","ts":1730264852000,"timestamp":1730264852000,"stopNo":"128063","direction":278.0,"lineId":"80301","speed":35.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89784238925144,"bd_lat":30.900710221128048,"lon":121.88725,"lat":30.897062,"deviceId":"77W1S014","ts":1730264890000,"timestamp":1730264890000,"stopNo":"126931","direction":268.0,"lineId":"80301","speed":40.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89428597247607,"bd_lat":30.900360032264537,"lon":121.883675,"lat":30.896778,"deviceId":"77W1S014","ts":1730264997000,"timestamp":1730264997000,"stopNo":"126932","direction":270.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90626469804877,"bd_lat":30.900558981481137,"lon":121.89572,"lat":30.89676,"deviceId":"77W1S014","ts":1730264705000,"timestamp":1730264705000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":18.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.90008765951121,"bd_lat":30.900559057215247,"lon":121.88951,"lat":30.89687,"deviceId":"77W1S014","ts":1730264848000,"timestamp":1730264848000,"stopNo":"128063","direction":279.0,"lineId":"80301","speed":33.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路卓卉路","ts":1730264848000,"lineCode":"80301","upDown":0,"stopNo":"128063","inOut":1,"createDate":1730264851942,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264848000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89502148743209,"bd_lat":30.900430816053387,"lon":121.884415,"lat":30.896835,"deviceId":"77W1S014","ts":1730264970000,"timestamp":1730264970000,"stopNo":"126932","direction":264.0,"lineId":"80301","speed":11.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90595344115236,"bd_lat":30.90055191818359,"lon":121.89541,"lat":30.896759,"deviceId":"77W1S014","ts":1730264715000,"timestamp":1730264715000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":3.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路沪城环路","ts":1730264715000,"lineCode":"80301","upDown":0,"stopNo":"126930","inOut":1,"createDate":1730264719617,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264715000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.89431629470351,"bd_lat":30.900372037240512,"lon":121.883705,"lat":30.89679,"deviceId":"77W1S014","ts":1730264984000,"timestamp":1730264984000,"stopNo":"126932","direction":270.0,"lineId":"80301","speed":5.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.89599210466311,"bd_lat":30.90050220719686,"lon":121.88539,"lat":30.896889,"deviceId":"77W1S014","ts":1730264930000,"timestamp":1730264930000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.901483555169,"bd_lat":30.900513948386312,"lon":121.890915,"lat":30.8968,"deviceId":"77W1S014","ts":1730264808000,"timestamp":1730264808000,"stopNo":"126930","direction":271.0,"lineId":"80301","speed":25.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90333491241968,"bd_lat":30.900531799908887,"lon":121.89278,"lat":30.896784,"deviceId":"77W1S014","ts":1730264755000,"timestamp":1730264755000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":31.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90202981742063,"bd_lat":30.90051427288283,"lon":121.891464,"lat":30.89679,"deviceId":"77W1S014","ts":1730264794000,"timestamp":1730264794000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":1.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.8964015764253,"bd_lat":30.900551784995276,"lon":121.8858,"lat":30.89693,"deviceId":"77W1S014","ts":1730264903000,"timestamp":1730264903000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":27.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6}] 48 "list": [{"bd_lon":121.90467819574694,"bd_lat":30.900545629815696,"lon":121.89413,"lat":30.896774,"deviceId":"77W1S014","ts":1730264742000,"timestamp":1730264742000,"stopNo":"126930","direction":272.0,"lineId":"80301","speed":33.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.89989041589938,"bd_lat":30.900580233328572,"lon":121.88931,"lat":30.896894,"deviceId":"77W1S014","ts":1730264850000,"timestamp":1730264850000,"stopNo":"128063","direction":277.0,"lineId":"80301","speed":35.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90069454903107,"bd_lat":30.900535838211702,"lon":121.89012,"lat":30.896835,"deviceId":"77W1S014","ts":1730264821000,"timestamp":1730264821000,"stopNo":"128063","direction":276.0,"lineId":"80301","speed":0.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路卓卉路","ts":1730264821000,"lineCode":"80301","upDown":0,"stopNo":"128063","inOut":0,"createDate":1730264825690,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264821000"},"inout_stop":0,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89525655752936,"bd_lat":30.90044660702875,"lon":121.88465,"lat":30.896847,"deviceId":"77W1S014","ts":1730264956000,"timestamp":1730264956000,"stopNo":"126932","direction":268.0,"lineId":"80301","speed":24.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路水华路","ts":1730264956000,"lineCode":"80301","upDown":0,"stopNo":"126932","inOut":0,"createDate":1730264961637,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264956000"},"inout_stop":0,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90203740623024,"bd_lat":30.900512501387293,"lon":121.89147,"lat":30.896788,"deviceId":"77W1S014","ts":1730264781000,"timestamp":1730264781000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89599210807043,"bd_lat":30.90049839119409,"lon":121.88539,"lat":30.896885,"deviceId":"77W1S014","ts":1730264917000,"timestamp":1730264917000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90650763313731,"bd_lat":30.900574422731786,"lon":121.895966,"lat":30.896772,"deviceId":"77W1S014","ts":1730264701000,"timestamp":1730264701000,"stopNo":"126930","direction":268.0,"lineId":"80301","speed":18.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.89599210466311,"bd_lat":30.90050220719686,"lon":121.88539,"lat":30.896889,"deviceId":"77W1S014","ts":1730264943000,"timestamp":1730264943000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":3.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89796373453942,"bd_lat":30.900714383979444,"lon":121.887375,"lat":30.897064,"deviceId":"77W1S014","ts":1730264889000,"timestamp":1730264889000,"stopNo":"126931","direction":270.0,"lineId":"80301","speed":38.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路建桥学院北门","ts":1730264889000,"lineCode":"80301","upDown":0,"stopNo":"126931","inOut":1,"createDate":1730264893416,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264889000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.9022270878919,"bd_lat":30.900514001354395,"lon":121.89166,"lat":30.896786,"deviceId":"77W1S014","ts":1730264768000,"timestamp":1730264768000,"stopNo":"126930","direction":270.0,"lineId":"80301","speed":18.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89600727155313,"bd_lat":30.90050248856405,"lon":121.88541,"lat":30.896889,"deviceId":"77W1S014","ts":1730264913000,"timestamp":1730264913000,"stopNo":"126931","direction":261.0,"lineId":"80301","speed":3.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89901801919352,"bd_lat":30.900690056246688,"lon":121.888435,"lat":30.89702,"deviceId":"77W1S014","ts":1730264876000,"timestamp":1730264876000,"stopNo":"126931","direction":268.0,"lineId":"80301","speed":9.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.9056877508437,"bd_lat":30.900541759662353,"lon":121.89514,"lat":30.896753,"deviceId":"77W1S014","ts":1730264729000,"timestamp":1730264729000,"stopNo":"126930","direction":268.0,"lineId":"80301","speed":22.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.9016656375683,"bd_lat":30.900515336243583,"lon":121.8911,"lat":30.896797,"deviceId":"77W1S014","ts":1730264805000,"timestamp":1730264805000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":16.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89440728696924,"bd_lat":30.900379432991862,"lon":121.8838,"lat":30.896795,"deviceId":"77W1S014","ts":1730264981000,"timestamp":1730264981000,"stopNo":"126932","direction":267.0,"lineId":"80301","speed":12.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路水华路","ts":1730264981000,"lineCode":"80301","upDown":0,"stopNo":"126932","inOut":1,"createDate":1730264986077,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264981000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90067937710931,"bd_lat":30.90053556084185,"lon":121.89011,"lat":30.896835,"deviceId":"77W1S014","ts":1730264835000,"timestamp":1730264835000,"stopNo":"128063","direction":276.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89907870115947,"bd_lat":30.900687363266552,"lon":121.8885,"lat":30.897017,"deviceId":"77W1S014","ts":1730264863000,"timestamp":1730264863000,"stopNo":"126931","direction":274.0,"lineId":"80301","speed":0.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路建桥学院北门","ts":1730264863000,"lineCode":"80301","upDown":0,"stopNo":"126931","inOut":0,"createDate":1730264867085,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264863000"},"inout_stop":0,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89967800540734,"bd_lat":30.900601124403273,"lon":121.8891,"lat":30.89692,"deviceId":"77W1S014","ts":1730264852000,"timestamp":1730264852000,"stopNo":"128063","direction":278.0,"lineId":"80301","speed":35.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89784238925144,"bd_lat":30.900710221128048,"lon":121.88725,"lat":30.897062,"deviceId":"77W1S014","ts":1730264890000,"timestamp":1730264890000,"stopNo":"126931","direction":268.0,"lineId":"80301","speed":40.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89428597247607,"bd_lat":30.900360032264537,"lon":121.883675,"lat":30.896778,"deviceId":"77W1S014","ts":1730264997000,"timestamp":1730264997000,"stopNo":"126932","direction":270.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90626469804877,"bd_lat":30.900558981481137,"lon":121.89572,"lat":30.89676,"deviceId":"77W1S014","ts":1730264705000,"timestamp":1730264705000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":18.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.90008765951121,"bd_lat":30.900559057215247,"lon":121.88951,"lat":30.89687,"deviceId":"77W1S014","ts":1730264848000,"timestamp":1730264848000,"stopNo":"128063","direction":279.0,"lineId":"80301","speed":33.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路卓卉路","ts":1730264848000,"lineCode":"80301","upDown":0,"stopNo":"128063","inOut":1,"createDate":1730264851942,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264848000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.89502148743209,"bd_lat":30.900430816053387,"lon":121.884415,"lat":30.896835,"deviceId":"77W1S014","ts":1730264970000,"timestamp":1730264970000,"stopNo":"126932","direction":264.0,"lineId":"80301","speed":11.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.90595344115236,"bd_lat":30.90055191818359,"lon":121.89541,"lat":30.896759,"deviceId":"77W1S014","ts":1730264715000,"timestamp":1730264715000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":3.0,"inout_stop_info":{"deviceId":"77W1S014","stopName":"方竹路沪城环路","ts":1730264715000,"lineCode":"80301","upDown":0,"stopNo":"126930","inOut":1,"createDate":1730264719617,"enable":false,"weeksYear":44,"tcc":false,"correct":false,"flag":0,"outTcc":false,"id":"77W1S014_1730264715000"},"inout_stop":1,"state":0,"upDown":0,"section_code":"184989","section_name":"方竹路(白薇路-沪城环路)","version":6},{"bd_lon":121.89431629470351,"bd_lat":30.900372037240512,"lon":121.883705,"lat":30.89679,"deviceId":"77W1S014","ts":1730264984000,"timestamp":1730264984000,"stopNo":"126932","direction":270.0,"lineId":"80301","speed":5.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184991","section_name":"方竹路(叶菊路-水华路)","version":6},{"bd_lon":121.89599210466311,"bd_lat":30.90050220719686,"lon":121.88539,"lat":30.896889,"deviceId":"77W1S014","ts":1730264930000,"timestamp":1730264930000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":0.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.901483555169,"bd_lat":30.900513948386312,"lon":121.890915,"lat":30.8968,"deviceId":"77W1S014","ts":1730264808000,"timestamp":1730264808000,"stopNo":"126930","direction":271.0,"lineId":"80301","speed":25.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90333491241968,"bd_lat":30.900531799908887,"lon":121.89278,"lat":30.896784,"deviceId":"77W1S014","ts":1730264755000,"timestamp":1730264755000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":31.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.90202981742063,"bd_lat":30.90051427288283,"lon":121.891464,"lat":30.89679,"deviceId":"77W1S014","ts":1730264794000,"timestamp":1730264794000,"stopNo":"126930","direction":269.0,"lineId":"80301","speed":1.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6},{"bd_lon":121.8964015764253,"bd_lat":30.900551784995276,"lon":121.8858,"lat":30.89693,"deviceId":"77W1S014","ts":1730264903000,"timestamp":1730264903000,"stopNo":"126931","direction":262.0,"lineId":"80301","speed":27.0,"inout_stop":-1,"state":0,"upDown":0,"section_code":"184990","section_name":"方竹路(沪城环路-叶菊路)","version":6}]
128 } 49 }
@@ -130,57 +51,190 @@ @@ -130,57 +51,190 @@
130 date.list.sort(function (a, b) { 51 date.list.sort(function (a, b) {
131 return parseInt((a.ts - b.ts) + '' + (a.stop_no - b.stop_no)); 52 return parseInt((a.ts - b.ts) + '' + (a.stop_no - b.stop_no));
132 }); 53 });
133 - var map = '';  
134 - // 地图的中心点和缩放级别 54 +
  55 + })
  56 +
  57 + var storage = window.localStorage;
  58 + var map;
  59 + var routes;//路段
  60 + var stations;//站点
  61 + var parks;//停车场
  62 + var carMarker;
  63 + var stop;
  64 +
  65 + function carPositioning(xlBm,clZhb){
  66 + stations = gb_map_spatial_data.getcurrentLineStationArr(xlBm);// 站点数据
  67 + //路段数据
  68 + routes = JSON.parse(storage.getItem(xlBm + '_route'));
  69 + routes = [routes.up_bd, routes.down_bd];
135 map = new BMap.Map("drawer_right_map"); 70 map = new BMap.Map("drawer_right_map");
136 - var point = new BMap.Point(121.89413, 30.896774);  
137 - map.centerAndZoom(point,16);  
138 - var marker = new BMap.Marker(date.list[0]);  
139 - map.addOverlay(marker);  
140 - // 地图的轨迹回放路径  
141 - var path = [];  
142 - var passdate = date.list;  
143 - for (var c in passdate){  
144 - path.push(new BMap.Point(passdate[c].bd_lon, passdate[c].bd_lat))  
145 - }  
146 - var carIcon = '/assets/img/bus1.png';  
147 - // 创建一个图标,用于表示轨迹回放的位置  
148 - var marker = new BMap.Marker(path[0]);  
149 - icon = new BMap.Icon(carIcon, new BMap.Size(25, 25));  
150 - marker.setIcon(icon);  
151 - marker.setRotation(270);  
152 - marker.setTop(true);  
153 - map.addOverlay(marker);  
154 - var polyline = new BMap.Polyline(path, {strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});  
155 - map.addOverlay(polyline);  
156 -  
157 - // 开始轨迹回放  
158 - var i = 0;  
159 - function play() {  
160 - if (i < path.length) {  
161 - // 设置当前位置  
162 - marker.setPosition(path[i]);  
163 - // 移动地图视角  
164 - map.panTo(path[i]);  
165 -  
166 - // 延迟1秒继续回放下一个位置  
167 - setTimeout(play, 200);  
168 - i++;  
169 - }  
170 - }  
171 - }); 71 + map.centerAndZoom(new BMap.Point(121.89413, 30.896774), 15);
  72 + map.enableScrollWheelZoom(true);
  73 + var carIcon = new BMap.Icon("/assets/img/bus1.png", new BMap.Size(32, 32));
  74 + carMarker = new BMap.Marker(new BMap.Point(1121.89413, 30.896774), {icon: carIcon});
  75 + map.addOverlay(carMarker);
172 76
173 77
  78 + $("#schedule-dklyanshi-modal .uk-close").on("click",function(){
  79 + // 清除定时器.
  80 + clearTimeout(stop);
  81 + });
  82 + // 清除定时器.
  83 + clearTimeout(stop);
  84 + //车辆定位
  85 + carDw(xlBm,clZhb);
  86 + var upDown = 0;
  87 + //路段
  88 + drawRoadPolyline(upDown);
  89 + //站点
  90 + drawStationPoint(upDown);
  91 + //站点名称
  92 + drawStationName(upDown);
  93 + }
174 94
  95 + function carDw(xlBm,clZhb){
  96 + stop = setInterval(() => {
  97 + fetch('/gps/real/line/'+xlBm)
  98 + .then(response => response.json())
  99 + .then(data => {
  100 + for (let t in data){
  101 + if(clZhb != data[t].nbbm)
  102 + continue;
  103 +
  104 + //坐标转换
  105 + var coord = CoordinateConverter.transformFromWGSToBaidu(CoordinateConverter.locationMake(data[t].lon, data[t].lat));
  106 + var newPoint = new BMap.Point(coord.lng, coord.lat);
  107 + carMarker.setPosition(newPoint);
  108 + if (!map.getBounds().containsPoint(newPoint)) {
  109 + map.panTo(newPoint);
  110 + }
  111 + }
  112 +
  113 + });
  114 + }, 5000);
175 115
176 - var timent = 5;  
177 - function time(){  
178 - $(".timerssn").html(timent);  
179 } 116 }
  117 + /**
  118 + * 根据走向绘制路段
  119 + */
  120 + var drawRoadPolyline = function (upDown) {
  121 + var colour = gb_map_config.getConfig().section.color;
  122 + var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos;
  123 + $.each(routes[upDown], function (i, item) {
  124 + pos = [];
  125 + $.each(item.split(','), function () {
  126 + temps = this.split(' ');
  127 + pos.push(new BMap.Point(temps[0], temps[1]));
  128 + });
  129 + map.addOverlay(new BMap.Polyline(pos, plConfig));
  130 + });
  131 + };
  132 +
  133 + /**
  134 + * 根据走向绘制站点点位
  135 + */
  136 + var drawStationPoint = function (upDown) {
  137 + var array = stations[upDown], psm;
  138 + $.each(array, function () {
  139 + //坐标转换
  140 + var coord = CoordinateConverter.transformFromWGSToBaidu(CoordinateConverter.locationMake(this.lon, this.lat));
  141 + this.bd_lat = coord.lat;
  142 + this.bd_lon = coord.lng;
  143 + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
  144 + psm.setTitle(this.stationName);
  145 + map.addOverlay(psm);
  146 + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
  147 + });
  148 + };
  149 + /**
  150 + * 绘制站点名称
  151 + */
  152 + var drawStationName = function (upDown) {
  153 + debugger
  154 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  155 + var array = stations[upDown];
  156 + $.each(array, function () {
  157 + var width = this.stationName.length * 12;
  158 + var label = new BMap.Label(this.stationName, {
  159 + position:new BMap.Point(this.bd_lon, this.bd_lat),
  160 + offset: new BMap.Size(-(width / 2), -27)
  161 + });
  162 + label.setStyle(style);
  163 + map.addOverlay(label);
  164 + });
180 165
  166 + };
181 167
  168 + </script>
182 169
  170 + <script id="dkl-nr-temp" type="text/html">
  171 + <div class="history-date" STYLE="padding-top:10px;">
  172 + <ul >
  173 + <li>
  174 + <h3><span>{{j_sj}}</span></h3>
  175 + <dl>
  176 + <dt>驾驶收到通知</dt>
  177 + </dl>
  178 + </li>
  179 + </ul>
  180 + <ul>
  181 + <li>
  182 + <h3><span>{{car_sj}}</span></h3>
  183 + <dl>
  184 + <dt>驾驶员抵达车辆、车辆收到行驶班次</dt>
  185 + </dl>
  186 + </li>
  187 + </ul>
  188 + <ul>
  189 + <li>
  190 + <h3><span>{{car_new}}</span></h3>
  191 + <dl>
  192 + <dt>车辆开始行驶至出发点</dt>
  193 + </dl>
  194 + </li>
  195 + </ul>
  196 + <ul>
  197 + <li>
  198 + <h3>车辆当前位置</h3>
  199 + <dl>
  200 + <div id="drawer_right_map" style="height: 300px;width: 100%"></div>
  201 + </dl>
  202 + </li>
  203 + </ul>
  204 + <ul>
  205 + <li>
  206 + <h3><span>{{carq_sj}}</span></h3>
  207 + <dl>
  208 + <dt>车辆抵达发车点</dt>
  209 + </dl>
  210 + </li>
  211 + </ul>
183 212
  213 + <ul>
  214 + <li>
  215 + <h3><span>{{fcsj_sj}}</span></h3>
  216 + <dl>
  217 + <dt>车辆运送乘客,继续监控站点是否还有大客流</dt>
  218 + </dl>
  219 + </li>
  220 + </ul>
  221 + <ul>
  222 + <li>
  223 + <h3><span>{{dzsj_sj}}</span></h3>
  224 + <dl>
  225 + <dt>车辆送达乘客</dt>
  226 + </dl>
  227 + </li>
  228 + </ul>
  229 + <ul>
  230 + <li>
  231 + <h3><span>{{dzsj_sj}}</span></h3>
  232 + <dl>
  233 + <dt>任务结束</dt>
  234 + </dl>
  235 + </li>
  236 + </ul>
  237 + </div>
184 </script> 238 </script>
185 239
186 </div> 240 </div>