Commit a3b6addc6427cbe6cc4a0e74af2188f2da5ca8ca

Authored by 潘钊
1 parent 45e19c79

update

src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
... ... @@ -102,17 +102,21 @@ public class ArrivalData_GPS implements CommandLineRunner{
102 102 * @Description: TODO(清理内存数据)
103 103 */
104 104 public void clearRAMData(String lineCode){
105   - //allArrivals.removeAll(lineCode);
106   - int count = 0;
  105 +
  106 + List<ArrivalEntity> remList = new ArrayList<>();
107 107  
108 108 //车辆映射的进出站数据,遍历删除对应线路数据。
109 109 Collection<ArrivalEntity> seList = startAndEndMaps.values();
110 110 for(ArrivalEntity arr : seList){
111   - if(arr.getLineCode().equals(lineCode)){
112   - if(startAndEndMaps.remove(arr.getDeviceId(), arr)){
113   - count ++;
114   - }
115   - }
  111 + if(arr.getLineCode().equals(lineCode))
  112 + remList.add(arr);
  113 + }
  114 +
  115 + //删除数据
  116 + int count = 0;
  117 + for(ArrivalEntity arr : remList){
  118 + startAndEndMaps.remove(arr.getNbbm(), arr);
  119 + count ++;
116 120 }
117 121  
118 122 logger.info(lineCode + " 清除到离站数据 ," + count);
... ...
src/main/java/com/bsth/data/directive/DayOfDirectives.java
... ... @@ -142,31 +142,37 @@ public class DayOfDirectives {
142 142  
143 143 public void clear(String device){
144 144 int c60 = 0, c64 = 0;
145   - //清除60
  145 + //找到该设备的60数据
146 146 Collection<D60> d60s = d60Map.values();
  147 + List<D60> rem60List = new ArrayList<>();
147 148 for(D60 d60 : d60s){
148   - if(d60.getDeviceId().equals(device)){
149   - //入库
150   - if(d60.getReply47() == null)
151   - directiveService.save(d60);
152   -
153   - if(null != d60Map.remove(d60.getMsgId()))
154   - c60 ++;
155   - }
  149 + if(d60.getDeviceId().equals(device))
  150 + rem60List.add(d60);
  151 + }
  152 + //清除60数据
  153 + for(D60 d60 : rem60List){
  154 + if(d60.getReply47() == null)
  155 + directiveService.save(d60);
  156 + if(null != d60Map.remove(d60.getMsgId()))
  157 + c60 ++;
156 158 }
157 159 logger.info("清除60数据 ," + c60);
158 160  
159   - //清除64
  161 + //找到该设备的64数据
160 162 Collection<D64> d64s = d64Map.values();
  163 + List<D64> rem64List = new ArrayList<>();
161 164 for(D64 d64 : d64s){
162   - if(d64.getDeviceId().equals(device)){
163   - //入库
164   - if(d64.getRespAck() == null)
165   - directiveService.save64(d64);
166   -
167   - if(null != d64Map.remove(d64.getKey()))
168   - c64 ++;
169   - }
  165 + if(d64.getDeviceId().equals(device))
  166 + rem64List.add(d64);
  167 + }
  168 +
  169 + //清除64数据
  170 + for(D64 d64 : rem64List){
  171 + if(d64.getRespAck() == null)
  172 + directiveService.save64(d64);
  173 +
  174 + if(null != d64Map.remove(d64.getKey()))
  175 + c64 ++;
170 176 }
171 177  
172 178 logger.info("清除64数据 ," + c64);
... ...
src/main/java/com/bsth/data/pilot80/PilotReport.java
... ... @@ -277,7 +277,9 @@ public class PilotReport {
277 277 }
278 278  
279 279 public void clear(String lineCode){
  280 + logger.info("清除 80数据 before: " + d80MultiMap.size());
280 281 d80MultiMap.removeAll(lineCode);
  282 + logger.info("清除 80数据 after: " + d80MultiMap.size());
281 283 }
282 284  
283 285 public Collection<? extends D80> findByCar(String nbbm) {
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
1 1 package com.bsth.data.schedule;
2 2  
  3 +import java.text.ParseException;
3 4 import java.util.ArrayList;
4 5 import java.util.Collection;
5 6 import java.util.Collections;
... ... @@ -220,11 +221,20 @@ public class DayOfSchedule implements CommandLineRunner {
220 221 * @Description: TODO(清理内存数据)
221 222 */
222 223 public void clearRAMData(String lineCode) {
  224 + int count = 0;
  225 + List<ScheduleRealInfo> remList = new ArrayList<>();
223 226 Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();
224 227 for (ScheduleRealInfo sch : schs) {
225 228 if (sch.getXlBm().equals(lineCode))
226   - nbbmScheduleMap.remove(sch.getClZbh(), sch);
  229 + remList.add(sch);
227 230 }
  231 +
  232 + for(ScheduleRealInfo sch : remList){
  233 + nbbmScheduleMap.remove(sch.getClZbh(), sch);
  234 + count ++;
  235 + }
  236 +
  237 + logger.info(lineCode + "排班清理 " + count);
228 238 }
229 239  
230 240 /**
... ... @@ -265,6 +275,15 @@ public class DayOfSchedule implements CommandLineRunner {
265 275 for (ScheduleRealInfo sch : realList) {
266 276 sch.setScheduleDateStr(DateUtils.sdfyyyyMMdd.format(sch.getScheduleDate()));
267 277 sch.setRealExecDate(sch.getScheduleDateStr());
  278 + // 计划终点时间
  279 + if (sch.getBcsj() != null) {
  280 + try{
  281 + sch.setZdsjT(DateUtils.sdfHHmm.parse(sch.getFcsj()).getTime() + (sch.getBcsj() * 60 * 1000));
  282 + sch.setZdsj(DateUtils.sdfHHmm.format(sch.getZdsjT()));
  283 + }catch(ParseException pe){
  284 + logger.error("loadPlanSch... 计算终点时间失败...");
  285 + }
  286 + }
268 287 }
269 288 } catch (Exception e) {
270 289 logger.error("", e);
... ... @@ -584,4 +603,13 @@ public class DayOfSchedule implements CommandLineRunner {
584 603 }
585 604 return outList;
586 605 }
  606 +
  607 + public ScheduleRealInfo delete(Long id) {
  608 + ScheduleRealInfo sch = id2SchedulMap.get(id);
  609 + if(!sch.isSflj())
  610 + return null;
  611 +
  612 + nbbmScheduleMap.remove(sch.getClZbh(), sch);
  613 + return sch;
  614 + }
587 615 }
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -87,7 +87,7 @@ public class SchAttrCalculator {
87 87 * @Description: TODO(计算班次的起点应到时间,list 必须是同一辆车的班次)
88 88 */
89 89 public void calcQdzTimePlan(List<ScheduleRealInfo> list){
90   - Collections.sort(list, new ScheduleComparator.FCSJ());
  90 + Collections.sort(list, new ScheduleComparator.FCNO());
91 91  
92 92 int len = list.size();
93 93 if(len == 0)
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -46,6 +46,7 @@ import com.bsth.security.util.SecurityUtils;
46 46 import com.bsth.service.SectionRouteService;
47 47 import com.bsth.service.impl.BaseServiceImpl;
48 48 import com.bsth.service.realcontrol.ScheduleRealInfoService;
  49 +import com.bsth.util.DateUtils;
49 50 import com.bsth.util.ReportRelatedUtils;
50 51 import com.bsth.util.ReportUtils;
51 52 import com.bsth.util.TimeUtils;
... ... @@ -304,32 +305,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
304 305 */
305 306 @Override
306 307 public Map<String, Object> save(ScheduleRealInfo t) {
307   - SysUser user = SecurityUtils.getCurrentUser();
308   - Date d = new Date();
309   -
310   - t.setScheduleDate(d);
311   - t.setRealExecDate(sdfMonth.format(d));
312   - t.setCreateBy(user);
313   - t.setSflj(true);
314   - Map<String, Object> map = super.save(t);
315   -
316   - // 加入缓存
317   - dayOfSchedule.put(t);
318   - dayOfSchedule.calcQdzTimePlan(t.getClZbh());
319   - //将该临加之后的班次作为更新返回页面
320   - List<ScheduleRealInfo> list = dayOfSchedule.nextAll(t)
321   - ,rsList = null;
322   -
323   - for(ScheduleRealInfo sch : list){
324   - if(sch.getId() == t.getId())
325   - rsList = new ArrayList<>();
  308 + Map<String, Object> rs = new HashMap<>();
  309 + try{
  310 + SysUser user = SecurityUtils.getCurrentUser();
  311 + String schDate = DayOfSchedule.currSchDateMap.get(t.getXlBm());
  312 +
  313 + t.setScheduleDateStr(schDate);
  314 + t.setScheduleDate(DateUtils.sdfyyyyMMdd.parse(schDate));
  315 + t.setRealExecDate(schDate);
  316 + t.setCreateBy(user);
  317 + t.setSflj(true);
  318 + //班次历时
  319 + t.setBcsj(DateUtils.calcHHmmDiff(t.getFcsj(), t.getZdsj()) / 1000 / 60);
  320 +
  321 + //实时入库
  322 + rs = super.save(t);
  323 + // 加入缓存
  324 + dayOfSchedule.put(t);
  325 +
  326 + dayOfSchedule.calcQdzTimePlan(t.getClZbh());
  327 + //将该临加之后的班次作为更新返回页面
  328 + List<ScheduleRealInfo> list = dayOfSchedule.nextAll(t)
  329 + ,rsList = null;
326 330  
327   - if(rsList != null)
328   - rsList.add(sch);
  331 + for(ScheduleRealInfo sch : list){
  332 + if(sch.getId() == t.getId())
  333 + rsList = new ArrayList<>();
  334 +
  335 + if(rsList != null)
  336 + rsList.add(sch);
  337 + }
  338 +
  339 + rs.put("ups", rsList);
  340 + }catch(Exception e){
  341 + logger.error("", e);
  342 + rs.put("status", ResponseCode.ERROR);
329 343 }
330   -
331   - map.put("ups", rsList);
332   - return map;
  344 + return rs;
333 345 }
334 346  
335 347 @Override
... ... @@ -1165,4 +1177,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1165 1177 public List<ScheduleRealInfo> realScheduleList(String line, String date) {
1166 1178 return scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
1167 1179 }
  1180 +
  1181 + @Override
  1182 + public Map<String, Object> delete(Long id) {
  1183 + Map<String, Object> rs = new HashMap<>();
  1184 + ScheduleRealInfo sch = dayOfSchedule.delete(id);
  1185 + if(null != sch){
  1186 + rs = super.delete(id);
  1187 + rs.put("t", sch);
  1188 + }
  1189 + else
  1190 + rs.put("status", ResponseCode.ERROR);
  1191 +
  1192 + return rs;
  1193 + }
1168 1194 }
... ...
src/main/java/com/bsth/util/DateUtils.java
... ... @@ -129,4 +129,8 @@ public class DateUtils {
129 129 }
130 130 return sdfyyyyMMdd.format(cal.getTime());
131 131 }
  132 +
  133 + public static int calcHHmmDiff(String fcsj, String zdsj) throws ParseException {
  134 + return (int) (sdfHHmm.parse(zdsj).getTime() - sdfHHmm.parse(fcsj).getTime());
  135 + }
132 136 }
... ...
src/main/resources/ms-jdbc.properties
1   -ms.mysql.driver= com.mysql.jdbc.Driver
2   -ms.mysql.url= jdbc:mysql://127.0.0.1:3306/ms?useUnicode=true&characterEncoding=utf-8
3   -ms.mysql.username= root
4   -ms.mysql.password= panzhao
5   -
6 1 #ms.mysql.driver= com.mysql.jdbc.Driver
7   -#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  2 +#ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8
8 3 #ms.mysql.username= root
9   -#ms.mysql.password= root2jsp
10 4 \ No newline at end of file
  5 +#ms.mysql.password= 123456
  6 +
  7 +ms.mysql.driver= com.mysql.jdbc.Driver
  8 +ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  9 +ms.mysql.username= root
  10 +ms.mysql.password= root2jsp
11 11 \ No newline at end of file
... ...
src/main/resources/static/index.html
... ... @@ -111,16 +111,27 @@ tr.row-active td {
111 111 display: block !important;
112 112 }
113 113  
114   -.page-header.navbar .page-logo {
115   - width: 335px;
116   -}
117   -
118 114 .page-header.navbar .page-logo .logo-default {
119 115 margin: 0;
120 116 }
121 117 .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle {
122 118 background-color: #284a99;
123 119 }
  120 +.page-header.navbar .page-logo{
  121 + padding-right: 10px;
  122 +}
  123 +
  124 +.page-logo .logo-default.logo-default-text{
  125 + font-weight: 600;
  126 + color: white !important;
  127 + margin-top: 19px !important;
  128 + font-size: 24px;
  129 + text-decoration: none;
  130 +}
  131 +.page-logo .logo-default.logo-default-text:HOVER{
  132 + color: #dedede !important;
  133 +}
  134 +
124 135 </style>
125 136  
126 137 <!-- ocLazyLoading载入文件的位置 -->
... ... @@ -128,12 +139,11 @@ tr.row-active td {
128 139  
129 140 </head>
130 141 <body class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed">
131   - <div class="page-header navbar navbar-fixed-top" style="background: #23438e;">
  142 + <div class="page-header navbar navbar-fixed-top" style="background: linear-gradient(to bottom ,#124e78, #125688);">
132 143 <div class="page-header-inner ">
133 144 <!-- LOGO -->
134 145 <div class="page-logo">
135   - <a href="index.html">
136   - <img src="/assets/img/logo_text.png" alt="logo" class="logo-default" /> </a>
  146 + <a href="index.html" class="logo-default logo-default-text" > 闵行公交调度系统 </a>
137 147 <div class="menu-toggler sidebar-toggler">
138 148 </div>
139 149 </div>
... ... @@ -146,12 +156,12 @@ tr.row-active td {
146 156 <li class="dropdown dropdown-extended dropdown-notification dropdown-dark" id="header_notification_bar">
147 157 <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
148 158 <i class="fa fa-bell"></i>
149   - <span class="badge badge-success"> 3 </span>
  159 + <span class="badge badge-success"> 0 </span>
150 160 </a>
151 161 <ul class="dropdown-menu" style="max-width: 345px;width: 345px;">
152 162 <li class="external">
153   - <h3>今日 <span class="bold">318 条</span> 通知</h3>
154   - <a href="page_user_profile_1.html">查看全部</a>
  163 + <h3>今日 <span class="bold">0 条</span> 通知</h3>
  164 + <a href="javascript:;">查看全部</a>
155 165 </li>
156 166 <li>
157 167 <ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283">
... ... @@ -279,7 +289,7 @@ tr.row-active td {
279 289 <!-- PJAX -->
280 290 <script src="/assets/plugins/jquery.pjax.js"></script>
281 291 <!-- layer 弹层 -->
282   -<script src="/assets/plugins/layer-v2.4/layer/layer.js" ></script>
  292 +<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script>
283 293 <!-- jquery.purl URL解析 -->
284 294 <script src="/assets/plugins/purl.js"></script>
285 295 <!-- jquery.serializejson JSON序列化插件 -->
... ...
src/main/resources/static/pages/control/line/child_pages/child_task.html
... ... @@ -183,6 +183,7 @@ $(function(){
183 183 });
184 184  
185 185 //主任务点击事件
  186 + var sch_remove = '<div class="sch_remove">×</div>';
186 187 $('#childTaskDiv').on('click', '.mainTable tr', function(){
187 188 $mainTab.find('tr._active').removeClass('_active');
188 189 $(this).addClass('_active');
... ... @@ -190,13 +191,24 @@ $(function(){
190 191 //显示班次详细
191 192 $.each(this.cells, function(i,cell){
192 193 $('#mainDetailPabel input[data-cell='+i+']').val($.trim($(cell).text()));
193   - });
  194 + })
  195 + var id = $(this).data('id');
  196 + //是否是临加班次
  197 + if(id){
  198 + var sch = _data.getSchedulById(id);
  199 + if(sch && sch.sflj)
  200 + $('#mainDetailPabel').append($(sch_remove).data('id', id));
  201 + else
  202 + $('#mainDetailPabel .sch_remove').remove();
  203 + }
  204 +
  205 + //返回false 点击的是空班次
194 206 if(!changeHandlerPanel(this))
195 207 return;
196 208  
197   - var id = $(this).data('id');
198   - childTaskBtn(scheduleIdMap[id].bcType);
199 209  
  210 + childTaskBtn(scheduleIdMap[id].bcType);
  211 + //刷新子任务列表
200 212 refreshChildTasks();
201 213 });
202 214  
... ... @@ -388,7 +400,6 @@ $(function(){
388 400 var $tr = $('.mainTable tr[data-id]', '#childTaskDiv').eq(0);
389 401 if($tr.length > 0){
390 402 var sch = _data.getSchedulById($tr.data('id'));
391   - console.log(sch);
392 403 //默认车辆
393 404 $('select[name=clZbh]', schAddPanel).val(sch.clZbh).trigger('change');
394 405 //默认驾驶员
... ... @@ -465,19 +476,15 @@ $(function(){
465 476 layer.msg('操作中...', {icon: 16,time:0});
466 477 $post('/realSchedule', param, function(rs){
467 478 var sch = rs.t;
468   - //前端缓存更新
469   - //scheduleLineMap[param.xlBm][param.lpName].push(sch);
470   - /* var ups = rs.ups;
471   - for(var i in ups){
472   - _data.updateSchedule(ups[i]);
473   - } */
474 479 //刷新表格
475   - //_alone.updateTableBySch(sch);
476   - _alone.update2Table(sch.xlBm, sch);
477   -
  480 + _alone.update2Table(sch.xlBm);
478 481 //关闭弹出层
479 482 layer.closeAll();
480   - layer.alert('临加班次成功!',{icon:1, shift: 5});
  483 +
  484 + layer.alert('临加班次成功!',{icon:1, shift: 5, end: function(){
  485 + //定位到新的班次
  486 + _alone.goToSch(sch, true);
  487 + }});
481 488 });
482 489 });
483 490  
... ... @@ -496,6 +503,24 @@ $(function(){
496 503 return r.stationName;
497 504 }
498 505 }
  506 +
  507 + //删除临加班次
  508 + $('#childTaskDiv').on('click', '#mainDetailPabel .sch_remove', function(){
  509 + //alert('删除..' + $(this).data('id'));
  510 + var id = $(this).data('id');
  511 + if(!id){
  512 + layer.alert('标识符无效!');
  513 + return;
  514 + }
  515 + removeConfirm('确定删除该班次信息?', '/realSchedule/' + id, function(rs){
  516 + //刷新表格
  517 + _alone.update2Table(rs.t.xlBm, function(){
  518 + //重新从_date.js获取数据
  519 + scheduleLineMap = _data.getLineLpMap();
  520 + refreshMainList();
  521 + });
  522 + });
  523 + });
499 524 });
500 525  
501 526 //刷新子任务表格
... ...
src/main/resources/static/pages/control/line/css/lineControl.css
... ... @@ -1117,6 +1117,7 @@ height: 400px;
1117 1117 white-space: nowrap;
1118 1118 overflow: hidden;
1119 1119 text-overflow: ellipsis;
  1120 + position: relative;
1120 1121 }
1121 1122  
1122 1123 .pic-panel{
... ... @@ -1678,6 +1679,39 @@ height: 400px;
1678 1679 content: "临加班次";
1679 1680 }
1680 1681  
  1682 +/* #mainDetailPabel.close-sch:AFTER {
  1683 + content: "×";
  1684 + position: absolute;
  1685 + top: -11px;
  1686 + right: 10px;
  1687 + font-size: 24px;
  1688 + font-weight: 700;
  1689 + line-height: 1;
  1690 + color: #908a8a;
  1691 + padding: 0 0 0 4px;
  1692 + background: #fff;
  1693 + text-shadow: 0 1px 0 #fff;
  1694 + cursor: pointer;
  1695 +} */
  1696 +
  1697 +#mainDetailPabel .sch_remove{
  1698 + position: absolute;
  1699 + top: -11px;
  1700 + right: 10px;
  1701 + font-size: 24px;
  1702 + font-weight: 700;
  1703 + line-height: 1;
  1704 + color: #908a8a;
  1705 + padding: 0 0 0 4px;
  1706 + background: #fff;
  1707 + text-shadow: 0 1px 0 #fff;
  1708 + cursor: pointer;
  1709 +}
  1710 +
  1711 +#mainDetailPabel .sch_remove_icon:HOVER{
  1712 + color: #636262;
  1713 +}
  1714 +
1681 1715 .custom-box-body .row{
1682 1716 margin-left: 0px;
1683 1717 margin-top: 8px;
... ... @@ -2518,4 +2552,17 @@ span.nt-coord:before{
2518 2552 font-size: 13px;
2519 2553 text-indent: 15px;
2520 2554 margin: 8px 0;
  2555 +}
  2556 +
  2557 +tr.linjia td:nth-child(1):AFTER {
  2558 + content: "\f173";
  2559 + font: normal normal normal 14px/1 FontAwesome;
  2560 + position: absolute;
  2561 + right: 1px;
  2562 + bottom: 2px;
  2563 + font-size: 8px;
  2564 + color: #ffffff;
  2565 + padding: 1px 3px 1px 3px;
  2566 + background: #e7505a;
  2567 + border-radius: 15px;
2521 2568 }
2522 2569 \ No newline at end of file
... ...
src/main/resources/static/pages/control/line/index.html
... ... @@ -228,8 +228,8 @@ function countDown(name){
228 228  
229 229 <script>
230 230 var updateLog = {
231   - text: '<div class="updete_log"><p>1、调整实到实发匹配算法,调整了东川路电子围栏。</p><p>2、修复了烂班的班次指令会发送给驾驶员的问题。</p><p>3、修复了车辆到达终点后马上跳出下一班实发的问题。</p><p>4、修复轨迹回放缓冲区重复绘制问题。</p><p class="font-red">注意:进出场班次必须按照起点站划分上下行,如 兰坪路浦江路 ——> 停车场 必须是下行班次,否则该班次将不会有发车时间。</p></div>'
232   - ,title: '2016年8月25号凌晨更新日志'
  231 + text: '<div class="updete_log"><p>1、调整停车场进出场算法。</p><p>2、临加班车可被删除,前提是还没有下发调度指令(即使下发失败)。</p><p class="font-red">注意:进出场班次必须按照起点站划分上下行,起点发出则上行,终点发出为下行,否则该班次将不会有发车时间。</p></div>'
  232 + ,title: '2016年8月26号凌晨更新日志'
233 233 }
234 234  
235 235 var lineCodes = '' //全部线路编码字符串,由data.js初始化
... ...
src/main/resources/static/pages/control/line/js/alone.js
... ... @@ -56,8 +56,6 @@ var _alone = (function(){
56 56 var type = schedule.xlDir==0?'up':'down';
57 57 calculateLineNo($('.pb-table[data-type='+type+']', tab)[0]);
58 58  
59   - if(!isBatch)
60   - goToSch(schedule);
61 59 },
62 60 //刷新多个班次,刷新完数据再统一计算行号
63 61 refreshScheduleArray: function(array){
... ... @@ -94,9 +92,12 @@ var _alone = (function(){
94 92 goToSch(schedule);
95 93 });
96 94 },
97   - update2Table: function(xlBm, schedule){
  95 + //刷新上行和下行2个表格
  96 + update2Table: function(xlBm, cb){
98 97 //上行
99 98 $.get('/realSchedule/lineCode/' + xlBm, function(array){
  99 + _data.clearByLineCode(xlBm);
  100 +
100 101 //加入_data缓存
101 102 $.each(array, function(){
102 103 _data.pushSchedule(this);
... ... @@ -114,13 +115,15 @@ var _alone = (function(){
114 115 //下行
115 116 tab.find('table[data-type=down] tbody').html(template('alone_plan_table_temp', {list: rs.down}))[0]
116 117 );
117   -
118 118 //定位到指定的班次
119   - goToSch(schedule);
  119 + //goToSch(schedule);
  120 +
  121 + cb && cb();
120 122 });
121 123 },
122 124 //重新计算行号
123 125 calculateLineNo: calculateLineNo
  126 + ,goToSch:goToSch
124 127 }
125 128  
126 129 //获取班次所在table
... ... @@ -131,13 +134,16 @@ var _alone = (function(){
131 134 }
132 135  
133 136 //定位到班次所在的行
134   - function goToSch(sch){
  137 + function goToSch(sch, ignoreLock){
135 138 var table = getTableBySch(sch);
136 139 if(!table.is(":visible"))
137 140 return;
138   - //表格被锁定
139   - if(table.parents('.sch_table_panel').hasClass('lock'))
140   - return;
  141 +
  142 + if(!ignoreLock){
  143 + //表格被锁定
  144 + if(table.parents('.sch_table_panel').hasClass('lock'))
  145 + return;
  146 + }
141 147  
142 148 var currTr = table.find('tr[data-id='+sch.id+']')
143 149 ,half = table.parents('._body').height() / 2
... ... @@ -165,9 +171,9 @@ var _alone = (function(){
165 171 }
166 172  
167 173 function splitDir(list){
168   - /*list.sort(function(a, b){
169   - return a.fcno - b.fcno;
170   - });*/
  174 + list.sort(function(a, b){
  175 + return a.dfsjT - b.dfsjT;
  176 + });
171 177 var rs = {up: [], down: []};
172 178 $.each(list, function(){
173 179 if(this.xlDir == upCode)
... ...
src/main/resources/static/pages/control/line/js/data.js
... ... @@ -82,12 +82,28 @@ var _data = (function(){
82 82 array.sort(fcsjSort);
83 83 return array;
84 84 },
  85 + //清理线路下班次
  86 + clearByLineCode: function(lineCode){
  87 + for(var id in schedules){
  88 + if(schedules[id].xlBm == lineCode){
  89 + schedules[id] = null;
  90 + delete schedules[id];
  91 + }
  92 + }
  93 +
  94 + lineLpMap[lineCode] = {};
  95 + },
85 96 //添加一个班次
86 97 pushSchedule: function(sch){
87 98 //附加信息
88 99 attachInfo(sch);
89 100 schedules[sch.id] = sch;
90   - lineLpMap[sch.xlBm][sch.lpName].push(sch);
  101 +
  102 + var xl=sch.xlBm,lp=sch.lpName;
  103 + if(!lineLpMap[xl][lp])
  104 + lineLpMap[xl][lp] = [];
  105 +
  106 + lineLpMap[xl][lp].push(sch);
91 107 },
92 108 //更新班次信息
93 109 updateSchedule: function(sch){
... ...
src/main/resources/static/pages/control/line/js/rightMenu.js
... ... @@ -388,7 +388,7 @@ var _menu = (function() {
388 388 if(rs.ts){
389 389 msg_ct('实发调整成功!');
390 390 //更新前端数据
391   - //_alone.refreshScheduleArray(rs.ts);
  391 + _alone.refreshScheduleArray(rs.ts);
392 392 }
393 393 });
394 394 });
... ...
src/main/resources/static/pages/control/line/temps/alone_tp.html
... ... @@ -104,7 +104,7 @@
104 104 <!-- 班次table -->
105 105 <script id="alone_plan_table_temp" type="text/html">
106 106 {{each list as item i}}
107   - <tr data-id={{item.id}}>
  107 +<tr data-id={{item.id}} class="{{if item.sflj}}linjia{{/if}}">
108 108 <td name="lineNo"></td>
109 109 <td data-name="lpName"><a href="javascript:;">{{item.lpName}}</a></td>
110 110  
... ...
src/main/resources/static/pages/mapmonitor/real/js/playBack.js
... ... @@ -111,8 +111,10 @@ var playBack = (function() {
111 111  
112 112 //添加进出站日志
113 113 function addInOutText(gps){
114   - var info = gps.inout_stop_info
115   - ,date = moment(gps.ts).format('HH:mm.ss')
  114 + var info = gps.inout_stop_info;
  115 + if(!info)
  116 + return;
  117 + var date = moment(gps.ts).format('HH:mm.ss')
116 118 ,clazz = info.inOut==1?'out':'in';
117 119 if(!info)
118 120 return;
... ...