|
|
@@ -7,8 +7,7 @@ import com.google.zxing.NotFoundException;
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
import com.jzg.commons.constants.dict.InsOrderStatusEnum;
|
|
|
-import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
|
|
|
-import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
+import com.jzg.commons.entity.quote.vo.*;
|
|
|
import com.jzg.commons.entity.quote.vo.aggregated.*;
|
|
|
import com.jzg.commons.entity.quote.vo.base.LoginBase;
|
|
|
import com.jzg.quotation.commons.entity.DetectLoginRequest;
|
|
|
@@ -29,9 +28,9 @@ import com.jzg.quotation.zijin.crawler.entity.response.*;
|
|
|
import com.jzg.quotation.zijin.crawler.service.ZiJinCrawlerRequest;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
@@ -88,12 +87,18 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
*/
|
|
|
@Override
|
|
|
public QuoteResultsVo quote(QuoteVo quoteVo) {
|
|
|
+ log.info("紫金爬虫");
|
|
|
log.info("quote入参的值:{}", JSON.toJSONString(quoteVo));
|
|
|
// 归属信息
|
|
|
AttributionInformationVo attributionInformationVo = quoteVo.getOrder().getAttributionInformationVo();
|
|
|
log.info("attributionInformationVo参数的值:{}", JSON.toJSONString(attributionInformationVo));
|
|
|
|
|
|
HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
+ log.info("headers参数的值:{}", JSON.toJSONString(headers));
|
|
|
+
|
|
|
+ String authorization = "FD385C99C9B35B64EF84590AACA95380";
|
|
|
+ headers.set("Authorization", authorization);
|
|
|
+
|
|
|
String userCode = ziJinCrawlerCacheComponent.getUserCode(attributionInformationVo.getUsername());
|
|
|
log.info("userCode:{}", userCode);
|
|
|
|
|
|
@@ -104,22 +109,28 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
// 1.2 构建归属信息(机构、套餐、渠道信息)
|
|
|
//ProposalInfoDTO proposalInfoDTO = boHaiBuildingAttributionInformation.build(parameters, userCode, headers);
|
|
|
try {
|
|
|
+ String comCode = "2140000601";
|
|
|
+
|
|
|
// 查询车辆信息
|
|
|
ZiJinCrawlerCarRequest ziJinCrawlerCarRequest = new ZiJinCrawlerCarRequest();
|
|
|
ziJinCrawlerCarRequest.setChannelCode("KSCD_PROD");
|
|
|
- ziJinCrawlerCarRequest.setComCode("2140000601");
|
|
|
+ ziJinCrawlerCarRequest.setComCode(comCode);
|
|
|
ziJinCrawlerCarRequest.setLicenseNo(quoteVo.getCarInfoVo().getLicenseNo());
|
|
|
ziJinCrawlerCarRequest.setVin(quoteVo.getCarInfoVo().getVinNo());
|
|
|
ZiJinCrawlerCarResponse ziJinCrawlerCarResponse = ziJinCrawlerRequestComponent.car(ziJinCrawlerCarRequest, headers);
|
|
|
log.info("ziJinCrawlerCarResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerCarResponse));
|
|
|
|
|
|
// 车辆和交通查询(获取订单号)
|
|
|
- ZiJinCrawlerGetOrderNoRequest ziJinCrawlerGetOrderNoRequest = buildGetOrderNoRequest();
|
|
|
+ ZiJinCrawlerGetOrderNoRequest ziJinCrawlerGetOrderNoRequest = buildGetOrderNoRequest(quoteVo, parameters, attributionInformationVo.getConfigInfo(), ziJinCrawlerCarResponse);
|
|
|
+ log.info("ziJinCrawlerGetOrderNoRequest参数的值:{}", JSON.toJSONString(ziJinCrawlerGetOrderNoRequest));
|
|
|
+ String modelCode = ziJinCrawlerGetOrderNoRequest.getModelCode();// 车辆模型代码
|
|
|
+ String iacVehicleCode = ziJinCrawlerGetOrderNoRequest.getIacVehicleCode();//IAC车辆代码(行业车型编码)
|
|
|
ZiJinCrawlerGetOrderNoResponse ziJinCrawlerGetOrderNoResponse = ziJinCrawlerRequestComponent.getOrderNo(ziJinCrawlerGetOrderNoRequest, headers);
|
|
|
log.info("ziJinCrawlerGetOrderNoResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerGetOrderNoResponse));
|
|
|
|
|
|
//获取车辆实际价值
|
|
|
ZiJinCrawlerGetCarActualValueRequest ziJinCrawlerGetCarActualValueRequest = buildGetCarActualValueRequest(quoteVo);
|
|
|
+ log.info("ziJinCrawlerGetCarActualValueRequest参数的值:{}", JSON.toJSONString(ziJinCrawlerGetCarActualValueRequest));
|
|
|
ZiJinCrawlerGetCarActualValueResponse ziJinCrawlerGetCarActualValueResponse = ziJinCrawlerRequestComponent.getCarActualValue(ziJinCrawlerGetCarActualValueRequest, headers);
|
|
|
log.info("ziJinCrawlerGetCarActualValueResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerGetCarActualValueResponse));
|
|
|
|
|
|
@@ -130,39 +141,48 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
ziJinCrawlerQuotationRequest.setBaseInfo(baseInfo);
|
|
|
|
|
|
// 设置车主信息
|
|
|
- ziJinCrawlerQuotationRequest.setCarOwnerInfo(buildCarOwnerInfo());
|
|
|
+ ZiJinCrawlerQuotationRequest.CarOwnerInfo carOwnerInfo = buildCarOwnerInfo(quoteVo);
|
|
|
+ ziJinCrawlerQuotationRequest.setCarOwnerInfo(carOwnerInfo);
|
|
|
|
|
|
- // 设置保险标志
|
|
|
+ // 设置保险标志(固定"0")
|
|
|
ziJinCrawlerQuotationRequest.setInsuranceSign("0");
|
|
|
|
|
|
// 设置被保险人列表
|
|
|
- ziJinCrawlerQuotationRequest.setInsuredList(buildInsuredList());
|
|
|
+ ziJinCrawlerQuotationRequest.setInsuredList(buildInsuredList(quoteVo, carOwnerInfo));
|
|
|
|
|
|
- // 设置订单ID
|
|
|
- ziJinCrawlerQuotationRequest.setOrderId("8aaa2c189a3d3d79019a48d1745253d1");
|
|
|
- // 设置订单来源
|
|
|
+ // 设置订单ID - 从getOrderNo接口返回的动态获取
|
|
|
+ ziJinCrawlerQuotationRequest.setOrderId(ziJinCrawlerGetOrderNoResponse.getOrderId());
|
|
|
+ // 设置订单来源(固定"KSCD_PROD")
|
|
|
ziJinCrawlerQuotationRequest.setOrderOrigin("KSCD_PROD");
|
|
|
- // 设置需求单校验标志
|
|
|
+ // 设置需求单校验标志(固定"1")
|
|
|
ziJinCrawlerQuotationRequest.setDemandNoCheckFlag("1");
|
|
|
- // 设置产品代码
|
|
|
+ // 设置产品代码(固定"CAR20190517"-机动车保险代码)
|
|
|
ziJinCrawlerQuotationRequest.setProductCode("CAR20190517");
|
|
|
- // 设置产品名称
|
|
|
+ // 设置产品名称(固定"机动车保险")
|
|
|
ziJinCrawlerQuotationRequest.setProductName("机动车保险");
|
|
|
|
|
|
// 设置减税信息
|
|
|
- ziJinCrawlerQuotationRequest.setTaxRelifInfo(buildTaxRelifInfo());
|
|
|
+ //ziJinCrawlerQuotationRequest.setTaxRelifInfo(buildTaxRelifInfo(quoteVo, carOwnerInfo, comCode, headers));
|
|
|
|
|
|
// 设置险种列表
|
|
|
- ziJinCrawlerQuotationRequest.setItemKindList(buildItemKindList());
|
|
|
+ Double actualValue = null;
|
|
|
+ if (ziJinCrawlerGetCarActualValueResponse != null && StringUtils.hasLength(ziJinCrawlerGetCarActualValueResponse.getActualValue())) {
|
|
|
+ actualValue = Double.parseDouble(ziJinCrawlerGetCarActualValueResponse.getActualValue());
|
|
|
+ }
|
|
|
+ ziJinCrawlerQuotationRequest.setItemKindList(buildItemKindList(quoteVo, actualValue));
|
|
|
|
|
|
// 设置附加保单信息列表
|
|
|
- ziJinCrawlerQuotationRequest.setCarPolicySubInfoList(buildCarPolicySubInfoList());
|
|
|
+ ziJinCrawlerQuotationRequest.setCarPolicySubInfoList(buildCarPolicySubInfoList(quoteVo));
|
|
|
|
|
|
// 设置车辆信息
|
|
|
- ziJinCrawlerQuotationRequest.setVehicleInfo(buildVehicleInfo());
|
|
|
+ ziJinCrawlerQuotationRequest.setVehicleInfo(buildVehicleInfo(quoteVo, actualValue, modelCode, iacVehicleCode));
|
|
|
|
|
|
// 设置盈利数据列表
|
|
|
- ziJinCrawlerQuotationRequest.setProfitDataList(buildProfitDataList());
|
|
|
+ ziJinCrawlerQuotationRequest.setProfitDataList(buildProfitDataList(quoteVo));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// 设置税务字段
|
|
|
ziJinCrawlerQuotationRequest.setTaxFields("identifyNumber,taxpayerIdentifier,taxpayerName,taxRegistryNumber");
|
|
|
@@ -171,6 +191,7 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
// 设置车载设备保费列表(空列表)
|
|
|
ziJinCrawlerQuotationRequest.setCarDevicePremiumDtoList(new ArrayList<>());
|
|
|
|
|
|
+ log.info("ziJinCrawlerQuotationRequest参数的值:{}", JSON.toJSONString(ziJinCrawlerQuotationRequest));
|
|
|
ZiJinCrawlerQuotationResponse ziJinCrawlerQuotationResponse = ziJinCrawlerRequestComponent.quotation(ziJinCrawlerQuotationRequest, headers);
|
|
|
log.info("ziJinCrawlerQuotationResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerQuotationResponse));
|
|
|
|
|
|
@@ -182,7 +203,7 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
//报价成功
|
|
|
//保存报价信息
|
|
|
ZiJinCrawlerSaveQuoteInfoRequest ziJinCrawlerSaveQuoteInfoRequest = buildSaveQuoteInfoRequest();
|
|
|
-
|
|
|
+ log.info("ziJinCrawlerSaveQuoteInfoRequest参数的值:{}", JSON.toJSONString(ziJinCrawlerSaveQuoteInfoRequest));
|
|
|
ZiJinCrawlerSaveQuoteInfoResponse ziJinCrawlerSaveQuoteInfoResponse = ziJinCrawlerRequestComponent.saveQuoteInformation(ziJinCrawlerSaveQuoteInfoRequest, headers);
|
|
|
log.info("ziJinCrawlerSaveQuoteInfoResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerSaveQuoteInfoResponse));
|
|
|
|
|
|
@@ -190,6 +211,7 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
ZiJinCrawlerSaveProposalRequest ziJinCrawlerSaveProposalRequest = new ZiJinCrawlerSaveProposalRequest();
|
|
|
ziJinCrawlerSaveProposalRequest.setOrderNo(ziJinCrawlerGetOrderNoResponse.getOrderNo());
|
|
|
ziJinCrawlerSaveProposalRequest.setProposalCheckNo(ziJinCrawlerQuotationResponse.getBasePart().getProposalCheckNo());
|
|
|
+ log.info("ziJinCrawlerSaveProposalRequest参数的值:{}", JSON.toJSONString(ziJinCrawlerSaveProposalRequest));
|
|
|
ZiJinCrawlerSaveProposalResponse ziJinCrawlerSaveProposalResponse = ziJinCrawlerRequestComponent.saveProposal(ziJinCrawlerSaveProposalRequest, headers);
|
|
|
log.info("ziJinCrawlerSaveProposalResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerSaveProposalResponse));
|
|
|
|
|
|
@@ -480,24 +502,130 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
*
|
|
|
* @return ZiJinCrawlerGetOrderNoRequest
|
|
|
*/
|
|
|
- private ZiJinCrawlerGetOrderNoRequest buildGetOrderNoRequest() {
|
|
|
+// private ZiJinCrawlerGetOrderNoRequest buildGetOrderNoRequest() {
|
|
|
+// ZiJinCrawlerGetOrderNoRequest request = new ZiJinCrawlerGetOrderNoRequest();
|
|
|
+// request.setBrandName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+// request.setLicenseNo("晋HJW581");
|
|
|
+// request.setOperatorCode("214000151");
|
|
|
+// request.setOrderOrigin("KSCD_PROD");
|
|
|
+// request.setProposalAreaCode("140000");
|
|
|
+// request.setProposalCityCode("140000");
|
|
|
+// request.setUserComCode("2140000601");
|
|
|
+// request.setVinNo("LSJA24U69MS091895");
|
|
|
+// request.setModelCode("RWD1598SQQ");
|
|
|
+// request.setProductCode("CAR20190517");
|
|
|
+// request.setProductName("机动车保险");
|
|
|
+// request.setTerminalId("KSCD");
|
|
|
+// request.setTerminalIdType("Vue-PC");
|
|
|
+// return request;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建获取订单号请求对象
|
|
|
+ * 参数来源对照Python get_orderid_orderno方法:
|
|
|
+ * brandName -> 车型匹配后的vehicleName
|
|
|
+ * licenseNo -> quoteVo车牌号
|
|
|
+ * operatorCode -> 配置参数userCode
|
|
|
+ * proposalAreaCode -> configInfo中的proposalAreaCode
|
|
|
+ * proposalCityCode -> configInfo中的proposalCityCode
|
|
|
+ * userComCode -> 配置参数comCode
|
|
|
+ * vinNo -> quoteVo车架号
|
|
|
+ * modelCode -> 车型匹配后的vehicleCode
|
|
|
+ *
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @param parameters 配置参数
|
|
|
+ * @param configInfo 归属配置信息
|
|
|
+ * @param carResponse 车辆查询响应
|
|
|
+ * @return ZiJinCrawlerGetOrderNoRequest
|
|
|
+ */
|
|
|
+ private ZiJinCrawlerGetOrderNoRequest buildGetOrderNoRequest(QuoteVo quoteVo, ZiJinCrawlerConfigureParameters parameters,
|
|
|
+ Map<String, String> configInfo, ZiJinCrawlerCarResponse carResponse) {
|
|
|
ZiJinCrawlerGetOrderNoRequest request = new ZiJinCrawlerGetOrderNoRequest();
|
|
|
- request.setBrandName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
- request.setLicenseNo("晋HJW581");
|
|
|
- request.setOperatorCode("214000151");
|
|
|
+
|
|
|
+ // 从车辆查询响应中匹配车型,获取brandName和modelCode
|
|
|
+ // 对应Python: brandName = PPcarinfo['vehicleName'], modelCode = PPcarinfo['vehicleCode']
|
|
|
+ String brandName = "";
|
|
|
+ String modelCode = "";
|
|
|
+ String iacVehicleCode = "";
|
|
|
+ if (carResponse != null && carResponse.getVehicleModelInfoList() != null && !carResponse.getVehicleModelInfoList().isEmpty()) {
|
|
|
+ // 按purchasePrice和seatCount匹配车型,与Python逻辑一致
|
|
|
+ String purchasePrice = quoteVo.getCarInfoVo().getPurchasePrice();//新车购置价[元]
|
|
|
+ String seatCount = quoteVo.getCarInfoVo().getSeatCount();//座位数[座]
|
|
|
+ ZiJinCrawlerCarResponse.VehicleModelInfo matchedModel = null; //车辆型号信息类
|
|
|
+ for (ZiJinCrawlerCarResponse.VehicleModelInfo model : carResponse.getVehicleModelInfoList()) {
|
|
|
+ if (purchasePrice != null && model.getPurchasePrice() != null
|
|
|
+ && Double.parseDouble(model.getPurchasePrice()) == Double.parseDouble(purchasePrice)
|
|
|
+ && model.getSeat() != null && seatCount != null
|
|
|
+ && Double.parseDouble(model.getSeat()) >= Double.parseDouble(seatCount)) {
|
|
|
+ matchedModel = model;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果没有匹配到,且只有一个车型,则使用该车型(与Python逻辑一致)
|
|
|
+ if (matchedModel == null && carResponse.getVehicleModelInfoList().size() == 1) {
|
|
|
+ ZiJinCrawlerCarResponse.VehicleModelInfo onlyModel = carResponse.getVehicleModelInfoList().get(0);
|
|
|
+ if (onlyModel.getSeat() != null && seatCount != null
|
|
|
+ && Double.parseDouble(onlyModel.getSeat()) >= Double.parseDouble(seatCount)) {
|
|
|
+ matchedModel = onlyModel;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(matchedModel == null){
|
|
|
+ List<ZiJinCrawlerCarResponse.VehicleModelInfo> vehicleModelInfoList = carResponse.getVehicleModelInfoList();
|
|
|
+ List<String> vehicleNameList =vehicleModelInfoList.stream().map(ZiJinCrawlerCarResponse.VehicleModelInfo::getVehicleName).distinct().collect(Collectors.toList());
|
|
|
+ List<String> vehicleCodeList =vehicleModelInfoList.stream().map(ZiJinCrawlerCarResponse.VehicleModelInfo::getVehicleCode).distinct().collect(Collectors.toList());
|
|
|
+ List<String> iacVehicleCodeList =vehicleModelInfoList.stream().map(ZiJinCrawlerCarResponse.VehicleModelInfo::getIacVehicleCode).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ if(CollectionUtils.isNotEmpty(vehicleNameList)
|
|
|
+ && CollectionUtils.isNotEmpty(vehicleCodeList)
|
|
|
+ && CollectionUtils.isNotEmpty(iacVehicleCodeList)
|
|
|
+ && vehicleNameList.size() == 1
|
|
|
+ && vehicleCodeList.size() == 1
|
|
|
+ && iacVehicleCodeList.size() == 1
|
|
|
+ ){
|
|
|
+ matchedModel = new ZiJinCrawlerCarResponse.VehicleModelInfo();
|
|
|
+ matchedModel.setVehicleName(vehicleNameList.get(0));
|
|
|
+ matchedModel.setVehicleCode(vehicleCodeList.get(0));
|
|
|
+ matchedModel.setIacVehicleCode(iacVehicleCodeList.get(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (matchedModel != null) {
|
|
|
+ brandName = matchedModel.getVehicleName();
|
|
|
+ modelCode = matchedModel.getVehicleCode();
|
|
|
+ iacVehicleCode = matchedModel.getIacVehicleCode();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setBrandName(brandName);
|
|
|
+ request.setLicenseNo(quoteVo.getCarInfoVo().getLicenseNo());
|
|
|
+ // operatorCode对应Python: operatorCode = self.baseInfo['handler1Code']
|
|
|
+ request.setOperatorCode(parameters.getUserCode());
|
|
|
request.setOrderOrigin("KSCD_PROD");
|
|
|
- request.setProposalAreaCode("140000");
|
|
|
- request.setProposalCityCode("140000");
|
|
|
- request.setUserComCode("2140000601");
|
|
|
- request.setVinNo("LSJA24U69MS091895");
|
|
|
- request.setModelCode("RWD1598SQQ");
|
|
|
+ // proposalAreaCode对应Python: proposalAreaCode = self.get_areacode(userComCode)
|
|
|
+ request.setProposalAreaCode(configInfo.getOrDefault("proposalAreaCode", ""));
|
|
|
+ // proposalCityCode对应Python: proposalCityCode = proposalAreaCode
|
|
|
+ request.setProposalCityCode(configInfo.getOrDefault("proposalCityCode", configInfo.getOrDefault("proposalAreaCode", "")));
|
|
|
+ // userComCode对应Python: userComCode = self.baseInfo['comCode']
|
|
|
+ request.setUserComCode(parameters.getComCode());
|
|
|
+ request.setVinNo(quoteVo.getCarInfoVo().getVinNo());
|
|
|
+ request.setModelCode(modelCode);
|
|
|
request.setProductCode("CAR20190517");
|
|
|
request.setProductName("机动车保险");
|
|
|
request.setTerminalId("KSCD");
|
|
|
request.setTerminalIdType("Vue-PC");
|
|
|
+
|
|
|
+ //
|
|
|
+ //request.setBrandName("哈弗CC6460AZ04B多用途乘用车");//品牌名称
|
|
|
+ //request.setModelCode("CC6460AZ04B");//车型代码
|
|
|
+ request.setOperatorCode("214000151");//操作员编号
|
|
|
+ request.setUserComCode("2140000601");//用户公司代码
|
|
|
+ request.setIacVehicleCode(iacVehicleCode);//IAC车辆代码(行业车型编码)
|
|
|
+
|
|
|
return request;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 构建获取车辆实际价值请求对象
|
|
|
*
|
|
|
@@ -566,57 +694,218 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
*
|
|
|
* @return ZiJinCrawlerQuotationRequest.CarOwnerInfo
|
|
|
*/
|
|
|
- private ZiJinCrawlerQuotationRequest.CarOwnerInfo buildCarOwnerInfo() {
|
|
|
+// private ZiJinCrawlerQuotationRequest.CarOwnerInfo buildCarOwnerInfo() {
|
|
|
+// ZiJinCrawlerQuotationRequest.CarOwnerInfo carOwnerInfo = new ZiJinCrawlerQuotationRequest.CarOwnerInfo();
|
|
|
+// carOwnerInfo.setCarOwner("王婧");//车主姓名
|
|
|
+// carOwnerInfo.setOwnerIdentifyNumber("14092519990322002X");//车主证件号码
|
|
|
+// carOwnerInfo.setOwnerIdentifyType("01");//车主证件类型(01-身份证)
|
|
|
+// carOwnerInfo.setVehicleOwnerNature("1");//车主性质(1-个人)
|
|
|
+// return carOwnerInfo;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建车主信息对象
|
|
|
+ * 参数来源对照Python get_owner_info方法:
|
|
|
+ * carOwner -> quoteVo车主姓名
|
|
|
+ * ownerIdentifyNumber -> quoteVo车主证件号码
|
|
|
+ * ownerIdentifyType -> 根据证件类型映射(01-身份证)
|
|
|
+ * vehicleOwnerNature -> 根据人员类型映射(1-个人, 5-企业)
|
|
|
+ * ownerAddress -> quoteVo车主地址
|
|
|
+ *
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @return ZiJinCrawlerQuotationRequest.CarOwnerInfo
|
|
|
+ */
|
|
|
+ private ZiJinCrawlerQuotationRequest.CarOwnerInfo buildCarOwnerInfo(QuoteVo quoteVo) {
|
|
|
ZiJinCrawlerQuotationRequest.CarOwnerInfo carOwnerInfo = new ZiJinCrawlerQuotationRequest.CarOwnerInfo();
|
|
|
- carOwnerInfo.setCarOwner("王婧");
|
|
|
- carOwnerInfo.setOwnerIdentifyNumber("14092519990322002X");
|
|
|
- carOwnerInfo.setOwnerIdentifyType("01");
|
|
|
- carOwnerInfo.setVehicleOwnerNature("1");
|
|
|
+
|
|
|
+ CustomerInfoVo ownersInfo = quoteVo.getOwnersInfo();
|
|
|
+ if (ownersInfo != null) {
|
|
|
+ carOwnerInfo.setCarOwner(ownersInfo.getName());//车主姓名
|
|
|
+ carOwnerInfo.setOwnerIdentifyNumber(ownersInfo.getIdentifyNumber());//车主证件号码
|
|
|
+
|
|
|
+ // 根据证件类型映射车主性质和证件类型代码
|
|
|
+ String identifyType = ownersInfo.getIdentifyType();
|
|
|
+ String personType = ownersInfo.getPersonType();
|
|
|
+
|
|
|
+ // 证件类型映射,参考Python get_owner_i方法
|
|
|
+ // 个人类型(1) -> vehicleOwnerNature="1"
|
|
|
+ // 企业类型(2) -> vehicleOwnerNature="5"
|
|
|
+ if ("2".equals(personType)) {
|
|
|
+ // 企业
|
|
|
+ carOwnerInfo.setVehicleOwnerNature("5");
|
|
|
+ // 企业证件类型映射
|
|
|
+ carOwnerInfo.setOwnerIdentifyType(mapEnterpriseIdentifyType(identifyType));
|
|
|
+ } else {
|
|
|
+ // 个人(默认)
|
|
|
+ carOwnerInfo.setVehicleOwnerNature("1");
|
|
|
+ carOwnerInfo.setOwnerIdentifyType("01");//01-身份证
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return carOwnerInfo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业证件类型映射
|
|
|
+ * 参考Python get_owner_i方法中的IDType映射
|
|
|
+ *
|
|
|
+ * @param identifyType 证件类型
|
|
|
+ * @return 映射后的证件类型代码
|
|
|
+ */
|
|
|
+ private String mapEnterpriseIdentifyType(String identifyType) {
|
|
|
+ if (identifyType == null) {
|
|
|
+ return "11";//默认工商注册号码
|
|
|
+ }
|
|
|
+ // 证件类型映射:工商注册号码->11, 统一社会信用代码->73, 组织机构代码->71
|
|
|
+ switch (identifyType) {
|
|
|
+ case "11": //工商注册号码
|
|
|
+ case "2": //企业类型默认
|
|
|
+ return "11";
|
|
|
+ case "73": //统一社会信用代码
|
|
|
+ return "73";
|
|
|
+ case "71": //组织机构代码
|
|
|
+ return "71";
|
|
|
+ default:
|
|
|
+ return "11";//默认工商注册号码
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 构建被保险人列表
|
|
|
+// *
|
|
|
+// * @return List<ZiJinCrawlerQuotationRequest.InsuredList>
|
|
|
+// */
|
|
|
+// private List<ZiJinCrawlerQuotationRequest.InsuredList> buildInsuredList() {
|
|
|
+// List<ZiJinCrawlerQuotationRequest.InsuredList> insuredList = new ArrayList<>();
|
|
|
+//
|
|
|
+// // 第一个被保险人
|
|
|
+// ZiJinCrawlerQuotationRequest.InsuredList insured1 = new ZiJinCrawlerQuotationRequest.InsuredList();
|
|
|
+// insured1.setInsuredName("王婧");
|
|
|
+// insured1.setInsuredNature("3");
|
|
|
+// insured1.setIdentifyType("01");
|
|
|
+// insured1.setIdentifyNumber("14092519990322002X");
|
|
|
+// insured1.setSex("2");
|
|
|
+// insured1.setInsuredType("1");
|
|
|
+// insured1.setMobile("18840186946");
|
|
|
+// insured1.setPostCode("030053");
|
|
|
+// insured1.setInsuredFlag(2);
|
|
|
+// insuredList.add(insured1);
|
|
|
+//
|
|
|
+// // 第二个被保险人
|
|
|
+// ZiJinCrawlerQuotationRequest.InsuredList insured2 = new ZiJinCrawlerQuotationRequest.InsuredList();
|
|
|
+// insured2.setInsuredName("王婧");
|
|
|
+// insured2.setInsuredNature("3");
|
|
|
+// insured2.setIdentifyType("01");
|
|
|
+// insured2.setIdentifyNumber("14092519990322002X");
|
|
|
+// insured2.setSex("2");
|
|
|
+// insured2.setInsuredType("1");
|
|
|
+// insured2.setMobile("18840186946");
|
|
|
+// insured2.setPostCode("030053");
|
|
|
+// insured2.setInsuredFlag(1);
|
|
|
+// insuredList.add(insured2);
|
|
|
+// return insuredList;
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建被保险人列表
|
|
|
+ *
|
|
|
+ * @return List<ZiJinCrawlerQuotationRequest.InsuredList>
|
|
|
+ */
|
|
|
/**
|
|
|
* 构建被保险人列表
|
|
|
+ * 参数来源对照Python get_insuredList_info方法:
|
|
|
+ * insuredList包含两个对象:投保人(insuredFlag=2)和被保人(insuredFlag=1)
|
|
|
*
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @param carOwnerInfo 车主信息(用于判断与车主关系)
|
|
|
* @return List<ZiJinCrawlerQuotationRequest.InsuredList>
|
|
|
*/
|
|
|
- private List<ZiJinCrawlerQuotationRequest.InsuredList> buildInsuredList() {
|
|
|
+ private List<ZiJinCrawlerQuotationRequest.InsuredList> buildInsuredList(QuoteVo quoteVo,
|
|
|
+ ZiJinCrawlerQuotationRequest.CarOwnerInfo carOwnerInfo) {
|
|
|
List<ZiJinCrawlerQuotationRequest.InsuredList> insuredList = new ArrayList<>();
|
|
|
|
|
|
- // 第一个被保险人
|
|
|
- ZiJinCrawlerQuotationRequest.InsuredList insured1 = new ZiJinCrawlerQuotationRequest.InsuredList();
|
|
|
- insured1.setInsuredName("王婧");
|
|
|
- insured1.setInsuredNature("3");
|
|
|
- insured1.setIdentifyType("01");
|
|
|
- insured1.setIdentifyNumber("14092519990322002X");
|
|
|
- insured1.setSex("2");
|
|
|
- insured1.setInsuredType("1");
|
|
|
- insured1.setMobile("18840186946");
|
|
|
- insured1.setPostCode("030053");
|
|
|
- insured1.setInsuredFlag(2);
|
|
|
- insuredList.add(insured1);
|
|
|
-
|
|
|
- // 第二个被保险人
|
|
|
- ZiJinCrawlerQuotationRequest.InsuredList insured2 = new ZiJinCrawlerQuotationRequest.InsuredList();
|
|
|
- insured2.setInsuredName("王婧");
|
|
|
- insured2.setInsuredNature("3");
|
|
|
- insured2.setIdentifyType("01");
|
|
|
- insured2.setIdentifyNumber("14092519990322002X");
|
|
|
- insured2.setSex("2");
|
|
|
- insured2.setInsuredType("1");
|
|
|
- insured2.setMobile("18840186946");
|
|
|
- insured2.setPostCode("030053");
|
|
|
- insured2.setInsuredFlag(1);
|
|
|
- insuredList.add(insured2);
|
|
|
+ CustomerInfoVo policyHolderInfo = quoteVo.getPolicyHolderInfo();//投保人
|
|
|
+ CustomerInfoVo insuredPersonInfo = quoteVo.getInsuredPersonInfo();//被保人
|
|
|
+
|
|
|
+ // 获取车主性质,用于判断投保人/被保人类型
|
|
|
+ String vehicleOwnerNature = carOwnerInfo != null ? carOwnerInfo.getVehicleOwnerNature() : "1";
|
|
|
+
|
|
|
+ // 1. 构建投保人信息 (insuredFlag=2)
|
|
|
+ if (policyHolderInfo != null) {
|
|
|
+ ZiJinCrawlerQuotationRequest.InsuredList policyHolder = new ZiJinCrawlerQuotationRequest.InsuredList();
|
|
|
+ buildInsuredItem(policyHolder, policyHolderInfo, 2, vehicleOwnerNature,
|
|
|
+ carOwnerInfo != null ? carOwnerInfo.getOwnerIdentifyNumber() : null);
|
|
|
+ insuredList.add(policyHolder);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 构建被保人信息 (insuredFlag=1)
|
|
|
+ if (insuredPersonInfo != null) {
|
|
|
+ ZiJinCrawlerQuotationRequest.InsuredList insuredPerson = new ZiJinCrawlerQuotationRequest.InsuredList();
|
|
|
+ buildInsuredItem(insuredPerson, insuredPersonInfo, 1, vehicleOwnerNature,
|
|
|
+ carOwnerInfo != null ? carOwnerInfo.getOwnerIdentifyNumber() : null);
|
|
|
+ insuredList.add(insuredPerson);
|
|
|
+ }
|
|
|
+
|
|
|
return insuredList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 构建单个被保险人对象
|
|
|
+ *
|
|
|
+ * @param insuredItem 被保险人对象
|
|
|
+ * @param customerInfo 客户信息
|
|
|
+ * @param insuredFlag 被保险人标志(1-被保人, 2-投保人)
|
|
|
+ * @param vehicleOwnerNature 车主性质(1-个人, 5-企业)
|
|
|
+ * @param ownerIdentifyNumber 车主证件号码(用于判断与车主关系)
|
|
|
+ */
|
|
|
+ private void buildInsuredItem(ZiJinCrawlerQuotationRequest.InsuredList insuredItem,
|
|
|
+ CustomerInfoVo customerInfo, int insuredFlag, String vehicleOwnerNature,
|
|
|
+ String ownerIdentifyNumber) {
|
|
|
+ insuredItem.setInsuredName(customerInfo.getName());
|
|
|
+ insuredItem.setIdentifyNumber(customerInfo.getIdentifyNumber());
|
|
|
+
|
|
|
+ // 证件类型映射
|
|
|
+ String identifyType = customerInfo.getIdentifyType();
|
|
|
+ String personType = customerInfo.getPersonType();
|
|
|
+ if ("2".equals(personType)) {
|
|
|
+ // 企业
|
|
|
+ insuredItem.setIdentifyType(mapEnterpriseIdentifyType(identifyType));
|
|
|
+ } else {
|
|
|
+ // 个人(默认)
|
|
|
+ insuredItem.setIdentifyType("01");//01-身份证
|
|
|
+ }
|
|
|
+
|
|
|
+ // 性别映射
|
|
|
+ String gender = customerInfo.getGender();
|
|
|
+ insuredItem.setSex("男".equals(gender) ? "1" : "2");
|
|
|
+
|
|
|
+ // 根据车主性质设置投保人/被保人类型
|
|
|
+ // 个人车主("1"): 投保人/被保人都是自然人
|
|
|
+ // 企业车主("5"): 投保人是法人,被保人是自然人
|
|
|
+ if ("5".equals(vehicleOwnerNature) && insuredFlag == 2) {
|
|
|
+ // 企业车主的投保人
|
|
|
+ insuredItem.setInsuredNature("4");//4-法人或其他组织
|
|
|
+ insuredItem.setInsuredType("2");
|
|
|
+ } else {
|
|
|
+ // 个人车主或被保人
|
|
|
+ insuredItem.setInsuredNature("3");//3-自然人
|
|
|
+ insuredItem.setInsuredType("1");
|
|
|
+ }
|
|
|
+
|
|
|
+ insuredItem.setMobile(customerInfo.getMobile());
|
|
|
+ insuredItem.setPostCode(StringUtils.hasLength(customerInfo.getPostCode()) ?
|
|
|
+ customerInfo.getPostCode() : "030000");
|
|
|
+ insuredItem.setInsuredFlag(insuredFlag);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 构建减税信息对象
|
|
|
*
|
|
|
* @return ZiJinCrawlerQuotationRequest.TaxRelifInfo
|
|
|
*/
|
|
|
- private ZiJinCrawlerQuotationRequest.TaxRelifInfo buildTaxRelifInfo() {
|
|
|
+ private ZiJinCrawlerQuotationRequest.TaxRelifInfo buildTaxRelifInfo2() {
|
|
|
ZiJinCrawlerQuotationRequest.TaxRelifInfo taxRelifInfo = new ZiJinCrawlerQuotationRequest.TaxRelifInfo();
|
|
|
taxRelifInfo.setTaxRelifFlag("1");
|
|
|
taxRelifInfo.setTaxpayerName("王婧");
|
|
|
@@ -627,167 +916,686 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
return taxRelifInfo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建减税信息对象
|
|
|
+ *
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @param carOwnerInfo 车主信息
|
|
|
+ * @param comCode 保险公司代码
|
|
|
+ * @param headers 请求头
|
|
|
+ * @return ZiJinCrawlerQuotationRequest.TaxRelifInfo
|
|
|
+ */
|
|
|
+ private ZiJinCrawlerQuotationRequest.TaxRelifInfo buildTaxRelifInfo(QuoteVo quoteVo,
|
|
|
+ ZiJinCrawlerQuotationRequest.CarOwnerInfo carOwnerInfo, String comCode, HttpHeaders headers) {
|
|
|
+ ZiJinCrawlerQuotationRequest.TaxRelifInfo taxRelifInfo = new ZiJinCrawlerQuotationRequest.TaxRelifInfo();
|
|
|
+
|
|
|
+ // 只有投保交强险时才构建完整的税务信息
|
|
|
+ // 交强险riskCode为"0507"
|
|
|
+ CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
|
|
|
+
|
|
|
+ // 获取税务登记证号
|
|
|
+ String taxRegistryNumber = "";
|
|
|
+ try {
|
|
|
+ ZiJinCrawlerGetTaxRegistryNumberResponse taxResponse = ziJinCrawlerRequestComponent.getTaxRegistryNumber(comCode, headers);
|
|
|
+ if (taxResponse != null && StringUtils.hasLength(taxResponse.getData())) {
|
|
|
+ taxRegistryNumber = taxResponse.getData();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("获取税务登记证号失败: {}", e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置税务信息
|
|
|
+ taxRelifInfo.setTaxRelifFlag("1");// 1 正常缴税 2 免税 3 减税 4 已完税 5 不征
|
|
|
+
|
|
|
+ if (carOwnerInfo != null) {
|
|
|
+ taxRelifInfo.setTaxpayerName(carOwnerInfo.getCarOwner());//纳税人姓名
|
|
|
+ taxRelifInfo.setTaxpayerIdentifier(carOwnerInfo.getOwnerIdentifyType());//纳税人标识(证件类型)
|
|
|
+ taxRelifInfo.setIdentifyNumber(carOwnerInfo.getOwnerIdentifyNumber());//证件号码
|
|
|
+ }
|
|
|
+
|
|
|
+ taxRelifInfo.setTaxRegistryNumber(taxRegistryNumber);//税务登记证号
|
|
|
+
|
|
|
+ // 整备质量(公斤转吨)
|
|
|
+ if (carInfoVo != null && StringUtils.hasLength(carInfoVo.getCompleteKerbMass())) {
|
|
|
+ String completeKerbMassTon = carInfoVo.completeKerbMassToTonCount();
|
|
|
+ taxRelifInfo.setCompleteKerbMass(completeKerbMassTon);
|
|
|
+ }
|
|
|
+
|
|
|
+ return taxRelifInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 构建险种列表
|
|
|
+ * 根据交强险和商业险的险种信息动态构建险种列表
|
|
|
*
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @param actualValue 车辆实际价值
|
|
|
* @return List<ZiJinCrawlerQuotationRequest.ItemKindList>
|
|
|
*/
|
|
|
- private List<ZiJinCrawlerQuotationRequest.ItemKindList> buildItemKindList() {
|
|
|
+ private List<ZiJinCrawlerQuotationRequest.ItemKindList> buildItemKindList(QuoteVo quoteVo, Double actualValue) {
|
|
|
List<ZiJinCrawlerQuotationRequest.ItemKindList> itemKindList = new ArrayList<>();
|
|
|
+ CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
|
|
|
+ List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
|
|
|
+
|
|
|
+ // 获取座位数
|
|
|
+ int seatCount = 5;
|
|
|
+ if (carInfoVo != null && StringUtils.hasLength(carInfoVo.getSeatCount())) {
|
|
|
+ seatCount = Integer.parseInt(carInfoVo.getSeatCount());
|
|
|
+ }
|
|
|
|
|
|
- // 交通事故强制责任险
|
|
|
- ZiJinCrawlerQuotationRequest.ItemKindList itemKind1 = new ZiJinCrawlerQuotationRequest.ItemKindList();
|
|
|
- itemKind1.setAmount("200000");
|
|
|
- itemKind1.setKindCode("BZ");
|
|
|
- itemKind1.setKindName("交通事故强制责任险");
|
|
|
- itemKind1.setRiskCode("0590");
|
|
|
- itemKind1.setBenchMarkPremium("950.0000");
|
|
|
- itemKind1.setBasePremium("950.0000");
|
|
|
- itemKindList.add(itemKind1);
|
|
|
-
|
|
|
- // 机动车第三者责任保险
|
|
|
- ZiJinCrawlerQuotationRequest.ItemKindList itemKind2 = new ZiJinCrawlerQuotationRequest.ItemKindList();
|
|
|
- itemKind2.setAmount(2000000);
|
|
|
- itemKind2.setKindCode("B");
|
|
|
- itemKind2.setKindName("机动车第三者责任保险");
|
|
|
- itemKind2.setRiskCode("050A");
|
|
|
- itemKind2.setBenchMarkPremium("687.7600");
|
|
|
- itemKind2.setBasePremium("515.8200");
|
|
|
- itemKindList.add(itemKind2);
|
|
|
-
|
|
|
- // 附加医保外用药责任险
|
|
|
- ZiJinCrawlerQuotationRequest.ItemKindList itemKind3 = new ZiJinCrawlerQuotationRequest.ItemKindList();
|
|
|
- itemKind3.setAmount("20000");
|
|
|
- itemKind3.setKindCode("S1");
|
|
|
- itemKind3.setKindName("附加医保外用药责任险(机动车第三者责任保险)");
|
|
|
- itemKind3.setRiskCode("050A");
|
|
|
- itemKind3.setBenchMarkPremium("28.3100");
|
|
|
- itemKind3.setBasePremium("21.2300");
|
|
|
- itemKindList.add(itemKind3);
|
|
|
+ // 1. 检查是否有交强险(riskCode='0507')
|
|
|
+ if (quoteVo.getCiRiskInfoVo() != null && "0507".equals(quoteVo.getCiRiskInfoVo().getRiskCode())) {
|
|
|
+ ZiJinCrawlerQuotationRequest.ItemKindList ciItem = new ZiJinCrawlerQuotationRequest.ItemKindList();
|
|
|
+ ciItem.setAmount("200000");
|
|
|
+ ciItem.setKindCode("BZ");
|
|
|
+ ciItem.setKindName("交通事故强制责任险");
|
|
|
+ ciItem.setRiskCode("0590");
|
|
|
+ itemKindList.add(ciItem);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 检查是否有商业险(riskCode='0510')
|
|
|
+ if (quoteVo.getBiRiskInfoVo() != null && "0510".equals(quoteVo.getBiRiskInfoVo().getRiskCode())) {
|
|
|
+ // 根据商业险险种列表构建
|
|
|
+ if (kindInfoVoList != null && !kindInfoVoList.isEmpty()) {
|
|
|
+ for (KindInfoVo kindItem : kindInfoVoList) {
|
|
|
+ String zgKindCode = kindItem.getKindCode();
|
|
|
+ ZiJinCrawlerQuotationRequest.ItemKindList zjItem = buildZiJinKindItem(zgKindCode, kindItem, seatCount, actualValue);
|
|
|
+ if (zjItem != null) {
|
|
|
+ itemKindList.add(zjItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // 道路救援服务特约条款
|
|
|
- ZiJinCrawlerQuotationRequest.ItemKindList itemKind4 = new ZiJinCrawlerQuotationRequest.ItemKindList();
|
|
|
- itemKind4.setKindCode("T1");
|
|
|
- itemKind4.setKindName("道路救援服务特约条款");
|
|
|
- itemKind4.setRiskCode("050A");
|
|
|
- itemKind4.setServiceTimes("2");
|
|
|
- itemKind4.setBenchMarkPremium("0.0000");
|
|
|
- itemKind4.setBasePremium("0.0000");
|
|
|
- itemKindList.add(itemKind4);
|
|
|
return itemKindList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据平台险种代码构建紫金险种对象
|
|
|
+ *
|
|
|
+ * @param zgKindCode 平台险种代码
|
|
|
+ * @param kindItem 平台险种信息
|
|
|
+ * @param seatCount 座位数
|
|
|
+ * @param actualValue 车辆实际价值
|
|
|
+ * @return ZiJinCrawlerQuotationRequest.ItemKindList
|
|
|
+ */
|
|
|
+ private ZiJinCrawlerQuotationRequest.ItemKindList buildZiJinKindItem(String zgKindCode, KindInfoVo kindItem,
|
|
|
+ int seatCount, Double actualValue) {
|
|
|
+ ZiJinCrawlerQuotationRequest.ItemKindList item = new ZiJinCrawlerQuotationRequest.ItemKindList();
|
|
|
+
|
|
|
+ switch (zgKindCode) {
|
|
|
+ case "A": // 机动车损失保险
|
|
|
+ item.setKindCode("A");
|
|
|
+ item.setKindName("机动车损失保险");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(actualValue != null ? actualValue.longValue() : 0);
|
|
|
+ item.setValue("0");
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "B": // 机动车第三者责任保险
|
|
|
+ item.setKindCode("B");
|
|
|
+ item.setKindName("机动车第三者责任保险");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ if (StringUtils.hasLength(kindItem.getAmount())) {
|
|
|
+ item.setAmount(Long.parseLong(kindItem.getAmount()));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "D3": // 机动车车上人员责任保险(司机)
|
|
|
+ item.setKindCode("D3");
|
|
|
+ item.setKindName("机动车车上人员责任保险(司机)");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ if (StringUtils.hasLength(kindItem.getAmount())) {
|
|
|
+ item.setAmount(Long.parseLong(kindItem.getAmount()));
|
|
|
+ item.setUnitAmount(kindItem.getAmount());
|
|
|
+ }
|
|
|
+ item.setQuantity(1);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "D4": // 机动车车上人员责任保险(乘客)
|
|
|
+ item.setKindCode("D4");
|
|
|
+ item.setKindName("机动车车上人员责任保险(乘客)");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ if (StringUtils.hasLength(kindItem.getAmount())) {
|
|
|
+ long perSeatAmount = Long.parseLong(kindItem.getAmount());
|
|
|
+ int passengerCount = seatCount - 1;
|
|
|
+ item.setAmount(perSeatAmount * passengerCount);
|
|
|
+ item.setUnitAmount(kindItem.getAmount());
|
|
|
+ item.setQuantity(passengerCount);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "L": // 附加车身划痕损失险
|
|
|
+ item.setKindCode("L");
|
|
|
+ item.setKindName("附加车身划痕损失险");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(kindItem.getAmount());
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "BD": // 附加法定节假日限额翻倍险
|
|
|
+ item.setKindCode("B2");
|
|
|
+ item.setKindName("附加法定节假日限额翻倍险");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ if (StringUtils.hasLength(kindItem.getAmount())) {
|
|
|
+ item.setAmount(Long.parseLong(kindItem.getAmount()));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "SY_FJ_YBW1": // 附加医保外用药责任险(机动车第三者责任保险)
|
|
|
+ item.setKindCode("S1");
|
|
|
+ item.setKindName("附加医保外用药责任险(机动车第三者责任保险)");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(kindItem.getAmount());
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "SY_FJ_YBW3": // 附加医保外用药责任险(司机)
|
|
|
+ item.setKindCode("S2");
|
|
|
+ item.setKindName("附加医保外用药责任险(机动车车上人员责任保险(司机))");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ if (StringUtils.hasLength(kindItem.getAmount())) {
|
|
|
+ item.setAmount(Long.parseLong(kindItem.getAmount()));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "SY_FJ_YBW2": // 附加医保外用药责任险(乘客)
|
|
|
+ item.setKindCode("S3");
|
|
|
+ item.setKindName("附加医保外用药责任险(机动车车上人员责任保险(乘客))");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ if (StringUtils.hasLength(kindItem.getAmount())) {
|
|
|
+ long perSeatAmount = Long.parseLong(kindItem.getAmount());
|
|
|
+ int passengerCount = seatCount - 1;
|
|
|
+ item.setAmount(perSeatAmount * passengerCount);
|
|
|
+ item.setUnitAmount(kindItem.getAmount());
|
|
|
+ item.setQuantity(passengerCount);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "TY1": // 道路救援服务特约条款
|
|
|
+ item.setKindCode("T1");
|
|
|
+ item.setKindName("道路救援服务特约条款");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
|
|
|
+ kindItem.getServiceTimes() : kindItem.getAmount());
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "TY2": // 车辆安全检测特约条款
|
|
|
+ item.setKindCode("T2");
|
|
|
+ item.setKindName("车辆安全检测特约条款");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
|
|
|
+ kindItem.getServiceTimes() : kindItem.getAmount());
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "TY3": // 代为驾驶服务特约条款
|
|
|
+ item.setKindCode("T3");
|
|
|
+ item.setKindName("代为驾驶服务特约条款");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
|
|
|
+ kindItem.getServiceTimes() : kindItem.getAmount());
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "TY4": // 代为送检服务特约条款
|
|
|
+ item.setKindCode("T4");
|
|
|
+ item.setKindName("代为送检服务特约条款");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
|
|
|
+ kindItem.getServiceTimes() : kindItem.getAmount());
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "MJ1": // 附加绝对免赔率特约险(车损险)
|
|
|
+ item.setKindCode("FA");
|
|
|
+ item.setKindName("附加绝对免赔率特约险(机动车损失保险)");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(0);
|
|
|
+ if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
|
|
|
+ // 提取数字部分
|
|
|
+ String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
|
|
|
+ item.setDeductibleRate(Integer.parseInt(deductibleRate));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "MJ2": // 附加绝对免赔率特约条款(三者险)
|
|
|
+ item.setKindCode("FB");
|
|
|
+ item.setKindName("附加绝对免赔率特约险(机动车第三者责任保险)");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(0);
|
|
|
+ if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
|
|
|
+ String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
|
|
|
+ item.setDeductibleRate(Integer.parseInt(deductibleRate));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "MJ3": // 附加绝对免赔率特约险(司机)
|
|
|
+ item.setKindCode("FD3");
|
|
|
+ item.setKindName("附加绝对免赔率特约险(机动车车上人员责任保险(司机))");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(0);
|
|
|
+ if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
|
|
|
+ String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
|
|
|
+ item.setDeductibleRate(Integer.parseInt(deductibleRate));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "MJ4": // 附加绝对免赔率特约险(乘客)
|
|
|
+ item.setKindCode("FD4");
|
|
|
+ item.setKindName("附加绝对免赔率特约险(机动车车上人员责任保险(乘客))");
|
|
|
+ item.setRiskCode("050A");
|
|
|
+ item.setAmount(0);
|
|
|
+ if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
|
|
|
+ String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
|
|
|
+ item.setDeductibleRate(Integer.parseInt(deductibleRate));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ // 未知险种代码,返回null
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 构建附加保单信息列表
|
|
|
*
|
|
|
* @return List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList>
|
|
|
*/
|
|
|
- private List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> buildCarPolicySubInfoList() {
|
|
|
- List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> carPolicySubInfoList = new ArrayList<>();
|
|
|
+// private List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> buildCarPolicySubInfoList() {
|
|
|
+// List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> carPolicySubInfoList = new ArrayList<>();
|
|
|
+//
|
|
|
+// ZiJinCrawlerQuotationRequest.CarPolicySubInfoList carPolicySubInfo1 = new ZiJinCrawlerQuotationRequest.CarPolicySubInfoList();
|
|
|
+// carPolicySubInfo1.setPlanName("山西9座以内非营业客车驾乘险10万档:36元/座-10万+1万+30元/天");
|
|
|
+// carPolicySubInfo1.setInsureGradeNo("214000737028");
|
|
|
+// carPolicySubInfo1.setIsUseInsured("1");
|
|
|
+// carPolicySubInfo1.setQuantity("1");
|
|
|
+// carPolicySubInfo1.setRiskCode("0737");
|
|
|
+// carPolicySubInfo1.setRiskName("驾乘人员人身意外伤害保险");
|
|
|
+// carPolicySubInfo1.setSumAmount(577000);
|
|
|
+// carPolicySubInfo1.setSumPremium(180);
|
|
|
+// carPolicySubInfo1.setActualPremium("180.00");
|
|
|
+// carPolicySubInfo1.setProductCode("ZKICATM_GRDL_Plan");
|
|
|
+// carPolicySubInfoList.add(carPolicySubInfo1);
|
|
|
+// return carPolicySubInfoList;
|
|
|
+// }
|
|
|
+
|
|
|
|
|
|
- ZiJinCrawlerQuotationRequest.CarPolicySubInfoList carPolicySubInfo1 = new ZiJinCrawlerQuotationRequest.CarPolicySubInfoList();
|
|
|
- carPolicySubInfo1.setPlanName("山西9座以内非营业客车驾乘险10万档:36元/座-10万+1万+30元/天");
|
|
|
- carPolicySubInfo1.setInsureGradeNo("214000737028");
|
|
|
- carPolicySubInfo1.setIsUseInsured("1");
|
|
|
- carPolicySubInfo1.setQuantity("1");
|
|
|
- carPolicySubInfo1.setRiskCode("0737");
|
|
|
- carPolicySubInfo1.setRiskName("驾乘人员人身意外伤害保险");
|
|
|
- carPolicySubInfo1.setSumAmount(577000);
|
|
|
- carPolicySubInfo1.setSumPremium(180);
|
|
|
- carPolicySubInfo1.setActualPremium("180.00");
|
|
|
- carPolicySubInfo1.setProductCode("ZKICATM_GRDL_Plan");
|
|
|
- carPolicySubInfoList.add(carPolicySubInfo1);
|
|
|
+ /**
|
|
|
+ * 构建附加保单信息列表
|
|
|
+ *
|
|
|
+ * @return List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList>
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 构建附加保单信息列表(驾乘险)
|
|
|
+ * 参数来源对照Python get_fcx_main方法:
|
|
|
+ * 根据驾乘险列表动态构建附加保单信息
|
|
|
+ * 目前只支持 rideRiskCode == "0733"(紫金驾驶人意外伤害保险)
|
|
|
+ *
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @return List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList>
|
|
|
+ */
|
|
|
+ private List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> buildCarPolicySubInfoList(QuoteVo quoteVo) {
|
|
|
+ List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> carPolicySubInfoList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<AccidentalDrivingVo> accidentalDrivings = quoteVo.getAccidentalDrivings();
|
|
|
+ if (accidentalDrivings == null || accidentalDrivings.isEmpty()) {
|
|
|
+ return carPolicySubInfoList;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (AccidentalDrivingVo drivingInsurance : accidentalDrivings) {
|
|
|
+ String rideRiskCode = drivingInsurance.getRiskCode();
|
|
|
+
|
|
|
+ // 目前只支持 rideRiskCode == "0733"(紫金驾驶人意外伤害保险)
|
|
|
+ if ("0733".equals(rideRiskCode)) {
|
|
|
+ ZiJinCrawlerQuotationRequest.CarPolicySubInfoList subInfo = buildRideRisk0733(drivingInsurance);
|
|
|
+ if (subInfo != null) {
|
|
|
+ carPolicySubInfoList.add(subInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 其他风险代码暂未配置,Python中会抛出异常
|
|
|
+ // 这里暂时跳过,不抛出异常
|
|
|
+ }
|
|
|
+
|
|
|
return carPolicySubInfoList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 构建紫金驾驶人意外伤害保险(riskCode=0733)信息
|
|
|
+ *
|
|
|
+ * @param drivingInsurance 驾乘险信息
|
|
|
+ * @return ZiJinCrawlerQuotationRequest.CarPolicySubInfoList
|
|
|
+ */
|
|
|
+ private ZiJinCrawlerQuotationRequest.CarPolicySubInfoList buildRideRisk0733(AccidentalDrivingVo drivingInsurance) {
|
|
|
+ ZiJinCrawlerQuotationRequest.CarPolicySubInfoList subInfo = new ZiJinCrawlerQuotationRequest.CarPolicySubInfoList();
|
|
|
+
|
|
|
+ // 默认值
|
|
|
+ subInfo.setPlanName("全国家用驾驶人意外险50万档:160元-50万+5万+150元/天");
|
|
|
+ subInfo.setInsureGradeNo("200000733009");
|
|
|
+ subInfo.setIsUseInsured("1");
|
|
|
+ subInfo.setQuantity("1");
|
|
|
+ subInfo.setRiskCode("0733");
|
|
|
+ subInfo.setRiskName("紫金驾驶人意外伤害保险");
|
|
|
+ subInfo.setSumAmount(577000);
|
|
|
+ subInfo.setSumPremium(160);
|
|
|
+ subInfo.setProductCode("ZKICATM_Driver_Plan_Common");
|
|
|
+
|
|
|
+ // 根据 planId(这里用 productCode 代替)匹配具体计划
|
|
|
+ String planId = drivingInsurance.getProductCode();
|
|
|
+ if (StringUtils.hasLength(planId)) {
|
|
|
+ switch (planId) {
|
|
|
+ case "214000733008":
|
|
|
+ subInfo.setPlanName("山西驾驶20座(不含)以下非营业型客车(不包括摩托车、拖拉机、农用运输车、电瓶车)2.5万档:25元/车-2.5万+2500元");
|
|
|
+ subInfo.setInsureGradeNo("214000733008");
|
|
|
+ subInfo.setSumAmount(27500);
|
|
|
+ subInfo.setSumPremium(25);
|
|
|
+ break;
|
|
|
+ case "200000733007":
|
|
|
+ subInfo.setPlanName("全国家用驾驶人意外险30万档:120元-30万+3万+100元/天");
|
|
|
+ subInfo.setInsureGradeNo("200000733007");
|
|
|
+ subInfo.setSumAmount(348000);
|
|
|
+ subInfo.setSumPremium(120);
|
|
|
+ break;
|
|
|
+ case "200000733009":
|
|
|
+ // 默认值就是这个计划,无需修改
|
|
|
+ break;
|
|
|
+ case "214000733004":
|
|
|
+ subInfo.setPlanName("太原驾驶人意外险5万档:50元-5万+0.5万");
|
|
|
+ subInfo.setInsureGradeNo("214000733004");
|
|
|
+ subInfo.setSumAmount(55000);
|
|
|
+ subInfo.setSumPremium(2607);
|
|
|
+ break;
|
|
|
+ // 其他计划可以继续添加
|
|
|
+ default:
|
|
|
+ // 使用默认值
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置实际保费
|
|
|
+ if (subInfo.getSumPremium() != null) {
|
|
|
+ subInfo.setActualPremium(String.format("%.2f", subInfo.getSumPremium().doubleValue()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return subInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建车辆信息对象
|
|
|
+ *
|
|
|
+ * @return ZiJinCrawlerQuotationRequest.VehicleInfo
|
|
|
+ */
|
|
|
+// private ZiJinCrawlerQuotationRequest.VehicleInfo buildVehicleInfo() {
|
|
|
+// ZiJinCrawlerQuotationRequest.VehicleInfo vehicleInfo = new ZiJinCrawlerQuotationRequest.VehicleInfo();
|
|
|
+//
|
|
|
+// // 基础车辆信息
|
|
|
+// vehicleInfo.setActualValue(73905.6);
|
|
|
+// vehicleInfo.setAgreeActualValue(73905.6);
|
|
|
+// vehicleInfo.setBrandName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+// vehicleInfo.setCarKindCode("A0");
|
|
|
+// vehicleInfo.setCarKindDetailId("KA");
|
|
|
+// vehicleInfo.setCarLoanFlag("1");
|
|
|
+// vehicleInfo.setCertificateDate("2021-11-01");
|
|
|
+// vehicleInfo.setChgOwnerFlag("1");
|
|
|
+// vehicleInfo.setCompletekerbmass(1539);
|
|
|
+// vehicleInfo.setEcdemicVehicleFlag("0");
|
|
|
+// vehicleInfo.setEngineNo("DNSM9070392");
|
|
|
+//
|
|
|
+// // 日期相关
|
|
|
+// vehicleInfo.setEnrollDate("2021-11-01");
|
|
|
+// vehicleInfo.setUpdateEnrollDate("2021-11-01");
|
|
|
+// vehicleInfo.setIssueDate("2025-10-16");
|
|
|
+// vehicleInfo.setMakeDate("2025-10-16");
|
|
|
+// vehicleInfo.setMakeDateJQ("2025-10-16");
|
|
|
+//
|
|
|
+// // 车辆技术参数
|
|
|
+// vehicleInfo.setExhaustCapacity(1490);
|
|
|
+// vehicleInfo.setFuelType("0");
|
|
|
+// vehicleInfo.setFuelTypeJY("D1");
|
|
|
+// vehicleInfo.setNewEnergyFlag("0");
|
|
|
+// vehicleInfo.setPower("133");
|
|
|
+// vehicleInfo.setModelEnergyType("D1");
|
|
|
+//
|
|
|
+// // 牌照和车辆识别
|
|
|
+// vehicleInfo.setLicenseColorCode("01");
|
|
|
+// vehicleInfo.setLicenseKindCode("02");
|
|
|
+// vehicleInfo.setLicenseNo("晋HJW581");
|
|
|
+// vehicleInfo.setLoanVehicleFlag("0");
|
|
|
+// vehicleInfo.setModelCode("RWD1598SQQ");
|
|
|
+// vehicleInfo.setNoLicenseFlag("1");
|
|
|
+// vehicleInfo.setVehicleId("1");
|
|
|
+// vehicleInfo.setVinNo("LSJA24U69MS091895");
|
|
|
+//
|
|
|
+// // 车辆分类和用途
|
|
|
+// vehicleInfo.setSeatCount(5);
|
|
|
+// vehicleInfo.setUseNatureCode("85");
|
|
|
+// vehicleInfo.setOriCarKindName("K33");
|
|
|
+// vehicleInfo.setPlatVehicleCode("CRWARJUC0001");
|
|
|
+// vehicleInfo.setVehicleStyleUniqueId("800004584");
|
|
|
+//
|
|
|
+// // 价格和商业信息
|
|
|
+// vehicleInfo.setPurchasePrice("103800");
|
|
|
+// vehicleInfo.setSale4SFlag("0");
|
|
|
+// vehicleInfo.setOriPurchasePrice("103800");
|
|
|
+// vehicleInfo.setIsInvokeJingYou("1");
|
|
|
+//
|
|
|
+// // 型号名称
|
|
|
+// vehicleInfo.setPrintVehicleModelName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+// vehicleInfo.setAliasName("荣威RX5 PLUS 330TGI 1.5T TST国潮智臻版");
|
|
|
+// vehicleInfo.setOriBrandName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+// vehicleInfo.setOriModelName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+// vehicleInfo.setPrintModelName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+//
|
|
|
+// return vehicleInfo;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 构建车辆信息对象
|
|
|
*
|
|
|
* @return ZiJinCrawlerQuotationRequest.VehicleInfo
|
|
|
*/
|
|
|
- private ZiJinCrawlerQuotationRequest.VehicleInfo buildVehicleInfo() {
|
|
|
+ /**
|
|
|
+ * 构建车辆信息对象
|
|
|
+ * 参数来源对照Python get_car_info_main方法:
|
|
|
+ * - carInfoVo: 车辆基本信息
|
|
|
+ * - actualValue: 车辆实际价值(从API获取)
|
|
|
+ *
|
|
|
+ * @param quoteVo 报价实体
|
|
|
+ * @param actualValue 车辆实际价值
|
|
|
+ * @return VehicleInfo
|
|
|
+ */
|
|
|
+ private ZiJinCrawlerQuotationRequest.VehicleInfo buildVehicleInfo(QuoteVo quoteVo, Double actualValue, String modelCode, String iacVehicleCode) {
|
|
|
+ log.info("quoteVo参数的值:{}", JSON.toJSONString(quoteVo));
|
|
|
ZiJinCrawlerQuotationRequest.VehicleInfo vehicleInfo = new ZiJinCrawlerQuotationRequest.VehicleInfo();
|
|
|
+ CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
|
|
|
+
|
|
|
+ if (carInfoVo == null) {
|
|
|
+ return vehicleInfo;
|
|
|
+ }
|
|
|
|
|
|
// 基础车辆信息
|
|
|
- vehicleInfo.setActualValue(73905.6);
|
|
|
- vehicleInfo.setAgreeActualValue(73905.6);
|
|
|
- vehicleInfo.setBrandName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
- vehicleInfo.setCarKindCode("A0");
|
|
|
- vehicleInfo.setCarKindDetailId("KA");
|
|
|
- vehicleInfo.setCarLoanFlag("1");
|
|
|
- vehicleInfo.setCertificateDate("2021-11-01");
|
|
|
- vehicleInfo.setChgOwnerFlag("1");
|
|
|
- vehicleInfo.setCompletekerbmass(1539);
|
|
|
+ if (actualValue != null) {
|
|
|
+ vehicleInfo.setActualValue(actualValue);
|
|
|
+ vehicleInfo.setAgreeActualValue(actualValue);
|
|
|
+ }
|
|
|
+ vehicleInfo.setBrandName(carInfoVo.getBrandName());
|
|
|
+
|
|
|
+ // 车辆种类代码转换(A0->客车, A1->货车等)
|
|
|
+ String carKindCode = carInfoVo.getCarKindCode();
|
|
|
+ if (StringUtils.hasLength(carKindCode)) {
|
|
|
+ vehicleInfo.setCarKindCode(carKindCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ vehicleInfo.setCarKindDetailId(carInfoVo.getCarKindDetailIdCode());
|
|
|
+
|
|
|
+ // 交强险过户标志
|
|
|
+ vehicleInfo.setCarLoanFlag(carInfoVo.isTransfer() ? "1" : "0");
|
|
|
+
|
|
|
+ // 购车发票日期(使用注册日期)
|
|
|
+ vehicleInfo.setCertificateDate(carInfoVo.getRegisterDate());
|
|
|
+
|
|
|
+ // 商业险过户标志
|
|
|
+ vehicleInfo.setChgOwnerFlag(carInfoVo.isTransferBi() ? "1" : "0");
|
|
|
+
|
|
|
+ // 整备质量
|
|
|
+ if (StringUtils.hasLength(carInfoVo.getCompleteKerbMass())) {
|
|
|
+ vehicleInfo.setCompletekerbmass(Integer.parseInt(carInfoVo.getCompleteKerbMass()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 外地车标志(默认0)
|
|
|
vehicleInfo.setEcdemicVehicleFlag("0");
|
|
|
- vehicleInfo.setEngineNo("DNSM9070392");
|
|
|
+
|
|
|
+ vehicleInfo.setEngineNo(carInfoVo.getEngineNo());
|
|
|
|
|
|
// 日期相关
|
|
|
- vehicleInfo.setEnrollDate("2021-11-01");
|
|
|
- vehicleInfo.setUpdateEnrollDate("2021-11-01");
|
|
|
- vehicleInfo.setIssueDate("2025-10-16");
|
|
|
- vehicleInfo.setMakeDate("2025-10-16");
|
|
|
- vehicleInfo.setMakeDateJQ("2025-10-16");
|
|
|
+ vehicleInfo.setEnrollDate(carInfoVo.getRegisterDate());
|
|
|
+ vehicleInfo.setUpdateEnrollDate(carInfoVo.getRegisterDate());
|
|
|
+ vehicleInfo.setIssueDate(carInfoVo.getIssueDate());
|
|
|
+
|
|
|
+ // 过户日期处理
|
|
|
+ if (carInfoVo.isTransferBi()) {
|
|
|
+ vehicleInfo.setMakeDate(carInfoVo.getRegisterDate());
|
|
|
+ }
|
|
|
+ if (carInfoVo.isTransfer()) {
|
|
|
+ vehicleInfo.setMakeDateJQ(carInfoVo.getRegisterDate());
|
|
|
+ }
|
|
|
|
|
|
// 车辆技术参数
|
|
|
- vehicleInfo.setExhaustCapacity(1490);
|
|
|
- vehicleInfo.setFuelType("0");
|
|
|
- vehicleInfo.setFuelTypeJY("D1");
|
|
|
- vehicleInfo.setNewEnergyFlag("0");
|
|
|
- vehicleInfo.setPower("133");
|
|
|
- vehicleInfo.setModelEnergyType("D1");
|
|
|
+ if (StringUtils.hasLength(carInfoVo.getDisplacement())) {
|
|
|
+ // displacement是升(L),需要转换为毫升(ml)
|
|
|
+ double displacement = Double.parseDouble(carInfoVo.getDisplacement());
|
|
|
+ vehicleInfo.setExhaustCapacity((int) (displacement * 1000));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 能源类型
|
|
|
+ vehicleInfo.setFuelType(carInfoVo.getEnergyTypeCode());
|
|
|
+ vehicleInfo.setFuelTypeJY(carInfoVo.getModelEnergyType());
|
|
|
+
|
|
|
+ // 新能源标志
|
|
|
+ vehicleInfo.setNewEnergyFlag(carInfoVo.isNewEnergyMark() ? "1" : "0");
|
|
|
+
|
|
|
+ vehicleInfo.setPower(carInfoVo.getPowerScale());
|
|
|
+ vehicleInfo.setModelEnergyType(carInfoVo.getModelEnergyType());
|
|
|
|
|
|
// 牌照和车辆识别
|
|
|
- vehicleInfo.setLicenseColorCode("01");
|
|
|
- vehicleInfo.setLicenseKindCode("02");
|
|
|
- vehicleInfo.setLicenseNo("晋HJW581");
|
|
|
- vehicleInfo.setLoanVehicleFlag("0");
|
|
|
- vehicleInfo.setModelCode("RWD1598SQQ");
|
|
|
- vehicleInfo.setNoLicenseFlag("1");
|
|
|
+ vehicleInfo.setLicenseColorCode(StringUtils.hasLength(carInfoVo.getLicenseColorCode()) ? carInfoVo.getLicenseColorCode() : "01");
|
|
|
+ vehicleInfo.setLicenseKindCode(StringUtils.hasLength(carInfoVo.getLicenseKindCode()) ? carInfoVo.getLicenseKindCode() : "02");
|
|
|
+ vehicleInfo.setLicenseNo(carInfoVo.getLicenseNo());
|
|
|
+
|
|
|
+ // 贷款车标志
|
|
|
+ vehicleInfo.setLoanVehicleFlag(carInfoVo.isLoanStatus() ? "1" : "0");
|
|
|
+
|
|
|
+ // 车型代码
|
|
|
+ vehicleInfo.setModelCode(modelCode);
|
|
|
+
|
|
|
+ // 是否新车未上牌
|
|
|
+ vehicleInfo.setNoLicenseFlag("0".equals(carInfoVo.getIsRegistered()) ? "0" : "1");
|
|
|
+
|
|
|
vehicleInfo.setVehicleId("1");
|
|
|
- vehicleInfo.setVinNo("LSJA24U69MS091895");
|
|
|
+ vehicleInfo.setVinNo(carInfoVo.getVinNo());
|
|
|
|
|
|
// 车辆分类和用途
|
|
|
- vehicleInfo.setSeatCount(5);
|
|
|
- vehicleInfo.setUseNatureCode("85");
|
|
|
- vehicleInfo.setOriCarKindName("K33");
|
|
|
- vehicleInfo.setPlatVehicleCode("CRWARJUC0001");
|
|
|
- vehicleInfo.setVehicleStyleUniqueId("800004584");
|
|
|
+ if (StringUtils.hasLength(carInfoVo.getSeatCount())) {
|
|
|
+ vehicleInfo.setSeatCount(Integer.parseInt(carInfoVo.getSeatCount()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用性质代码
|
|
|
+ vehicleInfo.setUseNatureCode(carInfoVo.getCarNatureCode());
|
|
|
+ vehicleInfo.setOriCarKindName(carInfoVo.getCarTypeCode());
|
|
|
+
|
|
|
+ // 平台车辆代码
|
|
|
+ vehicleInfo.setPlatVehicleCode(iacVehicleCode);
|
|
|
+
|
|
|
+ // 车型唯一ID
|
|
|
+ vehicleInfo.setVehicleStyleUniqueId("");
|
|
|
|
|
|
// 价格和商业信息
|
|
|
- vehicleInfo.setPurchasePrice("103800");
|
|
|
+ vehicleInfo.setPurchasePrice(carInfoVo.getPurchasePrice());
|
|
|
vehicleInfo.setSale4SFlag("0");
|
|
|
- vehicleInfo.setOriPurchasePrice("103800");
|
|
|
+ vehicleInfo.setOriPurchasePrice(carInfoVo.getPurchasePrice());
|
|
|
vehicleInfo.setIsInvokeJingYou("1");
|
|
|
|
|
|
// 型号名称
|
|
|
- vehicleInfo.setPrintVehicleModelName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
- vehicleInfo.setAliasName("荣威RX5 PLUS 330TGI 1.5T TST国潮智臻版");
|
|
|
- vehicleInfo.setOriBrandName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
- vehicleInfo.setOriModelName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
- vehicleInfo.setPrintModelName("荣威CSA6452NEAQ多用途乘用车");
|
|
|
+ vehicleInfo.setPrintVehicleModelName(carInfoVo.getBrandName());
|
|
|
+ vehicleInfo.setAliasName(carInfoVo.getBrandName());
|
|
|
+ vehicleInfo.setOriBrandName(carInfoVo.getBrandName());
|
|
|
+ vehicleInfo.setOriModelName(carInfoVo.getBrandName());
|
|
|
+ vehicleInfo.setPrintModelName(carInfoVo.getBrandName());
|
|
|
|
|
|
return vehicleInfo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建盈利数据列表
|
|
|
+ *
|
|
|
+ * @return List<ZiJinCrawlerQuotationRequest.ProfitDataList>
|
|
|
+ */
|
|
|
+// private List<ZiJinCrawlerQuotationRequest.ProfitDataList> buildProfitDataList() {
|
|
|
+// List<ZiJinCrawlerQuotationRequest.ProfitDataList> profitDataList = new ArrayList<>();
|
|
|
+//
|
|
|
+// // 第一个盈利数据项
|
|
|
+// ZiJinCrawlerQuotationRequest.ProfitDataList profitData1 = new ZiJinCrawlerQuotationRequest.ProfitDataList();
|
|
|
+// profitData1.setProfitCode("C31");
|
|
|
+// profitData1.setProfitRate("1.05");
|
|
|
+// profitDataList.add(profitData1);
|
|
|
+//
|
|
|
+// // 第二个盈利数据项
|
|
|
+// ZiJinCrawlerQuotationRequest.ProfitDataList profitData2 = new ZiJinCrawlerQuotationRequest.ProfitDataList();
|
|
|
+// profitData2.setProfitCode("C32");
|
|
|
+// profitData2.setProfitRate("1.000000");
|
|
|
+// profitDataList.add(profitData2);
|
|
|
+// return profitDataList;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建盈利数据列表
|
|
|
+ *
|
|
|
+ * @return List<ZiJinCrawlerQuotationRequest.ProfitDataList>
|
|
|
+ */
|
|
|
/**
|
|
|
* 构建盈利数据列表
|
|
|
+ * 参数来源对照Python代码:
|
|
|
+ * - coefficient: 自主定价系数,从 otherInfo 获取
|
|
|
+ * 只有当 coefficient 不为空且大于0时,才构建盈利数据列表
|
|
|
*
|
|
|
+ * @param quoteVo 报价实体
|
|
|
* @return List<ZiJinCrawlerQuotationRequest.ProfitDataList>
|
|
|
*/
|
|
|
- private List<ZiJinCrawlerQuotationRequest.ProfitDataList> buildProfitDataList() {
|
|
|
+ private List<ZiJinCrawlerQuotationRequest.ProfitDataList> buildProfitDataList(QuoteVo quoteVo) {
|
|
|
List<ZiJinCrawlerQuotationRequest.ProfitDataList> profitDataList = new ArrayList<>();
|
|
|
|
|
|
- // 第一个盈利数据项
|
|
|
- ZiJinCrawlerQuotationRequest.ProfitDataList profitData1 = new ZiJinCrawlerQuotationRequest.ProfitDataList();
|
|
|
- profitData1.setProfitCode("C31");
|
|
|
- profitData1.setProfitRate("1.05");
|
|
|
- profitDataList.add(profitData1);
|
|
|
-
|
|
|
- // 第二个盈利数据项
|
|
|
- ZiJinCrawlerQuotationRequest.ProfitDataList profitData2 = new ZiJinCrawlerQuotationRequest.ProfitDataList();
|
|
|
- profitData2.setProfitCode("C32");
|
|
|
- profitData2.setProfitRate("1.000000");
|
|
|
- profitDataList.add(profitData2);
|
|
|
+ // 获取自主定价系数
|
|
|
+ String coefficient = null;
|
|
|
+ if (quoteVo.getOtherInfo() != null) {
|
|
|
+ coefficient = quoteVo.getOtherInfo().getCoefficient();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 只有当 coefficient 不为空且大于0时,才构建盈利数据列表
|
|
|
+ if (StringUtils.hasLength(coefficient)) {
|
|
|
+ try {
|
|
|
+ double coefficientValue = Double.parseDouble(coefficient);
|
|
|
+ if (coefficientValue > 0) {
|
|
|
+ // 第一个盈利数据项 - 自主定价系数
|
|
|
+ ZiJinCrawlerQuotationRequest.ProfitDataList profitData1 = new ZiJinCrawlerQuotationRequest.ProfitDataList();
|
|
|
+ profitData1.setProfitCode("C31");
|
|
|
+ profitData1.setProfitRate(coefficient);
|
|
|
+ profitDataList.add(profitData1);
|
|
|
+
|
|
|
+ // 第二个盈利数据项 - 固定值
|
|
|
+ ZiJinCrawlerQuotationRequest.ProfitDataList profitData2 = new ZiJinCrawlerQuotationRequest.ProfitDataList();
|
|
|
+ profitData2.setProfitCode("C32");
|
|
|
+ profitData2.setProfitRate("1.000000");
|
|
|
+ profitDataList.add(profitData2);
|
|
|
+ }
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ // coefficient 不是有效数字,不构建盈利数据列表
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return profitDataList;
|
|
|
}
|
|
|
|