From e3001bc043c5ef77477db687d4fdd2716e7d7cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LI-CCONG=5C=E6=9D=8E=E8=81=AA=E8=81=AA?= <1441652193@qq.com> Date: Wed, 27 Mar 2024 14:20:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E7=82=B9=E3=80=81=E5=88=B0=E7=AB=99?= =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=AE=A2=E5=8D=95=E4=B8=9A=E5=8A=A1=E5=8A=9F?= =?UTF-8?q?=E8=83=BDbug=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8Dv2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/BusinessLogicException.java | 17 +++++++++ .../controller/RecycleOrderController.java | 2 +- .../service/impl/RecycleOrderServiceImpl.java | 37 ++++++++++--------- 3 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 nxhs-common/src/main/java/cc/yunxi/common/exception/BusinessLogicException.java diff --git a/nxhs-common/src/main/java/cc/yunxi/common/exception/BusinessLogicException.java b/nxhs-common/src/main/java/cc/yunxi/common/exception/BusinessLogicException.java new file mode 100644 index 0000000..5879a7f --- /dev/null +++ b/nxhs-common/src/main/java/cc/yunxi/common/exception/BusinessLogicException.java @@ -0,0 +1,17 @@ +package cc.yunxi.common.exception; + +// 业务异常类 +public class BusinessLogicException extends CommonException{ + + public BusinessLogicException(String message) { + super(message, 410); + } + + public BusinessLogicException(String message, Throwable cause) { + super(message, cause, 410); + } + + public BusinessLogicException(Throwable cause) { + super(cause, 410); + } +} diff --git a/nxhs-service/src/main/java/cc/yunxi/controller/RecycleOrderController.java b/nxhs-service/src/main/java/cc/yunxi/controller/RecycleOrderController.java index 5ffc6aa..d65c9df 100644 --- a/nxhs-service/src/main/java/cc/yunxi/controller/RecycleOrderController.java +++ b/nxhs-service/src/main/java/cc/yunxi/controller/RecycleOrderController.java @@ -297,7 +297,7 @@ public class RecycleOrderController { Collectors.toMap(ClientAddressSimpleVO::getId, v -> v, (k1, k2) -> k1)); orderRespVOList.forEach(v -> { String clientAddressId = (String) CommonUtil.obtainField(v, "clientAddressId"); - CommonUtil.assignField(v, "clientAddressId", clientAddressId); + CommonUtil.assignField(v, "addressInfo", clientAddressMap.get(clientAddressId)); }); } } diff --git a/nxhs-service/src/main/java/cc/yunxi/service/impl/RecycleOrderServiceImpl.java b/nxhs-service/src/main/java/cc/yunxi/service/impl/RecycleOrderServiceImpl.java index e210939..a6f3a85 100644 --- a/nxhs-service/src/main/java/cc/yunxi/service/impl/RecycleOrderServiceImpl.java +++ b/nxhs-service/src/main/java/cc/yunxi/service/impl/RecycleOrderServiceImpl.java @@ -2,6 +2,7 @@ package cc.yunxi.service.impl; import cc.yunxi.common.domain.LambdaQueryWrapperX; import cc.yunxi.common.exception.BizIllegalException; +import cc.yunxi.common.exception.BusinessLogicException; import cc.yunxi.common.exception.ForbiddenException; import cc.yunxi.common.utils.BeanUtils; import cc.yunxi.common.utils.CommonUtil; @@ -140,7 +141,7 @@ public class RecycleOrderServiceImpl extends ServiceImpl 0) { // 大于0.1km - throw new BizIllegalException("未到达!"); + throw new BusinessLogicException("未到达!"); } recycleOrder = BeanUtils.copyBean(orderReachVO, RecycleOrder.class); ; @@ -357,10 +358,10 @@ public class RecycleOrderServiceImpl extends ServiceImpl recycleOrderProductVOList = orderFinishVO.getOrderDetails(); @@ -369,7 +370,7 @@ public class RecycleOrderServiceImpl extends ServiceImpl