|
@@ -4,30 +4,37 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
|
|
+import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.model.vo.PersonAreaVo;
|
|
import com.ydtech.modules.admin.model.vo.PersonAreaVo;
|
|
|
import com.ydtech.modules.admin.service.SysAreaService;
|
|
import com.ydtech.modules.admin.service.SysAreaService;
|
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
import com.ydtech.modules.ins.model.vo.*;
|
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
|
|
+import com.ydtech.modules.order.components.FileComponents;
|
|
|
import com.ydtech.modules.order.components.bohai.BoHaiRequestApiComponent;
|
|
import com.ydtech.modules.order.components.bohai.BoHaiRequestApiComponent;
|
|
|
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.TaxArrears;
|
|
import com.ydtech.modules.order.entity.TaxArrears;
|
|
|
import com.ydtech.modules.order.entity.api.bohai.constants.Coverages;
|
|
import com.ydtech.modules.order.entity.api.bohai.constants.Coverages;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.bohai.constants.ResponseCode;
|
|
|
import com.ydtech.modules.order.entity.api.bohai.request.*;
|
|
import com.ydtech.modules.order.entity.api.bohai.request.*;
|
|
|
import com.ydtech.modules.order.entity.api.bohai.response.*;
|
|
import com.ydtech.modules.order.entity.api.bohai.response.*;
|
|
|
-import com.ydtech.modules.order.entity.api.zijin.request.SubmitVerifyRequest;
|
|
|
|
|
import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
|
|
import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
|
|
|
|
|
+import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
import com.ydtech.modules.order.entity.filter.CarModelsFilterUtils;
|
|
import com.ydtech.modules.order.entity.filter.CarModelsFilterUtils;
|
|
|
|
|
+import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
|
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.SpecialAuditVo;
|
|
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.bohai.ProductQueryVo;
|
|
|
import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
|
|
import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
|
|
|
import com.ydtech.modules.order.service.BoHaiOrderApiService;
|
|
import com.ydtech.modules.order.service.BoHaiOrderApiService;
|
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
|
|
+import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
|
|
+import com.ydtech.modules.order.service.InsTaskImagesService;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.utils.CalculateUtils;
|
|
import com.ydtech.utils.CalculateUtils;
|
|
|
-import com.ydtech.utils.idgen.IdGenerate;
|
|
|
|
|
|
|
+import com.ydtech.utils.StringUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -51,8 +58,41 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
|
|
|
|
|
private final InsAreaCompanyService insAreaCompanyService;
|
|
private final InsAreaCompanyService insAreaCompanyService;
|
|
|
|
|
|
|
|
|
|
+ private final InsOrdersService insOrdersService;
|
|
|
|
|
+
|
|
|
|
|
+ private final InsTaskImagesService insTaskImagesService;
|
|
|
|
|
+
|
|
|
|
|
+ private final FileComponents fileComponents;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<ZjQuoteAccidentVo>> quoteVo) {
|
|
|
|
|
|
|
+ public HttpResult<List<NonAutomotiveProductsResponse.DataDTO.ProductsDTO>> productQuery(ProductQueryVo productQueryVo) throws Exception {
|
|
|
|
|
+ // 账号信息
|
|
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(productQueryVo.getAgreementId());
|
|
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
|
|
+ BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
|
|
+ ptlAgreementAttribution);
|
|
|
|
|
+ NonAutomotiveProductsRequest nonAutomotiveProductsRequest = new NonAutomotiveProductsRequest(parameters, productQueryVo);
|
|
|
|
|
+ NonAutomotiveProductsResponse response = boHaiRequestApiComponent.products(nonAutomotiveProductsRequest);
|
|
|
|
|
+ List<NonAutomotiveProductsResponse.DataDTO.ProductsDTO> products = response.getData().getProducts();
|
|
|
|
|
+ return HttpResult.ok(products);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult<List<NonAutomotiveProductsDetailsResponse.DataDTO.CoveragesDTO>> productDetailsQuery(ProductDetailsQueryVo productDetailsQueryVo) throws Exception {
|
|
|
|
|
+ // 账号信息
|
|
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(productDetailsQueryVo.getAgreementId());
|
|
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
|
|
+ BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
|
|
+ ptlAgreementAttribution);
|
|
|
|
|
+ NonAutomotiveProductsDetailsRequest nonAutomotiveProductsDetailsRequest = new NonAutomotiveProductsDetailsRequest(parameters,
|
|
|
|
|
+ productDetailsQueryVo);
|
|
|
|
|
+ NonAutomotiveProductsDetailsResponse response = boHaiRequestApiComponent.productsDetails(nonAutomotiveProductsDetailsRequest);
|
|
|
|
|
+ List<NonAutomotiveProductsDetailsResponse.DataDTO.CoveragesDTO> coverages = response.getData().getCoverages();
|
|
|
|
|
+ return HttpResult.ok(coverages);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<ZjQuoteAccidentVo>> quoteVo) throws Exception {
|
|
|
// 协议id获取配置实体
|
|
// 协议id获取配置实体
|
|
|
String agreementId = quoteVo.getAgreementId();
|
|
String agreementId = quoteVo.getAgreementId();
|
|
|
// 账号信息
|
|
// 账号信息
|
|
@@ -61,85 +101,134 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
ptlAgreementAttribution);
|
|
|
GenerateOrderNoRequest generateOrderNoRequest = new GenerateOrderNoRequest(parameters);
|
|
GenerateOrderNoRequest generateOrderNoRequest = new GenerateOrderNoRequest(parameters);
|
|
|
- try {
|
|
|
|
|
- // 1 生成生成订单
|
|
|
|
|
- GenerateOrderNoResponse generateOrderNoResponse = boHaiRequestApiComponent.generateOrderNo(generateOrderNoRequest);
|
|
|
|
|
- String orderNo = generateOrderNoResponse.getData().getOrderNo();
|
|
|
|
|
-
|
|
|
|
|
- // 2 车型查询接口
|
|
|
|
|
- CarInfoVo carInfo = quoteInfoVo.getCarInfo();
|
|
|
|
|
- VehicleTypeQueryRequest vehicleTypeQueryRequest = new VehicleTypeQueryRequest(parameters, carInfo.getModelcname(), orderNo);
|
|
|
|
|
- VehicleTypeQueryResponse vehicleTypeQueryResponse = boHaiRequestApiComponent.vehicleTypeQuery(vehicleTypeQueryRequest);
|
|
|
|
|
- List<VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO> vehicleModels = vehicleTypeQueryResponse.getData().getVehicleModels();
|
|
|
|
|
- VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO vehicleModelsDTO =
|
|
|
|
|
- new CarModelsFilterUtils<VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO>().to(vehicleModels,
|
|
|
|
|
- quoteInfoVo.getCarInfo());
|
|
|
|
|
-
|
|
|
|
|
- // 3 车辆确认接口
|
|
|
|
|
- // 车主信息
|
|
|
|
|
- CustomerInfoVo ownerInfo = quoteInfoVo.getOwnerInfo();
|
|
|
|
|
- PersonAreaVo ownerInfoArea = sysAreaService.queryByAddressBoHai(ownerInfo.getAddr(), ownerInfo.getIdentifyNumber());
|
|
|
|
|
- // 被保人信息
|
|
|
|
|
- CustomerInfoVo insuredPersonInfo = quoteInfoVo.getInsuredPersonInfo();
|
|
|
|
|
- PersonAreaVo insuredPersonArea = sysAreaService.queryByAddressBoHai(insuredPersonInfo.getAddr(), ownerInfo.getIdentifyNumber());
|
|
|
|
|
- // 投保人信息
|
|
|
|
|
- CustomerInfoVo policyHolderInfo = quoteInfoVo.getPolicyHolderInfo();
|
|
|
|
|
- PersonAreaVo policyHolderArea = sysAreaService.queryByAddressBoHai(policyHolderInfo.getAddr(),
|
|
|
|
|
- policyHolderInfo.getIdentifyNumber());
|
|
|
|
|
- VehicleConfirmationReqeust vehicleConfirmationReqeust = new VehicleConfirmationReqeust(parameters, quoteInfoVo,
|
|
|
|
|
- vehicleModelsDTO, orderNo, ownerInfoArea, insuredPersonArea, policyHolderArea);
|
|
|
|
|
- VehicleConfirmationResponse vehicleConfirmationResponse =
|
|
|
|
|
- boHaiRequestApiComponent.vehicleConfirmation(vehicleConfirmationReqeust);
|
|
|
|
|
- // 车辆实际价值
|
|
|
|
|
- String currentValue = vehicleConfirmationResponse.getData().getVehicleModels().get(0).getCurrentValue();
|
|
|
|
|
-
|
|
|
|
|
- // 4. 报价接口
|
|
|
|
|
- QuotationRequest quotationRequest = new QuotationRequest(parameters, quoteInfoVo.getRiskList(), quoteInfoVo.getKindList(),
|
|
|
|
|
- currentValue, orderNo, carInfo);
|
|
|
|
|
- QuotationResponse response = boHaiRequestApiComponent.quotation(quotationRequest);
|
|
|
|
|
- QuoteRespVo quoteRespVo = getQuoteRespVo(response, quoteInfoVo);
|
|
|
|
|
- return responseOrder(response, quoteRespVo, ptlAgreementAttribution, orderNo);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 1 生成生成订单
|
|
|
|
|
+ GenerateOrderNoResponse generateOrderNoResponse = boHaiRequestApiComponent.generateOrderNo(generateOrderNoRequest);
|
|
|
|
|
+ String orderNo = generateOrderNoResponse.getData().getOrderNo();
|
|
|
|
|
+
|
|
|
|
|
+ // 2 车型查询接口
|
|
|
|
|
+ CarInfoVo carInfo = quoteInfoVo.getCarInfo();
|
|
|
|
|
+ VehicleTypeQueryRequest vehicleTypeQueryRequest = new VehicleTypeQueryRequest(parameters, carInfo.getModelcname(), orderNo);
|
|
|
|
|
+ VehicleTypeQueryResponse vehicleTypeQueryResponse = boHaiRequestApiComponent.vehicleTypeQuery(vehicleTypeQueryRequest);
|
|
|
|
|
+ List<VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO> vehicleModels = vehicleTypeQueryResponse.getData().getVehicleModels();
|
|
|
|
|
+ VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO vehicleModelsDTO =
|
|
|
|
|
+ new CarModelsFilterUtils<VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO>().to(vehicleModels, quoteInfoVo.getCarInfo());
|
|
|
|
|
+
|
|
|
|
|
+ // 3 车辆确认接口
|
|
|
|
|
+ // 车主信息
|
|
|
|
|
+ CustomerInfoVo ownerInfo = quoteInfoVo.getOwnerInfo();
|
|
|
|
|
+ PersonAreaVo ownerInfoArea = sysAreaService.queryByAddressBoHai(ownerInfo.getAddr(), ownerInfo.getIdentifyNumber());
|
|
|
|
|
+ // 被保人信息
|
|
|
|
|
+ CustomerInfoVo insuredPersonInfo = quoteInfoVo.getInsuredPersonInfo();
|
|
|
|
|
+ PersonAreaVo insuredPersonArea = sysAreaService.queryByAddressBoHai(insuredPersonInfo.getAddr(), ownerInfo.getIdentifyNumber());
|
|
|
|
|
+ // 投保人信息
|
|
|
|
|
+ CustomerInfoVo policyHolderInfo = quoteInfoVo.getPolicyHolderInfo();
|
|
|
|
|
+ PersonAreaVo policyHolderArea = sysAreaService.queryByAddressBoHai(policyHolderInfo.getAddr(),
|
|
|
|
|
+ policyHolderInfo.getIdentifyNumber());
|
|
|
|
|
+ VehicleConfirmationReqeust vehicleConfirmationReqeust = new VehicleConfirmationReqeust(parameters, quoteInfoVo, vehicleModelsDTO,
|
|
|
|
|
+ orderNo, ownerInfoArea, insuredPersonArea, policyHolderArea);
|
|
|
|
|
+ VehicleConfirmationResponse vehicleConfirmationResponse = boHaiRequestApiComponent.vehicleConfirmation(vehicleConfirmationReqeust);
|
|
|
|
|
+ // 车辆实际价值
|
|
|
|
|
+ String currentValue = vehicleConfirmationResponse.getData().getVehicleModels().get(0).getCurrentValue();
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 报价接口
|
|
|
|
|
+ QuotationRequest quotationRequest = new QuotationRequest(parameters, quoteInfoVo.getRiskList(), quoteInfoVo.getKindList(),
|
|
|
|
|
+ currentValue, orderNo, carInfo);
|
|
|
|
|
+ QuotationResponse response = boHaiRequestApiComponent.quotation(quotationRequest);
|
|
|
|
|
+ QuoteRespVo quoteRespVo = getQuoteRespVo(response, quoteInfoVo);
|
|
|
|
|
+ return responseOrder(response, quoteRespVo, ptlAgreementAttribution, orderNo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> submitImage(String subOrderNo) throws Exception {
|
|
public HttpResult<Object> submitImage(String subOrderNo) throws Exception {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
-
|
|
|
|
|
// 账号信息
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
// 通过 协议id获取配置实体
|
|
// 通过 协议id获取配置实体
|
|
|
BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
ptlAgreementAttribution);
|
|
|
|
|
|
|
|
- // 核保请求
|
|
|
|
|
- UnderwritingRequest underwritingRequest = new UnderwritingRequest(parameters, insAreaCompany.getInsOrderNo());
|
|
|
|
|
- UnderwritingResponse underwritingResponse = boHaiRequestApiComponent.underwriting(underwritingRequest);
|
|
|
|
|
-
|
|
|
|
|
- // 支付请求
|
|
|
|
|
|
|
+ List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insAreaCompany.getOrderno(),
|
|
|
|
|
+ insAreaCompany.getId(), true);
|
|
|
|
|
+ if (insTaskImagesBase64s.isEmpty()) {
|
|
|
|
|
+ return HttpResult.ok();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ ImageUploadRequest imageUploadRequest = new ImageUploadRequest(parameters, insAreaCompany.getId(), insAreaCompany.getInsOrderNo()
|
|
|
|
|
+ , insTaskImagesBase64s);
|
|
|
|
|
+ ImageUploadResponse response = boHaiRequestApiComponent.imageUpload(imageUploadRequest);
|
|
|
|
|
+ if (ResponseCode.R_Z00001.getCode().equals(response.getResponseCode())) {
|
|
|
|
|
+ return HttpResult.ok("上传成功");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ throw new SystemException(response.getResponseMsg());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpResult<Object> audit(String subOrderNo) {
|
|
|
|
|
|
|
+ public HttpResult<Object> audit(String subOrderNo) throws Exception {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
|
|
+ // 账号信息
|
|
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
|
|
+ BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
|
|
+ ptlAgreementAttribution);
|
|
|
|
|
|
|
|
|
|
+ // 核保请求
|
|
|
|
|
+ UnderwritingRequest underwritingRequest = new UnderwritingRequest(parameters, insAreaCompany.getId(),
|
|
|
|
|
+ insAreaCompany.getInsOrderNo());
|
|
|
|
|
+ UnderwritingResponse underwritingResponse = boHaiRequestApiComponent.underwriting(underwritingRequest);
|
|
|
|
|
+ int i = underwritingResponse.getData().verificationUnderwriting();
|
|
|
|
|
+
|
|
|
|
|
+ if (i == 1) {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
|
|
+ // 支付请求
|
|
|
|
|
+ PaymentRequest paymentRequest = new PaymentRequest(parameters, insAreaCompany.getId(), insAreaCompany.getInsOrderNo());
|
|
|
|
|
+ PaymentResponse paymentResponse = boHaiRequestApiComponent.payment(paymentRequest);
|
|
|
|
|
+ String payUrl = paymentResponse.getData().getPayUrl();
|
|
|
|
|
+ insAreaCompany.setPaymentLink(payUrl);
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("核保通过");
|
|
|
|
|
+ } else if (i == 2) {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ String trafficResultMsg = underwritingResponse.getData().getTrafficResultMsg();
|
|
|
|
|
+ String businessResultMsg = underwritingResponse.getData().getBusinessResultMsg();
|
|
|
|
|
+ return HttpResult.error(trafficResultMsg + "/n" + businessResultMsg);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult<CrawlerPolicyPrintVo> getPolicyPrint(String subOrderNo) throws Exception {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
|
|
+ InsOrders insOrders = insOrdersService.existOrder(insAreaCompany.getOrderno());
|
|
|
|
|
|
|
|
|
|
+ // 账号信息
|
|
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
|
|
+ BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
|
|
+ ptlAgreementAttribution);
|
|
|
|
|
|
|
|
|
|
+ ElectronicPolicyRequest electronicPolicyRequest = new ElectronicPolicyRequest(parameters, insAreaCompany.getId(),
|
|
|
|
|
+ insAreaCompany.getJqpolicyno(), insAreaCompany.getSypolicyno());
|
|
|
|
|
+ ElectronicPolicyResponse response = boHaiRequestApiComponent.electronicPolicy(electronicPolicyRequest);
|
|
|
|
|
|
|
|
|
|
+ ElectronicPolicyResponse.DataDTO data = response.getData();
|
|
|
|
|
+ CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
|
|
|
|
|
+ String licenseno = insOrders.getLicenseno();
|
|
|
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(data.getTrafficEPolicyUrl())) {
|
|
|
|
|
+ crawlerPolicyPrintVo.setJqxFlagUrl(fileComponents.gainCarInsPolicy(data.getTrafficEPolicyUrl(),
|
|
|
|
|
+ licenseno + insAreaCompany.getJqpolicyno() + "-交强险标志.pdf", licenseno));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public HttpResult<String> getPolicyPrint(PolicyPrintVo policyPrintVo) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(data.getBusinessEPolicyUrl())) {
|
|
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(fileComponents.gainCarInsPolicy(data.getBusinessEPolicyUrl(),
|
|
|
|
|
+ licenseno + insAreaCompany.getSypolicyno() + "-交强险保单.pdf", licenseno));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public QuoteRespVo getQuoteRespVo(QuotationResponse response, BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
public QuoteRespVo getQuoteRespVo(QuotationResponse response, BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
|
double jyPremium = 0;
|
|
double jyPremium = 0;
|
|
@@ -182,9 +271,7 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
}).collect(Collectors.toList()).get(0);
|
|
}).collect(Collectors.toList()).get(0);
|
|
|
|
|
|
|
|
kind.setAmount(kindInfoVo.getAmount());
|
|
kind.setAmount(kindInfoVo.getAmount());
|
|
|
-
|
|
|
|
|
kind.setCoveragePremium(Double.parseDouble(coveragesDTO.getPremium()));
|
|
kind.setCoveragePremium(Double.parseDouble(coveragesDTO.getPremium()));
|
|
|
-
|
|
|
|
|
kind.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
kind.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
|
kind.setServiceTimes(String.valueOf(kindInfoVo.getServiceTimes()));
|
|
kind.setServiceTimes(String.valueOf(kindInfoVo.getServiceTimes()));
|
|
|
if (!ObjectUtils.isEmpty(kindInfoVo.getDeductibleRate())) {
|
|
if (!ObjectUtils.isEmpty(kindInfoVo.getDeductibleRate())) {
|
|
@@ -206,17 +293,16 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
return quoteRespVo;
|
|
return quoteRespVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
public HttpResult<QuoteRespVo> responseOrder(QuotationResponse response, QuoteRespVo quoteRespVo,
|
|
public HttpResult<QuoteRespVo> responseOrder(QuotationResponse response, QuoteRespVo quoteRespVo,
|
|
|
PtlAgreementAttribution ptlAgreementAttribution, String orderId) {
|
|
PtlAgreementAttribution ptlAgreementAttribution, String orderId) {
|
|
|
// 保存订单信息
|
|
// 保存订单信息
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
|
- // 协议id
|
|
|
|
|
- String companyId = IdGenerate.nextId();
|
|
|
|
|
- insAreaCompany.setId(companyId);
|
|
|
|
|
|
|
+ // 渤海业务id
|
|
|
|
|
+ String busUniqueId = response.getData().getBusUniqueId();
|
|
|
|
|
+ insAreaCompany.setId(orderId);
|
|
|
insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(response)));
|
|
insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(response)));
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
- insAreaCompany.setInsOrderNo(orderId);
|
|
|
|
|
|
|
+ insAreaCompany.setInsOrderNo(busUniqueId);
|
|
|
// 车船税
|
|
// 车船税
|
|
|
QuotationResponse.DataDTO.TrafficPolicyDTO.VehicleTaxDTO vehicleTax = response.getData().getTrafficPolicy().getVehicleTax();
|
|
QuotationResponse.DataDTO.TrafficPolicyDTO.VehicleTaxDTO vehicleTax = response.getData().getTrafficPolicy().getVehicleTax();
|
|
|
TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(vehicleTax.getOverdueTaxAmount()),
|
|
TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(vehicleTax.getOverdueTaxAmount()),
|
|
@@ -224,9 +310,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
|
insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|
|
insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
|
- quoteRespVo.setCompanyId(companyId);
|
|
|
|
|
|
|
+ quoteRespVo.setCompanyId(orderId);
|
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|