Commit 48068e69 by zhangxingmin

Merge remote-tracking branch 'origin/test' into test

parents bc7acbec 798ff8bc
...@@ -1379,6 +1379,12 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1379,6 +1379,12 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
throw new BusinessException(ResultCode.FAIL.getCode(), "当前应付款已有出账金额,不能修改"); throw new BusinessException(ResultCode.FAIL.getCode(), "当前应付款已有出账金额,不能修改");
} }
// 查询保单数据
Policy policy = null;
if (StringUtils.isNotBlank(request.getPolicyNo())) {
policy = policyService.getOne(new QueryWrapper<Policy>().eq("policy_no", request.getPolicyNo()));
}
// 查询关联 fortune 数据,重新计算:已出帐金额、待出帐金额、已出帐比例、待出帐比例 // 查询关联 fortune 数据,重新计算:已出帐金额、待出帐金额、已出帐比例、待出帐比例
List<Fortune> fortuneList = fortuneService.lambdaQuery().eq(Fortune::getExpectedFortuneBizId, expectedFortune.getExpectedFortuneBizId()).list(); List<Fortune> fortuneList = fortuneService.lambdaQuery().eq(Fortune::getExpectedFortuneBizId, expectedFortune.getExpectedFortuneBizId()).list();
BigDecimal paidAmount = BigDecimal.ZERO; BigDecimal paidAmount = BigDecimal.ZERO;
...@@ -1406,6 +1412,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1406,6 +1412,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
BeanUtils.copyProperties(request, updateExpectedFortune); BeanUtils.copyProperties(request, updateExpectedFortune);
updateExpectedFortune.setId(expectedFortune.getId()); updateExpectedFortune.setId(expectedFortune.getId());
// 设置 policy 关联字段
if (policy != null) {
expectedFortune.setInsuranceCompanyBizId(policy.getInsuranceCompanyBizId());
expectedFortune.setProductLaunchBizId(policy.getProductLaunchBizId());
expectedFortune.setPremium(policy.getPaymentPremium());
expectedFortune.setPolicyCurrency(policy.getCurrency());
}
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例 // 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune.setPaidAmount(paidAmount); expectedFortune.setPaidAmount(paidAmount);
expectedFortune.setUnpaidAmount(unpaidAmount); expectedFortune.setUnpaidAmount(unpaidAmount);
......
...@@ -23,6 +23,9 @@ public class ExpectedFortuneUpdateRequest { ...@@ -23,6 +23,9 @@ public class ExpectedFortuneUpdateRequest {
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
private String actualPayoutDate; private String actualPayoutDate;
@Schema(description = "关联保单号")
private String policyNo;
/** /**
* 出账状态 * 出账状态
*/ */
......
...@@ -42,6 +42,12 @@ public class ApiExpectedFortunePageResponse { ...@@ -42,6 +42,12 @@ public class ApiExpectedFortunePageResponse {
private String payableNo; private String payableNo;
/** /**
* 关联业务编号
*/
@Schema(description = "关联业务编号")
private String associatedPayableNo;
/**
* 保单号 * 保单号
*/ */
@Schema(description = "policy no") @Schema(description = "policy no")
......
...@@ -157,7 +157,10 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe ...@@ -157,7 +157,10 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
// 查找对应的实际发佣 // 查找对应的实际发佣
List<ApiExpectedFortunePageResponse> matchedList = actualMap.get(expected.getExpectedFortuneBizId()); List<ApiExpectedFortunePageResponse> matchedList = actualMap.get(expected.getExpectedFortuneBizId());
if (CollUtil.isNotEmpty(matchedList)) { if (CollUtil.isNotEmpty(matchedList)) {
// 设置实际发佣的关联业务编号
matchedList.forEach(actual -> actual.setAssociatedPayableNo(expected.getPayableNo()));
sortedList.addAll(matchedList); sortedList.addAll(matchedList);
matchedActualPayableNos.add(expected.getExpectedFortuneBizId()); matchedActualPayableNos.add(expected.getExpectedFortuneBizId());
} }
} }
......
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