|
@@ -2,6 +2,7 @@ package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
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.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
@@ -14,6 +15,7 @@ import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
|
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.InsImagesUploadCacheComponents;
|
|
import com.ydtech.modules.order.components.InsImagesUploadCacheComponents;
|
|
|
import com.ydtech.modules.order.components.yangguang.YangGuangRequestApiComponents;
|
|
import com.ydtech.modules.order.components.yangguang.YangGuangRequestApiComponents;
|
|
|
import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
|
|
import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
|
|
@@ -23,7 +25,6 @@ import com.ydtech.modules.order.entity.api.yangguang.request.*;
|
|
|
import com.ydtech.modules.order.entity.api.yangguang.response.*;
|
|
import com.ydtech.modules.order.entity.api.yangguang.response.*;
|
|
|
import com.ydtech.modules.order.entity.api.zijin.constants.enums.BusType;
|
|
import com.ydtech.modules.order.entity.api.zijin.constants.enums.BusType;
|
|
|
import com.ydtech.modules.order.entity.config.YangGuangConfigureParameters;
|
|
import com.ydtech.modules.order.entity.config.YangGuangConfigureParameters;
|
|
|
-import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
|
|
import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
|
|
import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
|
|
|
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.po.InsTaskImagesBase64;
|
|
@@ -77,6 +78,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
|
|
|
|
|
private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
|
|
private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
|
|
|
|
|
|
|
|
|
|
+ private final FileComponents fileComponents;
|
|
|
|
|
|
|
|
@Value("${upload.file.path}")
|
|
@Value("${upload.file.path}")
|
|
|
private String uploadFilePath;
|
|
private String uploadFilePath;
|
|
@@ -136,7 +138,6 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
boolean isEnergy = carInfo.isNewEnergy();
|
|
boolean isEnergy = carInfo.isNewEnergy();
|
|
|
|
|
|
|
|
if (!yangGuangAccuracyCalculateResponse1.getErrorCode().equals("0")) {
|
|
if (!yangGuangAccuracyCalculateResponse1.getErrorCode().equals("0")) {
|
|
|
- QuoteRespVo resp = new QuoteRespVo();
|
|
|
|
|
InsOrders order = insOrdersService.getById(quoteInfoVo.getOrderNo());
|
|
InsOrders order = insOrdersService.getById(quoteInfoVo.getOrderNo());
|
|
|
InsOrderStatusEnum insOrderStatusEnum = InsOrderStatusEnum.QUOTE_FAILED;
|
|
InsOrderStatusEnum insOrderStatusEnum = InsOrderStatusEnum.QUOTE_FAILED;
|
|
|
if (yangGuangAccuracyCalculateResponse1.getErrorMessage().contains("重复投保")) {
|
|
if (yangGuangAccuracyCalculateResponse1.getErrorMessage().contains("重复投保")) {
|
|
@@ -424,6 +425,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
insAreaCompany.setSypolicyno(yangGuangProposalStatusQueryResponse.getBiPolicyNo());
|
|
insAreaCompany.setSypolicyno(yangGuangProposalStatusQueryResponse.getBiPolicyNo());
|
|
|
insAreaCompany.setJqapplyno(yangGuangProposalStatusQueryResponse.getCiProposalNo());
|
|
insAreaCompany.setJqapplyno(yangGuangProposalStatusQueryResponse.getCiProposalNo());
|
|
|
insAreaCompany.setSyapplyno(yangGuangProposalStatusQueryResponse.getBiProposalNo());
|
|
insAreaCompany.setSyapplyno(yangGuangProposalStatusQueryResponse.getBiProposalNo());
|
|
|
|
|
+ insAreaCompany.setAccidentStrInfo(yangGuangProposalStatusQueryResponse.getFCPolicyNo());
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("更新状态成功");
|
|
return HttpResult.ok("更新状态成功");
|
|
@@ -452,6 +454,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
String busNo;
|
|
String busNo;
|
|
|
BusType busType;
|
|
BusType busType;
|
|
|
String templateName;
|
|
String templateName;
|
|
|
|
|
+ boolean flag = false;
|
|
|
switch (policyPrintVo.getRiskCode()) {
|
|
switch (policyPrintVo.getRiskCode()) {
|
|
|
case InsuranceRisk.TRAFFIC_CODE:
|
|
case InsuranceRisk.TRAFFIC_CODE:
|
|
|
busNo = insAreaCompany.getJqpolicyno();
|
|
busNo = insAreaCompany.getJqpolicyno();
|
|
@@ -464,7 +467,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
templateName = "-商业险保单.pdf";
|
|
templateName = "-商业险保单.pdf";
|
|
|
break;
|
|
break;
|
|
|
case InsuranceRisk.ACCIDENT_CODE:
|
|
case InsuranceRisk.ACCIDENT_CODE:
|
|
|
- busNo = policyPrintVo.getPolicyNumber();
|
|
|
|
|
|
|
+ busNo = insAreaCompany.getAccidentStrInfo();
|
|
|
busType = BusType.BT_4;
|
|
busType = BusType.BT_4;
|
|
|
templateName = busNo + "-非车险保单.pdf";
|
|
templateName = busNo + "-非车险保单.pdf";
|
|
|
break;
|
|
break;
|
|
@@ -476,7 +479,8 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
if (!yangGuangGetEpolicyPdfUrlResponse.getErrorCode().equals("0")) {
|
|
if (!yangGuangGetEpolicyPdfUrlResponse.getErrorCode().equals("0")) {
|
|
|
return HttpResult.error("电子保单生成失败, 原因:" + yangGuangGetEpolicyPdfUrlResponse.getErrorMessage());
|
|
return HttpResult.error("电子保单生成失败, 原因:" + yangGuangGetEpolicyPdfUrlResponse.getErrorMessage());
|
|
|
}
|
|
}
|
|
|
- String transferUrl = gainCarInsPolicy(yangGuangGetEpolicyPdfUrlResponse.getEPolicyPDFURL(), licensePlate + templateName, insAreaCompany.getId());
|
|
|
|
|
|
|
+ String transferUrl = fileComponents.gainCarInsPolicyNew(yangGuangGetEpolicyPdfUrlResponse.getEPolicyPDFURL(),
|
|
|
|
|
+ licensePlate + "-" + templateName, insAreaCompany.getId(), customerInfoVo.getIdentifyNumber(), flag);
|
|
|
return HttpResult.ok("电子保单生成成功", transferUrl);
|
|
return HttpResult.ok("电子保单生成成功", transferUrl);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -505,9 +509,15 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public ReadPdfUrlListDto getPolicyByCompanyIdPdfList(InsAreaCompany insAreaCompany, InsOrders insOrders, boolean flag) {
|
|
public ReadPdfUrlListDto getPolicyByCompanyIdPdfList(InsAreaCompany insAreaCompany, InsOrders insOrders, boolean flag) {
|
|
|
- String jqPath = getPdfUrl(insAreaCompany, insOrders,InsuranceRisk.TRAFFIC_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(),insAreaCompany.getJqpolicyno(),flag);
|
|
|
|
|
- String syPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.BUSINESS_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), insAreaCompany.getSypolicyno(),flag);
|
|
|
|
|
- InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy =new InsAreaCompanyExternalPolicy(insAreaCompany.getId(),jqPath,syPath,null,null);
|
|
|
|
|
|
|
+ String jqPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.TRAFFIC_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(),insAreaCompany.getJqpolicyno(),flag);
|
|
|
|
|
+ String syPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.BUSINESS_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(),insAreaCompany.getSypolicyno(),flag);
|
|
|
|
|
+ String fcPath = "";
|
|
|
|
|
+ if (insAreaCompany.getAccidentStrInfo() != null && !insAreaCompany.getAccidentStrInfo().equals("")) {
|
|
|
|
|
+ //获取非车保单号
|
|
|
|
|
+ String FcProposalNo = insAreaCompany.getAccidentStrInfo();
|
|
|
|
|
+ fcPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.ACCIDENT_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), FcProposalNo, flag);
|
|
|
|
|
+ }
|
|
|
|
|
+ InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy =new InsAreaCompanyExternalPolicy(insAreaCompany.getId(),jqPath,syPath,fcPath,null);
|
|
|
return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy,insAreaCompany,null);
|
|
return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy,insAreaCompany,null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -526,9 +536,12 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
ptlAgreementAttribution);
|
|
ptlAgreementAttribution);
|
|
|
// 车牌号
|
|
// 车牌号
|
|
|
String licensePlate = insOrders.getLicenseno();
|
|
String licensePlate = insOrders.getLicenseno();
|
|
|
|
|
+
|
|
|
|
|
+ CustomerInfoVo customerInfoVo = insOrders.getApplyinfo().toJavaObject(CustomerInfoVo.class);
|
|
|
// 被保人信息
|
|
// 被保人信息
|
|
|
String templateName = null;
|
|
String templateName = null;
|
|
|
String url = null;
|
|
String url = null;
|
|
|
|
|
+ String transferUrl;
|
|
|
try{
|
|
try{
|
|
|
YangGuangGetEpolicyPdfUrlRequest request = new YangGuangGetEpolicyPdfUrlRequest(parameters,policyNo);
|
|
YangGuangGetEpolicyPdfUrlRequest request = new YangGuangGetEpolicyPdfUrlRequest(parameters,policyNo);
|
|
|
YangGuangGetEpolicyPdfUrlResponse response = yangGuangRequestApiComponents.getEpolicyPDFURL(request);
|
|
YangGuangGetEpolicyPdfUrlResponse response = yangGuangRequestApiComponents.getEpolicyPDFURL(request);
|
|
@@ -542,10 +555,12 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
url = response.getEPolicyPDFURL();
|
|
url = response.getEPolicyPDFURL();
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ transferUrl = fileComponents.gainCarInsPolicyNew(response.getEPolicyPDFURL(),
|
|
|
|
|
+ licensePlate + "-" + templateName, insAreaCompany.getId(),
|
|
|
|
|
+ customerInfoVo.getIdentifyNumber(),flag);
|
|
|
} catch (Exception e){
|
|
} catch (Exception e){
|
|
|
throw new SystemException(e.toString());
|
|
throw new SystemException(e.toString());
|
|
|
}
|
|
}
|
|
|
- String transferUrl = gainCarInsPolicyNew(url, templateName, insAreaCompany.getId(),flag);
|
|
|
|
|
return transferUrl;
|
|
return transferUrl;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -715,7 +730,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskName(accidentalDriving.getProductName());
|
|
insAreaCompanyAccidentalDriving.setRideRiskName(accidentalDriving.getProductName());
|
|
|
insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
|
|
insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ insAreaCompany.setAccidentInfo(JSONArray.parseArray(JSONArray.toJSONString(accidentalDrivingVo)));
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDrivings);
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDrivings);
|
|
|
} else {
|
|
} else {
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, new ArrayList<>());
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, new ArrayList<>());
|