Commit e86195b1d30a1b1bfa825db2afb71d61578cfa76

Authored by 潘钊
1 parent 8f6b2e0f

update...

src/main/java/com/bsth/controller/directive/DirectiveController.java
@@ -165,11 +165,11 @@ public class DirectiveController { @@ -165,11 +165,11 @@ public class DirectiveController {
165 * @throws 165 * @throws
166 */ 166 */
167 @RequestMapping(value = "/list", method = RequestMethod.GET) 167 @RequestMapping(value = "/list", method = RequestMethod.GET)
168 - public Map<String, Object> findDirective(String nbbm,@RequestParam int dType 168 + public Map<String, Object> findDirective(String nbbms,@RequestParam int dType
169 , @RequestParam(defaultValue = "0") int page, 169 , @RequestParam(defaultValue = "0") int page,
170 @RequestParam(defaultValue = "10") int size){ 170 @RequestParam(defaultValue = "10") int size){
171 171
172 - return directiveService.findDirective(nbbm, dType, page, size); 172 + return directiveService.findDirective(nbbms, dType, page, size);
173 } 173 }
174 174
175 @RequestMapping(value = "/c0a4", method = RequestMethod.POST) 175 @RequestMapping(value = "/c0a4", method = RequestMethod.POST)
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -365,11 +365,21 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -365,11 +365,21 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
365 } 365 }
366 366
367 @Override 367 @Override
368 - public Map<String, Object> findDirective(String nbbm, int dType, int page, int size) { 368 + public Map<String, Object> findDirective(String nbbms, int dType, int page, int size) {
369 Map<String, Object> rsMap = new HashMap<>(); 369 Map<String, Object> rsMap = new HashMap<>();
370 try{ 370 try{
371 - List<Directive> list = new ArrayList<>();  
372 371
  372 + List<String> carArray = new ArrayList<>(), deviceArray=new ArrayList<>();
  373 + if(StringUtils.isNotEmpty(nbbms)){
  374 + carArray = Splitter.on(",").splitToList(nbbms);
  375 + //转换成设备号
  376 + Map<String, String> nbbm2deviceMap = BasicData.deviceId2NbbmMap.inverse();
  377 + for(int i = 0, len=carArray.size(); i < len; i++){
  378 + deviceArray.add(nbbm2deviceMap.get(carArray.get(i)));
  379 + }
  380 + }
  381 +
  382 + List<Directive> list = new ArrayList<>();
373 switch (dType) { 383 switch (dType) {
374 case -1: 384 case -1:
375 //所有指令 385 //所有指令
@@ -409,18 +419,22 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -409,18 +419,22 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
409 419
410 // 时间倒序 420 // 时间倒序
411 Collections.sort(list, new DayOfDirectives.DComparator()); 421 Collections.sort(list, new DayOfDirectives.DComparator());
412 - if (StringUtils.isNotBlank(nbbm)) {  
413 - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);  
414 - //按车辆过滤 422 + if(deviceArray.size() > 0){
  423 + //按设备号过滤
415 List<Directive> subList = new ArrayList<>(); 424 List<Directive> subList = new ArrayList<>();
416 for (Directive d : list) { 425 for (Directive d : list) {
417 - if (d.getDeviceId().equals(deviceId)) { 426 + if (deviceArray.contains(d.getDeviceId())) {
418 subList.add(d); 427 subList.add(d);
419 } 428 }
420 } 429 }
421 list = subList; 430 list = subList;
422 } 431 }
423 432
  433 + for(Directive d : list){
  434 + d.setTimeHHmm(fmtHHmm.print(d.getTimestamp()));
  435 + d.setNbbm(BasicData.deviceId2NbbmMap.get(d.getDeviceId()));
  436 + }
  437 +
424 int count = list.size(); 438 int count = list.size();
425 // 分页 439 // 分页
426 int s = page * size, e = s + size; 440 int s = page * size, e = s + size;
@@ -429,15 +443,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -429,15 +443,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
429 e = count; 443 e = count;
430 444
431 List<Directive> rs = list.subList(s, e); 445 List<Directive> rs = list.subList(s, e);
432 -  
433 - // 时间格式化,车辆自编号转换  
434 - for (Directive d : rs) {  
435 - if (d.getTimeHHmm() == null)  
436 - d.setTimeHHmm(fmtHHmm.print(d.getTimestamp()));  
437 - if (d.getNbbm() == null)  
438 - d.setNbbm(BasicData.deviceId2NbbmMap.get(d.getDeviceId()));  
439 - }  
440 -  
441 rsMap.put("list", rs); 446 rsMap.put("list", rs);
442 rsMap.put("totalPages", count % size == 0 ? (count / size - 1) : count / size); 447 rsMap.put("totalPages", count % size == 0 ? (count / size - 1) : count / size);
443 rsMap.put("page", page); 448 rsMap.put("page", page);
@@ -450,51 +455,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -450,51 +455,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
450 455
451 @Override 456 @Override
452 public Map<String, Object> findAll80(Map<String, Object> map, int page, int size) { 457 public Map<String, Object> findAll80(Map<String, Object> map, int page, int size) {
453 - /*List<D80> d80s = new ArrayList<>();  
454 -  
455 - Object nbbm = map.get("nbbm");  
456 - if (null != nbbm && StringUtils.isNotEmpty(nbbm.toString())) {  
457 - d80s.addAll(pilotReport.findByCar(nbbm.toString()));  
458 - } else {  
459 - d80s.addAll(pilotReport.findAll());  
460 - }  
461 -  
462 - Short requestCode = Short.parseShort(map.get("requestCode").toString());  
463 - if (requestCode != -1) {  
464 - List<D80> temps = new ArrayList<>();  
465 - for (D80 d80 : d80s) {  
466 - if (d80.getData().getRequestCode().equals(requestCode))  
467 - temps.add(d80);  
468 - }  
469 - d80s = temps;  
470 - }  
471 -  
472 - //排序  
473 - Collections.sort(d80s, new Comparator<D80>() {  
474 - @Override  
475 - public int compare(D80 o1, D80 o2) {  
476 - return (int) (o2.getTimestamp() - o1.getTimestamp());  
477 - }  
478 - });  
479 -  
480 - //分页  
481 - int count = d80s.size();  
482 - // 分页  
483 - int s = page * size, e = s + size;  
484 -  
485 - if (e > count)  
486 - e = count;  
487 -  
488 - //SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");  
489 - List<D80> rs = d80s.subList(s, e);  
490 - for (D80 d80 : rs) {  
491 - d80.setTimeStr(fmtHHmm.print(d80.getTimestamp()));  
492 - }  
493 -  
494 - Map<String, Object> rsMap = new HashMap<>();  
495 - rsMap.put("list", rs);  
496 - rsMap.put("totalPages", count % size == 0 ? count / size - 1 : count / size);  
497 - rsMap.put("page", page);*/  
498 458
499 List all = ListFilterUtils.filter(pilotReport.findAll(), map, D80.class); 459 List all = ListFilterUtils.filter(pilotReport.findAll(), map, D80.class);
500 //排序 460 //排序
src/main/resources/static/pages/history_sch/edit/main_page.html
@@ -144,6 +144,19 @@ @@ -144,6 +144,19 @@
144 var hide_wait_modal = function () { 144 var hide_wait_modal = function () {
145 UIkit.modal('#gb_wait_modal').hide(); 145 UIkit.modal('#gb_wait_modal').hide();
146 }; 146 };
  147 +
  148 + var alt_confirm = function (content, succ, okBtn, noCenter) {
  149 + var modalEl = UIkit.modal.confirm(content, function () {
  150 + succ && succ();
  151 + modalEl.hide();
  152 + }, {
  153 + labels: {
  154 + Ok: okBtn,
  155 + Cancel: '取消'
  156 + }
  157 + , center: !noCenter
  158 + });
  159 + };
147 </script> 160 </script>
148 </body> 161 </body>
149 </html> 162 </html>
150 \ No newline at end of file 163 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/sys_mailbox.html
1 <div> 1 <div>
2 <script id="sys-note-80-temp" type="text/html"> 2 <script id="sys-note-80-temp" type="text/html">
3 - <div class="uk-width-medium-1-1 sys-note-80 sys-mail-item" data-id={{id}}> 3 + <div class="uk-width-medium-1-1 sys-note-80 sys-mail-item" data-id={{id}} data-schid="{{schId}}">
4 <div class="uk-panel uk-panel-box uk-panel-box-primary"> 4 <div class="uk-panel uk-panel-box uk-panel-box-primary">
5 <h4 class="uk-panel-title">{{data.nbbm}} {{text}}</h4> 5 <h4 class="uk-panel-title">{{data.nbbm}} {{text}}</h4>
6 <code>{{dateStr}}</code> 6 <code>{{dateStr}}</code>
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
@@ -21,9 +21,13 @@ @@ -21,9 +21,13 @@
21 <option value="1">运营指令</option> 21 <option value="1">运营指令</option>
22 <option value="2">线路切换指令</option> 22 <option value="2">线路切换指令</option>
23 </select> 23 </select>
  24 + <span class="horizontal-field">线路</span>
  25 + <select name="lineCode" style="width: 140px;">
  26 + <option value="">全部</option>
  27 + </select>
24 <span class="horizontal-field">车辆</span> 28 <span class="horizontal-field">车辆</span>
25 <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars"> 29 <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars">
26 - <input type="text" name="nbbm" placeholder="车辆自编号"> 30 + <input type="text" name="nbbms" placeholder="车辆自编号">
27 </div> 31 </div>
28 32
29 <button class="uk-button">检索</button> 33 <button class="uk-button">检索</button>
@@ -81,43 +85,18 @@ @@ -81,43 +85,18 @@
81 var form = $('.search-form', modal); 85 var form = $('.search-form', modal);
82 var page = 0; 86 var page = 0;
83 var pageSize = 12; 87 var pageSize = 12;
84 - //all car nbbm  
85 - var cars;  
86 - //custom autocomplete search function  
87 - var carInput = $('#uk-autocomplete-cars input');  
88 - var search_nbbm = function(release) {  
89 - var q = carInput.val().toUpperCase(),  
90 - rs = [],  
91 - max = 12,  
92 - count = 0;  
93 -  
94 - $.each(cars, function(i, item) {  
95 - if (item.indexOf(q) != -1){  
96 - rs.push({  
97 - value: item,  
98 - title: item  
99 - });  
100 - count ++;  
101 - }  
102 - if (count >= max)  
103 - return false;  
104 - });  
105 88
106 - release && release(rs);  
107 - } 89 + //线路下拉框
  90 + var opts = '<option value="">全部</option>';
  91 + $.each(gb_data_basic.activeLines, function () {
  92 + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>';
  93 + });
  94 + $('[name=lineCode]', form).html(opts);
108 95
109 $('#directive-history-modal').on('init', function(e, data) { 96 $('#directive-history-modal').on('init', function(e, data) {
110 e.stopPropagation(); 97 e.stopPropagation();
111 - // autocomplete  
112 - $.get('/basic/cars', function(rs) {  
113 - cars = rs;  
114 -  
115 - UIkit.autocomplete('#uk-autocomplete-cars', {  
116 - source: search_nbbm,  
117 - minLength: 1,  
118 - delay: 50  
119 - });  
120 - }); 98 + //车辆 autocomplete
  99 + gb_common.carAutocomplete($('#uk-autocomplete-cars', modal), gb_data_basic.carsArray());
121 query(); 100 query();
122 }); 101 });
123 102
@@ -133,6 +112,17 @@ @@ -133,6 +112,17 @@
133 var data = form.serializeJSON(); 112 var data = form.serializeJSON();
134 data.page = page; 113 data.page = page;
135 data.size = pageSize; 114 data.size = pageSize;
  115 + if(data.lineCode){
  116 + //有选择线路,重新设置车辆字符串
  117 + var nbbmArray=data.nbbms=gb_schedule_table.findNbbmByLineCode(data.lineCode);
  118 + if(nbbmArray.length>0){
  119 + data.nbbms='';
  120 + for(var i=0,n;n=nbbmArray[i++];){
  121 + data.nbbms+=n+',';
  122 + }
  123 + data.nbbms=data.nbbms.substr(0, data.nbbms.length-1);
  124 + }
  125 + }
136 126
137 $.get('/directive/list', data, function(rs) { 127 $.get('/directive/list', data, function(rs) {
138 $.each(rs.list, function(i, e){ 128 $.each(rs.list, function(i, e){
src/main/resources/static/real_control_v2/fragments/north/nav/report_80.html
@@ -14,10 +14,12 @@ @@ -14,10 +14,12 @@
14 <select name="requestCode"> 14 <select name="requestCode">
15 <option value="">全部</option> 15 <option value="">全部</option>
16 </select> 16 </select>
17 - <span class="horizontal-field">线路</span> 17 + <!--<span class="horizontal-field">线路</span>
18 <div class="uk-autocomplete uk-form autocomplete-line" > 18 <div class="uk-autocomplete uk-form autocomplete-line" >
19 <input type="text" name="lineId" placeholder="线路"> 19 <input type="text" name="lineId" placeholder="线路">
20 - </div> 20 + </div>-->
  21 + <span class="horizontal-field">线路</span>
  22 + <select name="lineId" style="width: 140px;"></select>
21 <span class="horizontal-field">车辆</span> 23 <span class="horizontal-field">车辆</span>
22 <div class="uk-autocomplete uk-form autocomplete-cars" > 24 <div class="uk-autocomplete uk-form autocomplete-cars" >
23 <input type="text" name="nbbm" placeholder="车辆自编号"> 25 <input type="text" name="nbbm" placeholder="车辆自编号">
@@ -80,6 +82,13 @@ @@ -80,6 +82,13 @@
80 var page = 0; 82 var page = 0;
81 var pageSize = 12; 83 var pageSize = 12;
82 84
  85 + //线路下拉框
  86 + var opts = '<option value="">全部</option>';
  87 + $.each(gb_data_basic.activeLines, function () {
  88 + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>';
  89 + });
  90 + $('[name=lineId]', form).html(opts);
  91 +
83 $(modal).on('init', function(e, data) { 92 $(modal).on('init', function(e, data) {
84 e.stopPropagation(); 93 e.stopPropagation();
85 var opt=''; 94 var opt='';
@@ -90,7 +99,7 @@ @@ -90,7 +99,7 @@
90 //车辆 autocomplete 99 //车辆 autocomplete
91 gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray()); 100 gb_common.carAutocomplete($('.autocomplete-cars', modal), gb_data_basic.carsArray());
92 //线路 autocomplete 101 //线路 autocomplete
93 - gb_common.lineAutocomplete($('.autocomplete-line', modal)); 102 + //gb_common.lineAutocomplete($('.autocomplete-line', modal));
94 query(); 103 query();
95 }); 104 });
96 105
@@ -106,12 +115,12 @@ @@ -106,12 +115,12 @@
106 var data = form.serializeJSON(); 115 var data = form.serializeJSON();
107 data.page = page; 116 data.page = page;
108 data.size = pageSize; 117 data.size = pageSize;
109 - //线路转换成编码 118 + /*//线路转换成编码
110 if(data.lineId){ 119 if(data.lineId){
111 var lineCode = gb_data_basic.findCodeByLinename(data.lineId); 120 var lineCode = gb_data_basic.findCodeByLinename(data.lineId);
112 if(lineCode) 121 if(lineCode)
113 data.lineId=lineCode; 122 data.lineId=lineCode;
114 - } 123 + }*/
115 $.get('/directive/findAll80', data, function(rs) { 124 $.get('/directive/findAll80', data, function(rs) {
116 $.each(rs.list, function(){ 125 $.each(rs.list, function(){
117 //命令字转中文 126 //命令字转中文
src/main/resources/static/real_control_v2/js/common.js
@@ -62,6 +62,18 @@ var gb_common = (function () { @@ -62,6 +62,18 @@ var gb_common = (function () {
62 return rs; 62 return rs;
63 }; 63 };
64 64
  65 + /**
  66 + * 从班次集合里提取车辆
  67 + * @param list
  68 + */
  69 + var extractNbbm = function (list) {
  70 + var rs = {};
  71 + $.each(list, function () {
  72 + rs[this.clZbh]=1;
  73 + });
  74 + return rs;
  75 + };
  76 +
65 var compileTempByDom = function (dom, opts) { 77 var compileTempByDom = function (dom, opts) {
66 var tps = {}, 78 var tps = {},
67 id; 79 id;
@@ -435,7 +447,8 @@ var gb_common = (function () { @@ -435,7 +447,8 @@ var gb_common = (function () {
435 adjustExps: adjustExps, 447 adjustExps: adjustExps,
436 inOutExps: inOutExps, 448 inOutExps: inOutExps,
437 next_elem: next_elem, 449 next_elem: next_elem,
438 - getDisabledVal: getDisabledVal 450 + getDisabledVal: getDisabledVal,
  451 + extractNbbm: extractNbbm
439 452
440 //whichTransitionEvent:whichTransitionEvent 453 //whichTransitionEvent:whichTransitionEvent
441 }; 454 };
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
@@ -651,6 +651,17 @@ var gb_schedule_table = (function () { @@ -651,6 +651,17 @@ var gb_schedule_table = (function () {
651 var refreshAll = function () { 651 var refreshAll = function () {
652 show(); 652 show();
653 }; 653 };
  654 +
  655 + /**
  656 + * 获取线路下营运的车辆
  657 + */
  658 + var findNbbmByLineCode = function (lineCode) {
  659 + try{
  660 + return gb_common.get_keys(gb_common.extractNbbm(gb_common.get_vals(line2Schedule[lineCode])));
  661 + }catch (e){
  662 + return [];
  663 + }
  664 + };
654 665
655 return { 666 return {
656 show: show, 667 show: show,
@@ -673,6 +684,7 @@ var gb_schedule_table = (function () { @@ -673,6 +684,7 @@ var gb_schedule_table = (function () {
673 showLateBadge: showLateBadge, 684 showLateBadge: showLateBadge,
674 cancelLateBadge: cancelLateBadge, 685 cancelLateBadge: cancelLateBadge,
675 refreshAll: refreshAll, 686 refreshAll: refreshAll,
676 - getNextNormalSch: getNextNormalSch 687 + getNextNormalSch: getNextNormalSch,
  688 + findNbbmByLineCode:findNbbmByLineCode
677 }; 689 };
678 })(); 690 })();
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
@@ -235,23 +235,37 @@ var gb_sch_websocket = (function () { @@ -235,23 +235,37 @@ var gb_sch_websocket = (function () {
235 dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click'); 235 dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');
236 }); 236 });
237 237
  238 + //80消息点击
  239 + $(document).on('click', '.sys-mailbox .sys-note-80', function () {
  240 + var lineCode = $(this).parents('li.line_schedule').data('id')
  241 + , id = $(this).data('schid');
  242 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  243 + var dl = gb_schedule_table.scroToDl(sch);
  244 + //高亮
  245 + gb_schedule_table.reset_drag_active_all(dl);
  246 + dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');
  247 + });
238 248
239 //80同意 249 //80同意
240 - $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function () { 250 + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function (e) {
  251 + e.stopPropagation();
241 $(this).attr('disabled', 'disabled'); 252 $(this).attr('disabled', 'disabled');
242 var panel = $(this).parents('.sys-note-80') 253 var panel = $(this).parents('.sys-note-80')
243 , id = panel.data('id'); 254 , id = panel.data('id');
244 255
245 reply80({id: id, reply: 0}); 256 reply80({id: id, reply: 0});
  257 + return false;
246 }); 258 });
247 259
248 //80不同意 260 //80不同意
249 $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button.reject', function () { 261 $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button.reject', function () {
  262 + e.stopPropagation();
250 $(this).attr('disabled', 'disabled'); 263 $(this).attr('disabled', 'disabled');
251 var panel = $(this).parents('.sys-note-80') 264 var panel = $(this).parents('.sys-note-80')
252 , id = panel.data('id'); 265 , id = panel.data('id');
253 266
254 reply80({id: id, reply: -1}); 267 reply80({id: id, reply: -1});
  268 + return false;
255 }); 269 });
256 270
257 var reply80 = function (data, cb) { 271 var reply80 = function (data, cb) {
@@ -344,10 +358,6 @@ var gb_sch_websocket = (function () { @@ -344,10 +358,6 @@ var gb_sch_websocket = (function () {
344 return; 358 return;
345 359
346 gb_schedule_context_menu.fcxxwt(sch); 360 gb_schedule_context_menu.fcxxwt(sch);
347 - var dl = gb_schedule_table.scroToDl(sch);  
348 - //高亮  
349 - gb_schedule_table.reset_drag_active_all(dl);  
350 - dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');  
351 }); 361 });
352 362
353 return { 363 return {