From 24185b09e5a98374b248be4dbf0b341ab561c6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Fri, 13 Mar 2026 19:05:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(quotation):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改AppRatioAgentConfigController中的价格计算逻辑,增加空值检查避免NPE - 更新PlanSearchItemVO中salePrice的计算方法,统一使用NumberUtil.multiply - 注释掉ProductModelMapper.xml中型号编号的查询条件 - 修正QuotationProductModelSearchVO中moduleName字段类型为String - 在PlanSearchItemVO中添加NumberUtil导入声明 --- .../common/pojo/vo/PlanSearchItemVO.java | 6 ++---- .../pojo/vo/QuotationProductModelSearchVO.java | 2 +- .../app/AppRatioAgentConfigController.java | 13 ++++++++----- .../main/resources/mapper/ProductModelMapper.xml | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java index 4a3fdb4e..c7246d98 100644 --- a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java +++ b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java @@ -1,5 +1,6 @@ package com.nflg.mobilebroken.common.pojo.vo; +import com.nflg.mobilebroken.common.util.NumberUtil; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -54,9 +55,6 @@ public class PlanSearchItemVO { private BigDecimal salePrice; public BigDecimal getSalePrice() { - if (Objects.nonNull(standardPrice)) { - return standardPrice.multiply(ratio); - } - return null; + return NumberUtil.multiply(standardPrice,ratio); } } diff --git a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/QuotationProductModelSearchVO.java b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/QuotationProductModelSearchVO.java index 001e878e..796a0d7d 100644 --- a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/QuotationProductModelSearchVO.java +++ b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/QuotationProductModelSearchVO.java @@ -14,7 +14,7 @@ public class QuotationProductModelSearchVO { /** * 模块名称 */ - private Integer moduleName; + private String moduleName; /** * 系列名称 diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/AppRatioAgentConfigController.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/AppRatioAgentConfigController.java index 11697597..eb003bad 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/AppRatioAgentConfigController.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/AppRatioAgentConfigController.java @@ -131,10 +131,13 @@ public class AppRatioAgentConfigController extends ControllerBase { && it.getUserId().equals(user.getId())) .findFirst() .orElse(null); - QuotationModelRatioAgentItem mitem = ratioAgentItemService.getEffectiveForUser(data.getBatchNumber(), AppUserUtil.getUserId()); - BigDecimal basePrice = Objects.nonNull(modelPrice) ? NumberUtil.multiply(modelPrice.getAmount(), Optional.ofNullable(mitem) - .map(QuotationModelRatioAgentItem::getStandardRatio) - .orElse(null)) : null; + BigDecimal basePrice = Optional.ofNullable(modelPrice).map(ModelPriceVO::getAmount).orElse(null); + if (Objects.nonNull(basePrice)) { + QuotationModelRatioAgentItem mitem = ratioAgentItemService.getEffectiveForUser(data.getBatchNumber(), AppUserUtil.getUserId()); + if (Objects.nonNull(mitem)) { + basePrice = NumberUtil.multiply(basePrice, mitem.getStandardRatio()); + } + } BigDecimal standardRatio = Objects.nonNull(item) ? item.getStandardRatio() : null; map.put(user.getId().toString() + "-standardPrice", NumberUtil.format(basePrice)); map.put(user.getId().toString() + "-standardRatio", NumberUtil.format(standardRatio)); @@ -239,7 +242,7 @@ public class AppRatioAgentConfigController extends ControllerBase { } /** - * 获取方案列表 + * 查看下级数据 */ @PostMapping("list/search") public ApiResult> search(@Valid @RequestBody ModelRatioUserSearchRequest request) { diff --git a/nflg-mobilebroken-repository/src/main/resources/mapper/ProductModelMapper.xml b/nflg-mobilebroken-repository/src/main/resources/mapper/ProductModelMapper.xml index c4fb6bde..e718f699 100644 --- a/nflg-mobilebroken-repository/src/main/resources/mapper/ProductModelMapper.xml +++ b/nflg-mobilebroken-repository/src/main/resources/mapper/ProductModelMapper.xml @@ -137,9 +137,9 @@ AND dis.model_id is not null - - AND pm.`no` like concat('%', #{request.no}, '%') - + + + ORDER BY pm.sort,pm.id DESC