Commit 82994a9f925c5b8540c079289b07e8fe4a660441

Authored by 潘钊
1 parent 5a6550d7

update...

src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -48,8 +48,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
48 48 */
49 49 @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)
50 50 public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,
51   - @RequestParam String dfsj,String bcType) {
52   - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType);
  51 + @RequestParam String dfsj,String bcType,
  52 + @RequestParam(defaultValue = "") String opType) {
  53 + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType);
53 54 }
54 55  
55 56 /**
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java
... ... @@ -38,7 +38,7 @@ public class ReverseSignalHandle extends SignalHandle {
38 38 if (isReverse(gps, prev)) {
39 39 RouteReverse reverse = reverseSearch(prevs, gps);
40 40  
41   - if (reverse.getCount() >= 3
  41 + if (reverse != null && reverse.getCount() >= 3
42 42 && reverse.isClose()
43 43 && !GeoCacheData.isEndStation(gps.getLineId(), gps.getUpDown(), reverse.getTurned())) {
44 44 scheduleSignalState.reverseAnalyse(reverse);
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -109,7 +109,7 @@ public class DayOfSchedule {
109 109 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm");
110 110  
111 111 //数据恢复
112   - private void dataRecovery() {
  112 + public void dataRecovery() {
113 113 GpsDataRecovery.run = true;
114 114  
115 115 Collection<LineConfig> confs = lineConfigs.getAll();
... ...
src/main/java/com/bsth/data/schedule/edit_logs/SchEditLogger.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs;
  2 +
  3 +/**
  4 + * 班次修正记录
  5 + * Created by panzhao on 2017/5/16.
  6 + */
  7 +public class SchEditLogger {
  8 +
  9 + /**
  10 + * 待发调整
  11 + */
  12 + public static void dftz(Long id, String remarks, String dfsj, String bcType, String opType){
  13 +
  14 + }
  15 +}
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -924,4 +924,8 @@ public class ScheduleRealInfo {
924 924 public void setFcpSn(int fcpSn) {
925 925 this.fcpSn = fcpSn;
926 926 }
  927 +
  928 + public boolean isInout(){
  929 + return this.getBcType().equals("out") || this.getBcType().equals("in");
  930 + }
927 931 }
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -16,7 +16,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
16 16  
17 17 Map<String, Collection<ScheduleRealInfo>> findByLines(String lines);
18 18  
19   - Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType);
  19 + Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType);
20 20  
21 21 Map<String, Object> destroy(String idsStr/*, int spaceAdjust*/, String remarks, String reason/*, int spaceNum*/);
22 22  
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -207,7 +207,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
207 207 private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
208 208  
209 209 @Override
210   - public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType) {
  210 + public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType) {
211 211 Map<String, Object> map = new HashMap<>();
212 212 try {
213 213  
... ... @@ -1155,7 +1155,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1155 1155 sch = list.get(i);
1156 1156  
1157 1157 //调整待发
1158   - outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null);
  1158 + outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "间隔调整");
1159 1159 }
1160 1160  
1161 1161 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -1325,7 +1325,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1325 1325 if (StringUtils.isNotEmpty(jhlc)) {
1326 1326 double jhlcNum = Double.parseDouble(jhlc);
1327 1327 //烂班
1328   - if(jhlcNum == 0 && sch.getJhlcOrig() != 0)
  1328 + if(jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch.isInout())
1329 1329 destroy(sch.getId() + "", "", map.get("adjustExps").toString());
1330 1330 else if(jhlcNum != sch.getJhlc()){
1331 1331 sch.setJhlc(jhlcNum);
... ... @@ -1375,7 +1375,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1375 1375 schedule = dayOfSchedule.get(id);
1376 1376  
1377 1377 if(schedule != null)
1378   - outgoAdjust(id, null, dfsj, null);
  1378 + outgoAdjust(id, null, dfsj, null, "批量调整");
1379 1379 }
1380 1380  
1381 1381 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -3222,7 +3222,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3222 3222 if (StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj()))
3223 3223 continue;
3224 3224  
3225   - tempMap = outgoAdjust(dc.getSchId(), "", dc.getNew_dfsj(), null);
  3225 + tempMap = outgoAdjust(dc.getSchId(), "", dc.getNew_dfsj(), null, "批量调整");
3226 3226  
3227 3227 if (tempMap.get("status").equals(ResponseCode.SUCCESS)) {
3228 3228 list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts"));
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -1158,3 +1158,8 @@ ul.left_tabs_lg li{
1158 1158 padding: 2px 7px;
1159 1159 border-radius: 3px;
1160 1160 }
  1161 +
  1162 +.uk-badge.sch_ldks{
  1163 + background: #8c8c8c;
  1164 + background-image: linear-gradient(to bottom,#a7a7a7,#8c8c8c);
  1165 +}
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/badge_tooltip.html
... ... @@ -61,4 +61,12 @@
61 61 </div>
62 62 </div>
63 63 </script>
  64 +
  65 + <script id="sch-table-ldks-tootip-temp" type="text/html">
  66 + <div class="tl-tip-panel">
  67 + <div style="font-size: 13px;">
  68 + {{qdzName}} 至 {{zdzName}}
  69 + </div>
  70 + </div>
  71 + </script>
64 72 </div>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
... ... @@ -115,6 +115,10 @@
115 115 (function() {
116 116 var modal = '#schedule-dftz-modal'
117 117 ,sch;
  118 +
  119 + var isInout = function (code) {
  120 + return code=='out' || code=='in';
  121 + };
118 122 $(modal).on('init', function(e, data) {
119 123 e.stopPropagation();
120 124 sch=data.sch;
... ... @@ -125,12 +129,12 @@
125 129 var bctypes=dictionaryUtils.getByGroup('ScheduleType')
126 130 ,opts='';
127 131  
128   - if(sch.bcType == 'out' || sch.bcType == 'in'){
  132 + if(isInout(sch.bcType)){
129 133 $('[name=bcType]', modal).html('<option value="'+sch.bcType+'">'+bctypes[sch.bcType]+'</option>');
130 134 }
131 135 else{
132 136 for(var code in bctypes){
133   - if(code!='venting' && code!='major' && code != 'normal')
  137 + if(isInout(code))
134 138 continue;
135 139 opts+='<option value="'+code+'">'+bctypes[code]+'</option>';
136 140 }
... ... @@ -166,10 +170,12 @@
166 170 url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html';
167 171 detailModal='#bctype-venting-modal';
168 172 }
169   - else{
  173 + else if(type=='major'){
170 174 detailModal='#bctype-major-modal';
171 175 url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html';
172 176 }
  177 + else
  178 + return;
173 179  
174 180 $.get(url, function(htmlStr){
175 181 $(document.body).append(htmlStr);
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -99,6 +99,8 @@
99 99 <span class="uk-badge uk-badge-danger">放站</span>
100 100 {{else if sch.bcType == "region"}}
101 101 <span class="uk-badge">区间</span>
  102 + {{else if sch.bcType == "ldks"}}
  103 + <span class="uk-badge sch_ldks">空2</span>
102 104 {{/if}}
103 105 {{if sch.sflj}}
104 106 <span class="uk-badge uk-badge-danger">临加</span>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
... ... @@ -74,6 +74,8 @@
74 74 <span class="uk-badge uk-badge-danger">放站</span>
75 75 {{else if sch.bcType == "region"}}
76 76 <span class="uk-badge sch_region">区间</span>
  77 + {{else if sch.bcType == "ldks"}}
  78 + <span class="uk-badge sch_ldks">空2</span>
77 79 {{/if}}
78 80 {{if sch.sflj}}
79 81 <span class="uk-badge uk-badge-danger">临加</span>
... ... @@ -126,12 +128,14 @@
126 128 <span class="uk-badge uk-badge-danger">放站</span>
127 129 {{else if bcType == "region"}}
128 130 <span class="uk-badge sch_region">区间</span>
  131 + {{else if sch.bcType == "ldks"}}
  132 + <span class="uk-badge uk-badge-notification sch_ldks">空2</span>
129 133 {{/if}}
130 134 {{if sflj}}
131 135 <span class="uk-badge uk-badge-danger">临加</span>
132 136 {{/if}}
133 137 {{if cTasks.length > 0}}
134   - <span class="uk-badge uk-badge-notification c_task">{{cTasks.length}}</span>
  138 + <span class="uk-badge c_task">{{cTasks.length}}</span>
135 139 {{/if}}
136 140 </dd>
137 141 </script>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/badge_tooltip.js
... ... @@ -2,6 +2,36 @@
2 2 /** badge 悬停 tip 相关 */
3 3 var gb_schedule_badge_tootip = (function () {
4 4  
  5 + var _opts = {
  6 + show:{
  7 + ready: true,
  8 + delay: 300
  9 + },
  10 + position: {
  11 + viewport: $(window),
  12 + my: 'center left',
  13 + at: 'center right'
  14 + },
  15 + hide: {
  16 + fixed: true,
  17 + delay: 300
  18 + },
  19 + events: {
  20 + hidden: function(event, api) {
  21 + //destroy dom
  22 + $(this).qtip('destroy', true);
  23 + }
  24 + }
  25 + };
  26 +
  27 + var getSch = function (e) {
  28 + var id = $(e).parents('dl').data('id'),
  29 + lineCode = $(e).parents('li.line_schedule').data('id'),
  30 + sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  31 + return sch;
  32 + };
  33 +
  34 + var _badge = '.schedule-wrap .ct_table_body .uk-badge';
5 35 var temps;
6 36 //html 模板
7 37 $.get('/real_control_v2/fragments/line_schedule/badge_tooltip.html', function(dom) {
... ... @@ -9,18 +39,13 @@ var gb_schedule_badge_tootip = (function () {
9 39 });
10 40  
11 41 //子任务 tootip
12   - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.c_task', function() {
  42 + $(document).on('mouseenter', _badge + '.c_task', function() {
13 43 $(this).qtip({
14   - show: {
15   - ready: true,
16   - delay: 300
17   - },
  44 + show: _opts.show,
18 45 content: {
19 46 text: function() {
20   - var id = $(this).parents('dl').data('id'),
21   - lineCode = $(this).parents('li.line_schedule').data('id'),
22   - sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
23   - //排序
  47 + var sch = getSch(this);
  48 + //子任务排序
24 49 var array = sch.cTasks.sort(function (a, b) {
25 50 var an = (a.mileageType=='service'?1:0)+''+(a.destroy?0:1);
26 51 var bn = (b.mileageType=='service'?1:0)+''+(b.destroy?0:1);
... ... @@ -29,134 +54,87 @@ var gb_schedule_badge_tootip = (function () {
29 54 return temps['sch-table-task-tootip-temp']({tasks: array});
30 55 }
31 56 },
32   - position: {
33   - viewport: $(window),
34   - my: 'center left',
35   - at: 'center right'
36   - },
  57 + position: _opts.position,
37 58 style: {
38 59 classes: 'qtip-light qtip-rounded qtip-shadow sch-badge-tip'
39 60 },
40   - hide: {
41   - fixed: true,
42   - delay: 300
43   - },
44   - events: {
45   - hidden: function(event, api) {
46   - //destroy dom
47   - $(this).qtip('destroy', true);
48   - }
49   - }
  61 + hide: _opts.hide,
  62 + events: _opts.events
50 63 });
51 64 });
52 65  
53 66 //区间 tootip
54   - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.sch_region', function() {
  67 + $(document).on('mouseenter', _badge+'.sch_region', function() {
55 68 $(this).qtip({
56   - show: {
57   - ready: true,
58   - delay: 300
59   - },
  69 + show: _opts.show,
60 70 content: {
61 71 text: function() {
62   - var id = $(this).parents('dl').data('id'),
63   - lineCode = $(this).parents('li.line_schedule').data('id'),
64   - sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
65   - return temps['sch-table-region-tootip-temp'](sch);
  72 + return temps['sch-table-region-tootip-temp'](getSch(this));
66 73 }
67 74 },
68   - position: {
69   - viewport: $(window),
70   - my: 'center left',
71   - at: 'center right'
72   - },
  75 + position: _opts.position,
73 76 style: {
74 77 classes: 'qtip-youtube sch-badge-tip'
75 78 },
76   - hide: {
77   - fixed: true,
78   - delay: 300
79   - },
80   - events: {
81   - hidden: function(event, api) {
82   - //destroy dom
83   - $(this).qtip('destroy', true);
84   - }
85   - }
  79 + hide: _opts.hide,
  80 + events: _opts.events
86 81 });
87 82 });
88 83  
89 84  
90 85 //出场 tootip
91   - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.out', function() {
  86 + $(document).on('mouseenter', _badge+'.out', function() {
92 87 $(this).qtip({
93   - show: {
94   - ready: true,
95   - delay: 300
96   - },
  88 + show: _opts.show,
97 89 content: {
98 90 text: function() {
99   - var id = $(this).parents('dl').data('id'),
100   - lineCode = $(this).parents('li.line_schedule').data('id'),
101   - sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
102   - return temps['sch-table-out-tootip-temp'](sch);
  91 + return temps['sch-table-out-tootip-temp'](getSch(this));
103 92 }
104 93 },
105   - position: {
106   - viewport: $(window),
107   - my: 'center left',
108   - at: 'center right'
109   - },
  94 + position: _opts.position,
110 95 style: {
111 96 classes: 'qtip-youtube sch-badge-tip'
112 97 },
113   - hide: {
114   - fixed: true,
115   - delay: 300
116   - },
117   - events: {
118   - hidden: function(event, api) {
119   - //destroy dom
120   - $(this).qtip('destroy', true);
121   - }
122   - }
  98 + hide: _opts.hide,
  99 + events: _opts.events
123 100 });
124 101 });
125 102  
126 103  
127 104 //进场 tootip
128   - $(document).on('mouseenter', '.schedule-wrap .ct_table_body .uk-badge.in', function() {
  105 + $(document).on('mouseenter', _badge+'.in', function() {
129 106 $(this).qtip({
130   - show: {
131   - ready: true,
132   - delay: 300
133   - },
  107 + show: _opts.show,
134 108 content: {
135 109 text: function() {
136   - var id = $(this).parents('dl').data('id'),
137   - lineCode = $(this).parents('li.line_schedule').data('id'),
138   - sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
139   - return temps['sch-table-in-tootip-temp'](sch);
  110 + return temps['sch-table-in-tootip-temp'](getSch(this));
140 111 }
141 112 },
142   - position: {
143   - viewport: $(window),
144   - my: 'center left',
145   - at: 'center right'
146   - },
  113 + position: _opts.position,
147 114 style: {
148 115 classes: 'qtip-youtube sch-badge-tip'
149 116 },
150   - hide: {
151   - fixed: true,
152   - delay: 300
153   - },
154   - events: {
155   - hidden: function(event, api) {
156   - //destroy dom
157   - $(this).qtip('destroy', true);
  117 + hide: _opts.hide,
  118 + events: _opts.events
  119 + });
  120 + });
  121 +
  122 + //2点间空放
  123 + $(document).on('mouseenter', _badge+'.sch_ldks', function() {
  124 + $(this).qtip({
  125 + show: _opts.show,
  126 + content: {
  127 + title:'两点间空驶',
  128 + text: function() {
  129 + return temps['sch-table-ldks-tootip-temp'](getSch(this));
158 130 }
159   - }
  131 + },
  132 + position: _opts.position,
  133 + style: {
  134 + classes: 'qtip-shadow qtip-bootstrap sch-badge-tip'
  135 + },
  136 + hide: _opts.hide,
  137 + events: _opts.events
160 138 });
161 139 });
162 140 })();
163 141 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -170,7 +170,7 @@ function showUpdateDescription() {
170 170 //更新说明
171 171 var updateDescription = {
172 172 date: '2017-05-16',
173   - text: '<h5>菜单栏加入了服务器时间</h5>'
  173 + text: '<h5>修复了进出场班次公里设置为0后自动烂班的问题</h5>'
174 174 };
175 175  
176 176 var storage = window.localStorage
... ...
src/main/resources/static/real_control_v2/js/minute_timer.js deleted 100644 → 0
1   -/** 时钟 */
2   -var gb_minute_timer = (function () {
3   -
4   -
5   - var getServerTime = function (cb) {
6   - function oncallback(jqXHR) {
7   - var time = jqXHR && jqXHR.getResponseHeader("Date");
8   - if (time)
9   - callback(new Date(time))
10   - }
11   -
12   - if ("function" == typeof callback)
13   - $.ajax({
14   - url: "/real_control_v2/assets/imgs/time.gif",
15   - type: "HEAD"
16   - }).done(function (data, textStatus, jqXHR) {
17   - oncallback(jqXHR)
18   - }).fail(function (jqXHR, textStatus, errorThrown) {
19   - oncallback(jqXHR)
20   - })
21   - };
22   -
23   -
24   - setTimeout(function () {
25   - getServerTime(function () {
26   - console.log('cb,,', cb);
27   - });
28   - }, 5000);
29   -
30   -})();
31 0 \ No newline at end of file
src/main/resources/static/real_control_v2/main.html
... ... @@ -184,8 +184,6 @@
184 184 <script src="/real_control_v2/js/websocket/sch_websocket.js" merge="custom_js"></script>
185 185 <!-- tts -->
186 186 <script src="/real_control_v2/js/utils/tts.js" merge="custom_js"></script>
187   -<!-- minute_timer.js -->
188   -<script src="/real_control_v2/js/minute_timer.js" merge="custom_js"></script>
189 187  
190 188 <!-- echart -->
191 189 <script src="/real_control_v2/assets/echarts-3/echarts.js" merge="plugins"></script>
... ...