Commit 5d2e60395a00b30e00051214cac98d3fc24e169b
1 parent
a4e98411
update...
Showing
5 changed files
with
54 additions
and
14 deletions
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| 1 | 1 | |
| 2 | 2 | package com.bsth.data.schedule.late_adjust; |
| 3 | 3 | |
| 4 | +import com.bsth.data.BasicData; | |
| 4 | 5 | import com.bsth.data.LineConfigData; |
| 5 | 6 | import com.bsth.data.gpsdata.GpsEntity; |
| 6 | 7 | import com.bsth.entity.realcontrol.LineConfig; |
| 7 | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 9 | +import com.bsth.util.Arith; | |
| 8 | 10 | import com.bsth.websocket.handler.SendUtils; |
| 9 | 11 | import org.slf4j.Logger; |
| 10 | 12 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -47,6 +49,9 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 47 | 49 | */ |
| 48 | 50 | public static void putLate(ScheduleRealInfo sch){ |
| 49 | 51 | try { |
| 52 | + //进出场班次不需要 | |
| 53 | + if(sch.getBcType().equals("in") || sch.getBcType().equals("out")) | |
| 54 | + return; | |
| 50 | 55 | //线路配置 |
| 51 | 56 | LineConfig config = lineConfigData.get(sch.getXlBm()); |
| 52 | 57 | if(sch.getLateMinute() == 0){ |
| ... | ... | @@ -115,11 +120,12 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 115 | 120 | if(sch == null) |
| 116 | 121 | return; |
| 117 | 122 | |
| 118 | - //进的是班次起点 | |
| 123 | + //进的是班次起点(名称一样即可) | |
| 124 | + gps.setStationName(BasicData.stationCode2NameMap.get(gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo())); | |
| 119 | 125 | if(gps.getStationName().equals(sch.getQdzName()) |
| 120 | 126 | && sch.getLateMinute() > 0){ |
| 121 | 127 | //自动调整待发 到达时间 + 停靠时间 |
| 122 | - long dt = (long) (gps.getTimestamp() + (sch.getLateMinute() * 60 * 1000)); | |
| 128 | + long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); | |
| 123 | 129 | sch.setDfsjAll(dt); |
| 124 | 130 | sch.setDfAuto(true); |
| 125 | 131 | //取消应发未到标记 | ... | ... |
src/main/java/com/bsth/util/Arith.java
| ... | ... | @@ -24,8 +24,20 @@ public class Arith { |
| 24 | 24 | BigDecimal b1 = new BigDecimal(v1.toString()); |
| 25 | 25 | BigDecimal b2 = new BigDecimal(v2.toString()); |
| 26 | 26 | return b1.add(b2).doubleValue(); |
| 27 | - } | |
| 28 | - | |
| 27 | + } | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 提供精确的加法运算。 | |
| 31 | + * @param v1 被加数 | |
| 32 | + * @param v2 加数 | |
| 33 | + * @return 两个参数的和 | |
| 34 | + */ | |
| 35 | + public static long addLong(Object v1,Object v2){ | |
| 36 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 37 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 38 | + return b1.add(b2).longValue(); | |
| 39 | + } | |
| 40 | + | |
| 29 | 41 | /** |
| 30 | 42 | * 提供精确的减法运算。 |
| 31 | 43 | * @param v1 被减数 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_range_turn.html
| ... | ... | @@ -167,7 +167,7 @@ |
| 167 | 167 | <div class="uk-grid"> |
| 168 | 168 | <div class="uk-width-3-10"> |
| 169 | 169 | <div class="uk-form-row"> |
| 170 | - <label class="uk-form-label">营运里程</label> | |
| 170 | + <label class="uk-form-label mileage_label">营运里程</label> | |
| 171 | 171 | </div> |
| 172 | 172 | </div> |
| 173 | 173 | <div class="uk-width-7-10 pl5"> |
| ... | ... | @@ -354,6 +354,9 @@ |
| 354 | 354 | return; |
| 355 | 355 | } |
| 356 | 356 | var data = dataArray[i]; |
| 357 | + //营运子任务不写备注 | |
| 358 | + if(data.mileageType == 'service' && !data.destroy) | |
| 359 | + data.remarks = ''; | |
| 357 | 360 | gb_common.$post('/childTask', data, function (rs) { |
| 358 | 361 | notify_succ('子任务添加成功'); |
| 359 | 362 | gb_schedule_table.updateSchedule(rs.t); |
| ... | ... | @@ -435,8 +438,10 @@ |
| 435 | 438 | $('[name=startDate]', cdf).val(ets); |
| 436 | 439 | //烂班2终点 |
| 437 | 440 | try { |
| 438 | - $('[name=endStation]', ndf).val(searchParallelStation()); | |
| 439 | - calcFormMileage(ndf, nextSch.xlDir); | |
| 441 | + if(!$('#emptyTurnCbox', modal)[0].checked){ | |
| 442 | + $('[name=endStation]', ndf).val(searchParallelStation()); | |
| 443 | + calcFormMileage(ndf, nextSch.xlDir); | |
| 444 | + } | |
| 440 | 445 | } catch (e) { |
| 441 | 446 | } |
| 442 | 447 | //开始时间 |
| ... | ... | @@ -595,12 +600,28 @@ |
| 595 | 600 | $('#emptyTurnCbox', modal).on('click', function () { |
| 596 | 601 | if(this.checked){ |
| 597 | 602 | //全程烂班 |
| 598 | - $('[name=endStation]', ndf).val(nextSch.zdzCode).attr('disabled'); | |
| 599 | - //空驶回起点 | |
| 600 | - | |
| 603 | + $('[name=endStation]', ndf).val(nextSch.zdzCode).attr('disabled', 'disabled'); | |
| 604 | + $('[name=mileage]', ndf).val(nextSch.jhlc).attr('disabled', 'disabled'); | |
| 605 | + //空驶回起点,营运变空驶 | |
| 606 | + var $panel = nsf.parents('.uk-panel').removeClass('uk-panel-box-primary') | |
| 607 | + .addClass('uk-panel-box-secondary'); | |
| 608 | + $panel.find('.uk-panel-badge').addClass('uk-badge-default').text('空驶'); | |
| 609 | + $panel.find('.mileage_label').text('空驶里程'); | |
| 610 | + | |
| 611 | + $('[name=mileageType]', nsf).val('empty'); | |
| 601 | 612 | } |
| 602 | 613 | else{ |
| 614 | + //恢复 | |
| 615 | + $('[name=endStation]', ndf).removeAttr('disabled'); | |
| 616 | + $('[name=mileage]', ndf).removeAttr('disabled'); | |
| 603 | 617 | |
| 618 | + //空驶变营运 | |
| 619 | + var $panel = nsf.parents('.uk-panel').removeClass('uk-panel-box-secondary') | |
| 620 | + .addClass('uk-panel-box-primary'); | |
| 621 | + $panel.find('.uk-panel-badge').removeClass('uk-badge-default').text('营运'); | |
| 622 | + $panel.find('.mileage_label').text('营运里程'); | |
| 623 | + | |
| 624 | + reClac(); | |
| 604 | 625 | } |
| 605 | 626 | }); |
| 606 | 627 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| ... | ... | @@ -193,7 +193,8 @@ var gb_schedule_context_menu = (function () { |
| 193 | 193 | |
| 194 | 194 | var idx='', minute=0; |
| 195 | 195 | $.each(schArray, function () { |
| 196 | - if(this.fcsjActual && this.status != 0){ | |
| 196 | + if(this.bcType=='in' || this.bcType=='out' || | |
| 197 | + (this.fcsjActual && this.status != 0)){ | |
| 197 | 198 | return true; |
| 198 | 199 | } |
| 199 | 200 | else |
| ... | ... | @@ -202,7 +203,7 @@ var gb_schedule_context_menu = (function () { |
| 202 | 203 | }); |
| 203 | 204 | |
| 204 | 205 | if(!idx || idx==''){ |
| 205 | - notify_err('没有需要调整的班次!'); | |
| 206 | + notify_err('没有需要设置误点停靠时间的班次!'); | |
| 206 | 207 | return; |
| 207 | 208 | } |
| 208 | 209 | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
| ... | ... | @@ -171,8 +171,8 @@ var disabled_submit_btn = function (form) { |
| 171 | 171 | function showUpdateDescription() { |
| 172 | 172 | //更新说明 |
| 173 | 173 | var updateDescription = { |
| 174 | - date: '2017-04-19', | |
| 175 | - text: '<h5>加油子任务改为空驶进出场子任务</h5><h5>计划烂班时调整说明必填</h5><h5>连接断开(横幅变红)后会自动尝试重连</h5><h5>误点调整功能加入,线上测试一天,20号再用</h5>' | |
| 174 | + date: '2017-04-20', | |
| 175 | + text: '<h5>现在可以在轨迹回放里看到停车场位置和多边形电子围栏</h5><h5>区间调头子任务,可以勾选“调头后空驶回起点”</h5>' | |
| 176 | 176 | }; |
| 177 | 177 | |
| 178 | 178 | var storage = window.localStorage | ... | ... |