From 3af9e7f9ef06f6538b2f5d3bc95f481b46b8cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=B4=B5=E5=BC=BA?= Date: Sat, 15 Mar 2025 16:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=A0=87=E7=8E=AF=E8=8A=82=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=AE=9A=E6=A0=87=E6=80=BB=E9=87=91=E9=A2=9D=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E=E9=87=87=E8=B4=AD=E6=8E=A7=E5=88=B6=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../validators/DecisionAmountValidator.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/main/java/shkd/repc/rebm/validators/DecisionAmountValidator.java b/main/java/shkd/repc/rebm/validators/DecisionAmountValidator.java index 3adbc31..718fc84 100644 --- a/main/java/shkd/repc/rebm/validators/DecisionAmountValidator.java +++ b/main/java/shkd/repc/rebm/validators/DecisionAmountValidator.java @@ -32,19 +32,24 @@ public class DecisionAmountValidator extends AbstractValidator { continue; } - //采购控制明细 - DynamicObjectCollection bottomEntry = decisionBill.getDynamicObjectCollection("bottomentry"); - if (!bottomEntry.isEmpty()){ + //定标供应商分录 + DynamicObjectCollection bidSection = decisionBill.getDynamicObjectCollection("bidsection"); + if (!bidSection.isEmpty()){ BigDecimal allEntryAmount=BigDecimal.ZERO; - for (DynamicObject dynamicObject : bottomEntry) { - //采购控制金额(含税) - BigDecimal botControlAmount = dynamicObject.getBigDecimal("botcontrolamount"); - allEntryAmount=allEntryAmount.add(botControlAmount); + for (DynamicObject supplierEntry : bidSection) { + DynamicObjectCollection entry = supplierEntry.getDynamicObjectCollection("supplierentry"); + if (!entry.isEmpty()){ + for (DynamicObject dynamicObject : entry) { + //最终价 + BigDecimal botControlAmount = dynamicObject.getBigDecimal("finalprice"); + allEntryAmount=allEntryAmount.add(botControlAmount); + } + } } - //定标总金额 - BigDecimal amount = decisionBill.getBigDecimal("amount"); - if (amount.compareTo(allEntryAmount)>0){ - this.addErrorMessage(dataEntity, "提交失败!定标总金额不能大于采购控制金额(含税)!"); + //采购控制总金额(含税) + BigDecimal amount = decisionBill.getBigDecimal("controlamount"); + if (allEntryAmount.compareTo(amount)>0){ + this.addErrorMessage(dataEntity, "提交失败!最终价不能大于采购控制金额(含税)!"); } } }