Commit 48970f07 by jianan

出账检核页面新增

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