|
@@ -37,7 +37,6 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme> implements PtlSchemeService {
|
|
public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme> implements PtlSchemeService {
|
|
|
|
|
|
|
@@ -119,29 +118,32 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 清空驾意险数据
|
|
* 清空驾意险数据
|
|
|
|
|
+ *
|
|
|
* @param ptlSchemeInfoList
|
|
* @param ptlSchemeInfoList
|
|
|
*/
|
|
*/
|
|
|
- private void cleanDrivingIntention(List<PtlSchemeInfo> ptlSchemeInfoList){
|
|
|
|
|
|
|
+ private void cleanDrivingIntention(List<PtlSchemeInfo> ptlSchemeInfoList) {
|
|
|
List<String> ids = ptlSchemeInfoList.stream().map(info -> info.getId()).collect(Collectors.toList());
|
|
List<String> ids = ptlSchemeInfoList.stream().map(info -> info.getId()).collect(Collectors.toList());
|
|
|
ptlSchemeInsuranceDrivingIntentionMapper.delete(new LambdaQueryWrapper<PtlSchemeInsuranceDrivingIntention>()
|
|
ptlSchemeInsuranceDrivingIntentionMapper.delete(new LambdaQueryWrapper<PtlSchemeInsuranceDrivingIntention>()
|
|
|
- .in(PtlSchemeInsuranceDrivingIntention::getSchemeInfoId, ids));
|
|
|
|
|
|
|
+ .in(PtlSchemeInsuranceDrivingIntention::getSchemeInfoId, ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 清空险种数据
|
|
* 清空险种数据
|
|
|
|
|
+ *
|
|
|
* @param ptlSchemeInfoList
|
|
* @param ptlSchemeInfoList
|
|
|
*/
|
|
*/
|
|
|
- private void cleanInsurance(List<PtlSchemeInfo> ptlSchemeInfoList){
|
|
|
|
|
|
|
+ private void cleanInsurance(List<PtlSchemeInfo> ptlSchemeInfoList) {
|
|
|
List<String> ids = ptlSchemeInfoList.stream().map(info -> info.getId()).collect(Collectors.toList());
|
|
List<String> ids = ptlSchemeInfoList.stream().map(info -> info.getId()).collect(Collectors.toList());
|
|
|
ptlSchemeInsuranceMapper.delete(new LambdaQueryWrapper<PtlSchemeInsurance>()
|
|
ptlSchemeInsuranceMapper.delete(new LambdaQueryWrapper<PtlSchemeInsurance>()
|
|
|
- .in(PtlSchemeInsurance::getSchemeInfoId, ids));
|
|
|
|
|
|
|
+ .in(PtlSchemeInsurance::getSchemeInfoId, ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 清空规则
|
|
* 清空规则
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private void cleanRules(PtlScheme ptlScheme){
|
|
|
|
|
|
|
+ private void cleanRules(PtlScheme ptlScheme) {
|
|
|
ptlSchemeRulesAttrLinkMapper.delete(new LambdaQueryWrapper<PtlSchemeRulesAttrLink>()
|
|
ptlSchemeRulesAttrLinkMapper.delete(new LambdaQueryWrapper<PtlSchemeRulesAttrLink>()
|
|
|
.eq(PtlSchemeRulesAttrLink::getSchemeId, ptlScheme.getId()));
|
|
.eq(PtlSchemeRulesAttrLink::getSchemeId, ptlScheme.getId()));
|
|
|
}
|
|
}
|
|
@@ -151,17 +153,17 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
//获取方案信息
|
|
//获取方案信息
|
|
|
PtlSchemeInfo ptlSchemeInfo = ptlSchemeInfoMapper.selectOne(new LambdaQueryWrapper<PtlSchemeInfo>()
|
|
PtlSchemeInfo ptlSchemeInfo = ptlSchemeInfoMapper.selectOne(new LambdaQueryWrapper<PtlSchemeInfo>()
|
|
|
.eq(PtlSchemeInfo::getId, id));
|
|
.eq(PtlSchemeInfo::getId, id));
|
|
|
- AssertionUtils.isFail(Objects.isNull(ptlSchemeInfo),"方案不存在");
|
|
|
|
|
|
|
+ AssertionUtils.isFail(Objects.isNull(ptlSchemeInfo), "方案不存在");
|
|
|
//获取方案信息
|
|
//获取方案信息
|
|
|
PtlScheme ptlScheme = ptlSchemeMapper.selectOne(new LambdaQueryWrapper<PtlScheme>()
|
|
PtlScheme ptlScheme = ptlSchemeMapper.selectOne(new LambdaQueryWrapper<PtlScheme>()
|
|
|
.eq(PtlScheme::getId, ptlSchemeInfo.getSchemeId()));
|
|
.eq(PtlScheme::getId, ptlSchemeInfo.getSchemeId()));
|
|
|
|
|
|
|
|
- AssertionUtils.isFail(Objects.isNull(ptlScheme),"方案不存在");
|
|
|
|
|
|
|
+ AssertionUtils.isFail(Objects.isNull(ptlScheme), "方案不存在");
|
|
|
|
|
|
|
|
//获取商业险
|
|
//获取商业险
|
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurances = ptlSchemeInsuranceMapper.getSchemeInsurance(ptlSchemeInfo.getId());
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurances = ptlSchemeInsuranceMapper.getSchemeInsurance(ptlSchemeInfo.getId());
|
|
|
- ptlSchemeInsurances.forEach(item->{
|
|
|
|
|
- item.getOptionVos().forEach(option->{
|
|
|
|
|
|
|
+ ptlSchemeInsurances.forEach(item -> {
|
|
|
|
|
+ item.getOptionVos().forEach(option -> {
|
|
|
item.getOptionId().add(option.getOptionId());
|
|
item.getOptionId().add(option.getOptionId());
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
@@ -200,13 +202,13 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
List<PtlAgreementUndwrtRulesAttr> agreementRulesVo = rulesGet(ptlScheme.getCompanyId(), ptlScheme.getId());
|
|
List<PtlAgreementUndwrtRulesAttr> agreementRulesVo = rulesGet(ptlScheme.getCompanyId(), ptlScheme.getId());
|
|
|
|
|
|
|
|
//拼装返回数据
|
|
//拼装返回数据
|
|
|
- PtlSchemeQueryVo vo = new PtlSchemeQueryVo(ptlScheme,ptlSchemeInfo,ptlSchemeInsurancesNew,ptlSchemeInsuranceDrivingIntentions,ptlSchemeRulesAttrLinks,agreementRulesVo);
|
|
|
|
|
|
|
+ PtlSchemeQueryVo vo = new PtlSchemeQueryVo(ptlScheme, ptlSchemeInfo, ptlSchemeInsurancesNew, ptlSchemeInsuranceDrivingIntentions, ptlSchemeRulesAttrLinks, agreementRulesVo);
|
|
|
|
|
|
|
|
return vo;
|
|
return vo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public PtlSchemeQueryVo getSchemeAll(String companyId,String productId,String schemeType,String energyType,String vehicleType,String carnature) {
|
|
|
|
|
|
|
+ public PtlSchemeQueryVo getSchemeAll(String companyId, String productId, String schemeType, String energyType, String vehicleType, String carnature) {
|
|
|
//获取方案信息
|
|
//获取方案信息
|
|
|
PtlScheme ptlScheme = ptlSchemeMapper.selectOne(new LambdaQueryWrapper<PtlScheme>()
|
|
PtlScheme ptlScheme = ptlSchemeMapper.selectOne(new LambdaQueryWrapper<PtlScheme>()
|
|
|
.eq(PtlScheme::getCompanyId, companyId)
|
|
.eq(PtlScheme::getCompanyId, companyId)
|
|
@@ -215,14 +217,14 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
.eq(PtlScheme::getEnergyType, energyType)
|
|
.eq(PtlScheme::getEnergyType, energyType)
|
|
|
.eq(PtlScheme::getProductId, productId));
|
|
.eq(PtlScheme::getProductId, productId));
|
|
|
|
|
|
|
|
- if(Objects.isNull(ptlScheme)){
|
|
|
|
|
|
|
+ if (Objects.isNull(ptlScheme)) {
|
|
|
throw new NoneException("方案不存在");
|
|
throw new NoneException("方案不存在");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取方案信息
|
|
//获取方案信息
|
|
|
List<PtlSchemeInfo> ptlSchemeInfos = ptlSchemeInfoMapper.selectList(new LambdaQueryWrapper<PtlSchemeInfo>()
|
|
List<PtlSchemeInfo> ptlSchemeInfos = ptlSchemeInfoMapper.selectList(new LambdaQueryWrapper<PtlSchemeInfo>()
|
|
|
.eq(PtlSchemeInfo::getSchemeId, ptlScheme.getId())
|
|
.eq(PtlSchemeInfo::getSchemeId, ptlScheme.getId())
|
|
|
- .eq(PtlSchemeInfo::getSchemeType, schemeType));
|
|
|
|
|
|
|
+ .eq(PtlSchemeInfo::getSchemeType, schemeType));
|
|
|
|
|
|
|
|
List<PtlSchemeQueryVo.Scheme> schemes = new ArrayList<>();
|
|
List<PtlSchemeQueryVo.Scheme> schemes = new ArrayList<>();
|
|
|
ptlSchemeInfos.forEach(ptlSchemeInfo -> {
|
|
ptlSchemeInfos.forEach(ptlSchemeInfo -> {
|
|
@@ -234,8 +236,8 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
|
|
//获取商业险
|
|
//获取商业险
|
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurances = ptlSchemeInsuranceMapper.getSchemeInsurance(ptlSchemeInfo.getId());
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurances = ptlSchemeInsuranceMapper.getSchemeInsurance(ptlSchemeInfo.getId());
|
|
|
- ptlSchemeInsurances.forEach(item->{
|
|
|
|
|
- item.getOptionVos().forEach(option->{
|
|
|
|
|
|
|
+ ptlSchemeInsurances.forEach(item -> {
|
|
|
|
|
+ item.getOptionVos().forEach(option -> {
|
|
|
item.getOptionId().add(option.getOptionId());
|
|
item.getOptionId().add(option.getOptionId());
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
@@ -254,13 +256,13 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
List<PtlAgreementUndwrtRulesAttr> agreementRulesVo = rulesGet(ptlScheme.getCompanyId(), ptlScheme.getId());
|
|
List<PtlAgreementUndwrtRulesAttr> agreementRulesVo = rulesGet(ptlScheme.getCompanyId(), ptlScheme.getId());
|
|
|
|
|
|
|
|
//拼装返回数据
|
|
//拼装返回数据
|
|
|
- PtlSchemeQueryVo vo = new PtlSchemeQueryVo(ptlScheme,ptlSchemeInfos,schemes,ptlSchemeRulesAttrLinks,agreementRulesVo);
|
|
|
|
|
|
|
+ PtlSchemeQueryVo vo = new PtlSchemeQueryVo(ptlScheme, ptlSchemeInfos, schemes, ptlSchemeRulesAttrLinks, agreementRulesVo);
|
|
|
|
|
|
|
|
return vo;
|
|
return vo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Page<PtlSchemeVo> getSchemePage(Page page,PtlSchemeVo ptlSchemeVo) {
|
|
|
|
|
|
|
+ public Page<PtlSchemeVo> getSchemePage(Page page, PtlSchemeVo ptlSchemeVo) {
|
|
|
Page<PtlSchemeVo> schemePage = ptlSchemeMapper.getSchemePage(page, ptlSchemeVo);
|
|
Page<PtlSchemeVo> schemePage = ptlSchemeMapper.getSchemePage(page, ptlSchemeVo);
|
|
|
return schemePage;
|
|
return schemePage;
|
|
|
}
|
|
}
|
|
@@ -285,8 +287,8 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
.collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
|
|
.collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
|
|
|
List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
|
|
List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
|
|
|
linkList.forEach(link -> {
|
|
linkList.forEach(link -> {
|
|
|
- if(attrMap.containsKey(link.getAttrCode())) {
|
|
|
|
|
- PtlAgreementUndwrtRulesAttr attr= attrMap.get(link.getAttrCode());
|
|
|
|
|
|
|
+ if (attrMap.containsKey(link.getAttrCode())) {
|
|
|
|
|
+ PtlAgreementUndwrtRulesAttr attr = attrMap.get(link.getAttrCode());
|
|
|
//处理多选和下拉
|
|
//处理多选和下拉
|
|
|
if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
|
|
if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
|
|
|
if (null != link.getMin()) {
|
|
if (null != link.getMin()) {
|
|
@@ -295,7 +297,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
attr.setMax(link.getMax());
|
|
attr.setMax(link.getMax());
|
|
|
attr.setOperator(link.getOperator());
|
|
attr.setOperator(link.getOperator());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
attr.setId(link.getId());
|
|
attr.setId(link.getId());
|
|
|
attr.setMin(link.getMin());
|
|
attr.setMin(link.getMin());
|
|
|
attr.setMax(link.getMax());
|
|
attr.setMax(link.getMax());
|
|
@@ -310,7 +312,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<EsmInsCompanyResVo> getCompanyList(String systemCode) {
|
|
public List<EsmInsCompanyResVo> getCompanyList(String systemCode) {
|
|
|
- HttpResult<List<EsmInsCompany>> companyListResult = esmInsCompanyClient.getUserCompany(systemCode,baseController.getToken(),systemCode);
|
|
|
|
|
|
|
+ HttpResult<List<EsmInsCompany>> companyListResult = esmInsCompanyClient.getUserCompany(systemCode);
|
|
|
List<EsmInsCompany> companyList = companyListResult.getData();
|
|
List<EsmInsCompany> companyList = companyListResult.getData();
|
|
|
return BeanUtil.copyToList(companyList, EsmInsCompanyResVo.class);
|
|
return BeanUtil.copyToList(companyList, EsmInsCompanyResVo.class);
|
|
|
}
|
|
}
|
|
@@ -325,37 +327,37 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
PtlAgreementDeptService ptlAgreementDeptService;
|
|
PtlAgreementDeptService ptlAgreementDeptService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<PtlAgreementInsCompanyVo> ruleFilterCompany(SchemeRuleFilterVo schemeRuleFilterVo){
|
|
|
|
|
|
|
+ public List<PtlAgreementInsCompanyVo> ruleFilterCompany(SchemeRuleFilterVo schemeRuleFilterVo) {
|
|
|
//如果用户租户code为App 则使用参数传来的租户code
|
|
//如果用户租户code为App 则使用参数传来的租户code
|
|
|
String systemCode = "";
|
|
String systemCode = "";
|
|
|
- if("APP".equals(baseController.getUserSystemCode())){
|
|
|
|
|
|
|
+ if ("APP".equals(baseController.getUserSystemCode())) {
|
|
|
systemCode = baseController.getAppSystemCode();
|
|
systemCode = baseController.getAppSystemCode();
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
systemCode = baseController.getUserSystemCode();
|
|
systemCode = baseController.getUserSystemCode();
|
|
|
}
|
|
}
|
|
|
//根据权限获取所有保司
|
|
//根据权限获取所有保司
|
|
|
- HttpResult<List<EsmInsCompany>> companyListResult = esmInsCompanyClient.getUserCompany(systemCode,baseController.getToken(),systemCode);
|
|
|
|
|
- AssertionUtils.isFail(companyListResult.getCode()!=200,companyListResult.getMsg());
|
|
|
|
|
|
|
+ HttpResult<List<EsmInsCompany>> companyListResult = esmInsCompanyClient.getUserCompany(systemCode);
|
|
|
|
|
+ AssertionUtils.isFail(companyListResult.getCode() != 200, companyListResult.getMsg());
|
|
|
List<EsmInsCompany> companyList = companyListResult.getData();
|
|
List<EsmInsCompany> companyList = companyListResult.getData();
|
|
|
//根据基本规则 能源、车辆类型、使用性质获取方案
|
|
//根据基本规则 能源、车辆类型、使用性质获取方案
|
|
|
List<PtlScheme> ptlSchemes = ptlSchemeMapper.selectList(new LambdaQueryWrapper<PtlScheme>()
|
|
List<PtlScheme> ptlSchemes = ptlSchemeMapper.selectList(new LambdaQueryWrapper<PtlScheme>()
|
|
|
.eq(PtlScheme::getEnergyType, schemeRuleFilterVo.getCarInfo().getEnergyTypeCode())
|
|
.eq(PtlScheme::getEnergyType, schemeRuleFilterVo.getCarInfo().getEnergyTypeCode())
|
|
|
.like(PtlScheme::getCarnature, schemeRuleFilterVo.getCarInfo().getCarNatureCode())
|
|
.like(PtlScheme::getCarnature, schemeRuleFilterVo.getCarInfo().getCarNatureCode())
|
|
|
.like(PtlScheme::getVehicleType, schemeRuleFilterVo.getCarInfo().getCarKindCode())
|
|
.like(PtlScheme::getVehicleType, schemeRuleFilterVo.getCarInfo().getCarKindCode())
|
|
|
- .eq(PtlScheme::getProductId,schemeRuleFilterVo.getProductId())
|
|
|
|
|
|
|
+ .eq(PtlScheme::getProductId, schemeRuleFilterVo.getProductId())
|
|
|
.eq(PtlScheme::getIsDelete, 0));
|
|
.eq(PtlScheme::getIsDelete, 0));
|
|
|
|
|
|
|
|
// 查找规则
|
|
// 查找规则
|
|
|
List<String> ptlSchemeIds = ptlSchemes.stream().map(PtlScheme::getId).collect(Collectors.toList());
|
|
List<String> ptlSchemeIds = ptlSchemes.stream().map(PtlScheme::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
- AssertionUtils.isFail(ptlSchemeIds.isEmpty(),"没有可报价的保险公司");
|
|
|
|
|
|
|
+ AssertionUtils.isFail(ptlSchemeIds.isEmpty(), "没有可报价的保险公司");
|
|
|
|
|
|
|
|
List<PtlSchemeRulesAttrLink> ptlSchemeRulesAttrLinks = ptlSchemeRulesAttrLinkMapper.selectList(new LambdaQueryWrapper<PtlSchemeRulesAttrLink>()
|
|
List<PtlSchemeRulesAttrLink> ptlSchemeRulesAttrLinks = ptlSchemeRulesAttrLinkMapper.selectList(new LambdaQueryWrapper<PtlSchemeRulesAttrLink>()
|
|
|
- .in(PtlSchemeRulesAttrLink::getSchemeId, ptlSchemeIds));
|
|
|
|
|
|
|
+ .in(PtlSchemeRulesAttrLink::getSchemeId, ptlSchemeIds));
|
|
|
|
|
|
|
|
// 将规则根据schemeId聚合转换成Map
|
|
// 将规则根据schemeId聚合转换成Map
|
|
|
Map<String, List<PtlSchemeRulesAttrLink>> ptlSchemeRulesAttrLinkMap = ptlSchemeRulesAttrLinks.stream()
|
|
Map<String, List<PtlSchemeRulesAttrLink>> ptlSchemeRulesAttrLinkMap = ptlSchemeRulesAttrLinks.stream()
|
|
|
- .collect(Collectors.groupingBy(PtlSchemeRulesAttrLink::getSchemeId));
|
|
|
|
|
|
|
+ .collect(Collectors.groupingBy(PtlSchemeRulesAttrLink::getSchemeId));
|
|
|
|
|
|
|
|
ValidateSchemeRuleVo validateSchemeRuleVo = new ValidateSchemeRuleVo();
|
|
ValidateSchemeRuleVo validateSchemeRuleVo = new ValidateSchemeRuleVo();
|
|
|
validateSchemeRuleVo.builderQuoteVo(schemeRuleFilterVo, redissonClient);
|
|
validateSchemeRuleVo.builderQuoteVo(schemeRuleFilterVo, redissonClient);
|
|
@@ -368,11 +370,11 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
List<String> companyIds = ptlSchemes.stream().map(ptlScheme -> ptlScheme.getCompanyId()).collect(Collectors.toList());
|
|
List<String> companyIds = ptlSchemes.stream().map(ptlScheme -> ptlScheme.getCompanyId()).collect(Collectors.toList());
|
|
|
companyList.removeIf(company -> !companyIds.contains(company.getId()));
|
|
companyList.removeIf(company -> !companyIds.contains(company.getId()));
|
|
|
List<PtlAgreementInsCompanyVo> resVo = new ArrayList<>();
|
|
List<PtlAgreementInsCompanyVo> resVo = new ArrayList<>();
|
|
|
- companyList.forEach(company->{
|
|
|
|
|
|
|
+ companyList.forEach(company -> {
|
|
|
PtlAgreementInsCompanyVo vo = new PtlAgreementInsCompanyVo();
|
|
PtlAgreementInsCompanyVo vo = new PtlAgreementInsCompanyVo();
|
|
|
- BeanUtil.copyProperties(company,vo);
|
|
|
|
|
|
|
+ BeanUtil.copyProperties(company, vo);
|
|
|
vo.setCnName(vo.getCode());
|
|
vo.setCnName(vo.getCode());
|
|
|
- vo.setLogo(MinioUtils.getPresignedObjectUrl(bucketName,company.getLogo()));
|
|
|
|
|
|
|
+ vo.setLogo(MinioUtils.getPresignedObjectUrl(bucketName, company.getLogo()));
|
|
|
resVo.add(vo);
|
|
resVo.add(vo);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -380,14 +382,14 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
dispatchRuleVos.setQuoteVo(validateSchemeRuleVo.getQuoteVo());
|
|
dispatchRuleVos.setQuoteVo(validateSchemeRuleVo.getQuoteVo());
|
|
|
//2.协议调度规则数据拼接
|
|
//2.协议调度规则数据拼接
|
|
|
String finalSystemCode = systemCode;
|
|
String finalSystemCode = systemCode;
|
|
|
- companyList.forEach(company->{
|
|
|
|
|
|
|
+ companyList.forEach(company -> {
|
|
|
PtlAgreementDispatchQuery query = new PtlAgreementDispatchQuery();
|
|
PtlAgreementDispatchQuery query = new PtlAgreementDispatchQuery();
|
|
|
query.setCompanyId(company.getId());
|
|
query.setCompanyId(company.getId());
|
|
|
- HttpResult agreementDispatch = orgClient.getAgreementDispatch(query,baseController.getToken(), finalSystemCode);
|
|
|
|
|
- if(agreementDispatch.getCode() == 200){
|
|
|
|
|
|
|
+ HttpResult agreementDispatch = orgClient.getAgreementDispatch(query);
|
|
|
|
|
+ if (agreementDispatch.getCode() == 200) {
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
List<PtlAgreementDispatchVo.DispatchVo> vos = new ArrayList<>();
|
|
List<PtlAgreementDispatchVo.DispatchVo> vos = new ArrayList<>();
|
|
|
- Map<String, Object> data = (Map<String, Object>)agreementDispatch.getData();
|
|
|
|
|
|
|
+ Map<String, Object> data = (Map<String, Object>) agreementDispatch.getData();
|
|
|
|
|
|
|
|
Object dispatchVosObj = data.get("dispatchVos");
|
|
Object dispatchVosObj = data.get("dispatchVos");
|
|
|
if (dispatchVosObj instanceof List) {
|
|
if (dispatchVosObj instanceof List) {
|
|
@@ -399,7 +401,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 根据section 分组 进行拆分 规则
|
|
// 根据section 分组 进行拆分 规则
|
|
|
- for (PtlAgreementDispatchVo.DispatchVo vo : vos){
|
|
|
|
|
|
|
+ for (PtlAgreementDispatchVo.DispatchVo vo : vos) {
|
|
|
List<PtlAgreementDispatchRulesAttrLink> attrLinks = vo.getAttrLinks();
|
|
List<PtlAgreementDispatchRulesAttrLink> attrLinks = vo.getAttrLinks();
|
|
|
Map<String, List<PtlAgreementDispatchRulesAttrLink>> grouped =
|
|
Map<String, List<PtlAgreementDispatchRulesAttrLink>> grouped =
|
|
|
attrLinks.stream()
|
|
attrLinks.stream()
|
|
@@ -420,20 +422,20 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
//
|
|
//
|
|
|
// 3. 校验调度数据
|
|
// 3. 校验调度数据
|
|
|
HttpResult httpResult = costsRuleClient.validateDispatchRule(dispatchRuleVos);
|
|
HttpResult httpResult = costsRuleClient.validateDispatchRule(dispatchRuleVos);
|
|
|
- if(httpResult.getCode() == 200){
|
|
|
|
|
|
|
+ if (httpResult.getCode() == 200) {
|
|
|
// 返回了调度id 通过调度id 查询动作
|
|
// 返回了调度id 通过调度id 查询动作
|
|
|
List<PtlAgreementDispatchVo.DispatchVo> agreementDispatchAction = ptlAgreementDispatchService.getAgreementDispatchAction((List<String>) httpResult.getData());
|
|
List<PtlAgreementDispatchVo.DispatchVo> agreementDispatchAction = ptlAgreementDispatchService.getAgreementDispatchAction((List<String>) httpResult.getData());
|
|
|
// 如果动作中存在替换协议则 保司标志置为调度
|
|
// 如果动作中存在替换协议则 保司标志置为调度
|
|
|
- resVo.forEach(company->{
|
|
|
|
|
|
|
+ resVo.forEach(company -> {
|
|
|
company.setIsDispatch(0);
|
|
company.setIsDispatch(0);
|
|
|
PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo = agreementDispatchAction.stream().filter(x -> x.getCompanyId().contains(company.getId())).findFirst().orElse(null);
|
|
PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo = agreementDispatchAction.stream().filter(x -> x.getCompanyId().contains(company.getId())).findFirst().orElse(null);
|
|
|
- if(ptlAgreementDispatchVo != null){
|
|
|
|
|
|
|
+ if (ptlAgreementDispatchVo != null) {
|
|
|
PtlAgreementDispatchAction action1 = ptlAgreementDispatchVo.getActions().stream().filter(action -> action.getActionCode().equals(ActionEnum.SPECIFY_AGREEMENT.getCode())).findFirst().orElse(null);
|
|
PtlAgreementDispatchAction action1 = ptlAgreementDispatchVo.getActions().stream().filter(action -> action.getActionCode().equals(ActionEnum.SPECIFY_AGREEMENT.getCode())).findFirst().orElse(null);
|
|
|
- if(action1 != null){
|
|
|
|
|
|
|
+ if (action1 != null) {
|
|
|
//将调度字段设为1
|
|
//将调度字段设为1
|
|
|
company.setIsDispatch(1);
|
|
company.setIsDispatch(1);
|
|
|
// 如果等于置顶协议 则 设置调用协议id
|
|
// 如果等于置顶协议 则 设置调用协议id
|
|
|
- if(action1.getActionCode().equals("specify_agreement")){
|
|
|
|
|
|
|
+ if (action1.getActionCode().equals("specify_agreement")) {
|
|
|
company.setDispatchAgreementId(action1.getActionJson().getString("agreementId"));
|
|
company.setDispatchAgreementId(action1.getActionJson().getString("agreementId"));
|
|
|
}
|
|
}
|
|
|
company.setDispatchId(ptlAgreementDispatchVo.getDispatchId());
|
|
company.setDispatchId(ptlAgreementDispatchVo.getDispatchId());
|
|
@@ -445,7 +447,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public SchemeResultVo getSchemeResult(String companyId,String productId){
|
|
|
|
|
|
|
+ public SchemeResultVo getSchemeResult(String companyId, String productId) {
|
|
|
List<SchemeResultVo.SchemeVo> schemeInsuranceInfo = ptlSchemeMapper.getSchemeInsuranceInfo(companyId, productId);
|
|
List<SchemeResultVo.SchemeVo> schemeInsuranceInfo = ptlSchemeMapper.getSchemeInsuranceInfo(companyId, productId);
|
|
|
List<SchemeResultVo.SchemeVo> schemeDrivingInfo = ptlSchemeMapper.getSchemeDrivingInfo(companyId, productId);
|
|
List<SchemeResultVo.SchemeVo> schemeDrivingInfo = ptlSchemeMapper.getSchemeDrivingInfo(companyId, productId);
|
|
|
// 创建一个 Map,Key: info.id, Value: List<Driving>
|
|
// 创建一个 Map,Key: info.id, Value: List<Driving>
|
|
@@ -468,7 +470,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- schemeInsuranceInfo.forEach(scheme->{
|
|
|
|
|
|
|
+ schemeInsuranceInfo.forEach(scheme -> {
|
|
|
for (SchemeResultVo.SchemeInfoVo info : scheme.getInfos()) {
|
|
for (SchemeResultVo.SchemeInfoVo info : scheme.getInfos()) {
|
|
|
info.setProductId(scheme.getProductId());
|
|
info.setProductId(scheme.getProductId());
|
|
|
info.setCompanyId(scheme.getCompanyId());
|
|
info.setCompanyId(scheme.getCompanyId());
|
|
@@ -476,7 +478,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
schemeInsuranceInfo.forEach(schemeVo -> {
|
|
schemeInsuranceInfo.forEach(schemeVo -> {
|
|
|
- if(!schemeVo.getInfos().isEmpty()){
|
|
|
|
|
|
|
+ if (!schemeVo.getInfos().isEmpty()) {
|
|
|
schemeVo.setSchemeType(schemeVo.getInfos().get(0).getSchemeType());
|
|
schemeVo.setSchemeType(schemeVo.getInfos().get(0).getSchemeType());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -487,8 +489,8 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
|
|
List<SchemeResultVo.SchemeInfoVo> allInfo = new ArrayList<>();
|
|
List<SchemeResultVo.SchemeInfoVo> allInfo = new ArrayList<>();
|
|
|
|
|
|
|
|
- schemeVo.forEach(scheme->{
|
|
|
|
|
- scheme.getInfos().forEach(item->{
|
|
|
|
|
|
|
+ schemeVo.forEach(scheme -> {
|
|
|
|
|
+ scheme.getInfos().forEach(item -> {
|
|
|
allInfo.add(item);
|
|
allInfo.add(item);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -498,7 +500,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
//把基础方案的商业险的value 赋值
|
|
//把基础方案的商业险的value 赋值
|
|
|
schemeResultVo.getSchemes().forEach(schemeInfoVo -> {
|
|
schemeResultVo.getSchemes().forEach(schemeInfoVo -> {
|
|
|
schemeInfoVo.getKinds().forEach(kind -> {
|
|
schemeInfoVo.getKinds().forEach(kind -> {
|
|
|
- if(!kind.getOptions().isEmpty()) {
|
|
|
|
|
|
|
+ if (!kind.getOptions().isEmpty()) {
|
|
|
kind.setAmount(kind.getOptions().get(0).getValue());
|
|
kind.setAmount(kind.getOptions().get(0).getValue());
|
|
|
kind.setUnitAmount(kind.getOptions().get(0).getValue());
|
|
kind.setUnitAmount(kind.getOptions().get(0).getValue());
|
|
|
kind.setServiceTimes(kind.getOptions().get(0).getValue());
|
|
kind.setServiceTimes(kind.getOptions().get(0).getValue());
|
|
@@ -508,12 +510,12 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
|
|
//自选方案
|
|
//自选方案
|
|
|
SchemeResultVo.SchemeVo opSchemeVo = schemeInsuranceInfo.stream().filter(x -> x.getSchemeType().equals("2")).findFirst().orElse(null);
|
|
SchemeResultVo.SchemeVo opSchemeVo = schemeInsuranceInfo.stream().filter(x -> x.getSchemeType().equals("2")).findFirst().orElse(null);
|
|
|
- if(Objects.nonNull(opSchemeVo)){
|
|
|
|
|
|
|
+ if (Objects.nonNull(opSchemeVo)) {
|
|
|
schemeResultVo.setOptionalScheme(opSchemeVo.getInfos().get(0));
|
|
schemeResultVo.setOptionalScheme(opSchemeVo.getInfos().get(0));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//排除交强险的险种
|
|
//排除交强险的险种
|
|
|
- schemeResultVo.getSchemes().stream().forEach(scheme->{
|
|
|
|
|
|
|
+ schemeResultVo.getSchemes().stream().forEach(scheme -> {
|
|
|
scheme.getKinds().removeIf(kind -> "J1".equals(kind.getKindCode()));
|
|
scheme.getKinds().removeIf(kind -> "J1".equals(kind.getKindCode()));
|
|
|
});
|
|
});
|
|
|
|
|
|