diff --git a/backend/crm/src/main/java/cn/cordys/crm/contract/service/ContractPaymentRecordService.java b/backend/crm/src/main/java/cn/cordys/crm/contract/service/ContractPaymentRecordService.java index 37f3f4b83..2a4288a76 100644 --- a/backend/crm/src/main/java/cn/cordys/crm/contract/service/ContractPaymentRecordService.java +++ b/backend/crm/src/main/java/cn/cordys/crm/contract/service/ContractPaymentRecordService.java @@ -460,16 +460,10 @@ public class ContractPaymentRecordService { if (StringUtils.isNotEmpty(excludeRecordId)) { recordLambdaQueryWrapper.nq(ContractPaymentRecord::getId, excludeRecordId); } - List contractPaymentRecords = contractPaymentRecordMapper.selectListByLambda(recordLambdaQueryWrapper); - BigDecimal alreadyPay = contractPaymentRecords.stream().map(ContractPaymentRecord::getRecordAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); Contract contract = contractMapper.selectByPrimaryKey(contractId); if (contract == null) { throw new GenericException(Translator.get("contract.not.exist")); } - BigDecimal contractAmount = Optional.ofNullable(contract.getAmount()).orElse(BigDecimal.ZERO); - if ((alreadyPay.add(payAmount)).compareTo(contractAmount) > 0) { - throw new GenericException(Translator.getWithArgs("record.amount.exceed", contractAmount.subtract(alreadyPay))); - } } /** diff --git a/backend/crm/src/main/resources/i18n/cordys-crm_en_US.properties b/backend/crm/src/main/resources/i18n/cordys-crm_en_US.properties index bd4ec0275..001e1065a 100644 --- a/backend/crm/src/main/resources/i18n/cordys-crm_en_US.properties +++ b/backend/crm/src/main/resources/i18n/cordys-crm_en_US.properties @@ -778,7 +778,6 @@ business_title.not.exist=Business title not exist business_title.exist=Business title exist business_title_import_tpl.name=Business_title_import_template # contract payment record -record.amount.exceed=The amount exceeded! The remaining contract payment amount is {0}. record.not.exist=Payment record does not exist record.amount.illegal=Payment amount must be greater than 0 payment.record.import_tpl.name=Payment_record_import_template diff --git a/backend/crm/src/main/resources/i18n/cordys-crm_zh_CN.properties b/backend/crm/src/main/resources/i18n/cordys-crm_zh_CN.properties index a6de6c709..a693b4430 100644 --- a/backend/crm/src/main/resources/i18n/cordys-crm_zh_CN.properties +++ b/backend/crm/src/main/resources/i18n/cordys-crm_zh_CN.properties @@ -778,7 +778,6 @@ business_title.not.exist=工商抬头不存在 business_title.exist=工商抬头已存在 business_title_import_tpl.name=工商抬头导入模板 # contract payment record -record.amount.exceed=金额超出! 剩余合同回款额为 {0}。 record.amount.illegal=回款金额需大于0 record.not.exist=回款记录不存在 payment.record.import_tpl.name=回款记录导入模板