|
@@ -6,6 +6,8 @@ import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
import com.jzg.commons.entity.quote.vo.CarInfoVo;
|
|
import com.jzg.commons.entity.quote.vo.CarInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
|
|
import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
|
|
|
|
|
+import com.jzg.commons.entity.quote.vo.KindInfoVo;
|
|
|
|
|
+import com.jzg.commons.entity.quote.vo.RiskInfoVo;
|
|
|
import com.jzg.quotation.chengtai.crawler.model.entity.*;
|
|
import com.jzg.quotation.chengtai.crawler.model.entity.*;
|
|
|
import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiImageUploadParam;
|
|
import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiImageUploadParam;
|
|
|
import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiPremiumcalParam;
|
|
import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiPremiumcalParam;
|
|
@@ -20,14 +22,12 @@ import com.jzg.quotation.commons.entity.vo.base.OrderBase;
|
|
|
import com.jzg.quotation.commons.entity.vo.image.InsuranceImageVo;
|
|
import com.jzg.quotation.commons.entity.vo.image.InsuranceImageVo;
|
|
|
import com.jzg.quotation.commons.service.QuotationApiBaseService;
|
|
import com.jzg.quotation.commons.service.QuotationApiBaseService;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.Base64;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
@@ -160,7 +160,7 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
// 保存保险单数据10 车辆信息
|
|
// 保存保险单数据10 车辆信息
|
|
|
ChengTaiInsuredObject insuredObject = buildChengTaiPolicyCar(fullCarData, chengTaiCarModel, quoteVo);
|
|
ChengTaiInsuredObject insuredObject = buildChengTaiPolicyCar(fullCarData, chengTaiCarModel, quoteVo);
|
|
|
|
|
|
|
|
- ChengTaiBiContract chengTaiBiContract = buildChengTaiBiContract();
|
|
|
|
|
|
|
+ ChengTaiBiContract chengTaiBiContract = buildChengTaiBiContract(quoteVo);
|
|
|
|
|
|
|
|
ChengTaiCiContract chengTaiCiContract = buildChengTaiCiContract();
|
|
ChengTaiCiContract chengTaiCiContract = buildChengTaiCiContract();
|
|
|
|
|
|
|
@@ -518,7 +518,85 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
return chengTaiSubmitReqBody;
|
|
return chengTaiSubmitReqBody;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private ChengTaiBiContract buildChengTaiBiContract() {
|
|
|
|
|
|
|
+ private ChengTaiBiContract buildChengTaiBiContract(QuoteVo quoteVo) {
|
|
|
|
|
+ RiskInfoVo biRiskInfoVo = quoteVo.getBiRiskInfoVo();
|
|
|
|
|
+
|
|
|
|
|
+ List<KindInfoVo> kindInfoVos = quoteVo.getKindInfoVo();
|
|
|
|
|
+
|
|
|
|
|
+ List<ChengTaiCoverage> chengTaiCoverageList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ for (KindInfoVo kindInfoVo : kindInfoVos) {
|
|
|
|
|
+
|
|
|
|
|
+ String kindCode = kindInfoVo.getKindCode();
|
|
|
|
|
+
|
|
|
|
|
+ if (kindCode.equals("A")) {
|
|
|
|
|
+ ChengTaiCoverage chengTaiCoverage = new ChengTaiCoverage();
|
|
|
|
|
+
|
|
|
|
|
+ chengTaiCoverage.setAmount(kindInfoVo.getAmount());
|
|
|
|
|
+ chengTaiCoverage.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
|
|
|
+ String quantity = kindInfoVo.getQuantity();
|
|
|
|
|
+ String serviceTimes = kindInfoVo.getServiceTimes();
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotBlank(quantity)) {
|
|
|
|
|
+ chengTaiCoverage.setQuantity(quantity);
|
|
|
|
|
+ } else if (StringUtils.isNotBlank(serviceTimes)) {
|
|
|
|
|
+ chengTaiCoverage.setQuantity(serviceTimes);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ chengTaiCoverage.setBasePremium("0");
|
|
|
|
|
+ chengTaiCoverage.setCoveragePremium("0");
|
|
|
|
|
+ chengTaiCoverage.setCalculateFlag("1 ");
|
|
|
|
|
+ chengTaiCoverage.setDeductible("0");
|
|
|
|
|
+ chengTaiCoverage.setDeductibleRate("0");
|
|
|
|
|
+ chengTaiCoverage.setIfMainKind("1");
|
|
|
|
|
+ chengTaiCoverage.setKindCode("A");
|
|
|
|
|
+ chengTaiCoverage.setKindFlag(true);
|
|
|
|
|
+ chengTaiCoverage.setKindName("车损险");
|
|
|
|
|
+ chengTaiCoverage.setKindName(kindInfoVo.getKindName());
|
|
|
|
|
+ chengTaiCoverage.setNotDeductibleCalculateFlag("0");
|
|
|
|
|
+ chengTaiCoverage.setNotDeductibleIfMainKind("0");
|
|
|
|
|
+ chengTaiCoverage.setNotDeductibleKindFlag(false);
|
|
|
|
|
+ chengTaiCoverage.setRate("0");
|
|
|
|
|
+ chengTaiCoverage.setRelatedInd("1");
|
|
|
|
|
+ chengTaiCoverage.setCurrency("CNY");
|
|
|
|
|
+ chengTaiCoverage.setShortRate("100");
|
|
|
|
|
+ chengTaiCoverage.setShortRateType("2");
|
|
|
|
|
+ chengTaiCoverage.setShow(true);
|
|
|
|
|
+ chengTaiCoverage.setValidDate(biRiskInfoVo.getStartDate());
|
|
|
|
|
+ chengTaiCoverage.setExpiryDate(biRiskInfoVo.getEndDate());
|
|
|
|
|
+
|
|
|
|
|
+ chengTaiCoverageList.add(chengTaiCoverage);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ List<ChengTaiCoverage> coverage = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ "amount":140182.4,
|
|
|
|
|
+ "basePremium":"0",
|
|
|
|
|
+ "coveragePremium":"0",
|
|
|
|
|
+ "calculateFlag":"1",
|
|
|
|
|
+ "deductible":0,
|
|
|
|
|
+ "deductibleRate":"0",
|
|
|
|
|
+ "ifMainKind":"1",
|
|
|
|
|
+ "kindCode":"A",
|
|
|
|
|
+ "kindFlag":true,
|
|
|
|
|
+ "kindName":"车损险",
|
|
|
|
|
+ "notDeductibleCalculateFlag":"0",
|
|
|
|
|
+ "notDeductibleIfMainKind":"0",
|
|
|
|
|
+ "notDeductibleKindFlag":true,
|
|
|
|
|
+ "relatedInd":"1",
|
|
|
|
|
+ "validDate":"2025-04-11 00:00:00",
|
|
|
|
|
+ "expiryDate":"2026-04-11 00:00:00",
|
|
|
|
|
+ "currency":"CNY",
|
|
|
|
|
+ "shortRate":100,
|
|
|
|
|
+ "shortRateType":"2"
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
ChengTaiContractMain contractMain = new ChengTaiContractMain();
|
|
ChengTaiContractMain contractMain = new ChengTaiContractMain();
|
|
|
contractMain.setCurrency("CNY");
|
|
contractMain.setCurrency("CNY");
|
|
|
contractMain.setExpiryDate("2026-04-04 00:00:00");
|
|
contractMain.setExpiryDate("2026-04-04 00:00:00");
|
|
@@ -532,6 +610,9 @@ public class ChengTaiCrawlerRequestService implements QuotationApiBaseService {
|
|
|
ChengTaiBiContract chengTaiBiContract = new ChengTaiBiContract();
|
|
ChengTaiBiContract chengTaiBiContract = new ChengTaiBiContract();
|
|
|
chengTaiBiContract.setContractMain(contractMain);
|
|
chengTaiBiContract.setContractMain(contractMain);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return chengTaiBiContract;
|
|
return chengTaiBiContract;
|
|
|
}
|
|
}
|
|
|
|
|
|