Commit f99bba4a by zhangxingmin

push

parent 693c1d6b
......@@ -350,16 +350,14 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
if (CollectionUtils.isEmpty(calculateTotalAmountDTOList)) {
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 exchangeRate = ObjectUtils.defaultIfNull(dto.getExchangeRate(), BigDecimal.ZERO);
//港币金额 = 发放金额 * 汇率
BigDecimal hkdAmount = amount.multiply(exchangeRate);
totalAmount.add(hkdAmount);
});
return amount.multiply(exchangeRate);
})
.reduce(BigDecimal.ZERO, BigDecimal::add);
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