| | |
| | | task.setSeqNum(taskDto.getSeqNum()); |
| | | task.setPriority(taskDto.getPriority()); |
| | | |
| | | |
| | | // ori -------------------------- |
| | | if (!Cools.isEmpty(taskDto.getOriLoc())) { |
| | | Loc oriLoc = locService.selecatByLocNo(taskDto.getOriLoc()); |
| | |
| | | // task.setOriCode(oriLoc.getCode()); |
| | | } |
| | | if (!Cools.isEmpty(taskDto.getOriSta())) { |
| | | Sta oriSta = staService.selectByStaNo(taskDto.getOriSta()); |
| | | Sta oriSta = staService.selectByStaNoOrName(taskDto.getOriSta()); |
| | | |
| | | if (null == oriSta) { |
| | | throw new BusinessException("oriSta: " + taskDto.getOriSta() + " doesn't exist!"); |
| | | } |
| | |
| | | task.setDestCode(destLoc.getCode()); |
| | | } |
| | | if (!Cools.isEmpty(taskDto.getDestSta())) { |
| | | Sta destSta = staService.selectByStaNo(taskDto.getDestSta()); |
| | | Sta destSta = staService.selectByStaNoOrName(taskDto.getDestSta()); |
| | | if (null == destSta) { |
| | | throw new BusinessException("destSta: " + taskDto.getDestSta() + " doesn't exist!"); |
| | | } |
| | |
| | | if (null != task.getDestLoc() && null != task.getDestSta()) { |
| | | throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong,either destLoc and destSta must be present"); |
| | | } |
| | | if (null != task.getOriSta()) { |
| | | if (null != task.getDestLoc()) { |
| | | task.setTaskType(TaskTypeType.STA_TO_LOC.val()); |
| | | if (!Cools.isEmpty(taskDto.getTaskType())) { |
| | | task.setTaskType(TaskTypeType.valueOf(taskDto.getTaskType()).val()); |
| | | } else { |
| | | if (null != task.getOriSta()) { |
| | | if (null != task.getDestLoc()) { |
| | | task.setTaskType(TaskTypeType.STA_TO_LOC.val()); |
| | | } |
| | | if (null != task.getDestSta()) { |
| | | task.setTaskType(TaskTypeType.STA_TO_STA.val()); |
| | | } |
| | | } |
| | | if (null != task.getDestSta()) { |
| | | task.setTaskType(TaskTypeType.STA_TO_STA.val()); |
| | | } |
| | | } |
| | | if (null != task.getOriLoc()) { |
| | | if (null != task.getDestLoc()) { |
| | | task.setTaskType(TaskTypeType.LOC_TO_LOC.val()); |
| | | } |
| | | if (null != task.getDestSta()) { |
| | | task.setTaskType(TaskTypeType.LOC_TO_STA.val()); |
| | | if (null != task.getOriLoc()) { |
| | | if (null != task.getDestLoc()) { |
| | | task.setTaskType(TaskTypeType.LOC_TO_LOC.val()); |
| | | } |
| | | if (null != task.getDestSta()) { |
| | | task.setTaskType(TaskTypeType.LOC_TO_STA.val()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | for (Task task : taskList) { |
| | | Code startCode = null; |
| | | Code endCode = null; |
| | | Loc oriLoc = null; Loc destLoc = null; |
| | | Sta oriSta = null; Sta destSta = null; |
| | | Loc oriLoc = null; |
| | | Loc destLoc = null; |
| | | Sta oriSta = null; |
| | | Sta destSta = null; |
| | | List<String> pathList = null; |
| | | switch (Objects.requireNonNull(TaskTypeType.get(task.getTaskTypeEl()))) { |
| | | case LOC_TO_LOC: |