From a1abe313bb2c5d36594dea1f270346e535d04585 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Mon, 24 Nov 2025 17:50:01 +0800 Subject: [PATCH] =?UTF-8?q?change(crm):=20=E5=A4=84=E7=90=86=E6=97=A0?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E6=97=B6=E9=87=91=E9=A2=9D=E6=B8=85=E9=9B=B6?= =?UTF-8?q?=E5=8F=8A=E4=BC=98=E5=8C=96=E7=89=A9=E6=96=99=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 无明细时将报价总金额全部置零,避免保留历史金额 - 修改物料分页查询方法,使用selectJoinPage提高查询效率 - 修改物料列表查询方法,使用selectJoinList增强数据关联能力 --- .../oa/crm/service/impl/CrmQuoteInfoServiceImpl.java | 9 ++++++++- .../oa/crm/service/impl/CrmQuoteMaterialServiceImpl.java | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteInfoServiceImpl.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteInfoServiceImpl.java index 9df12118..9421f4a4 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteInfoServiceImpl.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteInfoServiceImpl.java @@ -346,7 +346,14 @@ public class CrmQuoteInfoServiceImpl implements ICrmQuoteInfoService { .eq(CrmQuoteMaterial::getQuoteId, quoteId); List items = quoteMaterialMapper.selectVoList(lqw); if (items == null || items.isEmpty()) { - return true; // 无明细则不处理 + // 无明细时将金额全部置零,避免保留历史金额 + CrmQuoteInfo update = new CrmQuoteInfo(); + update.setQuoteId(quoteId); + update.setTotalIncludingTax(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP)); + update.setTotalBeforeTax(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP)); + update.setTotalTax(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP)); + update.setTotalPrice(BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP)); + return baseMapper.updateById(update) > 0; } // 汇总金额(统一两位小数,四舍五入) BigDecimal totalIncluding = BigDecimal.ZERO; diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteMaterialServiceImpl.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteMaterialServiceImpl.java index d5792f31..7c5f7800 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteMaterialServiceImpl.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/crm/service/impl/CrmQuoteMaterialServiceImpl.java @@ -54,7 +54,7 @@ public class CrmQuoteMaterialServiceImpl implements ICrmQuoteMaterialService { @Override public TableDataInfo queryPageList(CrmQuoteMaterialBo bo, PageQuery pageQuery) { MPJLambdaWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + Page result = baseMapper.selectJoinPage(pageQuery.build(), CrmQuoteMaterialVo.class, lqw); return TableDataInfo.build(result); } @@ -67,7 +67,7 @@ public class CrmQuoteMaterialServiceImpl implements ICrmQuoteMaterialService { @Override public List queryList(CrmQuoteMaterialBo bo) { MPJLambdaWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + return baseMapper.selectJoinList(CrmQuoteMaterialVo.class, lqw); } private MPJLambdaWrapper buildQueryWrapper(CrmQuoteMaterialBo bo) {