| | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | public List<Task> validBusDto(List<TaskDto> taskDtoList) { |
| | | public List<Task> validTaskDtoList(List<TaskDto> taskDtoList) { |
| | | List<Task> taskList = new ArrayList<>(); |
| | | for (TaskDto taskDto : taskDtoList) { |
| | | if (Cools.isEmpty(taskDto.getSeqNum())) { |
| | |
| | | throw new BusinessException("oriLoc: " + taskDto.getOriLoc() + " doesn't exist!"); |
| | | } |
| | | task.setOriLoc(oriLoc.getId()); |
| | | // task.setOriCode(oriLoc.getCode()); |
| | | } |
| | | if (!Cools.isEmpty(taskDto.getOriSta())) { |
| | | Sta oriSta = staService.selectByStaNo(taskDto.getOriSta()); |
| | |
| | | throw new BusinessException("oriSta: " + taskDto.getOriSta() + " doesn't exist!"); |
| | | } |
| | | task.setOriSta(oriSta.getId()); |
| | | // task.setOriCode(oriSta.getCode()); |
| | | } |
| | | // dest -------------------------- |
| | | if (!Cools.isEmpty(taskDto.getDestLoc())) { |
| | |
| | | startCode = codeService.getById(oriSta.getCode()); |
| | | endCode = codeService.getById(destSta.getCode()); |
| | | if (null == startCode) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 未绑定地面码"); |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " hasn't been bound to a QrCode yet"); |
| | | } |
| | | if (null == endCode) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 未绑定地面码"); |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " is not bound to a QrCode yet"); |
| | | } |
| | | pathList = mapService.validFeasibility(startCode, endCode); |
| | | if (Cools.isEmpty(pathList)) { |