Commit 8a909e9e by jianan

新增应收款,增加入参

parent d5fa48ea
......@@ -94,6 +94,12 @@ public class CommissionExpectedAddDto {
private BigDecimal amount;
/**
* 结算汇率
*/
@Schema(description = "结算汇率")
private BigDecimal exchangeRate;
/**
* 入账日 (估)
*/
@Schema(description = "入账日 (估) format:yyyy-MM-dd")
......
......@@ -420,7 +420,7 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
commissionExpected.setPremium(policy.getPaymentPremium());
} else {
BigDecimal expectedAmount = addDto.getAmount()
.multiply(commissionExpected.getDefaultExchangeRate());
.multiply(addDto.getExchangeRate());
commissionExpected.setExpectedAmount(expectedAmount);
}
......@@ -462,14 +462,18 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
if (StringUtils.isBlank(request.getCommissionType())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "入账项目类型不能为空");
}
// commissionType 只能是数字
if (!StringUtils.isNumeric(request.getCommissionType())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "入账项目类型只能是字典值");
}
// commissionName 不能为空
if (StringUtils.isBlank(request.getCommissionName())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "入账项目名称不能为空");
}
if (StringUtils.isBlank(request.getCurrency())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "入账币种不能为空");
}
if (request.getExchangeRate() == null) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "结算汇率不能为空");
}
if ("R".equals(request.getCommissionBizType())) {
if (request.getCommissionRatio() == null) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "关联保单应收单,佣金比例不能为空");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment