定标环节如果定标总金额大于采购控制金额不允许提交

This commit is contained in:
李贵强 2025-03-15 16:30:31 +08:00
parent e4ea1655f8
commit 3af9e7f9ef
1 changed files with 16 additions and 11 deletions

View File

@ -32,19 +32,24 @@ public class DecisionAmountValidator extends AbstractValidator {
continue; continue;
} }
//采购控制明细 //定标供应商分录
DynamicObjectCollection bottomEntry = decisionBill.getDynamicObjectCollection("bottomentry"); DynamicObjectCollection bidSection = decisionBill.getDynamicObjectCollection("bidsection");
if (!bottomEntry.isEmpty()){ if (!bidSection.isEmpty()){
BigDecimal allEntryAmount=BigDecimal.ZERO; BigDecimal allEntryAmount=BigDecimal.ZERO;
for (DynamicObject dynamicObject : bottomEntry) { for (DynamicObject supplierEntry : bidSection) {
//采购控制金额含税 DynamicObjectCollection entry = supplierEntry.getDynamicObjectCollection("supplierentry");
BigDecimal botControlAmount = dynamicObject.getBigDecimal("botcontrolamount"); if (!entry.isEmpty()){
allEntryAmount=allEntryAmount.add(botControlAmount); for (DynamicObject dynamicObject : entry) {
//最终价
BigDecimal botControlAmount = dynamicObject.getBigDecimal("finalprice");
allEntryAmount=allEntryAmount.add(botControlAmount);
}
}
} }
//定标总金额 //采购控制总金额含税
BigDecimal amount = decisionBill.getBigDecimal("amount"); BigDecimal amount = decisionBill.getBigDecimal("controlamount");
if (amount.compareTo(allEntryAmount)>0){ if (allEntryAmount.compareTo(amount)>0){
this.addErrorMessage(dataEntity, "提交失败!定标总金额不能大于采购控制金额(含税)!"); this.addErrorMessage(dataEntity, "提交失败!最终价不能大于采购控制金额(含税)!");
} }
} }
} }