|
@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service.impl;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.ydtech.config.properties.GuorenApiConfigurationProperties;
|
|
import com.ydtech.config.properties.GuorenApiConfigurationProperties;
|
|
@@ -17,21 +18,23 @@ import com.ydtech.modules.esm.service.EsmInsCompanyService;
|
|
|
import com.ydtech.modules.ins.model.guoren.*;
|
|
import com.ydtech.modules.ins.model.guoren.*;
|
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
|
import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
|
|
import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
|
|
|
-import com.ydtech.modules.ins.model.yc.accident.Accident;
|
|
|
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
|
import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
|
|
import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
|
|
|
import com.ydtech.modules.order.dao.InsTaskImagesMapper;
|
|
import com.ydtech.modules.order.dao.InsTaskImagesMapper;
|
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.guoren.constants.GoodsClassifyList;
|
|
|
import com.ydtech.modules.order.entity.api.guoren.constants.PlatformInterfaceCode;
|
|
import com.ydtech.modules.order.entity.api.guoren.constants.PlatformInterfaceCode;
|
|
|
import com.ydtech.modules.order.entity.api.guoren.request.ApplicationDetailsRequest;
|
|
import com.ydtech.modules.order.entity.api.guoren.request.ApplicationDetailsRequest;
|
|
|
import com.ydtech.modules.order.entity.api.guoren.request.NonAutoInsuranceRequest;
|
|
import com.ydtech.modules.order.entity.api.guoren.request.NonAutoInsuranceRequest;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.guoren.request.QueryNoCarPolicyNoRequest;
|
|
|
import com.ydtech.modules.order.entity.api.guoren.request.SignatureRequest;
|
|
import com.ydtech.modules.order.entity.api.guoren.request.SignatureRequest;
|
|
|
import com.ydtech.modules.order.entity.api.guoren.response.NonAutoInsOrderResponse;
|
|
import com.ydtech.modules.order.entity.api.guoren.response.NonAutoInsOrderResponse;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.guoren.response.QueryNoCarPolicyNoResponse;
|
|
|
import com.ydtech.modules.order.entity.api.guoren.response.SignatureResponse;
|
|
import com.ydtech.modules.order.entity.api.guoren.response.SignatureResponse;
|
|
|
|
|
+import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
|
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
|
-import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
|
|
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
|
|
import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
|
|
@@ -96,14 +99,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
private final GuorenRequestApiComponent guorenRequestApiComponent;
|
|
private final GuorenRequestApiComponent guorenRequestApiComponent;
|
|
|
|
|
|
|
|
|
|
|
|
|
- public GuorenOrderApiServiceImpl(GuorenApiConfigurationProperties properties,
|
|
|
|
|
- InsOrdersComponents insOrdersComponents,
|
|
|
|
|
- GuorenRequestApiComponent guorenRequestApiComponent,
|
|
|
|
|
- InsAreaCompanyService insAreaCompanyService,
|
|
|
|
|
- InsOrdersService insOrdersService,
|
|
|
|
|
- EsmInsCompanyService esmInsCompanyService,
|
|
|
|
|
- ConfigureParametersComponents configureParametersComponents,
|
|
|
|
|
- InsTaskImagesMapper insTaskImagesMapper) {
|
|
|
|
|
|
|
+ public GuorenOrderApiServiceImpl(GuorenApiConfigurationProperties properties, InsOrdersComponents insOrdersComponents, GuorenRequestApiComponent guorenRequestApiComponent, InsAreaCompanyService insAreaCompanyService, InsOrdersService insOrdersService, EsmInsCompanyService esmInsCompanyService, ConfigureParametersComponents configureParametersComponents, InsTaskImagesMapper insTaskImagesMapper) {
|
|
|
this.properties = properties;
|
|
this.properties = properties;
|
|
|
this.insOrdersComponents = insOrdersComponents;
|
|
this.insOrdersComponents = insOrdersComponents;
|
|
|
this.guorenRequestApiComponent = guorenRequestApiComponent;
|
|
this.guorenRequestApiComponent = guorenRequestApiComponent;
|
|
@@ -164,23 +160,29 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
// 2、车价查询
|
|
// 2、车价查询
|
|
|
CarPriceResp.DataDTO carPriceResult = carPriceQuery(yaQuoteInfoVo, vinQ, channelInfo);
|
|
CarPriceResp.DataDTO carPriceResult = carPriceQuery(yaQuoteInfoVo, vinQ, channelInfo);
|
|
|
AssertionUtils.isEmpty(carPriceResult, "车价获取失败");
|
|
AssertionUtils.isEmpty(carPriceResult, "车价获取失败");
|
|
|
-
|
|
|
|
|
- // 3、保费计算
|
|
|
|
|
- PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ);
|
|
|
|
|
- AssertionUtils.isEmpty(premiumResult, "保费计算失败");
|
|
|
|
|
-
|
|
|
|
|
- // 4、 创建非车订单
|
|
|
|
|
|
|
+ // 3、 创建非车订单
|
|
|
|
|
+ boolean isNoCar = false;
|
|
|
|
|
+ String jsPremium = "0";
|
|
|
|
|
+ String orderCode = null;
|
|
|
GuorenAccidentalDrivingVo accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
|
|
GuorenAccidentalDrivingVo accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
|
|
|
- if (!ObjectUtils.isEmpty(accidentalDrivingVo)) {
|
|
|
|
|
|
|
+ if (GoodsClassifyList.verificationGoodsCode(accidentalDrivingVo.getGoodsCode())) {
|
|
|
NonAutoInsOrderResponse nonAutoInsOrderResponse = nonAutoInsOrder(yaQuoteInfoVo, accidentalDrivingVo, carPriceResult.getInputvo(), channelInfo, vinQ);
|
|
NonAutoInsOrderResponse nonAutoInsOrderResponse = nonAutoInsOrder(yaQuoteInfoVo, accidentalDrivingVo, carPriceResult.getInputvo(), channelInfo, vinQ);
|
|
|
AssertionUtils.isEmpty(nonAutoInsOrderResponse.getData(), nonAutoInsOrderResponse.getMessage());
|
|
AssertionUtils.isEmpty(nonAutoInsOrderResponse.getData(), nonAutoInsOrderResponse.getMessage());
|
|
|
|
|
+ orderCode = nonAutoInsOrderResponse.getData().getOrderCode();
|
|
|
|
|
+ isNoCar = true;
|
|
|
|
|
+ jsPremium = accidentalDrivingVo.getPremium();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- QuoteRespVo quoteRespVo = buildQuoteRespVo(order, premiumResult, yaQuoteInfoVo);
|
|
|
|
|
|
|
+ // 4、保费计算
|
|
|
|
|
+ PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar);
|
|
|
|
|
+ AssertionUtils.isEmpty(premiumResult, "保费计算失败");
|
|
|
|
|
+
|
|
|
// 5、 生成订单
|
|
// 5、 生成订单
|
|
|
|
|
+ QuoteRespVo quoteRespVo = buildQuoteRespVo(order, premiumResult, yaQuoteInfoVo, jsPremium);
|
|
|
InsAreaCompany iac = responseOrder(order, quoteRespVo, quoteVo);
|
|
InsAreaCompany iac = responseOrder(order, quoteRespVo, quoteVo);
|
|
|
- // 6、 投保单保存
|
|
|
|
|
- InsuranceSlipResp insuranceSlip = insuranceSlip(yaQuoteInfoVo, carPriceResult.getInputvo());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 6、 投保单保存
|
|
|
|
|
+ InsuranceSlipResp insuranceSlip = guorenRequestApiComponent.insuranceSlip(yaQuoteInfoVo, carPriceResult.getInputvo(), orderCode);
|
|
|
if (insuranceSlip.getResultCode() == 1) {
|
|
if (insuranceSlip.getResultCode() == 1) {
|
|
|
return HttpResult.error(insuranceSlip.getResultMsg());
|
|
return HttpResult.error(insuranceSlip.getResultMsg());
|
|
|
}
|
|
}
|
|
@@ -188,7 +190,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
|
|
iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
|
|
|
//生成订单扩展
|
|
//生成订单扩展
|
|
|
responseOrderExtend(iac, quoteRespVo, premiumResult, carPriceResult.getInputvo());
|
|
responseOrderExtend(iac, quoteRespVo, premiumResult, carPriceResult.getInputvo());
|
|
|
- insAreaCompanyService.save(iac);
|
|
|
|
|
|
|
+ insAreaCompanyService.insertCompanyAndOrders(iac);
|
|
|
quoteRespVo.setCompanyId(iac.getId());
|
|
quoteRespVo.setCompanyId(iac.getId());
|
|
|
log.debug("--------报价结束,车牌:{},vin:{}--------------", carInfo.getLicenseNo(), carInfo.getVinNo());
|
|
log.debug("--------报价结束,车牌:{},vin:{}--------------", carInfo.getLicenseNo(), carInfo.getVinNo());
|
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
@@ -218,7 +220,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
|
|
|
//2、核保
|
|
//2、核保
|
|
|
- SubmitAuditResp auditResp = submitAudit(iac, channelInfo);
|
|
|
|
|
|
|
+ SubmitAuditResp auditResp = guorenRequestApiComponent.submitAudit(iac, channelInfo);
|
|
|
|
|
|
|
|
//核保状态 0初始值/1通过/2不通过/3 无需核保 9 待核保
|
|
//核保状态 0初始值/1通过/2不通过/3 无需核保 9 待核保
|
|
|
String statusJq = auditResp.getData().get(0).getUnderWriteFlagCI();
|
|
String statusJq = auditResp.getData().get(0).getUnderWriteFlagCI();
|
|
@@ -265,7 +267,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
InsUtils.buildOrderStatus(order, iac);
|
|
InsUtils.buildOrderStatus(order, iac);
|
|
|
if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
|
|
if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
|
|
|
//获取签名地址
|
|
//获取签名地址
|
|
|
- SignatureResponse signature = signature(iac);
|
|
|
|
|
|
|
+ SignatureResponse signature = guorenRequestApiComponent.signature(iac);
|
|
|
iac.setPaymentLink(signature.getQrCode());
|
|
iac.setPaymentLink(signature.getQrCode());
|
|
|
} else {
|
|
} else {
|
|
|
return HttpResult.error("核保操作失败,状态:" + InsOrderStatusEnum.matchKey(iac.getOrderstatus()).getDesc());
|
|
return HttpResult.error("核保操作失败,状态:" + InsOrderStatusEnum.matchKey(iac.getOrderstatus()).getDesc());
|
|
@@ -301,11 +303,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
boolean syBoo = null != syDataDTO && null == jqDataDTO && syDataDTO.getUnderwriteFlag().equals("1");
|
|
boolean syBoo = null != syDataDTO && null == jqDataDTO && syDataDTO.getUnderwriteFlag().equals("1");
|
|
|
//交商
|
|
//交商
|
|
|
boolean jqSyBoo = null != syDataDTO && null != jqDataDTO && syDataDTO.getUnderwriteFlag().equals("1") && jqDataDTO.getUnderwriteFlag().equals("1");
|
|
boolean jqSyBoo = null != syDataDTO && null != jqDataDTO && syDataDTO.getUnderwriteFlag().equals("1") && jqDataDTO.getUnderwriteFlag().equals("1");
|
|
|
-
|
|
|
|
|
if (jqBoo || syBoo || jqSyBoo) {
|
|
if (jqBoo || syBoo || jqSyBoo) {
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
//更新支付链接
|
|
//更新支付链接
|
|
|
- SignatureResponse signature = signature(iac);
|
|
|
|
|
|
|
+ SignatureResponse signature = guorenRequestApiComponent.signature(iac);
|
|
|
iac.setPaymentLink(signature.getQrCode());
|
|
iac.setPaymentLink(signature.getQrCode());
|
|
|
|
|
|
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
@@ -330,15 +331,13 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
if (updateFlag) {
|
|
if (updateFlag) {
|
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
order.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
order.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
|
|
+ guorenRequestApiComponent.queryNoCarPolicyNo(iac);
|
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
|
- return HttpResult.error("订单已支付,订单状态修改完成");
|
|
|
|
|
|
|
+ return HttpResult.ok("订单已支付,订单状态修改完成");
|
|
|
} else {
|
|
} else {
|
|
|
return HttpResult.error("订单还未支付哦");
|
|
return HttpResult.error("订单还未支付哦");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -356,7 +355,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
InsAreaCompany iac = insAreaCompanyService.getById(companyId);
|
|
InsAreaCompany iac = insAreaCompanyService.getById(companyId);
|
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
|
|
ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
|
|
|
//获取缴费地址
|
|
//获取缴费地址
|
|
|
- PayResp.DataDTO payResp = getPaid(iac, channelInfo);
|
|
|
|
|
|
|
+ PayResp.DataDTO payResp = guorenRequestApiComponent.getPaid(iac, channelInfo);
|
|
|
iac.setPaymentLink(payResp.getPayUrl());
|
|
iac.setPaymentLink(payResp.getPayUrl());
|
|
|
iac.setInsOrderNo(payResp.getOrderId());
|
|
iac.setInsOrderNo(payResp.getOrderId());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
insAreaCompanyService.updateCompanyAndOrders(iac);
|
|
@@ -395,12 +394,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
try {
|
|
try {
|
|
|
FilePart file1 = new FilePart("file", new File(a.getFilePath()));
|
|
FilePart file1 = new FilePart("file", new File(a.getFilePath()));
|
|
|
|
|
|
|
|
- Part[] parts = {file1,
|
|
|
|
|
- new StringPart("businessNo", formMap.get("businessNo").toString()),
|
|
|
|
|
- new StringPart("operatorCode", formMap.get("operatorCode").toString()),
|
|
|
|
|
- new StringPart("comCode", formMap.get("comCode").toString()),
|
|
|
|
|
- new StringPart("fileGroup", formMap.get("fileGroup").toString())
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Part[] parts = {file1, new StringPart("businessNo", formMap.get("businessNo").toString()), new StringPart("operatorCode", formMap.get("operatorCode").toString()), new StringPart("comCode", formMap.get("comCode").toString()), new StringPart("fileGroup", formMap.get("fileGroup").toString())};
|
|
|
|
|
|
|
|
String result = HttpUtil.sendPostFromFile(parts, properties.getUploadUrl());
|
|
String result = HttpUtil.sendPostFromFile(parts, properties.getUploadUrl());
|
|
|
if (StringUtils.isEmpty(result)) {
|
|
if (StringUtils.isEmpty(result)) {
|
|
@@ -420,99 +414,55 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 支付 获取支付url
|
|
|
|
|
- */
|
|
|
|
|
- public PayResp.DataDTO getPaid(InsAreaCompany iac, ChannelInfoDto channelInfo) {
|
|
|
|
|
- //构造请求参数
|
|
|
|
|
- PayReq req = PayReq.buildParam(iac, properties.getRedirectUrl(), channelInfo);
|
|
|
|
|
- PayResp payResp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00008, PayResp.class);
|
|
|
|
|
- if (null != payResp) {
|
|
|
|
|
- return payResp.getData();
|
|
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 32 通过二维码扫描获取电子投保单签名
|
|
|
|
|
- */
|
|
|
|
|
- public SignatureResponse signature(InsAreaCompany insAreaCompany) {
|
|
|
|
|
- //构造请求参数
|
|
|
|
|
- SignatureRequest signatureRequest = new SignatureRequest();
|
|
|
|
|
- signatureRequest.setProposalNoCI(insAreaCompany.getJqapplyno());
|
|
|
|
|
- signatureRequest.setProposalNoCI(insAreaCompany.getSyapplyno());
|
|
|
|
|
- return guorenRequestApiComponent.request(signatureRequest, PlatformInterfaceCode.API_IIIRBT00055, SignatureResponse.class);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 电子保单
|
|
|
|
|
- */
|
|
|
|
|
- public PolicyResp policyPrint(String policyNo) {
|
|
|
|
|
- Map<String, String> m = new HashMap<>();
|
|
|
|
|
- m.put("policyNo", policyNo);
|
|
|
|
|
- PolicyResp resp = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00027, PolicyResp.class);
|
|
|
|
|
- if (null != resp && resp.getResultCode() == 0) {
|
|
|
|
|
- return resp;
|
|
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 6 电子保单
|
|
* 6 电子保单
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpResult getPolicyPrintApi(PolicyPrintVo policyPrintVo) {
|
|
|
|
|
|
|
+ public HttpResult<String> getPolicyPrintApi(PolicyPrintVo policyPrintVo) {
|
|
|
//子订单
|
|
//子订单
|
|
|
- InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(policyPrintVo.getCompanyId());
|
|
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(policyPrintVo.getCompanyId());
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
- InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
- Map<String, String> m = new HashMap<>();
|
|
|
|
|
- if (policyPrintVo.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode())) {
|
|
|
|
|
- PolicyResp policyResp = policyPrint(iac.getJqpolicyno());
|
|
|
|
|
- //交强险标志
|
|
|
|
|
- String ciFlag = properties.getPolicyFlagUrl() + policyResp.getData();
|
|
|
|
|
- //交强险电子保单
|
|
|
|
|
- String ciPolicy = properties.getPolicyUrl() + policyResp.getData();
|
|
|
|
|
- String jqFlagUrl = gainCarInsPolicy(ciFlag, "1", order.getLicenseno());
|
|
|
|
|
- String jqUrl = gainCarInsPolicy(ciPolicy, "2", order.getLicenseno());
|
|
|
|
|
- m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
- m.put("jqUrl", jqUrl);
|
|
|
|
|
- }
|
|
|
|
|
- if (policyPrintVo.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode())) {
|
|
|
|
|
-
|
|
|
|
|
- PolicyResp policyResp = policyPrint(iac.getSypolicyno());
|
|
|
|
|
- //商业险电子保单
|
|
|
|
|
- String biPolicy = properties.getPolicyUrl() + policyResp.getData();
|
|
|
|
|
- String syUrl = gainCarInsPolicy(biPolicy, "3", order.getLicenseno());
|
|
|
|
|
- m.put("syUrl", syUrl);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+ // 车牌号
|
|
|
|
|
+ String licensePlate = insOrders.getLicenseno();
|
|
|
|
|
+ String templateName;
|
|
|
|
|
+ String busNo;
|
|
|
|
|
+ String url;
|
|
|
|
|
+ switch (policyPrintVo.getRiskCode()) {
|
|
|
|
|
+ case InsuranceRisk.TRAFFIC_CODE:
|
|
|
|
|
+ PolicyResp policyResp = guorenRequestApiComponent.policyPrint(insAreaCompany.getJqpolicyno());
|
|
|
|
|
+ if (PolicyPrintVo.PolicyPrintType.PPT_1.getCode().equals(policyPrintVo.getType())) {
|
|
|
|
|
+ templateName = "-交强险标志.pdf";
|
|
|
|
|
+ //交强险标志
|
|
|
|
|
+ url = properties.getPolicyFlagUrl() + policyResp.getData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ templateName = "-交强险保单.pdf";
|
|
|
|
|
+ url = properties.getPolicyUrl() + policyResp.getData();
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
- return HttpResult.ok(m);
|
|
|
|
|
|
|
+ case InsuranceRisk.BUSINESS_CODE:
|
|
|
|
|
+ templateName = "-商业险保单.pdf";
|
|
|
|
|
+ PolicyResp policyResp1 = guorenRequestApiComponent.policyPrint(insAreaCompany.getSypolicyno());
|
|
|
|
|
+ url = properties.getPolicyUrl() + policyResp1.getData();
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ case InsuranceRisk.ACCIDENT_CODE:
|
|
|
|
|
+ busNo = policyPrintVo.getPolicyNumber();
|
|
|
|
|
+ url = guorenRequestApiComponent.noCarElectronicPolicy(properties.getChannelCode(), insAreaCompany.getInsOrderNo(), busNo);
|
|
|
|
|
+ templateName = busNo + "-非车险保单.pdf";
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
|
|
+ default:
|
|
|
|
|
+ throw new SystemException("保险编号异常");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取车险保单 处理保单文件
|
|
|
|
|
- *
|
|
|
|
|
- * @param licensePlate 车牌号
|
|
|
|
|
- * @param flag 标识 1:交强险标志,2:交强险保单,3:商业险保单
|
|
|
|
|
- * @author: lig
|
|
|
|
|
- * @date: 2023年09月21日 0021
|
|
|
|
|
- */
|
|
|
|
|
- public String gainCarInsPolicy(String url, String flag, String licensePlate) {
|
|
|
|
|
- String fileName = licensePlate;
|
|
|
|
|
- if (flag.equals("1")) {
|
|
|
|
|
- fileName += "-交强险标志.pdf";
|
|
|
|
|
|
|
+ String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, licensePlate);
|
|
|
|
|
+ return HttpResult.ok("成功", transferUrl);
|
|
|
|
|
|
|
|
- } else if (flag.equals("2")) {
|
|
|
|
|
- fileName += "-交强险电子保单.pdf";
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- } else if (flag.equals("3")) {
|
|
|
|
|
- fileName += "-商业险电子保单.pdf";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ private String gainCarInsPolicy(String url, String fileName, String licensePlate) {
|
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
}
|
|
}
|
|
@@ -570,6 +520,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany();
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany();
|
|
|
insAreaCompany.setOrderno(insOrder.getOrderno());
|
|
insAreaCompany.setOrderno(insOrder.getOrderno());
|
|
|
insAreaCompany.setSumpremium(BigDecimal.valueOf(quoteRespVo.getSumPermium()));
|
|
insAreaCompany.setSumpremium(BigDecimal.valueOf(quoteRespVo.getSumPermium()));
|
|
|
|
|
+ insAreaCompany.setJypremium(BigDecimal.valueOf(quoteRespVo.getJyPremium()));
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
insAreaCompany.setRiskinfo(JSON.parseArray(JSON.toJSONString(quoteRespVo.getRiskList())));
|
|
insAreaCompany.setRiskinfo(JSON.parseArray(JSON.toJSONString(quoteRespVo.getRiskList())));
|
|
|
insAreaCompany.setKindinfo(JSON.parseArray(JSON.toJSONString(quoteRespVo.getKindList())));
|
|
insAreaCompany.setKindinfo(JSON.parseArray(JSON.toJSONString(quoteRespVo.getKindList())));
|
|
@@ -640,7 +591,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
* @author: lig
|
|
* @author: lig
|
|
|
* @date: 2023-08-21
|
|
* @date: 2023-08-21
|
|
|
*/
|
|
*/
|
|
|
- public static QuoteRespVo buildQuoteRespVo(InsOrders insOrder, PremiumResp.DataDTO rd, YaQuoteInfoVo yaQuoteInfoVo) {
|
|
|
|
|
|
|
+ public static QuoteRespVo buildQuoteRespVo(InsOrders insOrder, PremiumResp.DataDTO rd, YaQuoteInfoVo yaQuoteInfoVo, String jyPremium) {
|
|
|
|
|
|
|
|
//交强保费 含税
|
|
//交强保费 含税
|
|
|
BigDecimal jqPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPremiumCI()));
|
|
BigDecimal jqPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPremiumCI()));
|
|
@@ -648,10 +599,12 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
BigDecimal syPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPremiumBI()));
|
|
BigDecimal syPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPremiumBI()));
|
|
|
//车船税保费 含税
|
|
//车船税保费 含税
|
|
|
BigDecimal taxPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPayTax()));
|
|
BigDecimal taxPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPayTax()));
|
|
|
|
|
+ // 驾意险
|
|
|
|
|
+ BigDecimal noCarPremium = new BigDecimal(jyPremium);
|
|
|
//保费合计
|
|
//保费合计
|
|
|
- BigDecimal sumPermium = jqPremiumBig.add(syPremiumBig).add(taxPremiumBig);
|
|
|
|
|
- List<QuoteKindRespVo> kindRespVoList = new ArrayList<>();
|
|
|
|
|
|
|
+ BigDecimal sumPermium = jqPremiumBig.add(syPremiumBig).add(taxPremiumBig).add(noCarPremium);
|
|
|
|
|
|
|
|
|
|
+ List<QuoteKindRespVo> kindRespVoList = new ArrayList<>();
|
|
|
QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
|
quoteRespVo.setStartDateJq(rd.getCiStartDate());
|
|
quoteRespVo.setStartDateJq(rd.getCiStartDate());
|
|
|
quoteRespVo.setEndDateJq(rd.getCiEndDate());
|
|
quoteRespVo.setEndDateJq(rd.getCiEndDate());
|
|
@@ -695,6 +648,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
quoteRespVo.setSumPermium(sumPermium.doubleValue());//保费合计
|
|
quoteRespVo.setSumPermium(sumPermium.doubleValue());//保费合计
|
|
|
quoteRespVo.setTaxAmount(taxPremiumBig.doubleValue());//车船税
|
|
quoteRespVo.setTaxAmount(taxPremiumBig.doubleValue());//车船税
|
|
|
quoteRespVo.setTotalAdjustRate(1);
|
|
quoteRespVo.setTotalAdjustRate(1);
|
|
|
|
|
+ quoteRespVo.setJyPremium(noCarPremium.doubleValue());
|
|
|
// quoteRespVo.setILogPreUdwMess(StringUtils.toString(rd.getBirate().getBillcomeGroup()));//评分
|
|
// quoteRespVo.setILogPreUdwMess(StringUtils.toString(rd.getBirate().getBillcomeGroup()));//评分
|
|
|
quoteRespVo.setOrderno(insOrder.getOrderno()); //订单号
|
|
quoteRespVo.setOrderno(insOrder.getOrderno()); //订单号
|
|
|
quoteRespVo.setJqPremium(jqPremiumBig.doubleValue());
|
|
quoteRespVo.setJqPremium(jqPremiumBig.doubleValue());
|
|
@@ -875,15 +829,16 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
/**
|
|
/**
|
|
|
* 保费计算
|
|
* 保费计算
|
|
|
*/
|
|
*/
|
|
|
- public PremiumResp.DataDTO premiumQuery(BaseQuoteInfoVo yaQuoteInfoVo, CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ) {
|
|
|
|
|
|
|
+ public PremiumResp.DataDTO premiumQuery(BaseQuoteInfoVo yaQuoteInfoVo, CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar) {
|
|
|
|
|
|
|
|
//请求信息列表
|
|
//请求信息列表
|
|
|
List<String> requestInfoList = new ArrayList<>();
|
|
List<String> requestInfoList = new ArrayList<>();
|
|
|
boolean boo;
|
|
boolean boo;
|
|
|
//构造请求参数
|
|
//构造请求参数
|
|
|
- PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ);
|
|
|
|
|
|
|
+ PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar);
|
|
|
PremiumResp resp;
|
|
PremiumResp resp;
|
|
|
- StringBuffer flag = new StringBuffer();
|
|
|
|
|
|
|
+ StringBuilder flag = new StringBuilder();
|
|
|
|
|
+
|
|
|
for (; ; ) {
|
|
for (; ; ) {
|
|
|
resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004, PremiumResp.class);
|
|
resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004, PremiumResp.class);
|
|
|
req.getCi().getPrpTmain().setAnswer(null);
|
|
req.getCi().getPrpTmain().setAnswer(null);
|
|
@@ -920,30 +875,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 投保单保存
|
|
|
|
|
- *
|
|
|
|
|
- * @author: lig
|
|
|
|
|
- * @date: 2023年08月18日 0018
|
|
|
|
|
- */
|
|
|
|
|
- public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum) {
|
|
|
|
|
- //构造请求参数
|
|
|
|
|
- InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum);
|
|
|
|
|
- return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00006, InsuranceSlipResp.class);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 提交核保
|
|
|
|
|
- *
|
|
|
|
|
- * @author: lig
|
|
|
|
|
- * @date: 2023-08-23
|
|
|
|
|
- */
|
|
|
|
|
- public SubmitAuditResp submitAudit(InsAreaCompany iac, ChannelInfoDto channelInfo) {
|
|
|
|
|
- //构造请求参数
|
|
|
|
|
- SubmitAuditReq req = SubmitAuditReq.buildParam(iac, channelInfo);
|
|
|
|
|
- return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00007, SubmitAuditResp.class);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 投保单状态
|
|
* 投保单状态
|
|
@@ -978,8 +909,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
BeanUtils.copyProperties(prodListDTO, nonAutoInsuranceList);
|
|
BeanUtils.copyProperties(prodListDTO, nonAutoInsuranceList);
|
|
|
NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO prodRiskListDTO = prodListDTO.getProdRiskList().get(0);
|
|
NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO prodRiskListDTO = prodListDTO.getProdRiskList().get(0);
|
|
|
String riskCode = prodRiskListDTO.getRiskCode();
|
|
String riskCode = prodRiskListDTO.getRiskCode();
|
|
|
- List<NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO.ProdCvgLiabListDTO> prodCvgLiabList
|
|
|
|
|
- = prodRiskListDTO.getProdCvgLiabList();
|
|
|
|
|
|
|
+ List<NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO.ProdCvgLiabListDTO> prodCvgLiabList = prodRiskListDTO.getProdCvgLiabList();
|
|
|
nonAutoInsuranceList.setProdCvgLiabList(prodCvgLiabList);
|
|
nonAutoInsuranceList.setProdCvgLiabList(prodCvgLiabList);
|
|
|
nonAutoInsuranceList.setRiskCode(riskCode);
|
|
nonAutoInsuranceList.setRiskCode(riskCode);
|
|
|
nonAutoInsuranceLists.add(nonAutoInsuranceList);
|
|
nonAutoInsuranceLists.add(nonAutoInsuranceList);
|
|
@@ -1077,7 +1007,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取图片验证码 校验的code
|
|
* 获取图片验证码 校验的code
|
|
|
*
|
|
*
|
|
@@ -1090,12 +1019,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
|
|
|
bodyMap.put("syImage", StringUtils.toString(syImageStr, ""));
|
|
bodyMap.put("syImage", StringUtils.toString(syImageStr, ""));
|
|
|
String sendBody = JsonUtils.toJson(bodyMap);
|
|
String sendBody = JsonUtils.toJson(bodyMap);
|
|
|
String ocrStr = HttpUtil.sendPost("http://47.92.254.66:8088/getres", sendBody);
|
|
String ocrStr = HttpUtil.sendPost("http://47.92.254.66:8088/getres", sendBody);
|
|
|
- CheckCodeResp checkCodeResp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
|
|
|
|
|
- return checkCodeResp;
|
|
|
|
|
|
|
+ return JSONUtil.toBean(ocrStr, CheckCodeResp.class);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@Data
|
|
@Data
|
|
|
class CheckCodeResp {
|
|
class CheckCodeResp {
|
|
|
|
|
|