Commit 46299dc848ef97e888a3de23cf6410a0f93e0b82

Authored by 潘钊
1 parent 1c9476a8

update...

src/main/java/com/bsth/data/gpsdata/arrival/utils/SignalSchPlanMatcher.java
... ... @@ -46,6 +46,16 @@ public class SignalSchPlanMatcher {
46 46 return;
47 47 }
48 48 }
  49 +
  50 + //线路编码不匹配
  51 + if("out".equals(sch.getBcType()) && !sch.getXlBm().equals(outSigal.getLineId())){
  52 + ScheduleRealInfo nextOut = dayOfSchedule.nextByBcType(sch, "out");
  53 + if(nextOut != null && nextOut.getXlBm().equals(outSigal.getLineId())
  54 + && fcSpace(sch, outSigal) > fcSpace(nextOut, outSigal)){
  55 + dayOfSchedule.addExecPlan(nextOut);
  56 + return;
  57 + }
  58 + }
49 59 }catch (Exception e){
50 60 log.error("", e);
51 61 }
... ... @@ -63,4 +73,8 @@ public class SignalSchPlanMatcher {
63 73 outMatch(outSigal, next);
64 74 }
65 75 }
  76 +
  77 + public static int fcSpace(ScheduleRealInfo sch, GpsEntity gps){
  78 + return (int) Math.abs((sch.getDfsjT() - gps.getTimestamp()));
  79 + }
66 80 }
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -790,12 +790,13 @@ public class DayOfSchedule {
790 790  
791 791 boolean flag = false;
792 792 for(ScheduleRealInfo temp : list){
793   - if(temp == sch){
794   - flag = true;
795   - }
796 793  
797 794 if(flag && temp.getBcType().equals(bcType))
798 795 return temp;
  796 +
  797 + if(temp == sch){
  798 + flag = true;
  799 + }
799 800 }
800 801 return null;
801 802 }
... ...