Commit a423338d17003be5ede9df7703d4a331fd2aae79

Authored by 潘钊
1 parent a683dca8

update

src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
... ... @@ -163,10 +163,16 @@ public class InOutStationSignalHandle extends SignalHandle{
163 163  
164 164 private void outStationAndOutPark(ScheduleRealInfo sch){
165 165 LineConfig config = lineConfigData.get(sch.getXlBm());
  166 + //限定出站既出场的停车场
  167 + String park = config.getTwinsPark();
  168 + boolean limitPark = StringUtils.isNotEmpty(park);
  169 +
166 170 if (config != null && config.getOutConfig() == 2) {
167 171 //出站既出场
168 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 176 schPrev.setFcsjActualAll(sch.getFcsjActualTime());
171 177 schPrev.setZdsjActualAll(sch.getFcsjActualTime());
172 178  
... ... @@ -296,8 +302,14 @@ public class InOutStationSignalHandle extends SignalHandle{
296 302 */
297 303 private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next){
298 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 313 next.setFcsjActualAll(sch.getZdsjActualTime());
302 314 next.setZdsjActualAll(sch.getZdsjActualTime());
303 315  
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -197,12 +197,22 @@ public class SchAttrCalculator {
197 197 String lineCode = list.get(0).getXlBm();
198 198 LineConfig conf = lineConfigData.get(lineCode);
199 199 int outConfig = -1;
200   - if(conf != null)
  200 + //限定出站既出场的停车场
  201 + String park = null;
  202 + if(conf != null){
201 203 outConfig = conf.getOutConfig();
  204 + park = conf.getTwinsPark();
  205 + }
  206 + boolean limitPark = StringUtils.isNotEmpty(park);
202 207  
203 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 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 203 try {
204 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 207 for (String id : idList) {
208 208 schedule = dayOfSchedule.get(Long.parseLong(id));
209 209 if (schedule.isDestroy()) {
... ... @@ -219,14 +219,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
219 219 dayOfSchedule.save(schedule);
220 220 rsList.add(schedule);
221 221  
222   - //如果正在执行当前班次,跳下一个班次
  222 + /*//如果正在执行当前班次,跳下一个班次
223 223 execSch = dayOfSchedule.executeCurr(schedule.getClZbh());
224 224 if(execSch != null && execSch.getId().equals(schedule.getId())){
225 225 next = dayOfSchedule.next(schedule);
226 226 dayOfSchedule.addExecPlan(next);
227   - }
  227 + }*/
228 228 }
229 229  
  230 + //重新计算当前执行班次
  231 + dayOfSchedule.reCalcExecPlan(schedule.getClZbh());
  232 +
230 233 map.put("status", ResponseCode.SUCCESS);
231 234 } catch (Exception e) {
232 235 logger.error("", e);
... ... @@ -368,8 +371,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
368 371 //更新起点应到时间
369 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 379 rs.put("t", t);
374 380 } catch (Exception e) {
375 381 logger.error("", e);
... ...