|
|
@@ -2,8 +2,13 @@ package top.haijunit.train.simulation;
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import top.haijunit.train.domain.entity.RouteEntity;
|
|
|
+import top.haijunit.train.domain.entity.SelectionEntity;
|
|
|
+import top.haijunit.train.domain.repository.SelectionRepository;
|
|
|
+
|
|
|
+import java.util.LinkedList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author zhanghaijun
|
|
|
@@ -15,7 +20,16 @@ import org.springframework.stereotype.Service;
|
|
|
@RequiredArgsConstructor
|
|
|
public class TrainComputerService {
|
|
|
|
|
|
+ private SelectionRepository selectionRepository;
|
|
|
+
|
|
|
public void run(TrainItem trainItem) {
|
|
|
+ LinkedList<RouteEntity> routeList = TrainSimulationHolder.getRouteList(trainItem.getId());
|
|
|
+ if (routeList!= null &&!routeList.isEmpty()) {
|
|
|
+ // 没有触发进路
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<SelectionEntity> selectionEntities = selectionRepository.findAll();
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|