| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class TransferStationHandler { |
| | | |
| | | private static final long LOAD_DELAY_MS = 60000L; // load ( inbound ) delay timeout |
| | | private static final long PLACE_DELAY_MS = 15000L; // place ( outbound ) delay timeout |
| | | private static final int DEFAULT_LOAD_DELAY_MS = 1000; // load ( inbound ) delay timeout |
| | | private static final int DEFAULT_PLACE_DELAY_MS = 15000; // place ( outbound ) delay timeout |
| | | |
| | | @Autowired |
| | | private SegmentService segmentService; |
| | |
| | | if (prePosType.equals(TaskPosDto.PosType.ORI_STA)) { |
| | | |
| | | // 背篓未满才等 |
| | | Integer backpack = agvService.getBackpack(agvId); |
| | | List<Integer> usedBackpacks = segmentService.selectUsedBackpacks(currSeg.getTravelId(), agvId); // todo:vincent 拿不到数据 |
| | | if (usedBackpacks.size() >= backpack) { |
| | | Integer backpackCap = agvService.getBackpack(agvId); |
| | | List<Integer> usedBackpacks = segmentService.selectUsedBackpacks(currSeg.getTravelId(), agvId); |
| | | if (usedBackpacks.size() >= backpackCap) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | // } |
| | | |
| | | // timeout |
| | | return (now - preEndTime) < LOAD_DELAY_MS; |
| | | return (now - preEndTime) < Optional.ofNullable(rollerSta.getInboundWait()).orElse(DEFAULT_LOAD_DELAY_MS); |
| | | } |
| | | |
| | | // outbound |
| | |
| | | // } |
| | | |
| | | // timeout |
| | | return (now - preEndTime) < PLACE_DELAY_MS; |
| | | return (now - preEndTime) < Optional.ofNullable(rollerSta.getOutboundWait()).orElse(DEFAULT_PLACE_DELAY_MS); |
| | | } |
| | | |
| | | return false; |