From d030f058263bb9b43a59f6d447a9f46b55c1bfe5 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Mon, 7 Jul 2025 10:18:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(sip):=20=E7=A7=BB=E9=99=A4=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BB=B7=E6=A0=BC=E8=AE=A1=E7=AE=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除了 ProjectProductInfoServiceImpl 类中的价格计算逻辑 - 保留了产品编码验证逻辑 - 此修改可能会影响前端的价格显示,需要确认是否保留后端计算逻辑 --- .../impl/ProjectProductInfoServiceImpl.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java index f7a2ab2b..a17de930 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java @@ -124,19 +124,19 @@ public class ProjectProductInfoServiceImpl implements IProjectProductInfoService if (stringJoiner.length() > 0) { throw new ServiceException(StringUtils.format("产品编码[{}]在产品库中未找到,请确认后重试", stringJoiner.toString())); } - for (ProjectProductInfo info : list) { - //计算价格 防止前端价格计算错误 - if (info.getGuidanceDiscount() != null && info.getDiscount() == null) { - info.setDiscount(info.getGuidanceDiscount()); - } - if (info.getCataloguePrice() != null && info.getDiscount() != null) { - info.setPrice(info.getCataloguePrice().multiply(info.getDiscount()).setScale(2, RoundingMode.HALF_UP)); - } - if (info.getPrice() != null && info.getQuantity() != null) { - BigDecimal allPrice = info.getPrice().multiply(new BigDecimal(info.getQuantity())); - info.setAllPrice(allPrice.setScale(2, RoundingMode.HALF_UP)); - } - } +// for (ProjectProductInfo info : list) { +// //计算价格 防止前端价格计算错误 +// if (info.getGuidanceDiscount() != null && info.getDiscount() == null) { +// info.setDiscount(info.getGuidanceDiscount()); +// } +// if (info.getCataloguePrice() != null && info.getDiscount() != null) { +// info.setPrice(info.getCataloguePrice().multiply(info.getDiscount()).setScale(2, RoundingMode.HALF_UP)); +// } +// if (info.getPrice() != null && info.getQuantity() != null) { +// BigDecimal allPrice = info.getPrice().multiply(new BigDecimal(info.getQuantity())); +// info.setAllPrice(allPrice.setScale(2, RoundingMode.HALF_UP)); +// } +// } List projectProductInfos = projectProductInfoMapper.selectProjectProductInfoListByProjectId(Collections.singletonList(list.get(0).getProjectId())); Set idSet = list.stream().map(ProjectProductInfo::getId).collect(Collectors.toSet());