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, "提交失败!最终价不能大于采购控制金额(含税)!"); } } }