Commit 48a7df98 by jianan

出账检核-增加币种72

parent 9be96ff3
......@@ -527,19 +527,19 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
*/
@Transactional(rollbackFor = Exception.class)
public Result executeSync(List<QueryPolicyAndBrokerDto> queryPolicyAndBrokerDtoList,
String policyNo, List<ApiAnnouncementCommissionRatioListResponse> announcementRatioList,Integer paymentTerm) {
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表->入参queryPolicyAndBrokerDtoList:{}",JSON.toJSONString(queryPolicyAndBrokerDtoList));
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表->入参policyNo:{}",policyNo);
String policyNo, List<ApiAnnouncementCommissionRatioListResponse> announcementRatioList, Integer paymentTerm) {
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表->入参queryPolicyAndBrokerDtoList:{}", JSON.toJSONString(queryPolicyAndBrokerDtoList));
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表->入参policyNo:{}", policyNo);
HttpServletRequest request1 = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request1.getHeader("Authorization");
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表 token==============,{}",token);
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表 token==============,{}", token);
// 使用编程式事务,确保方法内的事务一致性
return transactionTemplate.execute(status -> {
try {
HttpServletRequest request2 = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token2 = request2.getHeader("Authorization");
log.info("使用编程式事务,确保方法内的事务一致性 token==============,{}",token2);
log.info("使用编程式事务,确保方法内的事务一致性 token==============,{}", token2);
//保单币种->港币的汇率
BigDecimal exchangeRate = BigDecimal.ZERO;
......@@ -564,7 +564,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
.toLocalDateTime();
List<CommissionRuleBinding> commissionRuleBindingList = brokerRelUserIdList(brokerDto);
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表->commissionRuleBindingList:{}",JSON.toJSONString(commissionRuleBindingList));
log.info("同步处理-> 遍历保单转介人列表信息 -> 调用基本法算出预计发佣列表->commissionRuleBindingList:{}", JSON.toJSONString(commissionRuleBindingList));
for (int i = 1; i <= paymentTerm; i++) {
Result<List<AlgorithmResDto>> result = executeBilling(ExecuteBillingDto.builder()
.name(brokerDto.getBrokerName())
......@@ -620,7 +620,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//默认结算汇率、港币金额
String policyCurrency = queryPolicyAndBrokerDtoList.get(0).getCurrency();
updateHkdAmountBatch(expectedFortuneList, policyCurrency, announcementRatioList);;
updateHkdAmountBatch(expectedFortuneList, policyCurrency, announcementRatioList);
;
//执行成功完毕,也要销毁redis缓存
redisUtil.deleteObject(RedisConstants.EXPECTED_FORTUNE + policyNo);
......@@ -656,6 +657,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
/**
* 查询和当前转介人相关关系(推荐,一级管理,二级管理,辅导)的客户端用户ID列表数据
*
* @param brokerDto
* @return
*/
......@@ -709,7 +711,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//构造销售佣金基本法项目的顺序下标值执行
List<Integer> executionOrderList = new ArrayList<>();
executionOrderList.add(1);
log.info("执行获得积分用户的非销售佣金基本法项目->入参:{}",JSON.toJSONString(dto));
log.info("执行获得积分用户的非销售佣金基本法项目->入参:{}", JSON.toJSONString(dto));
//执行获得积分用户的非销售佣金基本法项目
Result<List<AlgorithmResDto>> result = apiBasicLawCalculateService.policyBrokerAlgorithm(AlgorithmDto.builder()
.brokerBizId(brokerDto.getBrokerBizId())
......@@ -726,7 +728,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
.executionOrderList(executionOrderList)
.isNegateExecutionOrderList(true)
.build());
log.info("执行获得积分用户的非销售佣金基本法项目->出参:{}",JSON.toJSONString(result));
log.info("执行获得积分用户的非销售佣金基本法项目->出参:{}", JSON.toJSONString(result));
//生成保单预计发佣表记录 (非销售佣金基本法)
generateExpectedFortune(GenerateExpectedFortuneDto.builder()
......@@ -1153,6 +1155,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
/**
* 保单币种对预计来佣的结算币种的默认汇率
*
* @param policyCurrency 保单币种
* @param currency 预计来佣的结算币种
* @return 汇率
......@@ -1160,7 +1163,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
private BigDecimal queryExchangeRateByFeign(String policyCurrency, String currency) {
HttpServletRequest request2 = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token2 = request2.getHeader("Authorization");
log.info("保单币种对预计来佣的结算币种的默认汇率 token==============,{}",token2);
log.info("保单币种对预计来佣的结算币种的默认汇率 token==============,{}", token2);
if (policyCurrency.equalsIgnoreCase(currency)) {
return BigDecimal.ONE;
}
......@@ -1332,6 +1335,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
List<String> brokerBizIdList = request.getBrokerBizIdList();
List<String> signerBizIdList = request.getSignerBizIdList();
String fortuneBizType = request.getFortuneBizType();
String policyHolder = request.getPolicyHolder();
// 按保单号模糊查询
queryWrapper.eq(ObjectUtils.isNotEmpty(payableNo), "payable_no", payableNo);
......@@ -1347,11 +1351,19 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
queryWrapper.in(ObjectUtils.isNotEmpty(productLaunchBizIdList), "product_launch_biz_id", productLaunchBizIdList);
// 根据转介人(主)查询
if (!CollectionUtils.isEmpty(brokerBizIdList)) {
queryWrapper.apply("EXISTS (SELECT 1 FROM policy_follow f WHERE f.policy_no = expected_fortune.policy_no AND f.first_broker_biz_id in ({0}))",
Joiner.on(",").join(brokerBizIdList));
// 构建带引号的参数列表
String brokerIds = brokerBizIdList.stream()
.map(id -> "'" + id + "'")
.collect(Collectors.joining(","));
queryWrapper.apply("EXISTS (SELECT 1 FROM policy_follow f WHERE f.policy_no = expected_fortune.policy_no AND f.first_broker_biz_id in (" + brokerIds + "))");
}
queryWrapper.in(ObjectUtils.isNotEmpty(signerBizIdList), "signer_biz_id", signerBizIdList);
queryWrapper.eq(StringUtils.isNotBlank(fortuneBizType), "fortune_biz_type", fortuneBizType);
// 根据投保人名称查询
if (StringUtils.isNotBlank(policyHolder)) {
queryWrapper.apply("EXISTS (SELECT 1 FROM policy_follow f WHERE f.policy_no = expected_fortune.policy_no AND (f.policy_holder like concat('%', ?, '%') or f.policy_holder_en like concat('%', ?, '%')))",
policyHolder, policyHolder);
}
queryWrapper.in(ObjectUtils.isNotEmpty(request.getPolicyNoList()), "policy_no", request.getPolicyNoList());
// 按id升序排序
......
......@@ -266,7 +266,7 @@
</if>
</where>
ORDER BY id ASC
ORDER BY type ASC, create_time ASC
LIMIT #{pageSize} OFFSET #{offset}
</select>
......
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