From 947d49b8fda185f680375bb4b65303f751fdade4 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期五, 28 二月 2025 08:44:50 +0800 Subject: [PATCH] #优化 代码优化 --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java index 8401402..9179179 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java @@ -74,10 +74,17 @@ */ @PostMapping("/mat/auth") public R getProductForBarcode(@RequestBody Map<String, String> barcode) { + if (Objects.isNull(barcode)) { + return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } if (StringUtil.isNullOrEmpty(barcode.get("barcode"))) { return R.error("鏉$爜涓嶈兘涓虹┖锛侊紒"); } Order order = orderService.selectByBarcode(barcode.get("barcode")); + + if (Objects.isNull(order)) { + return R.error("璁㈠崟涓嶅瓨鍦紒"); + } List<OrderInfoDto> orders = orderService.getDetlForOrderId(order.getId()); @@ -240,7 +247,7 @@ throw new CoolException("璇锋眰鍙傛暟涓嶈兘涓虹┖锛侊紒"); } if (Objects.isNull(param.get("barcode"))) { - throw new CoolException("瀹瑰櫒缂栫爜涓嶈兘涓虹┖"); + throw new CoolException("鎾澧欏鍣ㄧ紪鐮佷笉鑳戒负绌�"); } if (Objects.isNull(param.get("orderNo"))) { throw new CoolException("璁㈠崟缂栧彿涓嶈兘涓虹┖锛侊紒"); -- Gitblit v1.9.1