Commit f99bba4a by zhangxingmin

push

parent 693c1d6b
...@@ -350,16 +350,14 @@ public class ApiSalaryServiceImpl implements ApiSalaryService { ...@@ -350,16 +350,14 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
if (CollectionUtils.isEmpty(calculateTotalAmountDTOList)) { if (CollectionUtils.isEmpty(calculateTotalAmountDTOList)) {
throw new BusinessException("计算入参的值不能为空"); throw new BusinessException("计算入参的值不能为空");
} }
BigDecimal totalAmount = BigDecimal.ZERO; //累加
calculateTotalAmountDTOList.forEach(dto -> { BigDecimal totalAmount = calculateTotalAmountDTOList.stream()
//发放金额 .map(dto -> {
BigDecimal amount = ObjectUtils.defaultIfNull(dto.getAmount(), BigDecimal.ZERO); BigDecimal amount = ObjectUtils.defaultIfNull(dto.getAmount(), BigDecimal.ZERO);
//汇率 BigDecimal exchangeRate = ObjectUtils.defaultIfNull(dto.getExchangeRate(), BigDecimal.ZERO);
BigDecimal exchangeRate = ObjectUtils.defaultIfNull(dto.getExchangeRate(), BigDecimal.ZERO); return amount.multiply(exchangeRate);
//港币金额 = 发放金额 * 汇率 })
BigDecimal hkdAmount = amount.multiply(exchangeRate); .reduce(BigDecimal.ZERO, BigDecimal::add);
totalAmount.add(hkdAmount);
});
return Result.success(totalAmount); return Result.success(totalAmount);
} }
......
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