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

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