Commit 4139092d by jianan

出账检核-增加币种77

parent 0ff081a6
...@@ -646,33 +646,28 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss ...@@ -646,33 +646,28 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "未找到保单对应的预计发佣记录,请先创建预计发佣记录"); throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "未找到保单对应的预计发佣记录,请先创建预计发佣记录");
} }
// 2. 根据本次发佣期数,查询是否有出账的记录 // 2. 根据本次发佣期数,查询是否有出账的记录
List<Fortune> fortuneList = fortuneService.lambdaQuery() List<Fortune> fortuneList = fortuneService.lambdaQuery()
.in(Fortune::getExpectedFortuneBizId, filteredExpectedFortuneList1.stream().map(ExpectedFortune::getExpectedFortuneBizId).collect(Collectors.toList())) .in(Fortune::getExpectedFortuneBizId, filteredExpectedFortuneList1.stream().map(ExpectedFortune::getExpectedFortuneBizId).collect(Collectors.toList()))
.list(); .list();
// 2.1 已出帐的保单号和期数
Set<String> fortuneSet = fortuneList.stream() // 2.1 校验是否有未出账的记录
.map(i -> i.getPolicyNo() + "_" + i.getFortunePeriod())
.collect(Collectors.toSet());
// 2.2 校验是否有已出账的记录
List<ExpectedFortune> filteredExpectedFortuneList2 = new ArrayList<>(); List<ExpectedFortune> filteredExpectedFortuneList2 = new ArrayList<>();
for (ExpectedFortune expectedFortune : filteredExpectedFortuneList1) { for (ExpectedFortune expectedFortune : filteredExpectedFortuneList1) {
String policyNo = expectedFortune.getPolicyNo(); // 如果有已出账记录,跳过
Integer fortunePeriod = expectedFortune.getFortunePeriod(); if (FortuneStatusEnum.SENT.getItemValue().equals(expectedFortune.getStatus())) {
// 如果有已出账记录,跳过,表示此次该预计出账已出账
if (fortuneSet.contains(policyNo + "_" + fortunePeriod)) {
continue; continue;
} }
filteredExpectedFortuneList2.add(expectedFortune); filteredExpectedFortuneList2.add(expectedFortune);
} }
// 2.3 校验预计发佣记录是否有出账币种、默认结算汇率 // 2.2 校验预计发佣记录是否有出账币种、默认结算汇率
for (ExpectedFortune expectedFortune : filteredExpectedFortuneList2) { for (ExpectedFortune expectedFortune : filteredExpectedFortuneList2) {
if (StringUtils.isBlank(expectedFortune.getRuleCurrency())) { if (StringUtils.isBlank(expectedFortune.getRuleCurrency())) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "预计发佣记录" + expectedFortune.getExpectedFortuneBizId() + "未配置保单币种"); throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "预计发佣记录" + expectedFortune.getExpectedFortuneBizId() + "未配置保单币种");
} }
} }
// 2.4 根据保单号、期数查询入账检核汇率 // 2.3 根据保单号、期数查询入账检核汇率
Map<String, BigDecimal> exchangeRateMap = this.queryCommissionExchangeRateMap(policyNoSet, commissionPeriodSet); Map<String, BigDecimal> exchangeRateMap = this.queryCommissionExchangeRateMap(policyNoSet, commissionPeriodSet);
// 3. 构建实际的初始发佣记录(使用入账检核汇率) // 3. 构建实际的初始发佣记录(使用入账检核汇率)
......
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