Commit d7f18bb46ae93c89c2015f65b7a2e6eb127df4d9
1 parent
f47326ac
车辆换线路后班次刷新后,重新加载车辆执行班次
Showing
2 changed files
with
10 additions
and
1 deletions
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -241,7 +241,7 @@ public class DayOfSchedule { |
| 241 | 241 | * @Title: searchAllCars |
| 242 | 242 | * @Description: TODO(搜索班次集合中的车辆) |
| 243 | 243 | */ |
| 244 | - private Set<String> searchAllCars(List<ScheduleRealInfo> list) { | |
| 244 | + public Set<String> searchAllCars(List<ScheduleRealInfo> list) { | |
| 245 | 245 | Set<String> cars = new HashSet<>(); |
| 246 | 246 | for (ScheduleRealInfo sch : list) |
| 247 | 247 | cars.add(sch.getClZbh()); | ... | ... |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| ... | ... | @@ -7,12 +7,14 @@ import com.bsth.data.pilot80.PilotReport; |
| 7 | 7 | import com.bsth.data.schedule.DayOfSchedule; |
| 8 | 8 | import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; |
| 9 | 9 | import com.bsth.entity.realcontrol.LineConfig; |
| 10 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 10 | 11 | import org.slf4j.Logger; |
| 11 | 12 | import org.slf4j.LoggerFactory; |
| 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 14 | import org.springframework.stereotype.Component; |
| 14 | 15 | |
| 15 | 16 | import java.util.Collection; |
| 17 | +import java.util.List; | |
| 16 | 18 | import java.util.Set; |
| 17 | 19 | |
| 18 | 20 | /** |
| ... | ... | @@ -73,6 +75,13 @@ public class ScheduleRefreshThread extends Thread{ |
| 73 | 75 | //重载排班数据 |
| 74 | 76 | dayOfSchedule.reloadSch(lineCode, currSchDate, false); |
| 75 | 77 | logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); |
| 78 | + //重新加载车辆执行班次 | |
| 79 | + List<ScheduleRealInfo> schList = dayOfSchedule.findByLineCode(lineCode); | |
| 80 | + Set<String> cars = dayOfSchedule.searchAllCars(schList); | |
| 81 | + for (String nbbm : cars) { | |
| 82 | + //车辆 ——> 要执行的班次对照 | |
| 83 | + dayOfSchedule.reCalcExecPlan(nbbm); | |
| 84 | + } | |
| 76 | 85 | } |
| 77 | 86 | }catch (Exception e){ |
| 78 | 87 | logger.error("班次更新失败!! -" + lineCode, e); | ... | ... |