|
|
@@ -1,6 +1,7 @@
|
|
|
package com.jzg.organization.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -28,6 +29,8 @@ import com.jzg.organization.client.OrgClient;
|
|
|
import com.jzg.organization.mapper.*;
|
|
|
import com.jzg.organization.service.*;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -40,6 +43,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme> implements PtlSchemeService {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(PtlSchemeServiceImpl.class);
|
|
|
@Value("${minio.bucket-name}")
|
|
|
private String bucketName;
|
|
|
|
|
|
@@ -70,9 +74,6 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
@Autowired
|
|
|
RedissonClient redissonClient;
|
|
|
|
|
|
- @Autowired
|
|
|
- private PtlAgreementService agreementService;
|
|
|
-
|
|
|
@Autowired
|
|
|
PtlAgreementDispatchService ptlAgreementDispatchService;
|
|
|
|
|
|
@@ -162,11 +163,9 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
//获取商业险
|
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurances = ptlSchemeInsuranceMapper.getSchemeInsurance(ptlSchemeInfo.getId());
|
|
|
- ptlSchemeInsurances.forEach(item -> {
|
|
|
- item.getOptionVos().forEach(option -> {
|
|
|
- item.getOptionId().add(option.getOptionId());
|
|
|
- });
|
|
|
- });
|
|
|
+ ptlSchemeInsurances.forEach(item -> item.getOptionVos().forEach(option -> {
|
|
|
+ item.getOptionId().add(option.getOptionId());
|
|
|
+ }));
|
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurancesNew = new ArrayList<>();
|
|
|
Map<String, PtlSchemeInsuranceVo> insuranceMap = new HashMap<>();
|
|
|
|
|
|
@@ -202,9 +201,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
List<PtlAgreementUndwrtRulesAttr> agreementRulesVo = rulesGet(ptlScheme.getCompanyId(), ptlScheme.getId());
|
|
|
|
|
|
//拼装返回数据
|
|
|
- PtlSchemeQueryVo vo = new PtlSchemeQueryVo(ptlScheme, ptlSchemeInfo, ptlSchemeInsurancesNew, ptlSchemeInsuranceDrivingIntentions, ptlSchemeRulesAttrLinks, agreementRulesVo);
|
|
|
-
|
|
|
- return vo;
|
|
|
+ return new PtlSchemeQueryVo(ptlScheme, ptlSchemeInfo, ptlSchemeInsurancesNew, ptlSchemeInsuranceDrivingIntentions, ptlSchemeRulesAttrLinks, agreementRulesVo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -236,11 +233,9 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
//获取商业险
|
|
|
List<PtlSchemeInsuranceVo> ptlSchemeInsurances = ptlSchemeInsuranceMapper.getSchemeInsurance(ptlSchemeInfo.getId());
|
|
|
- ptlSchemeInsurances.forEach(item -> {
|
|
|
- item.getOptionVos().forEach(option -> {
|
|
|
- item.getOptionId().add(option.getOptionId());
|
|
|
- });
|
|
|
- });
|
|
|
+ ptlSchemeInsurances.forEach(item -> item.getOptionVos().forEach(option -> {
|
|
|
+ item.getOptionId().add(option.getOptionId());
|
|
|
+ }));
|
|
|
scheme.setSchemeInsuranceList(ptlSchemeInsurances);
|
|
|
|
|
|
//获取驾意险
|
|
|
@@ -256,15 +251,12 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
List<PtlAgreementUndwrtRulesAttr> agreementRulesVo = rulesGet(ptlScheme.getCompanyId(), ptlScheme.getId());
|
|
|
|
|
|
//拼装返回数据
|
|
|
- PtlSchemeQueryVo vo = new PtlSchemeQueryVo(ptlScheme, ptlSchemeInfos, schemes, ptlSchemeRulesAttrLinks, agreementRulesVo);
|
|
|
-
|
|
|
- return vo;
|
|
|
+ return new PtlSchemeQueryVo(ptlScheme, ptlSchemeInfos, schemes, ptlSchemeRulesAttrLinks, agreementRulesVo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Page<PtlSchemeVo> getSchemePage(Page page, PtlSchemeVo ptlSchemeVo) {
|
|
|
- Page<PtlSchemeVo> schemePage = ptlSchemeMapper.getSchemePage(page, ptlSchemeVo);
|
|
|
- return schemePage;
|
|
|
+ return ptlSchemeMapper.getSchemePage(page, ptlSchemeVo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -323,9 +315,6 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
@Autowired
|
|
|
BaseController baseController;
|
|
|
|
|
|
- @Autowired
|
|
|
- PtlAgreementDeptService ptlAgreementDeptService;
|
|
|
-
|
|
|
@Override
|
|
|
public List<PtlAgreementInsCompanyVo> ruleFilterCompany(SchemeRuleFilterVo schemeRuleFilterVo) {
|
|
|
//如果用户租户code为App 则使用参数传来的租户code
|
|
|
@@ -339,6 +328,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
HttpResult<List<EsmInsCompany>> companyListResult = esmInsCompanyClient.getUserCompany(systemCode);
|
|
|
AssertionUtils.isFail(companyListResult.getCode() != 200, companyListResult.getMsg());
|
|
|
List<EsmInsCompany> companyList = companyListResult.getData();
|
|
|
+ log.info("根据权限获取到的保司个数是[{}].systemCode=[{}],systemCode=[{}]", CollUtil.size(companyList),systemCode,systemCode);
|
|
|
//根据基本规则 能源、车辆类型、使用性质获取方案
|
|
|
List<PtlScheme> ptlSchemes = ptlSchemeMapper.selectList(new LambdaQueryWrapper<PtlScheme>()
|
|
|
.eq(PtlScheme::getEnergyType, schemeRuleFilterVo.getCarInfo().getEnergyTypeCode())
|
|
|
@@ -356,8 +346,8 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
.in(PtlSchemeRulesAttrLink::getSchemeId, ptlSchemeIds));
|
|
|
|
|
|
// 将规则根据schemeId聚合转换成Map
|
|
|
- Map<String, List<PtlSchemeRulesAttrLink>> ptlSchemeRulesAttrLinkMap = ptlSchemeRulesAttrLinks.stream()
|
|
|
- .collect(Collectors.groupingBy(PtlSchemeRulesAttrLink::getSchemeId));
|
|
|
+// Map<String, List<PtlSchemeRulesAttrLink>> ptlSchemeRulesAttrLinkMap = ptlSchemeRulesAttrLinks.stream()
|
|
|
+// .collect(Collectors.groupingBy(PtlSchemeRulesAttrLink::getSchemeId));
|
|
|
|
|
|
ValidateSchemeRuleVo validateSchemeRuleVo = new ValidateSchemeRuleVo();
|
|
|
validateSchemeRuleVo.builderQuoteVo(schemeRuleFilterVo, redissonClient);
|
|
|
@@ -485,16 +475,13 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
|
|
|
SchemeResultVo schemeResultVo = new SchemeResultVo();
|
|
|
//基础方案
|
|
|
- List<SchemeResultVo.SchemeVo> schemeVo = schemeInsuranceInfo.stream().filter(x -> x.getSchemeType().equals("1")).collect(Collectors.toList());
|
|
|
+ List<SchemeResultVo.SchemeVo> schemeVo = schemeInsuranceInfo.stream().filter(x -> x.getSchemeType().equals("1")).toList();
|
|
|
|
|
|
List<SchemeResultVo.SchemeInfoVo> allInfo = new ArrayList<>();
|
|
|
|
|
|
- schemeVo.forEach(scheme -> {
|
|
|
- scheme.getInfos().forEach(item -> {
|
|
|
- allInfo.add(item);
|
|
|
- });
|
|
|
-
|
|
|
- });
|
|
|
+ schemeVo.forEach(scheme -> scheme.getInfos().forEach(item -> {
|
|
|
+ allInfo.add(item);
|
|
|
+ }));
|
|
|
|
|
|
schemeResultVo.setSchemes(allInfo);
|
|
|
//把基础方案的商业险的value 赋值
|