|
|
@@ -15,6 +15,7 @@ import com.jzg.commons.util.StringUtils;
|
|
|
import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
|
|
|
import com.jzg.quotation.commons.client.OrgClient;
|
|
|
import com.jzg.quotation.commons.constant.InsuranceCode;
|
|
|
+import com.jzg.quotation.commons.entity.DetectLoginRequest;
|
|
|
import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
|
|
|
import com.jzg.quotation.guoshou.crawler.component.GsCrawlerLoginComponent;
|
|
|
import com.jzg.quotation.guoshou.crawler.component.GsCrawlerRequestComponent;
|
|
|
@@ -63,13 +64,32 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
private final StringRedisTemplate redisTemplate;
|
|
|
private final RsaUtils rsaUtils;
|
|
|
private final OrgClient orgClient;
|
|
|
- private CloseableHttpClient httpClient;
|
|
|
+ private CloseableHttpClient httpClient;
|
|
|
|
|
|
@Override
|
|
|
public void login(LoginBase loginBase) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean detectLogin(DetectLoginRequest detectLoginRequest) {
|
|
|
+ String username = detectLoginRequest.getUsername();
|
|
|
+ String password = detectLoginRequest.getPassword();
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + username);
|
|
|
+ String token = JSONObject.parseObject(redisValue).getString("token");
|
|
|
+ String userID = JSONObject.parseObject(redisValue).getString("userID");
|
|
|
+ if (!StringUtils.hasText(token) || !StringUtils.hasText(userID)) {
|
|
|
+ AttributionInformationVo attributionInformationVo = new AttributionInformationVo();
|
|
|
+ Map<String, String> configInfo = new HashMap<>();
|
|
|
+ configInfo.put("username", username);
|
|
|
+ configInfo.put("password", password);
|
|
|
+ attributionInformationVo.setConfigInfo(configInfo);
|
|
|
+ return getLoginInfo(attributionInformationVo) != null;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public QuoteResultsVo quote(QuoteVo quoteVo) throws Exception {
|
|
|
OrderBase order = quoteVo.getOrder();
|
|
|
@@ -77,7 +97,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
|
|
|
// 查询loginInfo
|
|
|
UserInfoResponse.UserData loginInfo = getLoginInfo(attributionInformationVo);
|
|
|
- String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ attributionInformationVo.getConfigInfo().get("username"));
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + attributionInformationVo.getConfigInfo().get("username"));
|
|
|
String token = JSONObject.parseObject(redisValue).getString("token");
|
|
|
String userID = JSONObject.parseObject(redisValue).getString("userID");
|
|
|
JSONObject bindInfo = getBindInfo(redisValue, loginInfo);
|
|
|
@@ -87,17 +107,17 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
log.info("绑定信息查询成功,userAgentName:{}", bindInfo.getString("userAgentName"));
|
|
|
// 调用订单号接口
|
|
|
- InsuranceApplicationEntity insuranceApplicationEntity = new InsuranceApplicationEntity(redisValue,bindInfo,loginInfo,rsaUtils.encrypt(carInfoVo.getLicenseNo()),
|
|
|
- rsaUtils.encrypt(JSONObject.parseObject(redisValue).getString("userID")),carInfoVo.getEnergyTypeCode());
|
|
|
- String orderNo = gsCrawlerRequestComponent.queryOrderNo(insuranceApplicationEntity,redisValue);
|
|
|
- log.info("获取订单号成功,orderId:{}",orderNo);
|
|
|
+ InsuranceApplicationEntity insuranceApplicationEntity = new InsuranceApplicationEntity(redisValue, bindInfo, loginInfo, rsaUtils.encrypt(carInfoVo.getLicenseNo()),
|
|
|
+ rsaUtils.encrypt(JSONObject.parseObject(redisValue).getString("userID")), carInfoVo.getEnergyTypeCode());
|
|
|
+ String orderNo = gsCrawlerRequestComponent.queryOrderNo(insuranceApplicationEntity, redisValue);
|
|
|
+ log.info("获取订单号成功,orderId:{}", orderNo);
|
|
|
// 获取保险信息
|
|
|
- InsuranceInformationRequest informationRequest = new InsuranceInformationRequest(rsaUtils.encrypt(bindInfo.getString("userAgentCode")),orderNo,"");
|
|
|
- CarInsuranceQueryResponse.CarInsuranceData insuranceInformation = gsCrawlerRequestComponent.getInsuranceInformation(informationRequest,token);
|
|
|
- GsCrawlerCarQueryRequest carQueryRequest = new GsCrawlerCarQueryRequest(carInfoVo,insuranceInformation,rsaUtils.encrypt(carInfoVo.getVinNo()), orderNo);
|
|
|
+ InsuranceInformationRequest informationRequest = new InsuranceInformationRequest(rsaUtils.encrypt(bindInfo.getString("userAgentCode")), orderNo, "");
|
|
|
+ CarInsuranceQueryResponse.CarInsuranceData insuranceInformation = gsCrawlerRequestComponent.getInsuranceInformation(informationRequest, token);
|
|
|
+ GsCrawlerCarQueryRequest carQueryRequest = new GsCrawlerCarQueryRequest(carInfoVo, insuranceInformation, rsaUtils.encrypt(carInfoVo.getVinNo()), orderNo);
|
|
|
|
|
|
//查询车型
|
|
|
- List<GsCrawlerCarQueryResponse.VehicleModelDetail> vehicleModelDetails = gsCrawlerRequestComponent.carQuery(carQueryRequest,token);
|
|
|
+ List<GsCrawlerCarQueryResponse.VehicleModelDetail> vehicleModelDetails = gsCrawlerRequestComponent.carQuery(carQueryRequest, token);
|
|
|
GsCrawlerCarQueryResponse.VehicleModelDetail vehicleModelDetail = CarModelsFilterUtils.to(vehicleModelDetails, carInfoVo);
|
|
|
if (vehicleModelDetail == null) {
|
|
|
log.error("未匹配到车辆信息,vin:{}, seatCount:{}", carInfoVo.getVinNo());
|
|
|
@@ -105,31 +125,31 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
JSONObject jsonObject = gsCrawlerRequestComponent.salesFCBelongInfo(token, orderNo, bindInfo);
|
|
|
String businessNatureCode = jsonObject.getString("businessNatureCode");
|
|
|
- log.info("车辆信息查询成功,standardName:{}, seat:{}", vehicleModelDetail.getStandardName(),vehicleModelDetail.getSeat());
|
|
|
+ log.info("车辆信息查询成功,standardName:{}, seat:{}", vehicleModelDetail.getStandardName(), vehicleModelDetail.getSeat());
|
|
|
// 封装submit参数
|
|
|
- SubmitInsuranceInformationRequest submitInsuranceInformationRequest = new SubmitInsuranceInformationRequest(orderNo,quoteVo,vehicleModelDetail,loginInfo,bindInfo,insuranceInformation,userID,orgClient,businessNatureCode);
|
|
|
+ SubmitInsuranceInformationRequest submitInsuranceInformationRequest = new SubmitInsuranceInformationRequest(orderNo, quoteVo, vehicleModelDetail, loginInfo, bindInfo, insuranceInformation, userID, orgClient, businessNatureCode);
|
|
|
SubmitResponse submitResponse = gsCrawlerRequestComponent.submitInsuranceInformationRequest(submitInsuranceInformationRequest, token);
|
|
|
- if ("500".equals(submitResponse.getStatus())){
|
|
|
- throw new RuntimeException("提交保险信息失败"+ submitResponse.getMsg());
|
|
|
- }else if ("301".equals(submitResponse.getStatus())){
|
|
|
+ if ("500".equals(submitResponse.getStatus())) {
|
|
|
+ throw new RuntimeException("提交保险信息失败" + submitResponse.getMsg());
|
|
|
+ } else if ("301".equals(submitResponse.getStatus())) {
|
|
|
SubmitInsuranceInformationRequest.CustomerVo customerVo = submitInsuranceInformationRequest.getCustomerVo();
|
|
|
customerVo.setSamePerson("1");
|
|
|
customerVo.setSysStatus("1");
|
|
|
submitInsuranceInformationRequest.setCustomerVo(customerVo);
|
|
|
submitResponse = gsCrawlerRequestComponent.submitInsuranceInformationRequest(submitInsuranceInformationRequest, token);
|
|
|
- if ("500".equals(submitResponse.getStatus())){
|
|
|
- throw new RuntimeException("提交保险信息失败"+ submitResponse.getMsg());
|
|
|
- }else if("200".equals(submitResponse.getStatus())){
|
|
|
+ if ("500".equals(submitResponse.getStatus())) {
|
|
|
+ throw new RuntimeException("提交保险信息失败" + submitResponse.getMsg());
|
|
|
+ } else if ("200".equals(submitResponse.getStatus())) {
|
|
|
log.info("提交保险信息成功{}");
|
|
|
}
|
|
|
- } else if ("200".equals(submitResponse.getStatus())){
|
|
|
+ } else if ("200".equals(submitResponse.getStatus())) {
|
|
|
log.info("提交保险信息成功");
|
|
|
- }else {
|
|
|
- throw new RuntimeException("提交保险信息失败"+ submitResponse.getMsg());
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("提交保险信息失败" + submitResponse.getMsg());
|
|
|
}
|
|
|
// 加密转换查询
|
|
|
//String encrypt_userCode = gsCrawlerRequestComponent.getEncryptionConvert(userID, token);
|
|
|
- return calculation(orderNo,redisValue,quoteVo,insuranceInformation,loginInfo, vehicleModelDetail,bindInfo, businessNatureCode);
|
|
|
+ return calculation(orderNo, redisValue, quoteVo, insuranceInformation, loginInfo, vehicleModelDetail, bindInfo, businessNatureCode);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -138,11 +158,11 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
String ordersNo = underwritingVo.getOrder().getOrdersNo();
|
|
|
JSONObject quoteInfo = JSONObject.parseObject(redisTemplate.opsForValue().get(GsConstants.GS_REDIS_QUOTE_KEY + ordersNo));
|
|
|
UserInfoResponse.UserData loginInfo = getLoginInfo(attributionInformationVo);
|
|
|
- String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ attributionInformationVo.getConfigInfo().get("username"));
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + attributionInformationVo.getConfigInfo().get("username"));
|
|
|
JSONObject res = gsCrawlerRequestComponent.doCompleteTask(new OrderEntity(quoteInfo), redisValue);
|
|
|
log.info("核保结果:{}", res);
|
|
|
UnderwritingResultsVo underwritingResultsVo = new UnderwritingResultsVo();
|
|
|
- if (!"核保通过".equals(res.getString("msg"))){
|
|
|
+ if (!"核保通过".equals(res.getString("msg"))) {
|
|
|
Map<String, Object> errorMsg = getErrorMsg(res);
|
|
|
if (errorMsg != null && errorMsg.size() > 0) {
|
|
|
log.error("核保失败,errorMsg:{}", errorMsg);
|
|
|
@@ -154,15 +174,14 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.PAY_PENDING);
|
|
|
underwritingResultsVo.setUnderwritingResult(res.getString("msg"));
|
|
|
underwritingResultsVo.setPaymentLink(getPayUrl(quoteInfo, redisValue));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.AUDIT_FAIL);
|
|
|
}
|
|
|
return underwritingResultsVo;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- public Map<String, Object> getErrorMsg(JSONObject res){
|
|
|
+ public Map<String, Object> getErrorMsg(JSONObject res) {
|
|
|
if (!"核保通过".equals(res.getString("msg"))) {
|
|
|
if ("201".equals(res.getString("status"))) {
|
|
|
List<Map<String, String>> errList = new ArrayList<>();
|
|
|
@@ -199,33 +218,32 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public PaymentLinkResultsVo getPaymentLink(PaymentLinkVo paymentLinkVo) throws Exception {
|
|
|
AttributionInformationVo attributionInformationVo = paymentLinkVo.getOrder().getAttributionInformationVo();
|
|
|
String ordersNo = paymentLinkVo.getOrder().getOrdersNo();
|
|
|
JSONObject quoteInfo = JSONObject.parseObject(redisTemplate.opsForValue().get(GsConstants.GS_REDIS_QUOTE_KEY + ordersNo));
|
|
|
getLoginInfo(attributionInformationVo);
|
|
|
- String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ attributionInformationVo.getConfigInfo().get("username"));
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + attributionInformationVo.getConfigInfo().get("username"));
|
|
|
PaymentLinkResultsVo paymentLinkResultsVo = new PaymentLinkResultsVo();
|
|
|
paymentLinkResultsVo.setPaymentLink(getPayUrl(quoteInfo, redisValue));
|
|
|
return paymentLinkResultsVo;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public String getPayUrl(JSONObject quoteInfo, String redisValue){
|
|
|
+ public String getPayUrl(JSONObject quoteInfo, String redisValue) {
|
|
|
// 核保通过 获取订单详情
|
|
|
Map<String, Object> detailData = new HashMap<>();
|
|
|
detailData.put("orderNo", quoteInfo.getString("orderId"));
|
|
|
- detailData.put("structureId",JSONObject.parseObject(redisValue).getString("structureId"));
|
|
|
+ detailData.put("structureId", JSONObject.parseObject(redisValue).getString("structureId"));
|
|
|
detailData.put("userCode", JSONObject.parseObject(redisValue).getString("username"));
|
|
|
detailData.put("userLoginType", "1");
|
|
|
detailData.put("sellCode", null);
|
|
|
detailData.put("systemSource", "gstc");
|
|
|
- JSONObject doMesOrderDetailRes = gsCrawlerRequestComponent.doMesOrderDetail(redisValue,quoteInfo);
|
|
|
+ JSONObject doMesOrderDetailRes = gsCrawlerRequestComponent.doMesOrderDetail(redisValue, quoteInfo);
|
|
|
// 提取支付链接
|
|
|
String payUrl = JSONObject.parseObject(doMesOrderDetailRes.getString("data")).getString("payUrl");
|
|
|
- JSONObject tokenResponse = gsCrawlerRequestComponent.getTokenUrl(getTokenData(payUrl),redisValue);
|
|
|
+ JSONObject tokenResponse = gsCrawlerRequestComponent.getTokenUrl(getTokenData(payUrl), redisValue);
|
|
|
ResponseDTO shareInfo = gsCrawlerRequestComponent.getShareInfo(tokenResponse, redisValue);
|
|
|
return QrCodeReader.parseQrCodeUrl(shareInfo.getData().getUrl());
|
|
|
}
|
|
|
@@ -239,21 +257,21 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
JSONObject quote = JSONObject.parseObject(value);
|
|
|
// 查询loginInfo
|
|
|
UserInfoResponse.UserData loginInfo = getLoginInfo(attributionInformationVo);
|
|
|
- String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ attributionInformationVo.getConfigInfo().get("username"));
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + attributionInformationVo.getConfigInfo().get("username"));
|
|
|
// 获取归属信息
|
|
|
JSONObject bindInfo = getBindInfo(redisValue, loginInfo);
|
|
|
// 1. 自动生成订单
|
|
|
GenerateDataRequest generateDataRequest = new GenerateDataRequest(quote);
|
|
|
- gsCrawlerRequestComponent.doAutoGenerate(generateDataRequest,redisValue);
|
|
|
+ gsCrawlerRequestComponent.doAutoGenerate(generateDataRequest, redisValue);
|
|
|
// 2. 获取订单详情
|
|
|
- JSONObject doMesOrderDetail = gsCrawlerRequestComponent.doMesOrderDetail(redisValue,quote );
|
|
|
+ JSONObject doMesOrderDetail = gsCrawlerRequestComponent.doMesOrderDetail(redisValue, quote);
|
|
|
// 3. 获取上传状态
|
|
|
- gsCrawlerRequestComponent.getUploadSuccess(redisValue,quote);
|
|
|
+ gsCrawlerRequestComponent.getUploadSuccess(redisValue, quote);
|
|
|
// 4. 查询日志
|
|
|
JSONObject logData = new JSONObject();
|
|
|
- logData.put("orderNo",quote.getString("orderId"));
|
|
|
- logData.put("tranNo",quote.getString("tranNo"));
|
|
|
- logData.put("structureId",quote.getString("structureId"));
|
|
|
+ logData.put("orderNo", quote.getString("orderId"));
|
|
|
+ logData.put("tranNo", quote.getString("tranNo"));
|
|
|
+ logData.put("structureId", quote.getString("structureId"));
|
|
|
logData.put("userCode", quote.getString("userCode"));
|
|
|
logData.put("oriSysOperator", "EM2_user");
|
|
|
logData.put("oriSysOperatorKey", "RU0yZW0y");
|
|
|
@@ -283,20 +301,20 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
if (StringUtils.isNotEmpty(JYX_Policy) && JYX_Policy.length() != 22) {
|
|
|
JYX_Policy = "";
|
|
|
}
|
|
|
- redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo() + ":JQ_Policy:" , JQ_Policy,GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
- redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo() + ":SY_Policy:" , SY_Policy,GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
- redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo() + ":JYX_Policy:" , JYX_Policy,GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
+ redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo() + ":JQ_Policy:", JQ_Policy, GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
+ redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo() + ":SY_Policy:", SY_Policy, GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
+ redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo() + ":JYX_Policy:", JYX_Policy, GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
// 再次获取订单详情
|
|
|
- gsCrawlerRequestComponent.doMesOrderDetail(redisValue,quote);
|
|
|
+ gsCrawlerRequestComponent.doMesOrderDetail(redisValue, quote);
|
|
|
} else {
|
|
|
- log.info("查询QueryLog日志{}",queryLogResponse.getMsg());
|
|
|
- throw new RuntimeException("获取报价日志失败{}:"+ queryLogResponse.getMsg());
|
|
|
+ log.info("查询QueryLog日志{}", queryLogResponse.getMsg());
|
|
|
+ throw new RuntimeException("获取报价日志失败{}:" + queryLogResponse.getMsg());
|
|
|
}
|
|
|
|
|
|
JSONObject upload = upload(insuranceUploadImageVo.getImageVoList(), JQ_Policy, SY_Policy, JYX_Policy, loginInfo, bindInfo, quote, redisValue);
|
|
|
- if (!"200".equals(upload.getString("code"))){
|
|
|
- throw new RuntimeException("上传失败"+ upload.getString("message"));
|
|
|
- }else {
|
|
|
+ if (!"200".equals(upload.getString("code"))) {
|
|
|
+ throw new RuntimeException("上传失败" + upload.getString("message"));
|
|
|
+ } else {
|
|
|
log.info("上传成功{}", upload.toJSONString());
|
|
|
}
|
|
|
}
|
|
|
@@ -312,15 +330,15 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
OrderBase orderBase = downloadPolicyVo.getOrder();
|
|
|
JSONObject quote = JSONObject.parseObject(redisTemplate.opsForValue().get(GsConstants.GS_REDIS_QUOTE_KEY + orderBase.getOrdersNo()));
|
|
|
UserInfoResponse.UserData loginInfo = getLoginInfo(attributionInformationVo);
|
|
|
- String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ attributionInformationVo.getConfigInfo().get("username"));
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + attributionInformationVo.getConfigInfo().get("username"));
|
|
|
// 1. 获取订单列表
|
|
|
- DoMesOrdersRequest doMesOrdersRequest = new DoMesOrdersRequest(loginInfo.getAesCode(),"");
|
|
|
+ DoMesOrdersRequest doMesOrdersRequest = new DoMesOrdersRequest(loginInfo.getAesCode(), "");
|
|
|
JSONObject mesOrders = gsCrawlerRequestComponent.doMesOrders(doMesOrdersRequest, redisValue);
|
|
|
JSONObject order = JSONObject.parseObject(JSONObject.toJSONString(mesOrders.getJSONObject("data").getJSONArray("data").get(0)));
|
|
|
quote.put("orderId", order.getString("orderNo"));
|
|
|
// 获取订单详情
|
|
|
JSONObject jsonObject = gsCrawlerRequestComponent.doMesOrderDetail(redisValue, quote);
|
|
|
- JSONObject tokenResponse = gsCrawlerRequestComponent.getTokenUrl(getTokenData(JSONObject.toJSONString(jsonObject)),redisValue);
|
|
|
+ JSONObject tokenResponse = gsCrawlerRequestComponent.getTokenUrl(getTokenData(JSONObject.toJSONString(jsonObject)), redisValue);
|
|
|
String id = tokenResponse.getJSONObject("data").getString("id");
|
|
|
JSONObject orderDetail = gsCrawlerRequestComponent.getOrderDetail(id, redisValue);
|
|
|
JSONArray dzbdList = orderDetail.getJSONObject("data").getJSONArray("list");
|
|
|
@@ -352,7 +370,8 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
|
|
|
/**
|
|
|
* 下载PDF文件
|
|
|
- * @param pdfUrl PDF URL
|
|
|
+ *
|
|
|
+ * @param pdfUrl PDF URL
|
|
|
* @param savePath 保存路径
|
|
|
* @throws IOException 异常
|
|
|
*/
|
|
|
@@ -377,6 +396,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
|
|
|
/**
|
|
|
* 从PDF中获取支付时间
|
|
|
+ *
|
|
|
* @param pdfFilePath PDF文件路径
|
|
|
* @return 支付时间
|
|
|
* @throws IOException 异常
|
|
|
@@ -400,9 +420,9 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
public OrderStatusResultVo queryOrderState(OrderStatusVo orderStatusVo) throws Exception {
|
|
|
AttributionInformationVo attributionInformationVo = orderStatusVo.getOrder().getAttributionInformationVo();
|
|
|
UserInfoResponse.UserData loginInfo = getLoginInfo(attributionInformationVo);
|
|
|
- String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ attributionInformationVo.getConfigInfo().get("username"));
|
|
|
+ String redisValue = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + attributionInformationVo.getConfigInfo().get("username"));
|
|
|
// 1. 获取订单列表
|
|
|
- DoMesOrdersRequest doMesOrdersRequest = new DoMesOrdersRequest(loginInfo.getAesCode(),rsaUtils.encrypt(orderStatusVo.getCarInfo().getLicenseNo()));
|
|
|
+ DoMesOrdersRequest doMesOrdersRequest = new DoMesOrdersRequest(loginInfo.getAesCode(), rsaUtils.encrypt(orderStatusVo.getCarInfo().getLicenseNo()));
|
|
|
JSONObject mesOrders = gsCrawlerRequestComponent.doMesOrders(doMesOrdersRequest, redisValue);
|
|
|
String JQ_Policy = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_QUOTE_KEY + orderStatusVo.getOrder().getOrdersNo() + "JQ_Policy");
|
|
|
String SY_Policy = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_QUOTE_KEY + orderStatusVo.getOrder().getOrdersNo() + "SY_Policy");
|
|
|
@@ -420,8 +440,8 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
if (stateResponse.contains(JQ_Policy) || stateResponse.contains(SY_Policy) || stateResponse.contains(JYX_Policy)) {
|
|
|
JSONObject order = JSONObject.parseObject(JSONObject.toJSONString(mesOrders.getJSONObject("data").getJSONArray("data").get(0)));
|
|
|
JSONObject orderVo = new JSONObject();
|
|
|
- orderVo.put("structureId",loginInfo.getProvincialCom());
|
|
|
- orderVo.put("userCode",loginInfo.getUserCode());
|
|
|
+ orderVo.put("structureId", loginInfo.getProvincialCom());
|
|
|
+ orderVo.put("userCode", loginInfo.getUserCode());
|
|
|
orderVo.put("orderId", order.getString("orderNo"));
|
|
|
// 获取订单详情
|
|
|
JSONObject jsonObject = gsCrawlerRequestComponent.doMesOrderDetail(redisValue, orderVo);
|
|
|
@@ -465,13 +485,13 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
return resultVo;
|
|
|
}
|
|
|
|
|
|
- public String getRedisKey(AttributionInformationVo attributionInformationVo){
|
|
|
+ public String getRedisKey(AttributionInformationVo attributionInformationVo) {
|
|
|
String username = attributionInformationVo.getConfigInfo().get("username");
|
|
|
- String value = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ username);
|
|
|
- if (StringUtils.isEmpty(value)){
|
|
|
+ String value = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + username);
|
|
|
+ if (StringUtils.isEmpty(value)) {
|
|
|
gsCrawlerLoginComponent.login(attributionInformationVo);
|
|
|
- value = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY+ username);
|
|
|
- if (StringUtils.isEmpty(value)){
|
|
|
+ value = redisTemplate.opsForValue().get(GsConstants.GS_REDIS_LOGIN_KEY + username);
|
|
|
+ if (StringUtils.isEmpty(value)) {
|
|
|
getRedisKey(attributionInformationVo);
|
|
|
}
|
|
|
}
|
|
|
@@ -483,12 +503,12 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
String username = attributionInformationVo.getConfigInfo().get("username");
|
|
|
String redisValue = getRedisKey(attributionInformationVo);
|
|
|
UserInfoResponse loginInfo = gsCrawlerRequestComponent.getLoginInfo(redisValue);
|
|
|
- if (loginInfo == null || !"200".equals(loginInfo.getStatus())){
|
|
|
+ if (loginInfo == null || !"200".equals(loginInfo.getStatus())) {
|
|
|
log.warn("登录信息接口响应异常,重新获取用户信息,username:{}", loginInfo.getMsg());
|
|
|
redisTemplate.delete(GsConstants.GS_REDIS_LOGIN_KEY + username);
|
|
|
redisValue = getRedisKey(attributionInformationVo);
|
|
|
loginInfo = gsCrawlerRequestComponent.getLoginInfo(redisValue);
|
|
|
- if (loginInfo == null || !"200".equals(loginInfo.getStatus())){
|
|
|
+ if (loginInfo == null || !"200".equals(loginInfo.getStatus())) {
|
|
|
getLoginInfo(attributionInformationVo);
|
|
|
}
|
|
|
}
|
|
|
@@ -496,16 +516,15 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public void qutoationCrawler(InsuranceUploadImageVo insuranceUploadImageVo) {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- public JSONObject getBindInfo(String redisValue,UserInfoResponse.UserData loginInfo) {
|
|
|
+ public JSONObject getBindInfo(String redisValue, UserInfoResponse.UserData loginInfo) {
|
|
|
// 获取绑定信息
|
|
|
- List<JSONObject> bindInfoData = gsCrawlerRequestComponent.getBindInfo(redisValue,loginInfo.getUserCode());
|
|
|
+ List<JSONObject> bindInfoData = gsCrawlerRequestComponent.getBindInfo(redisValue, loginInfo.getUserCode());
|
|
|
if (CollectionUtil.isEmpty(bindInfoData)) {
|
|
|
log.error("绑定信息为空,username:{}");
|
|
|
throw new RuntimeException("未查询到归属信息");
|
|
|
@@ -529,8 +548,8 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
return bindInfo;
|
|
|
}
|
|
|
|
|
|
- public QuoteResultsVo calculation(String orderNo,String redisValue,QuoteVo quoteVo,CarInsuranceQueryResponse.CarInsuranceData insuranceInformation,UserInfoResponse.UserData loginInfo,
|
|
|
- GsCrawlerCarQueryResponse.VehicleModelDetail vehicleModelDetail,JSONObject bindInfo,String businessNatureCode) {
|
|
|
+ public QuoteResultsVo calculation(String orderNo, String redisValue, QuoteVo quoteVo, CarInsuranceQueryResponse.CarInsuranceData insuranceInformation, UserInfoResponse.UserData loginInfo,
|
|
|
+ GsCrawlerCarQueryResponse.VehicleModelDetail vehicleModelDetail, JSONObject bindInfo, String businessNatureCode) {
|
|
|
try {
|
|
|
String token = JSONObject.parseObject(redisValue).getString("token");
|
|
|
String userID = JSONObject.parseObject(redisValue).getString("userID");
|
|
|
@@ -539,7 +558,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
RiskInfoVo ciRiskInfoVo = quoteVo.getCiRiskInfoVo();
|
|
|
RiskInfoVo biRiskInfoVo = quoteVo.getBiRiskInfoVo();
|
|
|
// 获取车辆信息
|
|
|
- JSONObject carInfo = gsCrawlerRequestComponent.getCarConfirm(orderNo,token);
|
|
|
+ JSONObject carInfo = gsCrawlerRequestComponent.getCarConfirm(orderNo, token);
|
|
|
|
|
|
|
|
|
// 3. 解析车辆确认信息
|
|
|
@@ -551,7 +570,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
carInfo.put("tranNo", insuranceInformation.getMesOrderVo().getTransactionNo());
|
|
|
carInfo.put("oriSysOperatorKey", "RU0yZW0y");
|
|
|
carInfo.put("oriSysOperator", "EM2_user");
|
|
|
- carInfo.put("frameNo",carInfoVo.getVinNo());
|
|
|
+ carInfo.put("frameNo", carInfoVo.getVinNo());
|
|
|
carInfo.put("localpurchaseprice", localpurchaseprice);
|
|
|
carInfo.put("licenseColorCode", ("0".equals(carInfoVo.getEnergyTypeCode()) || "4".equals(carInfoVo.getEnergyTypeCode())) ? "01" : "06");
|
|
|
carInfo.put("vehicleQuality", vehicleQuality);
|
|
|
@@ -563,23 +582,23 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
carInfo.put("enginePower", enginePower);
|
|
|
carInfo.put("energyTypesName", vehicleModelDetail.getModelEnergyTypeName());
|
|
|
carInfo.put("vehicleTonnage", vehicleModelDetail.getVehicleTonnage());
|
|
|
- gsCrawlerRequestComponent.updateCarInfo(carInfo,token);
|
|
|
+ gsCrawlerRequestComponent.updateCarInfo(carInfo, token);
|
|
|
|
|
|
PlatCarInfoRequest platCarInfoRequest = new PlatCarInfoRequest(loginInfo, orderNo, userID);
|
|
|
- gsCrawlerRequestComponent.getPlatCarInfo(platCarInfoRequest,token);
|
|
|
+ gsCrawlerRequestComponent.getPlatCarInfo(platCarInfoRequest, token);
|
|
|
|
|
|
- InsuranceInformationRequest informationRequest = new InsuranceInformationRequest(rsaUtils.encrypt(userID),orderNo,"");
|
|
|
- CarInsuranceQueryResponse.CarInsuranceData insuranceData = gsCrawlerRequestComponent.getInsuranceInformation(informationRequest,token);
|
|
|
+ InsuranceInformationRequest informationRequest = new InsuranceInformationRequest(rsaUtils.encrypt(userID), orderNo, "");
|
|
|
+ CarInsuranceQueryResponse.CarInsuranceData insuranceData = gsCrawlerRequestComponent.getInsuranceInformation(informationRequest, token);
|
|
|
|
|
|
JSONObject desensitizationJson = JSONObject.parseObject(insuranceData.getDesensitizationJson());
|
|
|
- desensitizationJson.put("taxPayerAddress",desensitizationJson.getString("address"));
|
|
|
- desensitizationJson.put("taxPayerAddressChange","0");
|
|
|
- desensitizationJson.put("taxPayerIdentifyNumber",desensitizationJson.getString("carOwnerCardNo"));
|
|
|
- desensitizationJson.put("taxPayerIdentifyNumberChange","0");
|
|
|
+ desensitizationJson.put("taxPayerAddress", desensitizationJson.getString("address"));
|
|
|
+ desensitizationJson.put("taxPayerAddressChange", "0");
|
|
|
+ desensitizationJson.put("taxPayerIdentifyNumber", desensitizationJson.getString("carOwnerCardNo"));
|
|
|
+ desensitizationJson.put("taxPayerIdentifyNumberChange", "0");
|
|
|
|
|
|
- log.info("获取保险信息成功{}",JSONObject.toJSONString(insuranceData));
|
|
|
+ log.info("获取保险信息成功{}", JSONObject.toJSONString(insuranceData));
|
|
|
|
|
|
- CalculationInitializationRequest initializationRequest = new CalculationInitializationRequest(businessNatureCode,orderNo,userID,loginInfo);
|
|
|
+ CalculationInitializationRequest initializationRequest = new CalculationInitializationRequest(businessNatureCode, orderNo, userID, loginInfo);
|
|
|
InsuranceInitResponse.InsuranceInitData insuranceInitData = gsCrawlerRequestComponent.calculationInitialization(initializationRequest, token);
|
|
|
InsuranceInitResponse.OrderVo orderVo = insuranceInitData.getOrderVo();
|
|
|
|
|
|
@@ -614,27 +633,27 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
List<InsuranceInitResponse.ClauseInfo> clauseInfoList = insuranceInitData.getClauseInfoList();
|
|
|
// TODO 配置险种参数
|
|
|
configClauseInfo(clauseInfoList, quoteVo);
|
|
|
- DoCalculateRequest doCalculateRequest = new DoCalculateRequest(desensitizationJson,orderVo,clauseInfoList,syShow,loginInfo,bindInfo);
|
|
|
+ DoCalculateRequest doCalculateRequest = new DoCalculateRequest(desensitizationJson, orderVo, clauseInfoList, syShow, loginInfo, bindInfo);
|
|
|
PremiumCalculateResponse premiumCalculateResponse = gsCrawlerRequestComponent.doCalculate(doCalculateRequest, token);
|
|
|
return repeat(premiumCalculateResponse, orderNo, redisValue, quoteVo, insuranceInformation, loginInfo,
|
|
|
- vehicleModelDetail, bindInfo, businessNatureCode, token, syShow);
|
|
|
+ vehicleModelDetail, bindInfo, businessNatureCode, token, syShow);
|
|
|
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
- log.error("报价失败{}",e);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("报价失败{}", e);
|
|
|
throw new RuntimeException("报价失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 重复报价处理(处理重复投保问题)
|
|
|
+ *
|
|
|
* @param premiumCalculateResponse 报价响应
|
|
|
* @return 最终报价结果
|
|
|
*/
|
|
|
- public QuoteResultsVo repeat(PremiumCalculateResponse premiumCalculateResponse,String orderNo,String redisValue,QuoteVo quoteVo,CarInsuranceQueryResponse.CarInsuranceData insuranceInformation,UserInfoResponse.UserData loginInfo,
|
|
|
- GsCrawlerCarQueryResponse.VehicleModelDetail vehicleModelDetail,JSONObject bindInfo,String businessNatureCode,String token,String syShow) {
|
|
|
+ public QuoteResultsVo repeat(PremiumCalculateResponse premiumCalculateResponse, String orderNo, String redisValue, QuoteVo quoteVo, CarInsuranceQueryResponse.CarInsuranceData insuranceInformation, UserInfoResponse.UserData loginInfo,
|
|
|
+ GsCrawlerCarQueryResponse.VehicleModelDetail vehicleModelDetail, JSONObject bindInfo, String businessNatureCode, String token, String syShow) {
|
|
|
QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
|
|
|
// 2. 处理商业险重复投保
|
|
|
String jqRepeatinfo = "";
|
|
|
@@ -665,38 +684,38 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
info = syRepeatinfo + ";";
|
|
|
}
|
|
|
String errorMsg = info + premiumCalculateResponse.getMsg();
|
|
|
- log.error("报价失败,errorMsg:{}",errorMsg);
|
|
|
+ log.error("报价失败,errorMsg:{}", errorMsg);
|
|
|
quoteResultsVo.setErrorMessage(errorMsg);
|
|
|
quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.QUOTE_FAIL);
|
|
|
- }else if ("200".equals(premiumCalculateResponse.getStatus())){
|
|
|
+ } else if ("200".equals(premiumCalculateResponse.getStatus())) {
|
|
|
FeeCalculateResponse.DataDTO dataDTO = gsCrawlerRequestComponent.creatOrder(token, CreatOrderRequest.creatOrderRequest(premiumCalculateResponse.getData(), syShow, redisValue, loginInfo));
|
|
|
Object businessCalcFeeVo = dataDTO.getBusinessCalcFeeVo();
|
|
|
String sy_discountRate = "";
|
|
|
String discountRate = "";
|
|
|
- if (businessCalcFeeVo != null){
|
|
|
+ if (businessCalcFeeVo != null) {
|
|
|
sy_discountRate = JSONObject.parseObject(JSONObject.toJSONString(businessCalcFeeVo)).getString("'discountRate'");
|
|
|
discountRate = JSONObject.parseObject(JSONObject.toJSONString(businessCalcFeeVo)).getString("artifSelfPricesRat");
|
|
|
}
|
|
|
FeeCalculateResponse.CrossCalcFeeVoDTO crossCalcFeeVo = dataDTO.getCrossCalcFeeVo();
|
|
|
String jq_discountRate = "";
|
|
|
- if (crossCalcFeeVo != null){
|
|
|
+ if (crossCalcFeeVo != null) {
|
|
|
jq_discountRate = String.valueOf(crossCalcFeeVo.getRunPoundageRatio());
|
|
|
}
|
|
|
// 4. 存储结果到Redis
|
|
|
HashMap<String, String> saveRedis = new HashMap<>();
|
|
|
saveRedis.put("username", loginInfo.getUserCode());
|
|
|
saveRedis.put("businessOffice", loginInfo.getUserDepartment());
|
|
|
- saveRedis.put("structureId",loginInfo.getProvincialCom());
|
|
|
- saveRedis.put("userCode",JSONObject.parseObject(redisValue).getString("userID"));
|
|
|
+ saveRedis.put("structureId", loginInfo.getProvincialCom());
|
|
|
+ saveRedis.put("userCode", JSONObject.parseObject(redisValue).getString("userID"));
|
|
|
saveRedis.put("token", JSONObject.parseObject(redisValue).getString("token"));
|
|
|
- saveRedis.put("license",quoteVo.getCarInfoVo().getLicenseNo());
|
|
|
- saveRedis.put("zhanghao_info",loginInfo.getProvincialCom());
|
|
|
- saveRedis.put("gs_info",JSONObject.toJSONString(bindInfo));
|
|
|
+ saveRedis.put("license", quoteVo.getCarInfoVo().getLicenseNo());
|
|
|
+ saveRedis.put("zhanghao_info", loginInfo.getProvincialCom());
|
|
|
+ saveRedis.put("gs_info", JSONObject.toJSONString(bindInfo));
|
|
|
saveRedis.put("carinfo", JSON.toJSONString(vehicleModelDetail));
|
|
|
- saveRedis.put("sy_discountRate",sy_discountRate);
|
|
|
- saveRedis.put("syShow",syShow);
|
|
|
- saveRedis.put("discountRate",discountRate);
|
|
|
- saveRedis.put("jq_discountRate",jq_discountRate);
|
|
|
+ saveRedis.put("sy_discountRate", sy_discountRate);
|
|
|
+ saveRedis.put("syShow", syShow);
|
|
|
+ saveRedis.put("discountRate", discountRate);
|
|
|
+ saveRedis.put("jq_discountRate", jq_discountRate);
|
|
|
String tranNo = "";
|
|
|
String orderId = "";
|
|
|
if ("200".equals(premiumCalculateResponse.getStatus())) {
|
|
|
@@ -705,12 +724,12 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
orderId = resOrderVo.getOrderNo();
|
|
|
}
|
|
|
saveRedis.put("orderId", orderId);
|
|
|
- saveRedis.put("tranNo",tranNo);
|
|
|
- saveRedis.put("bj_res",JSONObject.toJSONString(premiumCalculateResponse));
|
|
|
+ saveRedis.put("tranNo", tranNo);
|
|
|
+ saveRedis.put("bj_res", JSONObject.toJSONString(premiumCalculateResponse));
|
|
|
saveRedis.put("bjresdata", JSON.toJSONString(premiumCalculateResponse.getData()));
|
|
|
- redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + quoteVo.getOrder().getOrdersNo(), JSONObject.toJSONString(saveRedis),GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
- return processCalcSuccessResult(premiumCalculateResponse,quoteVo,token);
|
|
|
- }else {
|
|
|
+ redisTemplate.opsForValue().set(GsConstants.GS_REDIS_QUOTE_KEY + quoteVo.getOrder().getOrdersNo(), JSONObject.toJSONString(saveRedis), GsConstants.REDIS_EXPIRE_SECONDS, TimeUnit.SECONDS);
|
|
|
+ return processCalcSuccessResult(premiumCalculateResponse, quoteVo, token);
|
|
|
+ } else {
|
|
|
quoteResultsVo.setErrorMessage("报价失败");
|
|
|
quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.QUOTE_FAIL);
|
|
|
}
|
|
|
@@ -719,29 +738,32 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
|
|
|
/**
|
|
|
* 处理报价成功结果
|
|
|
+ *
|
|
|
* @param premiumCalculateResponse 报价响应
|
|
|
* @return 格式化后的报价结果
|
|
|
*/
|
|
|
- private QuoteResultsVo processCalcSuccessResult(PremiumCalculateResponse premiumCalculateResponse,QuoteVo quoteVo,String token) {
|
|
|
+ private QuoteResultsVo processCalcSuccessResult(PremiumCalculateResponse premiumCalculateResponse, QuoteVo quoteVo, String token) {
|
|
|
// 1. 解析报价数据
|
|
|
PremiumCalculateResponse.DataDTO data = premiumCalculateResponse.getData();
|
|
|
PremiumCalculateResponse.OrderVoDTO orderVo = data.getOrderVo();
|
|
|
List<PremiumCalculateResponse.ClauseInfoListDTO> clauseInfoList = data.getClauseInfoList();
|
|
|
- JSONObject jsonObject = parseClausePrice(JSON.parseObject(JSONObject.toJSONString(clauseInfoList), new TypeReference<>() {}));
|
|
|
+ JSONObject jsonObject = parseClausePrice(JSON.parseObject(JSONObject.toJSONString(clauseInfoList), new TypeReference<>() {
|
|
|
+ }));
|
|
|
// 6. 解析出险次数
|
|
|
- Map<String, String> accidentResult = getAccidentRecord(orderVo.getOrderNo(),token);
|
|
|
- return GuoShouCrawlerQuoteResultsVoBuild.buildQuoteResultsVo(premiumCalculateResponse,accidentResult,quoteVo);
|
|
|
+ Map<String, String> accidentResult = getAccidentRecord(orderVo.getOrderNo(), token);
|
|
|
+ return GuoShouCrawlerQuoteResultsVoBuild.buildQuoteResultsVo(premiumCalculateResponse, accidentResult, quoteVo);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取出险次数
|
|
|
+ *
|
|
|
* @return 出险次数Map(交强险、商业险)
|
|
|
*/
|
|
|
- private Map<String, String> getAccidentRecord(String orderId,String token) {
|
|
|
+ private Map<String, String> getAccidentRecord(String orderId, String token) {
|
|
|
Map<String, String> result = new HashMap<>();
|
|
|
try {
|
|
|
- JSONObject accidentResponse = gsCrawlerRequestComponent.doAccidentRecord(orderId,token);
|
|
|
+ JSONObject accidentResponse = gsCrawlerRequestComponent.doAccidentRecord(orderId, token);
|
|
|
String res = JSONObject.toJSONString(accidentResponse);
|
|
|
String jqAccident = FirstMatchUtils.getFirstMatch("claimTimesJQ\":\"(.*?)\"", res, 1);
|
|
|
String syAccident = FirstMatchUtils.getFirstMatch("claimTimes\":\"(.*?)\"", res, 1);
|
|
|
@@ -759,6 +781,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
|
|
|
/**
|
|
|
* 解析险种价格
|
|
|
+ *
|
|
|
* @param clauseInfoList 险种列表
|
|
|
*/
|
|
|
private JSONObject parseClausePrice(List<Map<String, Object>> clauseInfoList) {
|
|
|
@@ -826,12 +849,12 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 配置险种参数(设置险种生效状态和保额)
|
|
|
+ *
|
|
|
* @param clauseInfoList 险种列表
|
|
|
*/
|
|
|
- private void configClauseInfo(List<InsuranceInitResponse.ClauseInfo> clauseInfoList,QuoteVo quoteVo) {
|
|
|
+ private void configClauseInfo(List<InsuranceInitResponse.ClauseInfo> clauseInfoList, QuoteVo quoteVo) {
|
|
|
List<KindInfoVo> kindInfoVo = quoteVo.getKindInfoVo();
|
|
|
String chesunChooseFlag = "off";
|
|
|
String huahenChooseFlag = "off";
|
|
|
@@ -844,20 +867,20 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
String sanzheAmount = "";
|
|
|
String ybw_sanzhe_amount = "";
|
|
|
for (KindInfoVo infoVo : kindInfoVo) {
|
|
|
- if ("机动车损失保险".equals(infoVo.getKindName())){
|
|
|
+ if ("机动车损失保险".equals(infoVo.getKindName())) {
|
|
|
chesunChooseFlag = "on";
|
|
|
} else if ("车身划痕损失险".equals(infoVo.getKindName())) {
|
|
|
huahenChooseFlag = "on";
|
|
|
huahenAmount = infoVo.getAmount();
|
|
|
- }else if ("附加绝对免赔率特约险(机动车损失保险)".equals(infoVo.getKindName())){
|
|
|
+ } else if ("附加绝对免赔率特约险(机动车损失保险)".equals(infoVo.getKindName())) {
|
|
|
fujiachesunChooseFlag = "on";
|
|
|
fujiachesunAmount = infoVo.getAmount();
|
|
|
} else if ("机动车第三者责任保险".equals(infoVo.getKindName())) {
|
|
|
sanzheChooseFlag = "on";
|
|
|
sanzheAmount = infoVo.getAmount();
|
|
|
- } else if ("机动车第三者责任保险法定节假日限额翻倍险".equals(infoVo.getKindName())){
|
|
|
+ } else if ("机动车第三者责任保险法定节假日限额翻倍险".equals(infoVo.getKindName())) {
|
|
|
fujia_jiejiari_chooseFlag = "on";
|
|
|
- } else if ("附加医保外用药责任险(机动车第三者责任保险)".equals(infoVo.getKindName())){
|
|
|
+ } else if ("附加医保外用药责任险(机动车第三者责任保险)".equals(infoVo.getKindName())) {
|
|
|
ybw_sanzhe_chooseFlag = "on";
|
|
|
ybw_sanzhe_amount = infoVo.getAmount();
|
|
|
}
|
|
|
@@ -866,7 +889,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
String clauseName = clause.getClauseName();
|
|
|
// 过滤特约服务条款
|
|
|
if ("特约服务条款".equals(clauseName)) {
|
|
|
- configSpecialClause(clause,quoteVo);
|
|
|
+ configSpecialClause(clause, quoteVo);
|
|
|
continue;
|
|
|
}
|
|
|
// 机动车损失险/新能源汽车损失险
|
|
|
@@ -908,7 +931,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
info.setOriCurAmount(sanzheAmount);
|
|
|
}
|
|
|
} else if (subClauseName.contains("附加医保外医疗费用责任险(机动车第三者责任保险)") || subClauseName.contains("附加医保外医疗费用责任险(新能源汽车第三者责任保险)")) {
|
|
|
- info.setEffect( "on".equals(ybw_sanzhe_chooseFlag) ? "Y" : "N");
|
|
|
+ info.setEffect("on".equals(ybw_sanzhe_chooseFlag) ? "Y" : "N");
|
|
|
if ("on".equals(ybw_sanzhe_chooseFlag)) {
|
|
|
info.setOriCurAmount(ybw_sanzhe_amount);
|
|
|
}
|
|
|
@@ -926,9 +949,10 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
|
|
|
/**
|
|
|
* 配置特约服务条款(道路救援、代驾、检测)
|
|
|
+ *
|
|
|
* @param clauseInfo 特约服务条款
|
|
|
*/
|
|
|
- private void configSpecialClause(InsuranceInitResponse.ClauseInfo clauseInfo,QuoteVo quoteVo) {
|
|
|
+ private void configSpecialClause(InsuranceInitResponse.ClauseInfo clauseInfo, QuoteVo quoteVo) {
|
|
|
List<KindInfoVo> kindInfoVo = quoteVo.getKindInfoVo();
|
|
|
String daolujy_chooseFlag = "off";
|
|
|
String daijia_chooseFlag = "off";
|
|
|
@@ -953,17 +977,17 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
for (InsuranceInitResponse.ClauseInfo info : clauseInfo.getClauseInfoVoList()) {
|
|
|
String subClauseName = info.getClauseName();
|
|
|
if ("on".equals(daolujy_chooseFlag)) {
|
|
|
- if ((subClauseName.contains("附加机动车道路救援服务特约条款")) || (subClauseName.contains("附加新能源汽车道路救援服务特约条款"))){
|
|
|
+ if ((subClauseName.contains("附加机动车道路救援服务特约条款")) || (subClauseName.contains("附加新能源汽车道路救援服务特约条款"))) {
|
|
|
info.setEffect("Y");
|
|
|
info.setCompensationDays(daolujy_times);
|
|
|
}
|
|
|
} else if ("on".equals(daijia_chooseFlag)) {
|
|
|
- if ((subClauseName.contains("附加机动车车辆安全检测特约条款")) || (subClauseName.contains("附加新能源汽车车辆安全检测特约条款"))){
|
|
|
+ if ((subClauseName.contains("附加机动车车辆安全检测特约条款")) || (subClauseName.contains("附加新能源汽车车辆安全检测特约条款"))) {
|
|
|
info.setEffect("Y");
|
|
|
info.setCompensationDays(daijia_times);
|
|
|
}
|
|
|
} else if ("on".equals(jiance_chooseFlag)) {
|
|
|
- if ((subClauseName.contains("附加机动车代为驾驶服务特约条款")) || (subClauseName.contains("附加新能源汽车代为驾驶服务特约条款"))){
|
|
|
+ if ((subClauseName.contains("附加机动车代为驾驶服务特约条款")) || (subClauseName.contains("附加新能源汽车代为驾驶服务特约条款"))) {
|
|
|
info.setEffect("Y");
|
|
|
info.setCompensationDays(jiance_times);
|
|
|
}
|
|
|
@@ -977,7 +1001,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
/**
|
|
|
* 图片上传
|
|
|
*/
|
|
|
- public JSONObject upload(List<InsuranceImageVo> imageVoList,String JQ_Policy,String SY_Policy,String JYX_Policy,UserInfoResponse.UserData loginInfo,JSONObject bindInfo,JSONObject quoteInfo,String redisValue) {
|
|
|
+ public JSONObject upload(List<InsuranceImageVo> imageVoList, String JQ_Policy, String SY_Policy, String JYX_Policy, UserInfoResponse.UserData loginInfo, JSONObject bindInfo, JSONObject quoteInfo, String redisValue) {
|
|
|
String ryMessage = null; // 人员照片错误
|
|
|
String rybMessage = null; // 人员照片背面错误
|
|
|
String clMessage = null; // 行驶证照片错误
|
|
|
@@ -986,7 +1010,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
String imageType = insuranceImageVo.getImageCode();
|
|
|
InsuranceImageVo.ImageDTO imageDTO = insuranceImageVo.getImageBase64List().get(0);
|
|
|
// 构建图片请求参数
|
|
|
- ImageUploadRequest uploadRequest = new ImageUploadRequest(imageDTO, quoteInfo, loginInfo,JQ_Policy,SY_Policy,imageType);
|
|
|
+ ImageUploadRequest uploadRequest = new ImageUploadRequest(imageDTO, quoteInfo, loginInfo, JQ_Policy, SY_Policy, imageType);
|
|
|
CheckImageResponse checkImage = gsCrawlerRequestComponent.doCheckImage(redisValue, uploadRequest);
|
|
|
if (!"200".equals(checkImage.getStatus()) && !"201".equals(checkImage.getStatus())) {
|
|
|
log.error("图片上传失败:{}", checkImage.getMsg());
|
|
|
@@ -1011,8 +1035,8 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
- UploadImagesRequest imageBusinessRequest = new UploadImagesRequest(loginInfo,JQ_Policy,SY_Policy,imageType,checkImage.getData(),quoteInfo,imageDTO.getImageBase64Str());
|
|
|
- gsCrawlerRequestComponent.uploadImages(imageBusinessRequest,redisValue);
|
|
|
+ UploadImagesRequest imageBusinessRequest = new UploadImagesRequest(loginInfo, JQ_Policy, SY_Policy, imageType, checkImage.getData(), quoteInfo, imageDTO.getImageBase64Str());
|
|
|
+ gsCrawlerRequestComponent.uploadImages(imageBusinessRequest, redisValue);
|
|
|
}
|
|
|
|
|
|
// 构建返回结果
|
|
|
@@ -1021,9 +1045,12 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
result.put("code", 400);
|
|
|
StringBuilder msg = new StringBuilder();
|
|
|
if (ryMessage != null) msg.append("人员照片------------------------").append(ryMessage);
|
|
|
- if (clMessage != null) msg.append("------------------------行驶证照片------------------------").append(clMessage);
|
|
|
- if (rybMessage != null) msg.append("------------------------人员照片背面------------------------").append(rybMessage);
|
|
|
- if (clbMessage != null) msg.append("------------------------行驶证照片背面------------------------").append(clbMessage);
|
|
|
+ if (clMessage != null)
|
|
|
+ msg.append("------------------------行驶证照片------------------------").append(clMessage);
|
|
|
+ if (rybMessage != null)
|
|
|
+ msg.append("------------------------人员照片背面------------------------").append(rybMessage);
|
|
|
+ if (clbMessage != null)
|
|
|
+ msg.append("------------------------行驶证照片背面------------------------").append(clbMessage);
|
|
|
result.put("message", msg.toString());
|
|
|
} else {
|
|
|
result.put("code", 200);
|
|
|
@@ -1043,7 +1070,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Map<String, Object> getTokenData(String string){
|
|
|
+ public Map<String, Object> getTokenData(String string) {
|
|
|
Pattern pattern = Pattern.compile("no=(.*?)&");
|
|
|
Matcher matcher = pattern.matcher(string);
|
|
|
List<String> noList = new ArrayList<>();
|
|
|
@@ -1056,7 +1083,7 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
return tokenData;
|
|
|
}
|
|
|
|
|
|
- public void revocation(String orderNo){
|
|
|
+ public void revocation(String orderNo) {
|
|
|
// String userName = "";
|
|
|
// // 查询loginInfo
|
|
|
// UserInfoResponse.UserData loginInfo = getLoginInfo(attributionInformationVo);
|
|
|
@@ -1076,6 +1103,4 @@ public class GuoshouCrawlerRequestImpl implements GuoshouCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|