|
|
@@ -1,14 +1,11 @@
|
|
|
package com.jzg.quotation.taikang.crawler.service;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jzg.commons.constants.quote.enums.quote.CarKindCode;
|
|
|
import com.jzg.commons.constants.quote.enums.quote.VehicleUseCode;
|
|
|
import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
|
|
|
import com.jzg.commons.entity.quote.vo.*;
|
|
|
-import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.commons.util.IDCardUtils;
|
|
|
import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
|
|
|
-import com.jzg.quotation.commons.utils.TimeProcessing;
|
|
|
import com.jzg.quotation.taikang.crawler.CodeUtil;
|
|
|
import com.jzg.quotation.taikang.crawler.model.TKLoginSession;
|
|
|
import com.jzg.quotation.taikang.crawler.model.api.*;
|
|
|
@@ -23,8 +20,6 @@ import org.springframework.stereotype.Service;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
-import java.util.regex.Matcher;
|
|
|
-import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
|
@@ -281,7 +276,6 @@ public class TKSimpleService {
|
|
|
|
|
|
// 车辆大类
|
|
|
String carKindCode = commonCarInfoVo.getCarKindCode();
|
|
|
-
|
|
|
if (carKindCode.equals(CarKindCode.CAR_KIND_CODE_A0.getCode())) {
|
|
|
carInfoVo.setCarType("A");
|
|
|
} else if (carKindCode.equals(CarKindCode.CAR_KIND_CODE_A1.getCode())) {
|
|
|
@@ -291,11 +285,8 @@ public class TKSimpleService {
|
|
|
}
|
|
|
|
|
|
setLicenseTypeByLicenseNo(carInfoVo, carInfoVo.getLicenseNo());
|
|
|
-
|
|
|
carInfoVo.setLocalCarFlag(null); // todo 车型查询时没有传这个参数,暂时不知什么地方用到。
|
|
|
-
|
|
|
// String tempOrderId = newOrderId(session);
|
|
|
-
|
|
|
CarModelinfoQueryParam carModelinfoQueryParam = new CarModelinfoQueryParam();
|
|
|
carModelinfoQueryParam.setTplatformId(session.getTplatformId());
|
|
|
carModelinfoQueryParam.setTplatLoginKey(session.getTplatLoginKey());
|
|
|
@@ -306,10 +297,7 @@ public class TKSimpleService {
|
|
|
carModelinfoQueryParam.setChannelCode("OffWeb");
|
|
|
carModelinfoQueryParam.setAreaInfoVo(area);
|
|
|
carModelinfoQueryParam.setCarInfoVo(carInfoVo);
|
|
|
-
|
|
|
- CarModelinfoQueryResult carModelinfoQueryResult = httpService.carModelinfoQuery(session, mainOrderId, carModelinfoQueryParam);
|
|
|
-
|
|
|
- return carModelinfoQueryResult;
|
|
|
+ return httpService.carModelinfoQuery(session, mainOrderId, carModelinfoQueryParam);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -438,7 +426,6 @@ public class TKSimpleService {
|
|
|
}
|
|
|
|
|
|
carInfoVo.setLocalCarFlag(null); // todo 车型查询时没有传这个参数,暂时不知什么地方用到。
|
|
|
-
|
|
|
CarModelinfoQueryParam carModelinfoQueryParam = new CarModelinfoQueryParam();
|
|
|
carModelinfoQueryParam.setTplatformId(session.getTplatformId());
|
|
|
carModelinfoQueryParam.setFromId(session.getFromid());
|
|
|
@@ -451,18 +438,11 @@ public class TKSimpleService {
|
|
|
return httpService.carModelinfoQuery(session, mainOrderId, carModelinfoQueryParam);
|
|
|
}
|
|
|
|
|
|
- public TKAreaInfoVo dataCreateArea(TKLoginSession session,
|
|
|
- String mainOrderId,
|
|
|
- CarInfoVo commonCarInfoVo,
|
|
|
- TKAgentFuzzy agentFuzzy,
|
|
|
- String agentCode,
|
|
|
- TKAgentQueryResult agentQueryResult,
|
|
|
- AreaUserResult province) {
|
|
|
+ public TKAreaInfoVo dataCreateArea(TKLoginSession session, String mainOrderId, CarInfoVo commonCarInfoVo, TKAgentFuzzy agentFuzzy,
|
|
|
+ String agentCode, TKAgentQueryResult agentQueryResult, AreaUserResult province) {
|
|
|
String tplatformId = session.getTplatformId();
|
|
|
String fromId = session.getFromid();
|
|
|
-
|
|
|
AreaUserResult.CityInfo city = province.getCityList().get(0);
|
|
|
-
|
|
|
TKAgent agent = new TKAgent();
|
|
|
agent.setStatus("1");
|
|
|
agent.setAgentCode(agentCode);
|
|
|
@@ -556,7 +536,6 @@ public class TKSimpleService {
|
|
|
insureInfo.setCarOwnerVo(carOwnerVo);
|
|
|
insureInfo.setAppliInfo(appliInfo);
|
|
|
insureInfo.setInsuredInfo(insuredInfo);
|
|
|
-
|
|
|
return insureInfo;
|
|
|
}
|
|
|
|
|
|
@@ -635,9 +614,7 @@ public class TKSimpleService {
|
|
|
|
|
|
// 车辆所有人信息
|
|
|
TKCarOwnerVo carOwnerVo = new TKCarOwnerVo();
|
|
|
-
|
|
|
CustomerInfoVo commonCustomersInfo = commonQuoteVo.getOwnersInfo();
|
|
|
-
|
|
|
if (commonCustomersInfo != null) {
|
|
|
carOwnerVo.setCarOwnerNature("1"); // todo
|
|
|
carOwnerVo.setCertificateType("01"); // 身份证
|
|
|
@@ -736,16 +713,12 @@ public class TKSimpleService {
|
|
|
}
|
|
|
|
|
|
TKSimpleService.setLicenseTypeByLicenseNo(car, car.getLicenseNo());
|
|
|
-
|
|
|
String passengerSeat = httpService.carTypePassengerSeat(session.getToken(), session.getTplatformId(), session.getFromid(), session.getComCode());
|
|
|
-
|
|
|
String carType = carType(passengerSeat, car.getCarType(), carOwnerVo.getCarOwnerNature());
|
|
|
-
|
|
|
if (carType != null) {
|
|
|
car.setCarType(carType);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
orderCreateOther(null);
|
|
|
car.setCarModel(Arrays.asList(tkCarModel));
|
|
|
car.setBrandName(tkCarModel.getModelName()); // todo 与 commonCarInfoVo.getBrandName() 重复
|
|
|
@@ -783,9 +756,7 @@ public class TKSimpleService {
|
|
|
param.setCarTaxVo(carTax);
|
|
|
param.setOtherInfo(otherInfo);
|
|
|
param.setOrderVersion("1");
|
|
|
-
|
|
|
SaveBasicInfoResult saveBasicInfoResult = httpService.saveBasicInfo(session.getToken(), param);
|
|
|
-
|
|
|
if (saveBasicInfoResult == null) {
|
|
|
throw new RuntimeException("HttpService#saveBasicInfo 失败!");
|
|
|
}
|
|
|
@@ -927,10 +898,7 @@ public class TKSimpleService {
|
|
|
* @param preciseInitResult
|
|
|
* @param commonQuoteVo
|
|
|
*/
|
|
|
- public PreciseInitResult orderQuote(TKLoginSession session,
|
|
|
- String mainOrderId,
|
|
|
- PreciseInitResult preciseInitResult,
|
|
|
- QuoteVo commonQuoteVo) {
|
|
|
+ public PreciseInitResult orderQuote(TKLoginSession session, String mainOrderId, PreciseInitResult preciseInitResult, QuoteVo commonQuoteVo) {
|
|
|
PreciseInitParam preciseInitParam = Converter.Instance.convertToParam(preciseInitResult);
|
|
|
|
|
|
// 全局固定参数
|
|
|
@@ -939,7 +907,6 @@ public class TKSimpleService {
|
|
|
String fromId = session.getFromid();
|
|
|
|
|
|
// 险种选中标志
|
|
|
-
|
|
|
TKFlag flag = preciseInitParam.getFlag();
|
|
|
if (flag == null) {
|
|
|
flag = new TKFlag();
|
|
|
@@ -954,14 +921,8 @@ public class TKSimpleService {
|
|
|
if (CollectionUtils.isEmpty(commonQuoteVo.getKindInfoVo())) {
|
|
|
flag.setCiFlag("0");
|
|
|
}
|
|
|
- // 无驾意险,经测试这个值无驾意险的时候请求还是传1,不用改变
|
|
|
- // if (CollectionUtils.isEmpty(commonQuoteVo.getAccidentalDrivings())) {
|
|
|
- // flag.setIsAccidentInsureFlag("0");
|
|
|
- // }
|
|
|
-
|
|
|
|
|
|
// 其他参数
|
|
|
-
|
|
|
TKOther other = preciseInitParam.getOther();
|
|
|
if (other == null) {
|
|
|
other = new TKOther();
|
|
|
@@ -1012,7 +973,6 @@ public class TKSimpleService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 同步商业险时间信息,从前端参数获取
|
|
|
RiskInfoVo commonBiRiskInfoVo = commonQuoteVo.getBiRiskInfoVo();
|
|
|
if (commonBiRiskInfoVo != null) {
|
|
|
@@ -1053,11 +1013,9 @@ public class TKSimpleService {
|
|
|
} else if (StringUtils.isNotBlank(serviceTimes)) {
|
|
|
tkCiKindVo.setQuantity(Integer.parseInt(serviceTimes));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 同步驾意险, 系统有选择驾意险进行匹配覆盖(泰康要求必须有驾意险)
|
|
|
Map<String, TKCarPlanInfo> carPlanInfoMap = Optional.ofNullable(preciseInitParam.getDriverAccidentVo().getCarPlanInfoList()).orElseGet(Collections::emptyList).stream().collect(Collectors.toMap(TKCarPlanInfo::getPlanCode, Function.identity()));
|
|
|
TKDriverAccidentVo driverAccidentVo = preciseInitParam.getDriverAccidentVo();// 泰康系统默认的驾意险信息
|
|
|
@@ -1135,7 +1093,6 @@ public class TKSimpleService {
|
|
|
httpService.entranceFor000012(token, tplatformId, fromId, mainOrderId, insureInfo);
|
|
|
|
|
|
PreciseInitResult preciseQuoteResult = httpService.preciseInitToVipQuote(token, tplatformId, tplatLoginKey, mainOrderId, insureInfo);
|
|
|
-
|
|
|
if (preciseQuoteResult == null) {
|
|
|
throw new RuntimeException("HttpService#preciseInitToQuote (核保)失败!");
|
|
|
}
|
|
|
@@ -1153,7 +1110,6 @@ public class TKSimpleService {
|
|
|
String tplatformId = session.getTplatformId();
|
|
|
String tplatLoginKey = session.getTplatLoginKey();
|
|
|
String token = session.getToken();
|
|
|
- InitProposalResult initProposalResult = httpService.initProposal(token, tplatformId, tplatLoginKey, mainOrderId);
|
|
|
- return initProposalResult;
|
|
|
+ return httpService.initProposal(token, tplatformId, tplatLoginKey, mainOrderId);
|
|
|
}
|
|
|
}
|