| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.zy.acs.common.utils.News; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | List<String> availableAgvNos = this.getAvailableAgvNos(agvAreaDispatcher.getAgvIdsByTask(task), false); |
| | | // List<String> availableAgvNos = this.getAvailableAgvNos(null); |
| | | if (Cools.isEmpty(availableAgvNos)) { |
| | | // log.warn("No available agv to assign the task[{}]", task.getSeqNum()); |
| | | // News.warn("No available agv to assign the task[{}]", task.getSeqNum()); |
| | | return null; |
| | | } |
| | | |
| | |
| | | |
| | | // valid |
| | | if (Cools.isEmpty(availableAgvNosByOriLane)) { |
| | | log.warn("No available agv to assign the task origin[{}]", task.getSeqNum()); |
| | | News.warn("No available agv to assign the task origin[{}]", task.getSeqNum()); |
| | | return null; |
| | | } |
| | | if (Cools.isEmpty(availableAgvNosByDestLane)) { |
| | | log.warn("No available agv to assign the task destination[{}]", task.getSeqNum()); |
| | | News.warn("No available agv to assign the task destination[{}]", task.getSeqNum()); |
| | | return null; |
| | | } |
| | | List<String> actualAvailableAgvNos = Cools.getIntersection(availableAgvNosByOriLane, availableAgvNosByDestLane); |
| | | if (Cools.isEmpty(actualAvailableAgvNos)) { |
| | | log.warn("No available agv to assign the task[{}]", task.getSeqNum()); |
| | | News.warn("No available agv to assign the task[{}]", task.getSeqNum()); |
| | | return null; |
| | | } |
| | | |