|
|
@@ -2,10 +2,12 @@ package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
+import com.ydtech.modules.order.entity.InsAreaCompanyCarUserInfo;
|
|
|
import com.ydtech.modules.order.entity.po.InsOrdersCarUserInfo;
|
|
|
import com.ydtech.modules.order.service.InsOrdersCarInfoService;
|
|
|
import com.ydtech.modules.order.service.InsOrdersCarUserInfoService;
|
|
|
@@ -43,6 +45,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -95,6 +98,9 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
@Autowired
|
|
|
private InsOrdersCarUserInfoService insOrdersCarUserInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InsAreaCompanyCarUserInfoService insAreaCompanyCarUserInfoService;
|
|
|
+
|
|
|
@Override
|
|
|
public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfo, BaseQuoteVo<AccidentalDrivingVo> zmQuoteVo) {
|
|
|
// 1. 协议id获取配置实体
|
|
|
@@ -171,8 +177,8 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
// 1. 协议id获取配置实体
|
|
|
HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class,
|
|
|
insAreaCompany.getAgreementId());
|
|
|
-// InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
InsOrdersBo insOrders = insOrdersService.queryInsOrders(insAreaCompany.getOrderno());
|
|
|
+
|
|
|
YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
|
|
|
|
|
|
// 2. 调用转投保接口
|
|
|
@@ -283,8 +289,31 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
|
|
|
InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
|
- InsOrdersCarUserInfo ownerinfo = insOrders.getOwnerinfo();
|
|
|
- InsOrdersCarUserInfo applyinfo = insOrders.getApplyinfo();
|
|
|
+
|
|
|
+ List<String> uids = new ArrayList<>();
|
|
|
+ uids.add(insAreaCompany.getOwnerId());
|
|
|
+ uids.add(insAreaCompany.getApplyId());
|
|
|
+ uids.add(insAreaCompany.getInsureId());
|
|
|
+ InsOrdersCarUserInfo ownerInfo = new InsOrdersCarUserInfo();
|
|
|
+ InsOrdersCarUserInfo applyInfo = new InsOrdersCarUserInfo();
|
|
|
+ InsOrdersCarUserInfo insureInfo = new InsOrdersCarUserInfo();
|
|
|
+ List<InsAreaCompanyCarUserInfo> carUserInfos = insAreaCompanyCarUserInfoService.list(new LambdaQueryWrapper<>(InsAreaCompanyCarUserInfo.class).in(InsAreaCompanyCarUserInfo::getId, uids));
|
|
|
+ carUserInfos.forEach(item->{
|
|
|
+ if (item.getId().equals(insAreaCompany.getOwnerId())) {
|
|
|
+ BeanUtils.copyProperties(item, ownerInfo);
|
|
|
+ insOrders.setOwnerinfo(ownerInfo);
|
|
|
+ }
|
|
|
+ if (item.getId().equals(insAreaCompany.getApplyId())) {
|
|
|
+ BeanUtils.copyProperties(item, applyInfo);
|
|
|
+ insOrders.setApplyinfo(applyInfo);
|
|
|
+ }
|
|
|
+ if (item.getId().equals(insAreaCompany.getInsureId())) {
|
|
|
+ BeanUtils.copyProperties(item, insureInfo);
|
|
|
+ insOrders.setInsureinfo(insureInfo);
|
|
|
+ }
|
|
|
+ });
|
|
|
+// InsOrdersCarUserInfo ownerinfo = insOrders.getOwnerinfo();
|
|
|
+// InsOrdersCarUserInfo applyinfo = insOrders.getApplyinfo();
|
|
|
|
|
|
List<String> collect =
|
|
|
insAreaCompany.getRiskinfo().toJavaList(RiskInfoVo.class).stream().map(RiskInfoVo::getRiskCode).collect(Collectors.toList());
|
|
|
@@ -293,10 +322,10 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
for (InsHuataiContributing insHuataiContributing : list) {
|
|
|
if ("T0028".equals(insHuataiContributing.getEngageCode())) {
|
|
|
- insHuataiContributing.setEngageDetail(insHuataiContributing.getEngageDetail() + ownerinfo.getName());
|
|
|
+ insHuataiContributing.setEngageDetail(insHuataiContributing.getEngageDetail() + ownerInfo.getName());
|
|
|
}
|
|
|
if ("T0093".equals(insHuataiContributing.getEngageCode())) {
|
|
|
- insHuataiContributing.setEngageDetail(insHuataiContributing.getEngageDetail() + applyinfo.getName());
|
|
|
+ insHuataiContributing.setEngageDetail(insHuataiContributing.getEngageDetail() + applyInfo.getName());
|
|
|
}
|
|
|
}
|
|
|
|