Skip to content

Commit 7c2a48c

Browse files
AgAnglefit2-zhao
authored andcommitted
refactor: contract payment amount check
--bug=1068744@tapd-34675357 --user=陈建星 去掉回款金额不能大于合同金额的限制 https://www.tapd.cn/34675357/s/1909532
1 parent 1639f3f commit 7c2a48c

3 files changed

Lines changed: 0 additions & 8 deletions

File tree

backend/crm/src/main/java/cn/cordys/crm/contract/service/ContractPaymentRecordService.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,10 @@ private void checkContractPaymentAmount(String contractId, BigDecimal payAmount,
460460
if (StringUtils.isNotEmpty(excludeRecordId)) {
461461
recordLambdaQueryWrapper.nq(ContractPaymentRecord::getId, excludeRecordId);
462462
}
463-
List<ContractPaymentRecord> contractPaymentRecords = contractPaymentRecordMapper.selectListByLambda(recordLambdaQueryWrapper);
464-
BigDecimal alreadyPay = contractPaymentRecords.stream().map(ContractPaymentRecord::getRecordAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
465463
Contract contract = contractMapper.selectByPrimaryKey(contractId);
466464
if (contract == null) {
467465
throw new GenericException(Translator.get("contract.not.exist"));
468466
}
469-
BigDecimal contractAmount = Optional.ofNullable(contract.getAmount()).orElse(BigDecimal.ZERO);
470-
if ((alreadyPay.add(payAmount)).compareTo(contractAmount) > 0) {
471-
throw new GenericException(Translator.getWithArgs("record.amount.exceed", contractAmount.subtract(alreadyPay)));
472-
}
473467
}
474468

475469
/**

backend/crm/src/main/resources/i18n/cordys-crm_en_US.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,6 @@ business_title.not.exist=Business title not exist
780780
business_title.exist=Business title exist
781781
business_title_import_tpl.name=Business_title_import_template
782782
# contract payment record
783-
record.amount.exceed=The amount exceeded! The remaining contract payment amount is {0}.
784783
record.not.exist=Payment record does not exist
785784
record.amount.illegal=Payment amount must be greater than 0
786785
payment.record.import_tpl.name=Payment_record_import_template

backend/crm/src/main/resources/i18n/cordys-crm_zh_CN.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,6 @@ business_title.not.exist=工商抬头不存在
780780
business_title.exist=工商抬头已存在
781781
business_title_import_tpl.name=工商抬头导入模板
782782
# contract payment record
783-
record.amount.exceed=金额超出! 剩余合同回款额为 {0}。
784783
record.amount.illegal=回款金额需大于0
785784
record.not.exist=回款记录不存在
786785
payment.record.import_tpl.name=回款记录导入模板

0 commit comments

Comments
 (0)