| | |
| | | import com.zy.acs.manager.manager.entity.Code; |
| | | import com.zy.acs.manager.manager.service.CodeService; |
| | | import com.zy.acs.manager.manager.service.RouteService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | /** |
| | | * Created by vincent on 10/25/2024 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class LaneService { |
| | | |
| | | public boolean isInitialized = Boolean.FALSE; |
| | | private boolean initialized = Boolean.FALSE; |
| | | |
| | | private final List<Lane> lanes = new ArrayList<>(); |
| | | |
| | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | public Boolean isInitialized() { |
| | | return this.initialized; |
| | | } |
| | | |
| | | public List<String> getLanePoints(String codeData) { |
| | | if (Cools.isEmpty(codeData) || !this.isInitialized) { |
| | | if (Cools.isEmpty(codeData) || !this.initialized) { |
| | | return null; |
| | | } |
| | | for (Lane lane : this.lanes) { |
| | |
| | | |
| | | @PostConstruct |
| | | public synchronized void init() { |
| | | log.info("the rcs system is starting to initialze lane data..."); |
| | | List<Code> codeList = codeService.list(new LambdaQueryWrapper<Code>().eq(Code::getStatus, 1)); |
| | | |
| | | this.fillAdjacencyCodeMap(codeList); |
| | |
| | | |
| | | this.filterLanesWithFewPoints(); |
| | | |
| | | this.isInitialized = Boolean.TRUE; |
| | | this.initialized = Boolean.TRUE; |
| | | log.info("the lane data initialzation has been completed in rcs system."); |
| | | } |
| | | |
| | | private void fillAdjacencyCodeMap(List<Code> codeList) { |