Commit 1d9075fd8406b5710ccb0ab952f995e21b1b8ec7

Authored by 潘钊
1 parent 668bce79

update...

src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
@@ -220,12 +220,12 @@ public class InStationProcess { @@ -220,12 +220,12 @@ public class InStationProcess {
220 private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next) { 220 private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next) {
221 LineConfig config = lineConfigData.get(sch.getXlBm()); 221 LineConfig config = lineConfigData.get(sch.getXlBm());
222 //限定出站既出场的停车场 222 //限定出站既出场的停车场
223 - String park = config.getTwinsPark();  
224 - boolean limitPark = StringUtils.isNotEmpty(park); 223 + List<String> parks = config.findTwinsParkList();
  224 + boolean limitPark = null != parks && parks.size() > 0;
225 225
226 226
227 if (next.getBcType().equals("in") && config.getOutConfig() == 2 && isEmptyMileage(next) 227 if (next.getBcType().equals("in") && config.getOutConfig() == 2 && isEmptyMileage(next)
228 - && (!limitPark || park.equals(next.getZdzCode()))) { 228 + && (!limitPark || parks.contains(next.getZdzCode()))) {
229 229
230 endSch(next, sch.getZdsjActualTime()); 230 endSch(next, sch.getZdsjActualTime());
231 231
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
@@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory; @@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
16 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.stereotype.Component; 17 import org.springframework.stereotype.Component;
18 18
  19 +import java.util.List;
  20 +
19 /** 21 /**
20 * 车辆出站处理程序 22 * 车辆出站处理程序
21 * Created by panzhao on 2017/11/16. 23 * Created by panzhao on 2017/11/16.
@@ -159,14 +161,14 @@ public class OutStationProcess { @@ -159,14 +161,14 @@ public class OutStationProcess {
159 try { 161 try {
160 LineConfig config = lineConfigData.get(sch.getXlBm()); 162 LineConfig config = lineConfigData.get(sch.getXlBm());
161 //限定出站既出场的停车场 163 //限定出站既出场的停车场
162 - String park = config.getTwinsPark();  
163 - boolean limitPark = StringUtils.isNotEmpty(park); 164 + List<String> parks = config.findTwinsParkList();
  165 + boolean limitPark = null != parks && parks.size() > 0;
164 166
165 if (config != null && config.getOutConfig() == 2) { 167 if (config != null && config.getOutConfig() == 2) {
166 //出站既出场 168 //出站既出场
167 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); 169 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
168 if (isOut(schPrev) && isEmptyMileage(schPrev) 170 if (isOut(schPrev) && isEmptyMileage(schPrev)
169 - && (!limitPark || park.equals(schPrev.getQdzCode()))) { 171 + && (!limitPark || parks.contains(schPrev.getQdzCode()))) {
170 172
171 endSch(schPrev, sch.getFcsjActualTime()); 173 endSch(schPrev, sch.getFcsjActualTime());
172 174
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -610,8 +610,8 @@ public class DayOfSchedule { @@ -610,8 +610,8 @@ public class DayOfSchedule {
610 outConfig = config.getOutConfig(); 610 outConfig = config.getOutConfig();
611 611
612 //限定出站既出场的停车场 612 //限定出站既出场的停车场
613 - String park = config.getTwinsPark();  
614 - boolean limitPark = StringUtils.isNotEmpty(park); 613 + List<String> parks = config.findTwinsParkList();
  614 + boolean limitPark = null != parks && parks.size() > 0;
615 boolean flag = false; 615 boolean flag = false;
616 ScheduleRealInfo next = null; 616 ScheduleRealInfo next = null;
617 for (ScheduleRealInfo temp : list) { 617 for (ScheduleRealInfo temp : list) {
@@ -625,7 +625,7 @@ public class DayOfSchedule { @@ -625,7 +625,7 @@ public class DayOfSchedule {
625 625
626 //出站既出场,忽略出场班次 626 //出站既出场,忽略出场班次
627 if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0)) 627 if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0))
628 - && (!limitPark || park.equals(temp.getQdzCode()))) 628 + && (!limitPark || parks.contains(temp.getQdzCode())))
629 continue; 629 continue;
630 630
631 if (flag) { 631 if (flag) {
@@ -672,8 +672,8 @@ public class DayOfSchedule { @@ -672,8 +672,8 @@ public class DayOfSchedule {
672 outConfig = config.getOutConfig(); 672 outConfig = config.getOutConfig();
673 673
674 //限定出站既出场的停车场 674 //限定出站既出场的停车场
675 - String park = config.getTwinsPark();  
676 - boolean limitPark = StringUtils.isNotEmpty(park); 675 + List<String> parks = config.findTwinsParkList();
  676 + boolean limitPark = null != parks && parks.size() > 0;
677 boolean flag = false; 677 boolean flag = false;
678 ScheduleRealInfo next = null; 678 ScheduleRealInfo next = null;
679 for (ScheduleRealInfo temp : list) { 679 for (ScheduleRealInfo temp : list) {
@@ -684,7 +684,7 @@ public class DayOfSchedule { @@ -684,7 +684,7 @@ public class DayOfSchedule {
684 684
685 //出站既出场,忽略出场班次 685 //出站既出场,忽略出场班次
686 if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0)) 686 if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0))
687 - && (!limitPark || park.equals(temp.getQdzCode()))) 687 + && (!limitPark || parks.contains(temp.getQdzCode())))
688 continue; 688 continue;
689 689
690 if (flag) { 690 if (flag) {
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
@@ -213,12 +213,12 @@ public class SchAttrCalculator { @@ -213,12 +213,12 @@ public class SchAttrCalculator {
213 213
214 int outConfig = -1; 214 int outConfig = -1;
215 //限定出站既出场的停车场 215 //限定出站既出场的停车场
216 - String park = null; 216 + List<String> parks = null;
217 if (conf != null) { 217 if (conf != null) {
218 outConfig = conf.getOutConfig(); 218 outConfig = conf.getOutConfig();
219 - park = conf.getTwinsPark(); 219 + parks = conf.findTwinsParkList();
220 } 220 }
221 - boolean limitPark = StringUtils.isNotEmpty(park); 221 + boolean limitPark = null != parks && parks.size() > 0;
222 222
223 ScheduleRealInfo sch, prev = null; 223 ScheduleRealInfo sch, prev = null;
224 for(int i = list.size() - 1; i >= 0; i --){ 224 for(int i = list.size() - 1; i >= 0; i --){
@@ -226,7 +226,7 @@ public class SchAttrCalculator { @@ -226,7 +226,7 @@ public class SchAttrCalculator {
226 226
227 //如果是出站既出场,忽略出场班次 227 //如果是出站既出场,忽略出场班次
228 if (outConfig == 2 && sch.getBcType().equals("out") 228 if (outConfig == 2 && sch.getBcType().equals("out")
229 - && (!limitPark || park.equals(sch.getQdzCode())) 229 + && (!limitPark || parks.contains(sch.getQdzCode()))
230 && (sch.getBcsj()==0 || sch.getJhlcOrig().intValue()==0)) 230 && (sch.getBcsj()==0 || sch.getJhlcOrig().intValue()==0))
231 continue; 231 continue;
232 232
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
1 package com.bsth.entity.realcontrol; 1 package com.bsth.entity.realcontrol;
2 2
3 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
  4 +import com.google.common.base.Splitter;
  5 +import org.apache.commons.lang3.StringUtils;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
4 8
5 import javax.persistence.*; 9 import javax.persistence.*;
  10 +import java.util.List;
6 11
7 /** 12 /**
8 * 13 *
@@ -34,11 +39,11 @@ public class LineConfig { @@ -34,11 +39,11 @@ public class LineConfig {
34 /** 出场时间设置 0:真实出场(设备离开缓冲区时间) 1:请求出场时间 2:出站即出场 */ 39 /** 出场时间设置 0:真实出场(设备离开缓冲区时间) 1:请求出场时间 2:出站即出场 */
35 private int outConfig; 40 private int outConfig;
36 41
37 - /** 出站既出场 对应的停车场 */  
38 - private String twinsPark; 42 + /** 出站既出场 对应的停车场 , 号分割多个*/
  43 + private String twinsParks;
39 44
40 /** 出站既出场 对应的起点站 */ 45 /** 出站既出场 对应的起点站 */
41 - private String twinsStation; 46 + private String twinsStations;
42 47
43 /** 调度指令模板 */ 48 /** 调度指令模板 */
44 private String schDirectiveTemp; 49 private String schDirectiveTemp;
@@ -169,13 +174,6 @@ public class LineConfig { @@ -169,13 +174,6 @@ public class LineConfig {
169 this.downOutDiff = downOutDiff; 174 this.downOutDiff = downOutDiff;
170 } 175 }
171 176
172 - public String getTwinsPark() {  
173 - return twinsPark;  
174 - }  
175 -  
176 - public void setTwinsPark(String twinsPark) {  
177 - this.twinsPark = twinsPark;  
178 - }  
179 177
180 public String getYjtkStart() { 178 public String getYjtkStart() {
181 return yjtkStart; 179 return yjtkStart;
@@ -217,13 +215,6 @@ public class LineConfig { @@ -217,13 +215,6 @@ public class LineConfig {
217 this.enableYjtk = enableYjtk; 215 this.enableYjtk = enableYjtk;
218 } 216 }
219 217
220 - public String getTwinsStation() {  
221 - return twinsStation;  
222 - }  
223 -  
224 - public void setTwinsStation(String twinsStation) {  
225 - this.twinsStation = twinsStation;  
226 - }  
227 218
228 public boolean isLockFirstOutTime() { 219 public boolean isLockFirstOutTime() {
229 return lockFirstOutTime; 220 return lockFirstOutTime;
@@ -240,4 +231,36 @@ public class LineConfig { @@ -240,4 +231,36 @@ public class LineConfig {
240 public void setAutoExec(boolean autoExec) { 231 public void setAutoExec(boolean autoExec) {
241 this.autoExec = autoExec; 232 this.autoExec = autoExec;
242 } 233 }
  234 +
  235 + public String getTwinsParks() {
  236 + return twinsParks;
  237 + }
  238 +
  239 + public void setTwinsParks(String twinsParks) {
  240 + this.twinsParks = twinsParks;
  241 + }
  242 +
  243 + public String getTwinsStations() {
  244 + return twinsStations;
  245 + }
  246 +
  247 + public void setTwinsStations(String twinsStations) {
  248 + this.twinsStations = twinsStations;
  249 + }
  250 +
  251 +
  252 + @Transient
  253 + Logger logger = LoggerFactory.getLogger(this.getClass());
  254 +
  255 +
  256 + public List<String> findTwinsParkList() {
  257 + try{
  258 + if(StringUtils.isEmpty(this.twinsParks))
  259 + return null;
  260 + return Splitter.on(",").splitToList(this.twinsParks);
  261 + }catch (Exception e){
  262 + logger.error("", e);
  263 + return null;
  264 + }
  265 + }
243 } 266 }
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
@@ -83,8 +83,8 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt; @@ -83,8 +83,8 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
83 83
84 conf.setOutConfig(type); 84 conf.setOutConfig(type);
85 if(type == 2){ 85 if(type == 2){
86 - conf.setTwinsPark(parkCode);  
87 - conf.setTwinsStation(stationCode); 86 + conf.setTwinsParks(parkCode);
  87 + conf.setTwinsStations(stationCode);
88 } 88 }
89 lineConfigData.set(conf); 89 lineConfigData.set(conf);
90 90
@@ -190,8 +190,8 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt; @@ -190,8 +190,8 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
190 Map<String, Object> rs = new HashMap<>(); 190 Map<String, Object> rs = new HashMap<>();
191 try { 191 try {
192 LineConfig conf = lineConfigData.get(lineCode); 192 LineConfig conf = lineConfigData.get(lineCode);
193 - conf.setTwinsPark(twinsPark);  
194 - conf.setTwinsStation(twinsStation); 193 + conf.setTwinsParks(twinsPark);
  194 + conf.setTwinsStations(twinsStation);
195 195
196 lineConfigData.set(conf); 196 lineConfigData.set(conf);
197 197
src/main/resources/static/real_control_v2/css/north.css
@@ -541,4 +541,29 @@ span.sm-grey{ @@ -541,4 +541,29 @@ span.sm-grey{
541 #line_config_entity_wrap .uk-list{ 541 #line_config_entity_wrap .uk-list{
542 display: block; 542 display: block;
543 margin-top: 25px; 543 margin-top: 25px;
  544 +}
  545 +
  546 +.park-and-station-wrap>.c_2_s_list{
  547 + border-bottom: 1px solid #dbdbdb;
  548 + padding-bottom: 15px;
  549 +}
  550 +
  551 +.park-and-station-wrap .add_btn_span{
  552 + border: 1px solid #b4b4b4;
  553 + padding: 5px 16px;
  554 + border-radius: 5px;
  555 + cursor: pointer;
  556 +}
  557 +
  558 +.park-and-station-wrap .add_btn_span:hover{
  559 + background: #ededed;
  560 +}
  561 +
  562 +.park-and-station-wrap .add_btn_span i.uk-icon-plus{
  563 + margin-right: 7px;
  564 +}
  565 +
  566 +
  567 +.park-and-station-wrap .c_2_s_list>.item{
  568 + margin-top: 12px;
544 } 569 }
545 \ No newline at end of file 570 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config_entity.html
@@ -68,7 +68,9 @@ @@ -68,7 +68,9 @@
68 <option {{if outConfig==2}}selected{{/if}} value=2>出站既出场</option> 68 <option {{if outConfig==2}}selected{{/if}} value=2>出站既出场</option>
69 </select> 69 </select>
70 时间作为进出场班次的实际时间 70 时间作为进出场班次的实际时间
71 - <div class="park-and-station-wrap"> 71 + <div class="park-and-station-wrap" style="display: {{outConfig==2?'block':'none'}}">
  72 + <div class="c_2_s_list"></div>
  73 + <span class="add_btn_span"><i class="uk-icon-plus"></i>添加</span>
72 </div> 74 </div>
73 <ul class="uk-list"> 75 <ul class="uk-list">
74 <li> 76 <li>
@@ -108,19 +110,41 @@ @@ -108,19 +110,41 @@
108 </script> 110 </script>
109 111
110 <script id="park-and-station-temp" type="text/html"> 112 <script id="park-and-station-temp" type="text/html">
111 - <span>停车场</span>  
112 - <select class="z-depth-input" name="twinsPark">  
113 - {{each parks as p i}}  
114 - <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option>  
115 - {{/each}}  
116 - </select>  
117 - <span>&nbsp;既是站点</span>  
118 - <select class="z-depth-input" name="twinsStation">  
119 - {{each routes as r i}}  
120 - <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}}  
121 - </option>  
122 - {{/each}}  
123 - </select> 113 + <div class="item">
  114 + <span>停车场</span>
  115 + <select class="z-depth-input" name="twinsPark">
  116 + {{each parks as p i}}
  117 + <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option>
  118 + {{/each}}
  119 + </select>
  120 + <span>&nbsp;既是站点</span>
  121 + <select class="z-depth-input" name="twinsStation">
  122 + {{each routes as r i}}
  123 + <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}}
  124 + </option>
  125 + {{/each}}
  126 + </select>
  127 +
  128 +
  129 + </div>
  130 + </script>
  131 +
  132 + <script id="park-and-station-2-temp" type="text/html">
  133 + <div class="item">
  134 + <span>停车场</span>
  135 + <select class="z-depth-input" name="twinsPark">
  136 + {{each parks as p i}}
  137 + <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option>
  138 + {{/each}}
  139 + </select>
  140 + <span>&nbsp;既是站点</span>
  141 + <select class="z-depth-input" name="twinsStation">
  142 + {{each routes as r i}}
  143 + <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}}
  144 + </option>
  145 + {{/each}}
  146 + </select>
  147 + </div>
124 </script> 148 </script>
125 <script> 149 <script>
126 (function () { 150 (function () {
@@ -276,10 +300,10 @@ @@ -276,10 +300,10 @@
276 conf: conf, 300 conf: conf,
277 routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]] 301 routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]]
278 }); 302 });
279 - $panel.html(htmlStr).show(); 303 + $panel.show().find('.c_2_s_list').html(htmlStr);
280 } 304 }
281 else 305 else
282 - $panel.html('').hide(); 306 + $panel.hide().find('.c_2_s_list').empty();
283 307
284 //切换场既是站的,停车场和站点 308 //切换场既是站的,停车场和站点
285 $('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation); 309 $('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation);
@@ -322,6 +346,26 @@ @@ -322,6 +346,26 @@
322 }, '我确定要禁用【' + conf.line.name + '】的自动执行', true); 346 }, '我确定要禁用【' + conf.line.name + '】的自动执行', true);
323 } 347 }
324 } 348 }
  349 +
  350 + /**
  351 + * 添加新的 场既是站
  352 + */
  353 + $(wrap).on('click', '.add_btn_span', function () {
  354 + var htmlStr = '',
  355 + $panel = $('.park-and-station-2-wrap', wrap);
  356 + if (conf['outConfig'] == 2) {
  357 + htmlStr = template('park-and-station-temp', {
  358 + parks: parks,
  359 + conf: conf,
  360 + routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]]
  361 + });
  362 + $('.c_2_s_list', $panel).append(htmlStr);
  363 + }
  364 +
  365 + //切换场既是站的,停车场和站点
  366 + //$('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation);
  367 + //$('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation);
  368 + });
325 })(); 369 })();
326 </script> 370 </script>
327 </div> 371 </div>
328 \ No newline at end of file 372 \ No newline at end of file