Commit a423338d17003be5ede9df7703d4a331fd2aae79
1 parent
a683dca8
update
Showing
3 changed files
with
37 additions
and
9 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -163,10 +163,16 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -163,10 +163,16 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 163 | 163 | ||
| 164 | private void outStationAndOutPark(ScheduleRealInfo sch){ | 164 | private void outStationAndOutPark(ScheduleRealInfo sch){ |
| 165 | LineConfig config = lineConfigData.get(sch.getXlBm()); | 165 | LineConfig config = lineConfigData.get(sch.getXlBm()); |
| 166 | + //限定出站既出场的停车场 | ||
| 167 | + String park = config.getTwinsPark(); | ||
| 168 | + boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 169 | + | ||
| 166 | if (config != null && config.getOutConfig() == 2) { | 170 | if (config != null && config.getOutConfig() == 2) { |
| 167 | //出站既出场 | 171 | //出站既出场 |
| 168 | ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | 172 | ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); |
| 169 | - if (schPrev != null && schPrev.getBcType().equals("out")) { | 173 | + if (schPrev != null && schPrev.getBcType().equals("out") |
| 174 | + && (!limitPark || park.equals(schPrev.getQdzCode()))) { | ||
| 175 | + | ||
| 170 | schPrev.setFcsjActualAll(sch.getFcsjActualTime()); | 176 | schPrev.setFcsjActualAll(sch.getFcsjActualTime()); |
| 171 | schPrev.setZdsjActualAll(sch.getFcsjActualTime()); | 177 | schPrev.setZdsjActualAll(sch.getFcsjActualTime()); |
| 172 | 178 | ||
| @@ -296,8 +302,14 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -296,8 +302,14 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 296 | */ | 302 | */ |
| 297 | private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next){ | 303 | private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next){ |
| 298 | LineConfig config = lineConfigData.get(sch.getXlBm()); | 304 | LineConfig config = lineConfigData.get(sch.getXlBm()); |
| 299 | - if (next.getBcType().equals("in") && | ||
| 300 | - config != null && config.getOutConfig() == 2) { | 305 | + //限定出站既出场的停车场 |
| 306 | + String park = config.getTwinsPark(); | ||
| 307 | + boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 308 | + | ||
| 309 | + | ||
| 310 | + if (next.getBcType().equals("in") && config.getOutConfig() == 2 | ||
| 311 | + && (!limitPark || park.equals(next.getZdzCode()))) { | ||
| 312 | + | ||
| 301 | next.setFcsjActualAll(sch.getZdsjActualTime()); | 313 | next.setFcsjActualAll(sch.getZdsjActualTime()); |
| 302 | next.setZdsjActualAll(sch.getZdsjActualTime()); | 314 | next.setZdsjActualAll(sch.getZdsjActualTime()); |
| 303 | 315 |
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| @@ -197,12 +197,22 @@ public class SchAttrCalculator { | @@ -197,12 +197,22 @@ public class SchAttrCalculator { | ||
| 197 | String lineCode = list.get(0).getXlBm(); | 197 | String lineCode = list.get(0).getXlBm(); |
| 198 | LineConfig conf = lineConfigData.get(lineCode); | 198 | LineConfig conf = lineConfigData.get(lineCode); |
| 199 | int outConfig = -1; | 199 | int outConfig = -1; |
| 200 | - if(conf != null) | 200 | + //限定出站既出场的停车场 |
| 201 | + String park = null; | ||
| 202 | + if(conf != null){ | ||
| 201 | outConfig = conf.getOutConfig(); | 203 | outConfig = conf.getOutConfig(); |
| 204 | + park = conf.getTwinsPark(); | ||
| 205 | + } | ||
| 206 | + boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 202 | 207 | ||
| 203 | for(ScheduleRealInfo sch : list){ | 208 | for(ScheduleRealInfo sch : list){ |
| 204 | //如果是出站既出场,忽略出场班次 | 209 | //如果是出站既出场,忽略出场班次 |
| 205 | - if(outConfig == 2 && sch.getBcType().equals("out")) | 210 | + if(outConfig == 2 && sch.getBcType().equals("out") |
| 211 | + && (!limitPark || park.equals(sch.getQdzCode()))) | ||
| 212 | + continue; | ||
| 213 | + | ||
| 214 | + //忽略烂班 | ||
| 215 | + if(sch.isDestroy()) | ||
| 206 | continue; | 216 | continue; |
| 207 | 217 | ||
| 208 | //已执行 | 218 | //已执行 |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -203,7 +203,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -203,7 +203,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 203 | try { | 203 | try { |
| 204 | List<String> idList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(idsStr)); | 204 | List<String> idList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(idsStr)); |
| 205 | 205 | ||
| 206 | - ScheduleRealInfo schedule = null, execSch, next; | 206 | + ScheduleRealInfo schedule = null, next; |
| 207 | for (String id : idList) { | 207 | for (String id : idList) { |
| 208 | schedule = dayOfSchedule.get(Long.parseLong(id)); | 208 | schedule = dayOfSchedule.get(Long.parseLong(id)); |
| 209 | if (schedule.isDestroy()) { | 209 | if (schedule.isDestroy()) { |
| @@ -219,14 +219,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -219,14 +219,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 219 | dayOfSchedule.save(schedule); | 219 | dayOfSchedule.save(schedule); |
| 220 | rsList.add(schedule); | 220 | rsList.add(schedule); |
| 221 | 221 | ||
| 222 | - //如果正在执行当前班次,跳下一个班次 | 222 | + /*//如果正在执行当前班次,跳下一个班次 |
| 223 | execSch = dayOfSchedule.executeCurr(schedule.getClZbh()); | 223 | execSch = dayOfSchedule.executeCurr(schedule.getClZbh()); |
| 224 | if(execSch != null && execSch.getId().equals(schedule.getId())){ | 224 | if(execSch != null && execSch.getId().equals(schedule.getId())){ |
| 225 | next = dayOfSchedule.next(schedule); | 225 | next = dayOfSchedule.next(schedule); |
| 226 | dayOfSchedule.addExecPlan(next); | 226 | dayOfSchedule.addExecPlan(next); |
| 227 | - } | 227 | + }*/ |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | + //重新计算当前执行班次 | ||
| 231 | + dayOfSchedule.reCalcExecPlan(schedule.getClZbh()); | ||
| 232 | + | ||
| 230 | map.put("status", ResponseCode.SUCCESS); | 233 | map.put("status", ResponseCode.SUCCESS); |
| 231 | } catch (Exception e) { | 234 | } catch (Exception e) { |
| 232 | logger.error("", e); | 235 | logger.error("", e); |
| @@ -368,8 +371,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -368,8 +371,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 368 | //更新起点应到时间 | 371 | //更新起点应到时间 |
| 369 | List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(t.getClZbh()); | 372 | List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(t.getClZbh()); |
| 370 | 373 | ||
| 374 | + //重新计算车辆当前执行班次 | ||
| 375 | + dayOfSchedule.reCalcExecPlan(t.getClZbh()); | ||
| 371 | 376 | ||
| 372 | - rs.put("ts", ts); | 377 | + |
| 378 | + rs.put("ts", ts); | ||
| 373 | rs.put("t", t); | 379 | rs.put("t", t); |
| 374 | } catch (Exception e) { | 380 | } catch (Exception e) { |
| 375 | logger.error("", e); | 381 | logger.error("", e); |