From 6d87095160644a43da8f0f4d5565249e44334b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 26 Mar 2026 11:13:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(shopping):=20=E4=BF=AE=E5=A4=8D=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=AF=86=E7=A0=81=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 当用户未设置查看密码时直接返回验证结果 - 避免未设置密码情况下的空指针异常 - 简化密码验证流程提高代码可读性 --- .../quotation/controller/app/ShoppingController.java | 11 +++++++++-- .../quotation/pojo/vo/ShoppingCartVO.java | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java index 7c521abb..3e1ec635 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java @@ -340,6 +340,13 @@ public class ShoppingController extends ControllerBase { QuotationShoppingCart cart = shoppingCartService.getById(id); VUtils.trueThrowBusinessError(Objects.isNull(cart)).throwMessage("未找到购物车信息"); ShoppingCartVO vo = Convert.convert(ShoppingCartVO.class, cart); + ProductModel model=productModelService.lambdaQuery() + .eq(ProductModel::getState, 1) + .eq(ProductModel::getBatchNumber, cart.getModelId()) + .one(); + if (Objects.nonNull(model)){ + vo.setModelKeyId(model.getId()); + } //获取部件配置 // Long categoryId = getCategoryId(); // List parts = modelConfigService.getEffectives(cart.getConfigId(), cart.getPriceId(), categoryId, MultilingualUtil.getLanguage()); @@ -429,7 +436,7 @@ public class ShoppingController extends ControllerBase { */ @Transactional @PostMapping("/quotation/generate") - public ApiResult generateQuotation(@RequestBody @NotEmpty List cartIds) { + public ApiResult generateQuotation(@RequestBody @NotEmpty List cartIds) { List carts = shoppingCartService.lambdaQuery() .eq(QuotationShoppingCart::getStatus, 0) .eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0) @@ -484,7 +491,7 @@ public class ShoppingController extends ControllerBase { .eq(QuotationShoppingCart::getStatus, 0) .in(QuotationShoppingCart::getId, cartIds) .update(); - return ApiResult.success(); + return ApiResult.success(order.getId()); } /** diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/vo/ShoppingCartVO.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/vo/ShoppingCartVO.java index d27edd91..9b68a5cd 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/vo/ShoppingCartVO.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/vo/ShoppingCartVO.java @@ -25,6 +25,11 @@ public class ShoppingCartVO { */ private Long modelId; + /** + * 机型自增id + */ + private Integer modelKeyId; + /** * 价格id */