|
|
@@ -134,7 +134,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- // 3 组装参数
|
|
|
+ // 3 组装报价参数
|
|
|
HuaTaiQuotedPriceRequest quotedPriceRequest = new HuaTaiQuotedPriceRequest(quoteInfo, fullCarDataDto,actualValueResponse, zmQuoteVo.getAccidentalDrivingVo(), huaTaiConfigureParameters);
|
|
|
quotedPriceRequest.setHead(baseRequestHead);
|
|
|
|
|
|
@@ -158,69 +158,104 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
|
|
|
|
|
|
- // 2. 提交核保
|
|
|
+ // 2. 调用转投保接口
|
|
|
HuaTaiSubmitResponse response = submitForUnderwriting(yaQuoteInfoVo,insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
|
- HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany,huaTaiConfigureParameters,"1");
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 0 下发修改
|
|
|
+ * 1 转人工
|
|
|
+ * 3 转复核
|
|
|
+ * 4 自核通过
|
|
|
+ * 6 强制下发
|
|
|
+ * 7 强制自核
|
|
|
+ * 9 自核异常
|
|
|
+ */
|
|
|
boolean haveJQFlag = false;
|
|
|
boolean haveSYFlag = false;
|
|
|
+ String jqStatus = "";
|
|
|
+ String syStatus = "";
|
|
|
+ StringBuffer jqNotion = new StringBuffer();
|
|
|
+ StringBuffer syNotion = new StringBuffer();
|
|
|
for(HuaTaiSubmitResponse.AppliResult appliResult:response.getAppliResult()){
|
|
|
appliResult.getStatus();
|
|
|
if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
|
|
|
haveJQFlag = true;
|
|
|
if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
-
|
|
|
- if(appliResult.getStatus()==""){
|
|
|
-
|
|
|
+ jqStatus = appliResult.getStatus();
|
|
|
+ for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
|
+ jqNotion.append(notion.getUWResult()+",");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())){
|
|
|
haveSYFlag = true;
|
|
|
if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
-
|
|
|
+ syStatus = appliResult.getStatus();
|
|
|
+ for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
|
+ syNotion.append(notion.getUWResult()+",");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 3. 人工核保
|
|
|
- /*if (SubmitStatus.S_3.getCode().equals(response.getSubmitStatus())) {
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
- if(StringUtils.isNotEmpty(response.getSubmitNotion())){
|
|
|
- insAreaCompany.setAuditopinion(response.getSubmitNotion());
|
|
|
+ String totalStatus = "";
|
|
|
+ //同保交商
|
|
|
+ if(haveJQFlag && haveSYFlag){
|
|
|
+ //自核通过 和 强制自核
|
|
|
+ if("4,7".contains(jqStatus) && "4,7".contains(syStatus)){
|
|
|
+ totalStatus = "4";
|
|
|
+ }
|
|
|
+ //转人工和转复核
|
|
|
+ if("1,3".contains(jqStatus) || "1,3".contains(syStatus)){
|
|
|
+ totalStatus = "1";
|
|
|
+ }
|
|
|
+ if("0,6,7".contains(jqStatus) || "0,6,7".contains(syStatus)){
|
|
|
+ totalStatus = "0";
|
|
|
+ }
|
|
|
+ }else if((haveJQFlag && !haveSYFlag)||(!haveJQFlag && haveSYFlag)){//单保交强或单保商业
|
|
|
+ String status = jqStatus;
|
|
|
+ if(StringUtils.isNotEmpty(syStatus)){
|
|
|
+ status = syStatus;
|
|
|
+ }
|
|
|
+ if("4,7".contains(status)){
|
|
|
+ totalStatus = "4";
|
|
|
+ }else if("1,3".contains(status)){
|
|
|
+ totalStatus = "1";
|
|
|
+ }else if("0,6,7".contains(status)){
|
|
|
+ totalStatus = "0";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if("4".equals(totalStatus)){
|
|
|
+ //再调用缴费接口获取缴费链接
|
|
|
+ HuaTaiPaymentUrlRequest huaTaiPaymentUrlRequest = new HuaTaiPaymentUrlRequest(insAreaCompany,huaTaiConfigureParameters);
|
|
|
+ huaTaiPaymentUrlRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
+ HuaTaiPaymentUrlResponse paymentUrlResponse = huaTaiRequestApiComponents.getPaymentUrl(huaTaiPaymentUrlRequest, HuaTaiPaymentUrlResponse.class);
|
|
|
+ if(StringUtils.isNotEmpty(paymentUrlResponse.getPayUrl())){
|
|
|
+ insAreaCompany.setPaymentLink(paymentUrlResponse.getPayUrl());
|
|
|
}
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- return HttpResult.error(response.getSubmitNotion());
|
|
|
+ return HttpResult.ok("核保成功");
|
|
|
+ }else if("1".equals(totalStatus)){
|
|
|
+ //再次调用提交核保接口
|
|
|
+ HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany,huaTaiConfigureParameters,"1");
|
|
|
+ huaTaiSubmitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
+ HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(huaTaiSubmitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
|
|
|
+ //根据核保返回信息进行更新
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ return HttpResult.error("已转人工核保");
|
|
|
+ }else {
|
|
|
+ String notion = jqNotion.toString()+syNotion.toString();
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ return HttpResult.error(notion);
|
|
|
}
|
|
|
- // huaTaiRequestApiComponents.validationResults(response);
|
|
|
- // 4. 投保单号
|
|
|
- insAreaCompany.setPaymentLink(response.getPayUrl());
|
|
|
- insAreaCompany.setJqapplyno(response.getForceProposalNo());
|
|
|
- insAreaCompany.setSyapplyno(response.getBizProposalNo());
|
|
|
- insAreaCompany.setJyapplyno(response.getAccidentProposalNo());
|
|
|
- insAreaCompany.setInsOrderNo(response.getProposalNo());
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);*/
|
|
|
- return HttpResult.ok("核保成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
|
- /* InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
|
|
|
- // 1. 协议id获取配置实体
|
|
|
- ZmConfigureParameters zmConfigureParameters = configureParametersComponents.toEntity(ZmConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
|
-
|
|
|
- InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
- // 2. 投保单号(总)
|
|
|
- String insOrderNo = insAreaCompany.getId();
|
|
|
-
|
|
|
- List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insOrders.getOrderno());
|
|
|
- if (insTaskImagesBase64s.isEmpty()) {
|
|
|
- throw new SystemException("请检查影像是否上传了");
|
|
|
- }
|
|
|
- UploadImageRequest request = new UploadImageRequest(insTaskImagesBase64s, insOrderNo);
|
|
|
- request.setHead(new BaseRequestHead(zmConfigureParameters));
|
|
|
- huaTaiRequestApiComponents.uploadImage(request, UploadImageResponse.class);*/
|
|
|
return HttpResult.ok("上传文件成功");
|
|
|
}
|
|
|
|
|
|
@@ -248,20 +283,6 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
orderStatusRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
|
|
|
HuaTaiOrderStatusResponse orderStatusResponse = huaTaiRequestApiComponents.orderStatus(orderStatusRequest, HuaTaiOrderStatusResponse.class);
|
|
|
-// String status = orderStatusResponse.getStatus();
|
|
|
-//
|
|
|
-// // 3. 承保成功修改状态
|
|
|
-// if (status.equals(String.valueOf(PaymentStatusEnum.P_2.getCode()))) {
|
|
|
-// insAreaCompany.setJqpolicyno(orderStatusResponse.getSubContractNoJ());
|
|
|
-// insAreaCompany.setSypolicyno(orderStatusResponse.getSubContractNoS());
|
|
|
-//// insAreaCompany.setJypolicyno(orderStatusResponse.getAccidentNo());
|
|
|
-// insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
-// insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
-//
|
|
|
-// return HttpResult.ok(PaymentStatusEnum.P_2.getMeaning());
|
|
|
-// }
|
|
|
-//
|
|
|
-// return HttpResult.error(Enum.valueOf(PaymentStatusEnum.class, "P_" + status).getMeaning());
|
|
|
return HttpResult.ok("");
|
|
|
}
|
|
|
|
|
|
@@ -284,8 +305,6 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
// 2. 组装请求体
|
|
|
HuaTaiPaymentUrlRequest orderStatusRequest = new HuaTaiPaymentUrlRequest();
|
|
|
- /* orderStatusRequest.setOrderNo(insAreaCompany.getId());
|
|
|
- orderStatusRequest.setSubProposalNo(insAreaCompany.getInsOrderNo());*/
|
|
|
orderStatusRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
HuaTaiPaymentUrlResponse orderStatusResponse = huaTaiRequestApiComponents.getPaymentUrl(orderStatusRequest, HuaTaiPaymentUrlResponse.class);
|
|
|
return HttpResult.ok("");
|
|
|
@@ -302,48 +321,10 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
// 1. 协议id获取配置实体
|
|
|
HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
|
InsOrders order = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
- String licensePlate = order.getLicenseno();
|
|
|
- String policyNo;
|
|
|
- /* String code = DocumentTypeEnum.code(policyPrintVo.getType());
|
|
|
- String riskCode = policyPrintVo.getRiskCode();
|
|
|
- if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
|
|
|
- policyNo = insAreaCompany.getJqpolicyno();
|
|
|
- } else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
|
- policyNo = insAreaCompany.getJqpolicyno();
|
|
|
- } else {
|
|
|
- throw new SystemException("险种代码不存在");
|
|
|
- }*/
|
|
|
|
|
|
// 2. 组装请求体
|
|
|
HuaTaiInsurancePolicyPrintRequest request = new HuaTaiInsurancePolicyPrintRequest();
|
|
|
- /* request.setRiskCode(InsuranceTypeCorrespondence.getRisk().get(riskCode));
|
|
|
- request.setPolicyNo(policyNo);
|
|
|
- request.setDocumentType(code);
|
|
|
- request.setHead(new BaseRequestHead(zmConfigureParameters));*/
|
|
|
HuaTaiInsurancePolicyPrintResponse response = huaTaiRequestApiComponents.insurancePolicyPrint(request, HuaTaiInsurancePolicyPrintResponse.class);
|
|
|
- /* if("1".equals(response.getStatusCode())){
|
|
|
- List<String> urlList = response.getDownloadUrl();
|
|
|
-
|
|
|
- if(urlList!=null && !urlList.isEmpty()){
|
|
|
- String url = urlList.get(0);
|
|
|
- String templateName = "";
|
|
|
- if("DZ_AJ".equals(code)){
|
|
|
- templateName = "-交强险标志.pdf";
|
|
|
- }else if("DZ_AE".equals(code)){
|
|
|
- if("0330".equals(request.getRiskCode())){
|
|
|
- templateName = "-交强险保单.pdf";
|
|
|
- }else {
|
|
|
- templateName = "-商业险保单.pdf";
|
|
|
- }
|
|
|
- }
|
|
|
- String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, licensePlate);
|
|
|
- List<String> transferUrlList = new ArrayList<>();
|
|
|
- transferUrlList.add(transferUrl);
|
|
|
- response.setDownloadUrl(transferUrlList);
|
|
|
- }
|
|
|
- }else{
|
|
|
- return HttpResult.error("中煤电子保单生成失败,请重试或联系中煤!");
|
|
|
- }*/
|
|
|
return HttpResult.ok("下载成功"/*, response.getDownloadUrl()*/);
|
|
|
}
|
|
|
|
|
|
@@ -351,12 +332,13 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- * @param orderNo 华泰订单号
|
|
|
- * @param frameNo 车架号
|
|
|
- * @param customerInfoVo 车辆信息
|
|
|
- * @param huaTaiConfigureParameters 华泰配置参数
|
|
|
- * @return 核保请求参数
|
|
|
+ *
|
|
|
+ * @param yaQuoteInfoVo
|
|
|
+ * @param insAreaCompany
|
|
|
+ * @param huaTaiConfigureParameters
|
|
|
+ * @return
|
|
|
*/
|
|
|
public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo,insAreaCompany,huaTaiConfigureParameters);
|
|
|
@@ -492,11 +474,9 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
// 2. 组装请求体
|
|
|
HuaTaiSubmitStatusQueryRequest submitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest();
|
|
|
-// submitStatusQueryRequest.setProposalNo(insAreaCompany.getInsOrderNo());
|
|
|
submitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
|
|
|
HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(submitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
|
|
|
-// String underWriteInd = submitStatusQueryResponse.getUnderWriteInd();
|
|
|
String underWriteInd="";
|
|
|
// 3. 通过返回核保状态修改状态
|
|
|
if ("核保通过".equals(underWriteInd) || "自动核保".equals(underWriteInd)) {
|