Commit 76678330 by zhangxingmin

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

parents c3b2d3a1 4781f047
......@@ -2,6 +2,7 @@
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/yd-csf-api/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/yd-csf-api/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/yd-csf-feign/src/main/java" charset="UTF-8" />
......
......@@ -892,6 +892,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//保单发佣批次ID
// fortune.setBatchBizId(fortuneDto.getBatchBizId());
fortune.setFortuneBizType("R");
fortune.setIsPart(0);
fortune.setPolicyCurrency(fortuneDto.getCurrency());
fortune.setPremium(fortuneDto.getPaymentPremium());
//转介人姓名 (获得积分的业务员)
......@@ -1011,7 +1012,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// 5. 组装返回结果
ApiExpectedFortunePageResponseVO response = new ApiExpectedFortunePageResponseVO();
response.setStatisticsVO(statisticsVO);
response.setPage(iPage); // 恢复分页数据
response.setPage(iExpectedFortuneService.getVOPage(iPage)); // 恢复分页数据
log.info("查询应付款管理列表完成, 耗时: {}ms, 页码: {}, 页大小: {}, 总记录数: {}",
System.currentTimeMillis() - startTime,
......@@ -1207,22 +1208,17 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
.collect(Collectors.toMap(UserGradeDto::getClientUserBizId, Function.identity()));
List<String> policyNoList = payableReportPage.getRecords().stream().map(PayableReportVO::getPolicyNo).collect(Collectors.toList());
List<Policy> policyList = new ArrayList<>();
List<PolicyFollow> policyFollowList = new ArrayList<>();
if (!CollectionUtils.isEmpty(policyNoList)) {
policyList = policyService.lambdaQuery()
.in(Policy::getPolicyNo, policyNoList)
.list();
policyFollowList = policyFollowService.lambdaQuery()
.in(PolicyFollow::getPolicyNo, policyNoList)
.list();
}
Map<String, Policy> policyMap = policyList.stream()
.collect(Collectors.toMap(Policy::getPolicyNo, Function.identity()));
Map<String, PolicyFollow> policyFollowMap = policyFollowList.stream()
.collect(Collectors.toMap(PolicyFollow::getPolicyNo, Function.identity()));
List<PayableReportVO> voList = payableReportPage.getRecords().stream().map(vo -> {
Policy policy = policyMap.get(vo.getPolicyNo());
PolicyFollow policyFollow= policyFollowMap.get(vo.getPolicyNo());
UserGradeDto userGradeDto= userGradeMap.get(vo.getBrokerBizId());
......@@ -1230,9 +1226,6 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
if (userGradeDto != null) {
vo.setBrokerGradeName(userGradeDto.getGradeName());
}
if (policy != null) {
vo.setPolicyCurrency(CurrencyEnum.toLabel(policy.getCurrency()));
}
if (policyFollow != null) {
vo.setProductName(policyFollow.getProductName());
vo.setProductLaunchBizId(policyFollow.getProductLaunchBizId());
......
......@@ -38,7 +38,7 @@ public class ApiExpectedFortunePageResponse {
/**
* 应付款编号
*/
@Schema(description = "应付款编号")
@Schema(description = "应付款编号(业务编号)")
private String payableNo;
/**
......
......@@ -5,6 +5,7 @@ import com.yd.csf.service.model.AgentAccumulatedFyc;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
......@@ -20,6 +21,8 @@ public interface IAgentAccumulatedFycService extends IService<AgentAccumulatedFy
List<UserGradeDto> queryUserGradeList(List<String> userBizIdList);
Map<String, UserGradeDto> queryUserGradeMap(List<String> userBizIdList);
List<AgentAccumulatedFyc> queryList(List<String> agentIdList);
List<AgentAccumulatedFyc> queryAll();
......
......@@ -33,7 +33,7 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
ExpectedFortuneStatisticsVO getStatistics(List<Long> expectedFortuneIds);
IPage<ApiExpectedFortunePageResponse> getVOPage(IPage<ExpectedFortune> iPage);
IPage<ApiExpectedFortunePageResponse> getVOPage(IPage<ApiExpectedFortunePageResponse> iPage);
List<ApiExpectedFortunePageResponse> toVOList(List<ExpectedFortune> fortuneList);
......
......@@ -9,7 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* <p>
......@@ -53,4 +58,14 @@ public class AgentAccumulatedFycServiceImpl extends ServiceImpl<AgentAccumulated
return this.baseMapper.queryUserGradeList(userBizIdList);
}
@Override
public Map<String, UserGradeDto> queryUserGradeMap(List<String> userBizIdList) {
if (CollectionUtils.isEmpty(userBizIdList)) {
return Collections.emptyMap();
}
return this.baseMapper.queryUserGradeList(userBizIdList)
.stream()
.collect(Collectors.toMap(UserGradeDto::getClientUserBizId, Function.identity()));
}
}
......@@ -83,14 +83,42 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
}
@Override
public IPage<ApiExpectedFortunePageResponse> getVOPage(IPage<ExpectedFortune> iPage) {
List<ExpectedFortune> expectedFortuneList = iPage.getRecords();
public IPage<ApiExpectedFortunePageResponse> getVOPage(IPage<ApiExpectedFortunePageResponse> iPage) {
List<ApiExpectedFortunePageResponse> expectedFortuneList = iPage.getRecords();
Page<ApiExpectedFortunePageResponse> expectedFortuneVOPage = new Page<>(iPage.getCurrent(), iPage.getSize(), iPage.getTotal());
if (CollUtil.isEmpty(expectedFortuneList)) {
return expectedFortuneVOPage;
}
List<ApiExpectedFortunePageResponse> expectedFortuneVOList = toVOList(expectedFortuneList);
expectedFortuneVOPage.setRecords(expectedFortuneVOList);
// 1. 转介人职级信息
List<String> brokerBizIds = expectedFortuneList.stream().map(ApiExpectedFortunePageResponse::getBrokerBizId).collect(Collectors.toList());
Map<String, UserGradeDto> userGradeMap = iAgentAccumulatedFycService.queryUserGradeMap(brokerBizIds);
// 2. 关联查询保单信息
for (ApiExpectedFortunePageResponse vo : expectedFortuneList) {
vo.setCurrencyName("港币");
// String ratio = finalBrokerRatioMap.get(ef.getBrokerBizId());
// vo.setCommissionRatio(ratio);
// Policy policy = policyMap.get(vo.getPolicyNo());
// PolicyFollow follow = policyFollowMap.get(vo.getPolicyNo());
UserGradeDto userGradeDto = userGradeMap.get(vo.getBrokerBizId());
if (userGradeDto != null) {
vo.setBrokerGradeName(userGradeDto.getGradeName());
}
// if (policy != null) {
// vo.setInsuranceCompany(policy.getInsuranceCompany());
// }
// if (follow != null) {
// vo.setProductName(follow.getProductName());
// vo.setProductLaunchBizId(follow.getProductLaunchBizId());
// }
}
// expectedFortuneVOPage.setRecords(voList);
return expectedFortuneVOPage;
}
......
......@@ -69,6 +69,30 @@ public class CommissionVO implements Serializable {
private String productName;
/**
* 保单本期来佣率
*/
@Schema(description = "保单本期来佣率")
private BigDecimal commissionRatio;
/**
* 投保人
*/
@Schema(description = "投保人")
private String policyHolder;
/**
* 投保人英文
*/
@Schema(description = "投保人英文")
private String policyHolderEn;
/**
* 转介人
*/
@Schema(description = "转介人")
private String broker;
/**
* 保险公司
*/
@Schema(description = "保险公司")
......
......@@ -56,6 +56,7 @@
select
null as payable_no,
ef.policy_no as policyNo,
ef.policy_currency as policyCurrency,
(select pp.name from policy_policyholder pp where pp.policy_biz_id = p.policy_biz_id limit 1) as policyHolder,
(select pp.name_en from policy_policyholder pp where pp.policy_biz_id = p.policy_biz_id limit 1) as policyHolderEn,
MAX(ef.premium) as premium,
......@@ -111,6 +112,7 @@
select
ef.payable_no as payable_no,
ef.policy_no as policyNo,
ef.policy_currency as policyCurrency,
(select pp.name from policy_policyholder pp where pp.policy_biz_id = p.policy_biz_id limit 1) as policyHolder,
(select pp.name_en from policy_policyholder pp where pp.policy_biz_id = p.policy_biz_id limit 1) as policyHolderEn,
ef.premium as premium,
......
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