Commit b267c276 by jianan

新增应付8

parent ef9e2e1e
...@@ -683,9 +683,18 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -683,9 +683,18 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
.map(FortuneAddRequest::getPolicyNo) .map(FortuneAddRequest::getPolicyNo)
.filter(StringUtils::isNotBlank).collect(Collectors.toSet()); .filter(StringUtils::isNotBlank).collect(Collectors.toSet());
// 查询保单号
Map<String, Policy> policyMap = new HashMap<>();
// 查询预计出账 // 查询预计出账
Map<String, ExpectedFortune> expectedFortuneMap = new HashMap<>(); Map<String, ExpectedFortune> expectedFortuneMap = new HashMap<>();
// 查询入账记录
Map<String, Commission> commissionByPolicyPeriod = new HashMap<>();
if (CollectionUtils.isNotEmpty(policyNoSet)) { if (CollectionUtils.isNotEmpty(policyNoSet)) {
// 查询保单号
List<Policy> policyList = policyService.lambdaQuery().in(Policy::getPolicyNo, policyNoSet).list();
policyMap = policyList.stream().collect(Collectors.toMap(Policy::getPolicyNo, Function.identity(), (oldValue, newValue) -> newValue));
// 查询预计出账
expectedFortuneMap = expectedFortuneService.lambdaQuery() expectedFortuneMap = expectedFortuneService.lambdaQuery()
.in(ExpectedFortune::getPolicyNo, policyNoSet) .in(ExpectedFortune::getPolicyNo, policyNoSet)
.list() .list()
...@@ -695,11 +704,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -695,11 +704,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
Function.identity(), Function.identity(),
(oldValue, newValue) -> newValue) (oldValue, newValue) -> newValue)
); );
}
// 查询入账记录 // 查询入账记录
List<Commission> commissionList = commissionService.lambdaQuery().in(Commission::getPolicyNo, policyNoSet) List<Commission> commissionList = commissionService.lambdaQuery().in(Commission::getPolicyNo, policyNoSet)
.list(); .list();
Map<String, Commission> commissionByPolicyPeriod = new HashMap<>();
if (CollectionUtils.isNotEmpty(commissionList)) { if (CollectionUtils.isNotEmpty(commissionList)) {
commissionByPolicyPeriod = commissionList.stream() commissionByPolicyPeriod = commissionList.stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
...@@ -708,7 +715,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -708,7 +715,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
(oldValue, newValue) -> newValue // 遇到重复时使用新值 (oldValue, newValue) -> newValue // 遇到重复时使用新值
)); ));
} }
}
List<Fortune> fortuneList = new ArrayList<>(); List<Fortune> fortuneList = new ArrayList<>();
List<ExpectedFortune> expectedFortuneUpdateList = new ArrayList<>(); List<ExpectedFortune> expectedFortuneUpdateList = new ArrayList<>();
...@@ -724,6 +731,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -724,6 +731,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortune.setCurrentPaymentHkdAmount(fortune.getHkdAmount()); fortune.setCurrentPaymentHkdAmount(fortune.getHkdAmount());
if ("R".equals(fortuneAddRequest.getFortuneBizType())) { if ("R".equals(fortuneAddRequest.getFortuneBizType())) {
if (policyMap.get(fortuneAddRequest.getPolicyNo()) == 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());
if (expectedFortune == null) { if (expectedFortune == null) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), fortuneAddRequest.getFortuneName() + " 预计出账不存在"); throw new BusinessException(ResultCode.NULL_ERROR.getCode(), fortuneAddRequest.getFortuneName() + " 预计出账不存在");
......
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