Commit bfa472d9f5de1ae2c214fd5e1f5158f289fdd8ba

Authored by 潘钊
1 parent 833d3521

update...

src/main/java/com/bsth/data/in_out/RealInoutHandler.java
@@ -70,7 +70,7 @@ public class RealInoutHandler { @@ -70,7 +70,7 @@ public class RealInoutHandler {
70 if(cio.getType() == 2 || cio.getType() == 4) 70 if(cio.getType() == 2 || cio.getType() == 4)
71 psts.add(cio); 71 psts.add(cio);
72 72
73 - if (cio.getType() == 2) 73 + if (cio.getType() == 2 || cio.getType() == 1)//待进 和 实进
74 busIn(cio); //公交车进场 74 busIn(cio); //公交车进场
75 else if (cio.getType() == 4) 75 else if (cio.getType() == 4)
76 busOut(cio); //公交车出场 76 busOut(cio); //公交车出场
@@ -91,8 +91,11 @@ public class RealInoutHandler { @@ -91,8 +91,11 @@ public class RealInoutHandler {
91 if (StringUtils.isEmpty(nbbm)) 91 if (StringUtils.isEmpty(nbbm))
92 return; 92 return;
93 93
  94 +
94 //车辆已经在泊位上,先移除(可能没有出场信号) 95 //车辆已经在泊位上,先移除(可能没有出场信号)
95 if(car2berthMap.containsKey(nbbm)){ 96 if(car2berthMap.containsKey(nbbm)){
  97 + if(cio.getType()==1)//待进
  98 + return;
96 car2berthMap.remove(nbbm); 99 car2berthMap.remove(nbbm);
97 } 100 }
98 Bus bus = BusDataBuffer.findOne(nbbm); 101 Bus bus = BusDataBuffer.findOne(nbbm);
@@ -105,7 +108,12 @@ public class RealInoutHandler { @@ -105,7 +108,12 @@ public class RealInoutHandler {
105 //是否有固定泊位 108 //是否有固定泊位
106 String lockBName = BerthDataBuffer.getLockBerthName(nbbm); 109 String lockBName = BerthDataBuffer.getLockBerthName(nbbm);
107 if(StringUtils.isNotEmpty(lockBName)){ 110 if(StringUtils.isNotEmpty(lockBName)){
108 - car2berthMap.put(nbbm, lockBName); 111 + if(cio.getType()==2)
  112 + car2berthMap.put(nbbm, lockBName);
  113 + else {
  114 + //泊位引导
  115 + LedHttpPushHandler.busIn(bus.getCarPlate(), lockBName);
  116 + }
109 } 117 }
110 else{ 118 else{
111 //停空闲泊位 119 //停空闲泊位
@@ -122,17 +130,20 @@ public class RealInoutHandler { @@ -122,17 +130,20 @@ public class RealInoutHandler {
122 break; 130 break;
123 } 131 }
124 if(null != free){ 132 if(null != free){
125 - car2berthMap.put(nbbm, free.getName()); 133 + if(cio.getType()==2)
  134 + car2berthMap.put(nbbm, free.getName());
  135 + else{
  136 + //泊位引导
  137 + LedHttpPushHandler.busIn(nbbm, free.getName());
  138 + }
126 } 139 }
127 else 140 else
128 logger.info("没有空余泊位了"); 141 logger.info("没有空余泊位了");
129 } 142 }
130 143
131 - if(car2berthMap.containsKey(nbbm))  
132 - LedHttpPushHandler.busIn(bus.getCarPlate(), car2berthMap.get(nbbm));  
133 -  
134 //通知客户端 144 //通知客户端
135 - sendUtils.sendCarIn(nbbm, car2berthMap.get(nbbm), cio.getT()); 145 + if(cio.getType() == 2)
  146 + sendUtils.sendCarIn(nbbm, car2berthMap.get(nbbm), cio.getT());
136 } 147 }
137 148
138 private void addPlanFiled(CarInOutEntity cio, ScheduleInOut sch) { 149 private void addPlanFiled(CarInOutEntity cio, ScheduleInOut sch) {