From 7f70cb15d035f0c233b9e62b9e43aa985317c908 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 04 十一月 2024 10:22:45 +0800 Subject: [PATCH] # --- zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java | 48 +++++++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 23 deletions(-) diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java index aff806f..bf7d1d3 100644 --- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java +++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java @@ -37,11 +37,11 @@ @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("seqNum涓嶈兘涓虹┖"); + throw new BusinessException("Task seqNum can't be empty!"); } Task task = new Task(); taskList.add(task); @@ -53,22 +53,24 @@ if (!Cools.isEmpty(taskDto.getOriLoc())) { Loc oriLoc = locService.selecatByLocNo(taskDto.getOriLoc()); if (null == oriLoc) { - throw new BusinessException("oriLoc: " + taskDto.getOriLoc() + "涓嶅瓨鍦�"); + 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()); if (null == oriSta) { - throw new BusinessException("oriSta: " + 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())) { Loc destLoc = locService.selecatByLocNo(taskDto.getDestLoc()); if (null == destLoc) { - throw new BusinessException("destLoc: " + taskDto.getDestLoc() + "涓嶅瓨鍦�"); + throw new BusinessException("destLoc: " + taskDto.getDestLoc() + " doesn't exist!"); } task.setDestLoc(destLoc.getId()); task.setDestCode(destLoc.getCode()); @@ -76,7 +78,7 @@ if (!Cools.isEmpty(taskDto.getDestSta())) { Sta destSta = staService.selectByStaNo(taskDto.getDestSta()); if (null == destSta) { - throw new BusinessException("destSta: " + taskDto.getDestSta() + "涓嶅瓨鍦�"); + throw new BusinessException("destSta: " + taskDto.getDestSta() + " doesn't exist!"); } task.setDestSta(destSta.getId()); task.setDestCode(destSta.getCode()); @@ -84,16 +86,16 @@ // task-type ---------------------------------- if (null == task.getOriLoc() && null == task.getOriSta()) { - throw new BusinessException(task.getSeqNum() + " 閿欒锛宱riLoc鍜宱riSta蹇呴』瀛樺湪涓�椤�"); + throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宼here must be at least one of oriLoc and oriSta"); } if (null != task.getOriLoc() && null != task.getOriSta()) { - throw new BusinessException(task.getSeqNum() + " 閿欒锛宱riLoc鍜宱riSta鍙兘瀛樺湪涓�椤�"); + throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宼here must be at least one of oriLoc and oriSta"); } if (null == task.getDestLoc() && null == task.getDestSta()) { - throw new BusinessException(task.getSeqNum() + " 閿欒锛宒estLoc鍜宒estSta蹇呴』瀛樺湪涓�椤�"); + throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宔ither destLoc and destSta must be present"); } if (null != task.getDestLoc() && null != task.getDestSta()) { - throw new BusinessException(task.getSeqNum() + " 閿欒锛宒estLoc鍜宒estSta鍙兘瀛樺湪涓�椤�"); + throw new BusinessException("seNum:" + task.getSeqNum() + " is wrong锛宔ither destLoc and destSta must be present"); } if (null != task.getOriSta()) { if (null != task.getDestLoc()) { @@ -128,14 +130,14 @@ startCode = codeService.getById(oriLoc.getCode()); endCode = codeService.getById(destLoc.getCode()); if (null == startCode) { - throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜"); + throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " hasn't been bound to a QrCode yet"); } if (null == endCode) { - throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜"); + throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " is not bound to a QrCode yet"); } pathList = mapService.validFeasibility(startCode, endCode); if (Cools.isEmpty(pathList)) { - throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riLoc锛�" + task.getOriLoc() + "鏃犳硶琛岃蛋鑷� destLoc" + task.getDestLoc()); + throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riLoc锛�" + task.getOriLoc() + " is unable to reach destLoc" + task.getDestLoc()); } task.setPhase(JSON.toJSONString(pathList)); break; @@ -146,14 +148,14 @@ startCode = codeService.getById(oriLoc.getCode()); endCode = codeService.getById(destSta.getCode()); if (null == startCode) { - throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜"); + throw new BusinessException("oriLoc锛�" + oriLoc.getLocNo() + " hasn't been bound to QrCode yet"); } if (null == endCode) { - throw new BusinessException("destSta锛�" + destSta.getStaNo() + " 鏈粦瀹氬湴闈㈢爜"); + throw new BusinessException("destSta锛�" + destSta.getStaNo() + " is not bound to QrCode yet"); } pathList = mapService.validFeasibility(startCode, endCode); if (Cools.isEmpty(pathList)) { - throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riLoc锛�" + task.getOriLoc() + "鏃犳硶琛岃蛋鑷� destSta" + task.getDestSta()); + throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riLoc锛�" + task.getOriLoc() + " can't move to destSta" + task.getDestSta()); } task.setPhase(JSON.toJSONString(pathList)); break; @@ -164,14 +166,14 @@ startCode = codeService.getById(oriSta.getCode()); endCode = codeService.getById(destLoc.getCode()); if (null == startCode) { - throw new BusinessException("oriSta锛�" + oriSta.getStaNo() + " 鏈粦瀹氬湴闈㈢爜"); + throw new BusinessException("oriSta锛�" + oriSta.getStaNo() + " hasn't bound to QrCode yet"); } if (null == endCode) { - throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " 鏈粦瀹氬湴闈㈢爜"); + throw new BusinessException("destLoc锛�" + destLoc.getLocNo() + " is not bound to QrCode yet"); } pathList = mapService.validFeasibility(startCode, endCode); if (Cools.isEmpty(pathList)) { - throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riSta锛�" + task.getOriSta() + "鏃犳硶琛岃蛋鑷� destLoc" + task.getDestLoc()); + throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riSta锛�" + task.getOriSta() + " is unable to react destLoc" + task.getDestLoc()); } task.setPhase(JSON.toJSONString(pathList)); break; @@ -182,19 +184,19 @@ 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)) { - throw new BusinessException(task.getSeqNum() + "浠诲姟閿欒锛宱riSta锛�" + task.getOriSta() + "鏃犳硶琛岃蛋鑷� destSta" + task.getDestSta()); + throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛宱riSta锛�" + task.getOriSta() + " can't move to destSta" + task.getDestSta()); } task.setPhase(JSON.toJSONString(pathList)); break; default: - throw new BusinessException(task.getSeqNum() + "浠诲姟绫诲瀷閿欒"); + throw new BusinessException("seqNum:" + task.getSeqNum() + " is wrong锛� cause this type not exist"); } } -- Gitblit v1.9.1