Commit 2d6cdf9acf2b140a13e036c8afb34276b9055805
1 parent
c13b906b
update
Showing
1 changed file
with
12 additions
and
0 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/CorrectSignalHandle.java
| @@ -6,6 +6,9 @@ import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | @@ -6,6 +6,9 @@ import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | ||
| 6 | import com.bsth.data.schedule.DayOfSchedule; | 6 | import com.bsth.data.schedule.DayOfSchedule; |
| 7 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 7 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 9 | +import com.bsth.service.directive.DirectiveService; | ||
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.stereotype.Component; | 13 | import org.springframework.stereotype.Component; |
| 11 | 14 | ||
| @@ -18,6 +21,10 @@ public class CorrectSignalHandle extends SignalHandle { | @@ -18,6 +21,10 @@ public class CorrectSignalHandle extends SignalHandle { | ||
| 18 | 21 | ||
| 19 | @Autowired | 22 | @Autowired |
| 20 | DayOfSchedule dayOfSchedule; | 23 | DayOfSchedule dayOfSchedule; |
| 24 | + @Autowired | ||
| 25 | + DirectiveService directiveService; | ||
| 26 | + | ||
| 27 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 21 | 28 | ||
| 22 | @Override | 29 | @Override |
| 23 | public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | 30 | public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { |
| @@ -41,6 +48,11 @@ public class CorrectSignalHandle extends SignalHandle { | @@ -41,6 +48,11 @@ public class CorrectSignalHandle extends SignalHandle { | ||
| 41 | gps.setState(0); | 48 | gps.setState(0); |
| 42 | } | 49 | } |
| 43 | 50 | ||
| 51 | + if(gps.getState() != 0){ | ||
| 52 | + logger.info(gps.getNbbm() + " 纠正状态到营运"); | ||
| 53 | + //切换到营运状态 | ||
| 54 | + directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "纠正@系统"); | ||
| 55 | + } | ||
| 44 | 56 | ||
| 45 | return true; | 57 | return true; |
| 46 | } | 58 | } |