|
|
@@ -3,22 +3,28 @@ package com.jzg.quotation.summary.service.impl;
|
|
|
import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.quotation.commons.constant.enums.base.ApiType;
|
|
|
import com.jzg.quotation.commons.constant.enums.base.QuoteRuleCategory;
|
|
|
+import com.jzg.quotation.commons.entity.vo.aggregated.InsuranceUploadImageVo;
|
|
|
import com.jzg.quotation.commons.entity.vo.aggregated.QuoteResultsVo;
|
|
|
import com.jzg.quotation.commons.entity.vo.aggregated.QuoteVo;
|
|
|
import com.jzg.quotation.commons.entity.vo.aggregated.UploadImageVo;
|
|
|
import com.jzg.quotation.commons.entity.vo.base.OrderBase;
|
|
|
+import com.jzg.quotation.commons.entity.vo.image.ImageVo;
|
|
|
+import com.jzg.quotation.commons.entity.vo.image.InsuranceImageVo;
|
|
|
import com.jzg.quotation.commons.service.QuotationApiBaseService;
|
|
|
import com.jzg.quotation.commons.service.QuotationBaseService;
|
|
|
import com.jzg.quotation.commons.service.QuotationCrawlerBaseService;
|
|
|
import com.jzg.quotation.summary.converter.QuoteInfoConverter;
|
|
|
+import com.jzg.quotation.summary.entity.po.QuoteImageRuleMapping;
|
|
|
import com.jzg.quotation.summary.entity.po.QuoteRuleMapping;
|
|
|
import com.jzg.quotation.summary.service.InsuranceCompanyRequestService;
|
|
|
+import com.jzg.quotation.summary.service.QuoteImageRuleMappingService;
|
|
|
import com.jzg.quotation.summary.service.QuoteRuleMappingService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @description: TODO
|
|
|
@@ -31,6 +37,8 @@ public class InsuranceCompanyRequestServiceImpl implements InsuranceCompanyReque
|
|
|
|
|
|
private final QuoteRuleMappingService quoteRuleMappingService;
|
|
|
|
|
|
+ private final QuoteImageRuleMappingService quoteImageRuleMappingService;
|
|
|
+
|
|
|
private final Map<String, QuotationApiBaseService> quoteApiBaseServiceMap;
|
|
|
|
|
|
private final Map<String, QuotationCrawlerBaseService> quotationCrawlerBaseServiceMap;
|
|
|
@@ -58,8 +66,7 @@ public class InsuranceCompanyRequestServiceImpl implements InsuranceCompanyReque
|
|
|
@Override
|
|
|
public QuoteResultsVo quote(QuoteVo quoteVo) {
|
|
|
OrderBase order = quoteVo.getOrder();
|
|
|
- String insuranceCompanyCode = order.getInsuranceCompanyCode();
|
|
|
- String insuranceCode = extractEnglishChars(insuranceCompanyCode);
|
|
|
+ String insuranceCode = extractEnglishChars(order.getInsuranceCompanyCode());
|
|
|
Map<String, List<QuoteRuleMapping>> quoteKindMappingMap = quoteRuleMappingService.getByInsuranceCompanyCode(insuranceCode);
|
|
|
QuoteInfoConverter.converterCarInfoVo(quoteVo.getCarInfoVo(), quoteKindMappingMap.get(QuoteRuleCategory.QUOTE_INFO.getCode()));
|
|
|
QuoteInfoConverter.converterKindInfoVo(quoteVo.getKindInfoVo(), quoteKindMappingMap.get(QuoteRuleCategory.KIND.getCode()));
|
|
|
@@ -68,10 +75,13 @@ public class InsuranceCompanyRequestServiceImpl implements InsuranceCompanyReque
|
|
|
|
|
|
@Override
|
|
|
public void uploadImage(UploadImageVo uploadImageVo) {
|
|
|
-
|
|
|
+ OrderBase order = uploadImageVo.getOrder();
|
|
|
+ String insuranceCode = extractEnglishChars(order.getInsuranceCompanyCode());
|
|
|
+ Map<String, ImageVo> imageVoMap = uploadImageVo.getImageVoList().stream().collect(Collectors.toMap(ImageVo::getImageType, x -> x));
|
|
|
+ List<InsuranceImageVo> insuranceImageVoList = quoteImageRuleMappingService.buildInsuranceUploadImageVo(insuranceCode, imageVoMap);
|
|
|
+ InsuranceUploadImageVo insuranceUploadImageVo = new InsuranceUploadImageVo(uploadImageVo.getOrder(), insuranceImageVoList);
|
|
|
+ getQuotationBase(order.getApiType(), insuranceCode).uploadImage(insuranceUploadImageVo);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|