Commit 717a3a4b by jianan

修改预计发佣报错

parent 26c736b5
...@@ -1244,18 +1244,22 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1244,18 +1244,22 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
if (expectedFortune.getPaidAmount().compareTo(BigDecimal.ZERO) > 0) { if (expectedFortune.getPaidAmount().compareTo(BigDecimal.ZERO) > 0) {
throw new BusinessException(ResultCode.FAIL.getCode(), "当前应付款已有出账金额,不能修改"); throw new BusinessException(ResultCode.FAIL.getCode(), "当前应付款已有出账金额,不能修改");
} }
CurrencyEnum currencyEnum;
try {
currencyEnum = CurrencyEnum.valueOf(request.getCurrency());
} catch (IllegalArgumentException e) {
throw new BusinessException(ResultCode.FAIL.getCode(), "币种错误:" + request.getCurrency());
}
ExpectedFortune updateExpectedFortune = new ExpectedFortune(); ExpectedFortune updateExpectedFortune = new ExpectedFortune();
BeanUtils.copyProperties(request, updateExpectedFortune); BeanUtils.copyProperties(request, updateExpectedFortune);
updateExpectedFortune.setId(expectedFortune.getId()); updateExpectedFortune.setId(expectedFortune.getId());
// 默认结算汇率 // 默认结算汇率
if (updateExpectedFortune.getDefaultExchangeRate() == null) {
updateExpectedFortune.setDefaultExchangeRate( updateExpectedFortune.setDefaultExchangeRate(
queryExchangeRateByFeign( queryExchangeRateByFeign(
updateExpectedFortune.getPolicyCurrency(), expectedFortune.getPolicyCurrency(),
updateExpectedFortune.getCurrency() updateExpectedFortune.getCurrency()
)); ));
}
// 计算港币金额 // 计算港币金额
updateExpectedFortune.setHkdAmount(updateExpectedFortune.getAmount().multiply(updateExpectedFortune.getDefaultExchangeRate())); updateExpectedFortune.setHkdAmount(updateExpectedFortune.getAmount().multiply(updateExpectedFortune.getDefaultExchangeRate()));
......
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