Commit aa3561811d35cea2bd3065877f48ec23dd5a63bf

Authored by 徐烜
2 parents 875889e8 fb086f82

Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang

src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
... ... @@ -46,6 +46,9 @@ public class InOutStationSignalHandle extends SignalHandle{
46 46  
47 47 private final static int MAX_BEFORE_TIME = 1000 * 60 * 72;
48 48  
  49 + //最大的班次时间差,防止异常的GPS时间打乱数据
  50 + private final static int MAX_NORMAL_DIFF = 1000 * 60 * 60 * 12;
  51 +
49 52 @Override
50 53 public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
51 54 //忽略掉线信号
... ... @@ -106,8 +109,14 @@ public class InOutStationSignalHandle extends SignalHandle{
106 109 ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm());
107 110 String qdzCode = sch.getQdzCode();
108 111  
  112 + int diff = (int) (sch.getDfsjT() - gps.getTimestamp());
  113 +
109 114 //首班出场最多提前1.2小时
110   - if(dayOfSchedule.isFirstOut(sch) && sch.getDfsjT() - gps.getTimestamp() > MAX_BEFORE_TIME)
  115 + if(dayOfSchedule.isFirstOut(sch) && diff > MAX_BEFORE_TIME)
  116 + return;
  117 +
  118 + //正常班次最大时间差
  119 + if(Math.abs(diff) > MAX_NORMAL_DIFF)
111 120 return;
112 121  
113 122 //起点发车
... ... @@ -169,8 +178,13 @@ public class InOutStationSignalHandle extends SignalHandle{
169 178  
170 179 if(gps.getStopNo().equals(sch.getZdzCode())){
171 180  
  181 + int diff = (int) (sch.getZdsjT() - gps.getTimestamp());
172 182 //进场最多提前1.2小时
173   - if(sch.getBcType().equals("in") && sch.getZdsjT() - gps.getTimestamp() > MAX_BEFORE_TIME)
  183 + if(sch.getBcType().equals("in") && diff > MAX_BEFORE_TIME)
  184 + return;
  185 +
  186 + //正常班次最大时间差
  187 + if(Math.abs(diff) > MAX_NORMAL_DIFF)
174 188 return;
175 189  
176 190 //实达时间不覆盖
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -716,28 +716,35 @@ li.map-panel {
716 716 }
717 717  
718 718 #schedule-lp_change-modal .sch-list dl dt:nth-of-type(1), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(1) {
719   - width: 9%;
  719 + width: 7%;
720 720 border-left: 1px solid #dedede;
721 721 }
722 722  
723 723 #schedule-lp_change-modal .sch-list dl dt:nth-of-type(2), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(2) {
724   - width: 30%;
  724 + width: 25%;
725 725 }
726 726  
727 727 #schedule-lp_change-modal .sch-list dl dt:nth-of-type(3), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(3) {
728   - width: 28%;
  728 + width: 20%;
729 729 }
730 730  
731 731 #schedule-lp_change-modal .sch-list dl dt:nth-of-type(4), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(4) {
732   - width: 17%;
733   -}
  732 + width: 10%;
  733 + }
734 734  
735 735 #schedule-lp_change-modal .sch-list dl dt:nth-of-type(5), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(5) {
  736 + width: 22%;
  737 +}
  738 +
  739 +#schedule-lp_change-modal .sch-list dl dt:nth-of-type(6), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(6) {
736 740 width: 15%;
737 741 }
738 742  
  743 +
  744 +
  745 +
739 746 #schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(1), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(1) {
740   - width: 9%;
  747 + width: 7%;
741 748 border-left: 1px solid #dedede;
742 749 }
743 750  
... ... @@ -746,15 +753,19 @@ li.map-panel {
746 753 }
747 754  
748 755 #schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(3), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(3) {
749   - width: 17%;
  756 + width: 22%;
750 757 }
751 758  
752 759 #schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(4), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(4) {
753   - width: 28%;
  760 + width: 10%;
754 761 }
755 762  
756 763 #schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(5), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(5) {
757   - width: 30%;
  764 + width: 20%;
  765 +}
  766 +
  767 +#schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(6), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(6) {
  768 + width: 25%;
758 769 }
759 770  
760 771 #schedule-lp_change-modal .ct_table.sch-list .ct_table_body dl.active {
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
1 1 <div class="uk-modal" id="schedule-lp_change-modal">
2   - <div class="uk-modal-dialog" style="width: 900px;">
  2 + <div class="uk-modal-dialog" style="width: 1200px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5 5 <h2>路牌对调</h2></div>
... ... @@ -18,10 +18,11 @@
18 18 <div class="ct_table sch-list" style="margin-top: 14px;">
19 19 <div class="ct_table_head">
20 20 <dl>
21   - <dt><input type="checkbox"></dt>
  21 + <dt><input type="checkbox" class="global_box"></dt>
22 22 <dt>驾驶员</dt>
23 23 <dt>车辆</dt>
24 24 <dt>路牌</dt>
  25 + <dt>起点站</dt>
25 26 <dt>时间</dt>
26 27 </dl>
27 28 </div>
... ... @@ -43,8 +44,9 @@
43 44 <div class="ct_table sch-list reverse" style="margin-top: 14px;">
44 45 <div class="ct_table_head">
45 46 <dl>
46   - <dt><input type="checkbox"></dt>
  47 + <dt><input type="checkbox" class="global_box"></dt>
47 48 <dt>时间</dt>
  49 + <dt>起点站</dt>
48 50 <dt>路牌</dt>
49 51 <dt>车辆</dt>
50 52 <dt>驾驶员</dt>
... ... @@ -74,14 +76,35 @@
74 76 <dd>{{sch.jGh}}/{{sch.jName}}</dd>
75 77 <dd>{{sch.clZbh}}</dd>
76 78 <dd>{{sch.lpName}}</dd>
77   - <dd>{{sch.dfsj}}</dd>
  79 + <dd>{{sch.qdzName}}</dd>
  80 + <dd>{{sch.dfsj}}
  81 + {{if sch.bcType == "out"}}
  82 + <span class="uk-badge uk-badge-success">出</span>
  83 + {{else if sch.bcType == "in"}}
  84 + <span class="uk-badge uk-badge-warning">进</span>
  85 + {{else if sch.bcType == "venting"}}
  86 + <span class="uk-badge uk-badge-danger">直</span>
  87 + {{else if sch.bcType == "major"}}
  88 + <span class="uk-badge uk-badge-danger">放</span>
  89 + {{/if}}
  90 + </dd>
78 91 </dl>
79 92 {{/each}}
80 93 {{else if order == 1}}
81 94 {{each array as sch i}}
82 95 <dl>
83 96 <dd><input type="checkbox"></dd>
84   - <dd>{{sch.dfsj}}</dd>
  97 + <dd>{{sch.dfsj}}{{if sch.bcType == "out"}}
  98 + <span class="uk-badge uk-badge-success">出</span>
  99 + {{else if sch.bcType == "in"}}
  100 + <span class="uk-badge uk-badge-warning">进</span>
  101 + {{else if sch.bcType == "venting"}}
  102 + <span class="uk-badge uk-badge-danger">直</span>
  103 + {{else if sch.bcType == "major"}}
  104 + <span class="uk-badge uk-badge-danger">放</span>
  105 + {{/if}}
  106 + </dd>
  107 + <dd>{{sch.qdzName}}</dd>
85 108 <dd>{{sch.lpName}}</dd>
86 109 <dd>{{sch.clZbh}}</dd>
87 110 <dd>{{sch.jGh}}/{{sch.jName}}</dd>
... ... @@ -113,6 +136,8 @@
113 136 ops += '<option value="' + lp + '">' + lp + '</option>';
114 137 });
115 138 lpSelect.html(ops);
  139 +
  140 + disabledSubmitBtn();
116 141 });
117 142  
118 143 //路牌切换事件
... ... @@ -122,6 +147,8 @@
122 147  
123 148 var htmlStr = template('schedule-lp_change-list-temp', {array: list[order][lp], order: order});
124 149 $('.sch-list .ct_table_body', modal).eq(order).html(htmlStr);
  150 +
  151 + disabledSubmitBtn();
125 152 });
126 153  
127 154  
... ... @@ -136,6 +163,12 @@
136 163 $('[name=lineSelect]:eq(0)', modal).val(sch.xlBm).trigger('change');
137 164 //左默认路牌
138 165 $('[name=lpName]:eq(0)', modal).val(sch.lpName).trigger('change');
  166 +
  167 +
  168 + //右默认线路路牌
  169 + $('[name=lineSelect]:eq(1)', modal).val(sch.xlBm).trigger('change');
  170 + //右默认路牌
  171 + $('[name=lpName]:eq(1)', modal).val(sch.lpName).trigger('change');
139 172 });
140 173  
141 174 //选中事件
... ... @@ -148,25 +181,62 @@
148 181 cancelActiveDl(dl);
149 182 });
150 183  
151   - $(modal).on('click', '.sch-list dl', function (e) {
  184 + $(modal).on('click', '.sch-list .ct_table_body dl', function (e) {
152 185 e.stopPropagation();
153   - var cbox = $(this).find('input[type=checkbox]')[0];
154   - if (!$(this).hasClass('active')) {
  186 + if (!$(this).hasClass('active'))
155 187 activeDl($(this));
156   - cbox.checked = true;
157   - }
158   - else {
  188 + else
159 189 cancelActiveDl($(this));
160   - cbox.checked = false;
161   - }
  190 +
  191 + disabledSubmitBtnByBalance();
162 192 });
163 193  
164 194 function activeDl(dl) {
165 195 dl.addClass('active');
  196 + dl.find('input[type=checkbox]')[0].checked = true;
166 197 }
167 198  
168 199 function cancelActiveDl(dl) {
169 200 dl.removeClass('active');
  201 + dl.find('input[type=checkbox]')[0].checked = false;
  202 + }
  203 +
  204 + function disabledSubmitBtn() {
  205 + //同一个路牌不能对调
  206 + var leftLP = $('[name=lineSelect]:eq(0)', modal).val() + '_' + $('[name=lpName]:eq(0)', modal).val();
  207 + var rightLP = $('[name=lineSelect]:eq(1)', modal).val() + '_' + $('[name=lpName]:eq(1)', modal).val();
  208 + var $submitBtn = $('button[type=submit]', modal);
  209 + if(leftLP == rightLP)
  210 + $submitBtn.attr('disabled', 'disabled');
  211 + else
  212 + $submitBtn.removeAttr('disabled');
  213 + }
  214 +
  215 + function disabledSubmitBtnByBalance() {
  216 + var leftSize = $('.sch-list:eq(0) dl.active', modal).length;
  217 + var rightSize = $('.sch-list:eq(1) dl.active', modal).length;
  218 + var $submitBtn = $('button[type=submit]', modal);
  219 + if(leftSize != rightSize)
  220 + $submitBtn.attr('disabled', 'disabled');
  221 + else if(leftSize != 0)
  222 + $submitBtn.removeAttr('disabled');
  223 + }
  224 +
  225 + //全选
  226 + $('.global_box', modal).on('click', function () {
  227 + var $table = $(this).parents('.ct_table.sch-list');
  228 + globalSelected($table, this.checked?1:-1);
  229 + });
  230 +
  231 + function globalSelected($tab, status) {
  232 + var dls = $tab.find('.ct_table_body dl');
  233 +
  234 + dls.each(function () {
  235 + if(status == 1)
  236 + activeDl($(this));
  237 + else
  238 + cancelActiveDl($(this));
  239 + });
170 240 }
171 241 })();
172 242 </script>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -177,8 +177,7 @@ var gb_schedule_context_menu = (function () {
177 177 },
178 178 'sep3': '---------',
179 179 'lp_change': {
180   - name: '路牌对调',
181   - disabled: true
  180 + name: '路牌对调'
182 181 }
183 182 }
184 183 });
... ...