Commit f1e8e9dd by zhangxingmin

push

parent db26732d
......@@ -237,11 +237,23 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
if (policyFollow != null) {
ApiAnnouncementCommissionRatioListRequest ratioListRequest = new ApiAnnouncementCommissionRatioListRequest();
ratioListRequest.setEffectiveDate(policyFollow.getEffectiveDate());
ratioListRequest.setPaymentTerm(policyFollow.getIssueNumber().toString());
ratioListRequest.setPaymentTerm(policyFollow.getIssueNumber().toString()); // 保留原有过滤条件(可根据业务决定是否需要)
ratioListRequest.setProductLaunchBizId(policyFollow.getProductLaunchBizId());
Result<List<ApiAnnouncementCommissionRatioListResponse>> listResult = ratioFeignClient.list(ratioListRequest);
if (listResult != null && !CollectionUtils.isEmpty(listResult.getData())) {
paymentTerm = listResult.getData().size();
// 取 endPeriod 的最大值作为总期数
paymentTerm = listResult.getData().stream()
.map(item -> {
try {
return Integer.parseInt(item.getEndPeriod()); // 将字符串转为整数
} catch (NumberFormatException e) {
// 若转换失败,记录日志并返回0,避免影响最大值计算
log.warn("endPeriod 格式错误: {}", item.getEndPeriod());
return 0;
}
})
.max(Integer::compareTo)
.orElse(0); // 若无有效值,默认0
}
}
......
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