Commit 48970f07 by jianan

出账检核页面新增

parent 2a8e305a
......@@ -787,7 +787,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
.list()
.stream()
.collect(Collectors.toMap(
i -> i.getPolicyNo() + "_" + i.getFortunePeriod() + "_" + i.getFortuneType(),
i -> i.getPolicyNo() + "_" + i.getFortunePeriod() + "_" + i.getFortuneType() + "_" + i.getBrokerBizId(),
Function.identity(),
(oldValue, newValue) -> newValue)
);
......@@ -797,7 +797,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (CollectionUtils.isNotEmpty(commissionList)) {
commissionByPolicyPeriod = commissionList.stream()
.collect(Collectors.toMap(
commission -> commissionService.buildPolicyPeriodKey(commission.getPolicyNo(), commission.getCommissionPeriod()),
commission -> commission.getPolicyNo() + "_" + commission.getCommissionPeriod(),
Function.identity(),
(oldValue, newValue) -> newValue // 遇到重复时使用新值
));
......@@ -810,7 +810,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
String realName = currentLoginUser.getRealName();
List<Fortune> fortuneList = new ArrayList<>();
List<ExpectedFortune> expectedFortuneUpdateList = new ArrayList<>();
for (FortuneAddRequest fortuneAddRequest : fortuneAddRequestList) {
// 校验参数
valiAddFortune(fortuneAddRequest);
......@@ -823,13 +823,12 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
String fortuneName = queryByDict(fortuneAddRequest.getFortuneType());
fortune.setFortuneName(fortuneName);
if ("R".equals(fortuneAddRequest.getFortuneBizType())) {
Policy policy = policyMap.get(fortuneAddRequest.getPolicyNo());
if (policy == null) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), fortuneAddRequest.getPolicyNo() + " 保单号不存在");
}
ExpectedFortune expectedFortune = expectedFortuneMap.get(fortuneAddRequest.getPolicyNo() + "_" + fortuneAddRequest.getFortunePeriod() + "_" + fortuneAddRequest.getFortuneType());
ExpectedFortune expectedFortune = expectedFortuneMap.get(fortuneAddRequest.getPolicyNo() + "_" + fortuneAddRequest.getFortunePeriod() + "_" + fortuneAddRequest.getFortuneType() + "_" + fortuneAddRequest.getBrokerBizId());
if (expectedFortune == null) {
// 同步新增预计出账
expectedFortune = createExpectedFortune(fortuneAddRequest, policy, fortuneName);
......@@ -857,7 +856,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortune.setPayoutDate(expectedFortune.getPayoutDate());
// 关联来佣业务ID
String key = commissionService.buildPolicyPeriodKey(expectedFortune.getPolicyNo(), expectedFortune.getFortunePeriod());
String key = fortune.getPolicyNo() + "_" + fortune.getFortunePeriod();
Commission matchedCommission = commissionByPolicyPeriod.get(key);
if (matchedCommission != null) {
fortune.setCommissionBizId(matchedCommission.getCommissionBizId());
......@@ -889,10 +888,6 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
}
this.saveBatch(fortuneList);
if (CollectionUtils.isNotEmpty(expectedFortuneUpdateList)) {
expectedFortuneService.updateBatchById(expectedFortuneUpdateList);
}
return true;
}
......
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