|
@@ -2,18 +2,13 @@ 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.ydtech.constants.enums.InsuranceRisk;
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
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.exception.SystemException;
|
|
|
import com.ydtech.modules.fee.service.FeeRuleSchemeService;
|
|
import com.ydtech.modules.fee.service.FeeRuleSchemeService;
|
|
|
-import com.ydtech.modules.ins.model.request.Response;
|
|
|
|
|
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.zm.ZmCarModel;
|
|
|
|
|
-import com.ydtech.modules.ins.utils.CompressUtil;
|
|
|
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
import com.ydtech.modules.order.components.huatai.HuaTaiRequestApiComponents;
|
|
import com.ydtech.modules.order.components.huatai.HuaTaiRequestApiComponents;
|
|
|
import com.ydtech.modules.order.components.huatai.HuiTaiUploadImageComponents;
|
|
import com.ydtech.modules.order.components.huatai.HuiTaiUploadImageComponents;
|
|
@@ -22,24 +17,16 @@ 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.TaxArrears;
|
|
import com.ydtech.modules.order.entity.TaxArrears;
|
|
|
import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
|
|
import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
|
|
|
-import com.ydtech.modules.order.entity.api.huatai.request.HuaTaiQuotedPriceRequest;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiQuotedPriceResponse;
|
|
|
|
|
import com.ydtech.modules.order.entity.api.huatai.request.*;
|
|
import com.ydtech.modules.order.entity.api.huatai.request.*;
|
|
|
import com.ydtech.modules.order.entity.api.huatai.response.*;
|
|
import com.ydtech.modules.order.entity.api.huatai.response.*;
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.BaseRequestHead;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.SubmitStatus;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.request.ModelsQueryRequest;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.request.UploadImageRequest;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.response.ModelsQueryResponse;
|
|
|
|
|
-import com.ydtech.modules.order.entity.api.zhongmei.response.UploadImageResponse;
|
|
|
|
|
import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
|
|
import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
|
|
|
-import com.ydtech.modules.order.entity.config.ZmConfigureParameters;
|
|
|
|
|
import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
|
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.*;
|
|
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
|
|
|
import com.ydtech.modules.order.service.*;
|
|
import com.ydtech.modules.order.service.*;
|
|
|
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;
|
|
@@ -50,13 +37,11 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.core.ParameterizedTypeReference;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
-import java.time.LocalDate;
|
|
|
|
|
-import java.time.LocalDateTime;
|
|
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.Collections;
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -131,7 +116,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
List<HuaTaiModelsQueryResponse.CarModelDto> carModelDtos = huaTaiRequestApiComponents.modelQuery(huaTaiModelsQueryRequest, HuaTaiModelsQueryResponse.class);
|
|
List<HuaTaiModelsQueryResponse.CarModelDto> carModelDtos = huaTaiRequestApiComponents.modelQuery(huaTaiModelsQueryRequest, HuaTaiModelsQueryResponse.class);
|
|
|
|
|
|
|
|
List<HuaTaiModelsQueryResponse.CarModelDto.FullCarDataDto> fullCarDataDtos = new ArrayList<>();
|
|
List<HuaTaiModelsQueryResponse.CarModelDto.FullCarDataDto> fullCarDataDtos = new ArrayList<>();
|
|
|
- for(HuaTaiModelsQueryResponse.CarModelDto carModelDto : carModelDtos){
|
|
|
|
|
|
|
+ for (HuaTaiModelsQueryResponse.CarModelDto carModelDto : carModelDtos) {
|
|
|
fullCarDataDtos.add(carModelDto.getFullCarData());
|
|
fullCarDataDtos.add(carModelDto.getFullCarData());
|
|
|
}
|
|
}
|
|
|
// 2.2 过滤车型
|
|
// 2.2 过滤车型
|
|
@@ -141,17 +126,17 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
HuaTaiActualValueResponse actualValueResponse = null;
|
|
HuaTaiActualValueResponse actualValueResponse = null;
|
|
|
for (RiskInfoVo riskInfoVo : quoteInfo.getRiskList()) {
|
|
for (RiskInfoVo riskInfoVo : quoteInfo.getRiskList()) {
|
|
|
- if("0510".equals(riskInfoVo.getRiskCode())){
|
|
|
|
|
|
|
+ if ("0510".equals(riskInfoVo.getRiskCode())) {
|
|
|
String startDate = riskInfoVo.getStartDate();
|
|
String startDate = riskInfoVo.getStartDate();
|
|
|
- HuaTaiActualValueRequest huaTaiActualValueRequest = new HuaTaiActualValueRequest(carInfo,fullCarDataDto,startDate);
|
|
|
|
|
|
|
+ HuaTaiActualValueRequest huaTaiActualValueRequest = new HuaTaiActualValueRequest(carInfo, fullCarDataDto, startDate);
|
|
|
huaTaiActualValueRequest.setHead(baseRequestHead);
|
|
huaTaiActualValueRequest.setHead(baseRequestHead);
|
|
|
- actualValueResponse = huaTaiRequestApiComponents.actualValue(huaTaiActualValueRequest,HuaTaiActualValueResponse.class);
|
|
|
|
|
|
|
+ actualValueResponse = huaTaiRequestApiComponents.actualValue(huaTaiActualValueRequest, HuaTaiActualValueResponse.class);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3 组装报价参数
|
|
// 3 组装报价参数
|
|
|
- HuaTaiQuotedPriceRequest quotedPriceRequest = new HuaTaiQuotedPriceRequest(quoteInfo, fullCarDataDto,actualValueResponse, zmQuoteVo.getAccidentalDrivingVo(), huaTaiConfigureParameters);
|
|
|
|
|
|
|
+ HuaTaiQuotedPriceRequest quotedPriceRequest = new HuaTaiQuotedPriceRequest(quoteInfo, fullCarDataDto, actualValueResponse, zmQuoteVo.getAccidentalDrivingVo(), huaTaiConfigureParameters);
|
|
|
quotedPriceRequest.setHead(baseRequestHead);
|
|
quotedPriceRequest.setHead(baseRequestHead);
|
|
|
|
|
|
|
|
HuaTaiQuotedPriceResponse quotedPriceResponse = huaTaiRequestApiComponents.quotedPrice(quotedPriceRequest, HuaTaiQuotedPriceResponse.class);
|
|
HuaTaiQuotedPriceResponse quotedPriceResponse = huaTaiRequestApiComponents.quotedPrice(quotedPriceRequest, HuaTaiQuotedPriceResponse.class);
|
|
@@ -163,6 +148,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 转投保接口
|
|
* 转投保接口
|
|
|
|
|
+ *
|
|
|
* @param companyId 子订单号
|
|
* @param companyId 子订单号
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -175,7 +161,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
|
|
YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
|
|
|
|
|
|
|
|
// 2. 调用转投保接口
|
|
// 2. 调用转投保接口
|
|
|
- HuaTaiSubmitResponse response = submitForUnderwriting(yaQuoteInfoVo,insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
|
|
+ HuaTaiSubmitResponse response = submitForUnderwriting(yaQuoteInfoVo, insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 0 下发修改
|
|
* 0 下发修改
|
|
@@ -192,78 +178,78 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
String syStatus = "";
|
|
String syStatus = "";
|
|
|
StringBuffer jqNotion = new StringBuffer();
|
|
StringBuffer jqNotion = new StringBuffer();
|
|
|
StringBuffer syNotion = new StringBuffer();
|
|
StringBuffer syNotion = new StringBuffer();
|
|
|
- for(HuaTaiSubmitResponse.AppliResult appliResult:response.getAppliResult()){
|
|
|
|
|
|
|
+ for (HuaTaiSubmitResponse.AppliResult appliResult : response.getAppliResult()) {
|
|
|
appliResult.getStatus();
|
|
appliResult.getStatus();
|
|
|
- if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())) {
|
|
|
haveJQFlag = true;
|
|
haveJQFlag = true;
|
|
|
- if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
|
|
|
|
+ if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
|
|
|
jqStatus = appliResult.getStatus();
|
|
jqStatus = appliResult.getStatus();
|
|
|
- for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
|
|
|
- jqNotion.append(notion.getUWNotion()+",");
|
|
|
|
|
|
|
+ for (HuaTaiSubmitResponse.Notion notion : appliResult.getNotion()) {
|
|
|
|
|
+ jqNotion.append(notion.getUWNotion() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())) {
|
|
|
haveSYFlag = true;
|
|
haveSYFlag = true;
|
|
|
- if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
|
|
|
|
+ if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
|
|
|
syStatus = appliResult.getStatus();
|
|
syStatus = appliResult.getStatus();
|
|
|
- for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
|
|
|
- syNotion.append(notion.getUWNotion()+",");
|
|
|
|
|
|
|
+ for (HuaTaiSubmitResponse.Notion notion : appliResult.getNotion()) {
|
|
|
|
|
+ syNotion.append(notion.getUWNotion() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String totalStatus = "";
|
|
String totalStatus = "";
|
|
|
//同保交商
|
|
//同保交商
|
|
|
- if(haveJQFlag && haveSYFlag){
|
|
|
|
|
|
|
+ if (haveJQFlag && haveSYFlag) {
|
|
|
//自核通过 和 强制自核
|
|
//自核通过 和 强制自核
|
|
|
- if("4,7".contains(jqStatus) && "4,7".contains(syStatus)){
|
|
|
|
|
|
|
+ if ("4,7".contains(jqStatus) && "4,7".contains(syStatus)) {
|
|
|
totalStatus = "4";
|
|
totalStatus = "4";
|
|
|
}
|
|
}
|
|
|
//转人工和转复核
|
|
//转人工和转复核
|
|
|
- if("1,3".contains(jqStatus) || "1,3".contains(syStatus)){
|
|
|
|
|
|
|
+ if ("1,3".contains(jqStatus) || "1,3".contains(syStatus)) {
|
|
|
totalStatus = "1";
|
|
totalStatus = "1";
|
|
|
}
|
|
}
|
|
|
- if("0,6,7".contains(jqStatus) || "0,6,7".contains(syStatus)){
|
|
|
|
|
|
|
+ if ("0,6,7".contains(jqStatus) || "0,6,7".contains(syStatus)) {
|
|
|
totalStatus = "0";
|
|
totalStatus = "0";
|
|
|
}
|
|
}
|
|
|
- }else if((haveJQFlag && !haveSYFlag)||(!haveJQFlag && haveSYFlag)){//单保交强或单保商业
|
|
|
|
|
|
|
+ } else if ((haveJQFlag && !haveSYFlag) || (!haveJQFlag && haveSYFlag)) {//单保交强或单保商业
|
|
|
String status = jqStatus;
|
|
String status = jqStatus;
|
|
|
- if(StringUtils.isNotEmpty(syStatus)){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(syStatus)) {
|
|
|
status = syStatus;
|
|
status = syStatus;
|
|
|
}
|
|
}
|
|
|
- if("4,7".contains(status)){
|
|
|
|
|
|
|
+ if ("4,7".contains(status)) {
|
|
|
totalStatus = "4";
|
|
totalStatus = "4";
|
|
|
- }else if("1,3".contains(status)){
|
|
|
|
|
|
|
+ } else if ("1,3".contains(status)) {
|
|
|
totalStatus = "1";
|
|
totalStatus = "1";
|
|
|
- }else if("0,6,7".contains(status)){
|
|
|
|
|
|
|
+ } else if ("0,6,7".contains(status)) {
|
|
|
totalStatus = "0";
|
|
totalStatus = "0";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if("4".equals(totalStatus)){
|
|
|
|
|
|
|
+ if ("4".equals(totalStatus)) {
|
|
|
//再调用缴费接口获取缴费链接
|
|
//再调用缴费接口获取缴费链接
|
|
|
- String payUrl = getPaymentUrl(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
- if(StringUtils.isNotEmpty(payUrl)){
|
|
|
|
|
|
|
+ String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(payUrl)) {
|
|
|
insAreaCompany.setPaymentLink(payUrl);
|
|
insAreaCompany.setPaymentLink(payUrl);
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("核保成功");
|
|
return HttpResult.ok("核保成功");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.error("获取支付链接失败");
|
|
return HttpResult.error("获取支付链接失败");
|
|
|
}
|
|
}
|
|
|
- }else if("1".equals(totalStatus)){
|
|
|
|
|
|
|
+ } else if ("1".equals(totalStatus)) {
|
|
|
//再次调用提交核保接口
|
|
//再次调用提交核保接口
|
|
|
- HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany,huaTaiConfigureParameters,"1");
|
|
|
|
|
|
|
+ HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "1");
|
|
|
//根据核保返回信息进行更新
|
|
//根据核保返回信息进行更新
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.error("已转人工核保");
|
|
return HttpResult.error("已转人工核保");
|
|
|
- }else {
|
|
|
|
|
- String notion = jqNotion.toString()+syNotion.toString();
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String notion = jqNotion.toString() + syNotion.toString();
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.error(notion);
|
|
return HttpResult.error(notion);
|
|
@@ -281,18 +267,19 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
if (insUploadImagesDtoList.isEmpty()) {
|
|
if (insUploadImagesDtoList.isEmpty()) {
|
|
|
throw new SystemException("请检查影像是否上传了");
|
|
throw new SystemException("请检查影像是否上传了");
|
|
|
}
|
|
}
|
|
|
- HuaTaiUploadImageRequest request = new HuaTaiUploadImageRequest(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
|
|
+ HuaTaiUploadImageRequest request = new HuaTaiUploadImageRequest(insAreaCompany, huaTaiConfigureParameters);
|
|
|
request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
//调用华泰影像接口获取上传链接地址
|
|
//调用华泰影像接口获取上传链接地址
|
|
|
HuaTaiUploadImageResponse response = huaTaiRequestApiComponents.uploadImage(request, HuaTaiUploadImageResponse.class);
|
|
HuaTaiUploadImageResponse response = huaTaiRequestApiComponents.uploadImage(request, HuaTaiUploadImageResponse.class);
|
|
|
//爬虫方式进行图片上传
|
|
//爬虫方式进行图片上传
|
|
|
- huiTaiUploadImageComponents.uploadImage(response.getUrl(),insUploadImagesDtoList);
|
|
|
|
|
|
|
+ huiTaiUploadImageComponents.uploadImage(response.getUrl(), insUploadImagesDtoList);
|
|
|
return HttpResult.ok("上传文件成功");
|
|
return HttpResult.ok("上传文件成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 缴费查询
|
|
* 缴费查询
|
|
|
|
|
+ *
|
|
|
* @param companyId 子订单号
|
|
* @param companyId 子订单号
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -307,7 +294,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
return HttpResult.ok(InsOrderStatusEnum.ACCEPT_INSURANCE.getDesc());
|
|
return HttpResult.ok(InsOrderStatusEnum.ACCEPT_INSURANCE.getDesc());
|
|
|
}
|
|
}
|
|
|
// 2. 组装请求体
|
|
// 2. 组装请求体
|
|
|
- HuaTaiOrderStatusRequest orderStatusRequest = new HuaTaiOrderStatusRequest(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
|
|
+ HuaTaiOrderStatusRequest orderStatusRequest = new HuaTaiOrderStatusRequest(insAreaCompany, huaTaiConfigureParameters);
|
|
|
orderStatusRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
orderStatusRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
HuaTaiOrderStatusResponse orderStatusResponse = huaTaiRequestApiComponents.orderStatus(orderStatusRequest, HuaTaiOrderStatusResponse.class);
|
|
HuaTaiOrderStatusResponse orderStatusResponse = huaTaiRequestApiComponents.orderStatus(orderStatusRequest, HuaTaiOrderStatusResponse.class);
|
|
|
|
|
|
|
@@ -316,54 +303,55 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
String jqFailReason = "";
|
|
String jqFailReason = "";
|
|
|
String syFailReason = "";
|
|
String syFailReason = "";
|
|
|
List<HuaTaiOrderStatusResponse.PayDetaiDto> payDetaiList = orderStatusResponse.getPayDetaiList();
|
|
List<HuaTaiOrderStatusResponse.PayDetaiDto> payDetaiList = orderStatusResponse.getPayDetaiList();
|
|
|
- for(HuaTaiOrderStatusResponse.PayDetaiDto payDetai:payDetaiList){
|
|
|
|
|
|
|
+ for (HuaTaiOrderStatusResponse.PayDetaiDto payDetai : payDetaiList) {
|
|
|
insAreaCompany.getJqapplyno();
|
|
insAreaCompany.getJqapplyno();
|
|
|
//交强保单号存值
|
|
//交强保单号存值
|
|
|
- if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno()) && insAreaCompany.getJqapplyno().equals(payDetai.getBUSINESSNO())){
|
|
|
|
|
- if("1".equals(payDetai.getPOLICYSTATUS())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno()) && insAreaCompany.getJqapplyno().equals(payDetai.getBUSINESSNO())) {
|
|
|
|
|
+ if ("1".equals(payDetai.getPOLICYSTATUS())) {
|
|
|
jqExistFlag = true;
|
|
jqExistFlag = true;
|
|
|
insAreaCompany.setJqpolicyno(payDetai.getPOLICYNO());
|
|
insAreaCompany.setJqpolicyno(payDetai.getPOLICYNO());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
jqFailReason = payDetai.getFAILREASON();
|
|
jqFailReason = payDetai.getFAILREASON();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//商业保单号存值
|
|
//商业保单号存值
|
|
|
- if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(payDetai.getBUSINESSNO())){
|
|
|
|
|
- if("1".equals(payDetai.getPOLICYSTATUS())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(payDetai.getBUSINESSNO())) {
|
|
|
|
|
+ if ("1".equals(payDetai.getPOLICYSTATUS())) {
|
|
|
syExistFlag = true;
|
|
syExistFlag = true;
|
|
|
insAreaCompany.setSypolicyno(payDetai.getPOLICYNO());
|
|
insAreaCompany.setSypolicyno(payDetai.getPOLICYNO());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
syFailReason = payDetai.getFAILREASON();
|
|
syFailReason = payDetai.getFAILREASON();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(jqExistFlag||syExistFlag){
|
|
|
|
|
|
|
+ if (jqExistFlag || syExistFlag) {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("保单生成成功");
|
|
return HttpResult.ok("保单生成成功");
|
|
|
- }else{
|
|
|
|
|
- if(StringUtils.isNotEmpty(jqFailReason)||StringUtils.isNotEmpty(syFailReason)){
|
|
|
|
|
- return HttpResult.error("保单生成失败,原因为:"+jqFailReason+syFailReason);
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (StringUtils.isNotEmpty(jqFailReason) || StringUtils.isNotEmpty(syFailReason)) {
|
|
|
|
|
+ return HttpResult.error("保单生成失败,原因为:" + jqFailReason + syFailReason);
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("保单生成失败,华泰返回异常,请联系管理员排查!");
|
|
return HttpResult.error("保单生成失败,华泰返回异常,请联系管理员排查!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private String getPaymentUrl(InsAreaCompany insAreaCompany ,HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
|
|
|
|
+ private String getPaymentUrl(InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
String payUrl = "";
|
|
String payUrl = "";
|
|
|
- HuaTaiPaymentUrlRequest huaTaiPaymentUrlRequest = new HuaTaiPaymentUrlRequest(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
|
|
+ HuaTaiPaymentUrlRequest huaTaiPaymentUrlRequest = new HuaTaiPaymentUrlRequest(insAreaCompany, huaTaiConfigureParameters);
|
|
|
huaTaiPaymentUrlRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
huaTaiPaymentUrlRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
HuaTaiPaymentUrlResponse paymentUrlResponse = huaTaiRequestApiComponents.getPaymentUrl(huaTaiPaymentUrlRequest, HuaTaiPaymentUrlResponse.class);
|
|
HuaTaiPaymentUrlResponse paymentUrlResponse = huaTaiRequestApiComponents.getPaymentUrl(huaTaiPaymentUrlRequest, HuaTaiPaymentUrlResponse.class);
|
|
|
- if(StringUtils.isNotEmpty(paymentUrlResponse.getPayUrl())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(paymentUrlResponse.getPayUrl())) {
|
|
|
payUrl = paymentUrlResponse.getPayUrl();
|
|
payUrl = paymentUrlResponse.getPayUrl();
|
|
|
}
|
|
}
|
|
|
return payUrl;
|
|
return payUrl;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- *电子保单下载接口
|
|
|
|
|
|
|
+ * 电子保单下载接口
|
|
|
|
|
+ *
|
|
|
* @param policyPrintVo
|
|
* @param policyPrintVo
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -389,44 +377,43 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
HuaTaiInsurancePolicyPrintResponse response = huaTaiRequestApiComponents.insurancePolicyPrint(request, HuaTaiInsurancePolicyPrintResponse.class);
|
|
HuaTaiInsurancePolicyPrintResponse response = huaTaiRequestApiComponents.insurancePolicyPrint(request, HuaTaiInsurancePolicyPrintResponse.class);
|
|
|
CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
|
|
CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
|
|
|
- if("0".equals(response.getHead().getReturnCode())){
|
|
|
|
|
|
|
+ if ("0".equals(response.getHead().getReturnCode())) {
|
|
|
List<HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto> urlList = response.getElecDownLoadResultList();
|
|
List<HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto> urlList = response.getElecDownLoadResultList();
|
|
|
//接口文档与返回示例不一致,待联调后修改
|
|
//接口文档与返回示例不一致,待联调后修改
|
|
|
|
|
|
|
|
- if(urlList!=null && !urlList.isEmpty()){
|
|
|
|
|
- for(HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto elecDownLoadResultDto :urlList){
|
|
|
|
|
|
|
+ if (urlList != null && !urlList.isEmpty()) {
|
|
|
|
|
+ for (HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto elecDownLoadResultDto : urlList) {
|
|
|
String url = elecDownLoadResultDto.getDownURL();
|
|
String url = elecDownLoadResultDto.getDownURL();
|
|
|
if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
|
|
if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
|
|
|
- crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(url, licensePlate + "-交强险保单.pdf", licensePlate,password));
|
|
|
|
|
- crawlerPolicyPrintVo.setJqxFlagUrl(gainCarInsPolicy(url, licensePlate + "-交强险标志.pdf", licensePlate,password));
|
|
|
|
|
- }else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
|
|
|
- crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicy(url, licensePlate + "-商业险保单.pdf", licensePlate,password));
|
|
|
|
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(url, licensePlate + "-交强险保单.pdf", licensePlate, password));
|
|
|
|
|
+ crawlerPolicyPrintVo.setJqxFlagUrl(gainCarInsPolicy(url, licensePlate + "-交强险标志.pdf", licensePlate, password));
|
|
|
|
|
+ } else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicy(url, licensePlate + "-商业险保单.pdf", licensePlate, password));
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
|
* 先下载到本地,然后再解压到固定路径
|
|
* 先下载到本地,然后再解压到固定路径
|
|
|
*/
|
|
*/
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- return HttpResult.error("获取华泰电子保单失败:"+response.getRegistResult());
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return HttpResult.error("获取华泰电子保单失败:" + response.getRegistResult());
|
|
|
}
|
|
}
|
|
|
- return HttpResult.ok("下载成功",crawlerPolicyPrintVo);
|
|
|
|
|
|
|
+ return HttpResult.ok("下载成功", crawlerPolicyPrintVo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String gainCarInsPolicy(String url, String fileName, String licensePlate,String password) {
|
|
|
|
|
|
|
+ public String gainCarInsPolicy(String url, String fileName, String licensePlate, String password) {
|
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
|
- return FileUtil.netUrlStoreToLocal(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl,password,licensePlate);
|
|
|
|
|
|
|
+ return FileUtil.netUrlStoreToLocal(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl, password, licensePlate);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- *
|
|
|
|
|
* @param yaQuoteInfoVo
|
|
* @param yaQuoteInfoVo
|
|
|
* @param insAreaCompany
|
|
* @param insAreaCompany
|
|
|
* @param huaTaiConfigureParameters
|
|
* @param huaTaiConfigureParameters
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
|
|
- HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo,insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
|
|
+ public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
|
|
+ HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo, insAreaCompany, huaTaiConfigureParameters);
|
|
|
submitRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
submitRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
return huaTaiRequestApiComponents.submit(submitRequest, HuaTaiSubmitResponse.class);
|
|
return huaTaiRequestApiComponents.submit(submitRequest, HuaTaiSubmitResponse.class);
|
|
|
}
|
|
}
|
|
@@ -438,17 +425,17 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
double syDiscount = 0;
|
|
double syDiscount = 0;
|
|
|
String jqApplyNo = "";
|
|
String jqApplyNo = "";
|
|
|
String syApplyNo = "";
|
|
String syApplyNo = "";
|
|
|
- List<HuaTaiQuotedPriceResponse.ContractDto.CoverageDto> syCoverageDtoList =null;
|
|
|
|
|
|
|
+ List<HuaTaiQuotedPriceResponse.ContractDto.CoverageDto> syCoverageDtoList = null;
|
|
|
HuaTaiQuotedPriceResponse.ContractDto.TaxDto taxDto = null;
|
|
HuaTaiQuotedPriceResponse.ContractDto.TaxDto taxDto = null;
|
|
|
List<HuaTaiQuotedPriceResponse.ContractDto> contractDtoList = quotedPriceResponse.getBusinessData().getContract();
|
|
List<HuaTaiQuotedPriceResponse.ContractDto> contractDtoList = quotedPriceResponse.getBusinessData().getContract();
|
|
|
- for(HuaTaiQuotedPriceResponse.ContractDto contractDto:contractDtoList){
|
|
|
|
|
|
|
+ for (HuaTaiQuotedPriceResponse.ContractDto contractDto : contractDtoList) {
|
|
|
HuaTaiQuotedPriceResponse.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
|
|
HuaTaiQuotedPriceResponse.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
|
|
|
- if("1002".equals(contractMain.getRiskCode())){
|
|
|
|
|
|
|
+ if ("1002".equals(contractMain.getRiskCode())) {
|
|
|
taxDto = contractDto.getTax();
|
|
taxDto = contractDto.getTax();
|
|
|
jqDiscount = contractMain.getTotalAdjustRate();
|
|
jqDiscount = contractMain.getTotalAdjustRate();
|
|
|
jqPremium = contractMain.getTotalPremium();
|
|
jqPremium = contractMain.getTotalPremium();
|
|
|
jqApplyNo = contractMain.getContractNo();
|
|
jqApplyNo = contractMain.getContractNo();
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
syCoverageDtoList = contractDto.getCoverage();
|
|
syCoverageDtoList = contractDto.getCoverage();
|
|
|
syDiscount = contractMain.getTotalAdjustRate();
|
|
syDiscount = contractMain.getTotalAdjustRate();
|
|
|
syPremium = contractMain.getTotalPremium();
|
|
syPremium = contractMain.getTotalPremium();
|
|
@@ -460,7 +447,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
// 报价险种放入保费
|
|
// 报价险种放入保费
|
|
|
List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
|
|
|
|
|
|
- for(QuoteRiskRespVo quoteRiskRespVo:riskList1){
|
|
|
|
|
|
|
+ for (QuoteRiskRespVo quoteRiskRespVo : riskList1) {
|
|
|
if (InsuranceRisk.TRAFFIC.getCode().equals(quoteRiskRespVo.getRiskCode())) {
|
|
if (InsuranceRisk.TRAFFIC.getCode().equals(quoteRiskRespVo.getRiskCode())) {
|
|
|
quoteRespVo.setStartDateJq(quoteRiskRespVo.getStartDate());
|
|
quoteRespVo.setStartDateJq(quoteRiskRespVo.getStartDate());
|
|
|
quoteRespVo.setEndDateJq(quoteRiskRespVo.getEndDate());
|
|
quoteRespVo.setEndDateJq(quoteRiskRespVo.getEndDate());
|
|
@@ -501,7 +488,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
double sumPayTax = 0;
|
|
double sumPayTax = 0;
|
|
|
if (!ObjectUtils.isEmpty(taxDto)) {
|
|
if (!ObjectUtils.isEmpty(taxDto)) {
|
|
|
- sumPayTax = taxDto.getSumTax();
|
|
|
|
|
|
|
+ sumPayTax = taxDto.getSumTax();
|
|
|
}
|
|
}
|
|
|
quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
|
|
quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
|
|
|
quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax));//保费合计
|
|
quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax));//保费合计
|
|
@@ -523,22 +510,22 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
List<HuaTaiQuotedPriceResponse.ContractDto> contractDtoList = quotedPriceResponse.getBusinessData().getContract();
|
|
List<HuaTaiQuotedPriceResponse.ContractDto> contractDtoList = quotedPriceResponse.getBusinessData().getContract();
|
|
|
String jqQuerySequenceNo = " ";
|
|
String jqQuerySequenceNo = " ";
|
|
|
String syQuerySequenceNo = " ";
|
|
String syQuerySequenceNo = " ";
|
|
|
- for(HuaTaiQuotedPriceResponse.ContractDto contractDto:contractDtoList) {
|
|
|
|
|
|
|
+ for (HuaTaiQuotedPriceResponse.ContractDto contractDto : contractDtoList) {
|
|
|
HuaTaiQuotedPriceResponse.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
|
|
HuaTaiQuotedPriceResponse.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
|
|
|
HuaTaiQuotedPriceResponse.ContractDto.PlatFormMessageDto platFormMessageDto = contractDto.getPlatFormMessage();
|
|
HuaTaiQuotedPriceResponse.ContractDto.PlatFormMessageDto platFormMessageDto = contractDto.getPlatFormMessage();
|
|
|
if ("1002".equals(contractMain.getRiskCode())) {
|
|
if ("1002".equals(contractMain.getRiskCode())) {
|
|
|
jqQuerySequenceNo = platFormMessageDto.getQuerySequenceNo();
|
|
jqQuerySequenceNo = platFormMessageDto.getQuerySequenceNo();
|
|
|
taxDto = contractDto.getTax();
|
|
taxDto = contractDto.getTax();
|
|
|
// 车船税
|
|
// 车船税
|
|
|
- TaxArrears taxArrears = new TaxArrears("往年欠税",taxDto.getSumTaxDefault(), taxDto.getSumOverdue());
|
|
|
|
|
|
|
+ TaxArrears taxArrears = new TaxArrears("往年欠税", taxDto.getSumTaxDefault(), taxDto.getSumOverdue());
|
|
|
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)));
|
|
|
quoteRespVo.setTaxArrears(taxArrearsList);
|
|
quoteRespVo.setTaxArrears(taxArrearsList);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
syQuerySequenceNo = platFormMessageDto.getQuerySequenceNo();
|
|
syQuerySequenceNo = platFormMessageDto.getQuerySequenceNo();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- insAreaCompany.setInsOrderNo(jqQuerySequenceNo+"-"+syQuerySequenceNo);
|
|
|
|
|
|
|
+ insAreaCompany.setInsOrderNo(jqQuerySequenceNo + "-" + syQuerySequenceNo);
|
|
|
quoteRespVo.setCompanyId(insAreaCompany.getId());
|
|
quoteRespVo.setCompanyId(insAreaCompany.getId());
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok(quotedPriceResponse.getHead().getReturnMessage(), quoteRespVo);
|
|
return HttpResult.ok(quotedPriceResponse.getHead().getReturnMessage(), quoteRespVo);
|
|
@@ -546,6 +533,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 提交核保及查询核保状态接口
|
|
* 提交核保及查询核保状态接口
|
|
|
|
|
+ *
|
|
|
* @param companyId
|
|
* @param companyId
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -566,23 +554,23 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
String syStatus = "";
|
|
String syStatus = "";
|
|
|
StringBuffer jqNotion = new StringBuffer();
|
|
StringBuffer jqNotion = new StringBuffer();
|
|
|
StringBuffer syNotion = new StringBuffer();
|
|
StringBuffer syNotion = new StringBuffer();
|
|
|
- HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany,huaTaiConfigureParameters,"2");
|
|
|
|
|
- for(HuaTaiSubmitStatusQueryResponse.AppliResult appliResult:submitStatusQueryResponse.getAppliResult()){
|
|
|
|
|
- if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
|
|
|
|
|
|
|
+ HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "2");
|
|
|
|
|
+ for (HuaTaiSubmitStatusQueryResponse.AppliResult appliResult : submitStatusQueryResponse.getAppliResult()) {
|
|
|
|
|
+ if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())) {
|
|
|
haveJQFlag = true;
|
|
haveJQFlag = true;
|
|
|
- if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
|
|
|
|
+ if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
|
|
|
jqStatus = appliResult.getUnderWriteFlag();
|
|
jqStatus = appliResult.getUnderWriteFlag();
|
|
|
- for(HuaTaiSubmitStatusQueryResponse.Notion notion:appliResult.getNotion()){
|
|
|
|
|
- jqNotion.append(notion.getUWNotion()+",");
|
|
|
|
|
|
|
+ for (HuaTaiSubmitStatusQueryResponse.Notion notion : appliResult.getNotion()) {
|
|
|
|
|
+ jqNotion.append(notion.getUWNotion() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())) {
|
|
|
haveSYFlag = true;
|
|
haveSYFlag = true;
|
|
|
- if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
|
|
|
|
+ if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
|
|
|
syStatus = appliResult.getUnderWriteFlag();
|
|
syStatus = appliResult.getUnderWriteFlag();
|
|
|
- for(HuaTaiSubmitStatusQueryResponse.Notion notion:appliResult.getNotion()){
|
|
|
|
|
- syNotion.append(notion.getUWNotion()+",");
|
|
|
|
|
|
|
+ for (HuaTaiSubmitStatusQueryResponse.Notion notion : appliResult.getNotion()) {
|
|
|
|
|
+ syNotion.append(notion.getUWNotion() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -598,68 +586,69 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
String totalUnderWriteInd = "";
|
|
String totalUnderWriteInd = "";
|
|
|
//同保交商
|
|
//同保交商
|
|
|
- if(haveJQFlag && haveSYFlag){
|
|
|
|
|
|
|
+ if (haveJQFlag && haveSYFlag) {
|
|
|
//已通过核保未实收
|
|
//已通过核保未实收
|
|
|
- if("8".contains(jqStatus) && "8".contains(syStatus)){
|
|
|
|
|
|
|
+ if ("8".contains(jqStatus) && "8".contains(syStatus)) {
|
|
|
totalUnderWriteInd = "8";
|
|
totalUnderWriteInd = "8";
|
|
|
- }else if("1".contains(jqStatus) || "1".contains(syStatus)){
|
|
|
|
|
|
|
+ } else if ("1".contains(jqStatus) || "1".contains(syStatus)) {
|
|
|
totalUnderWriteInd = "1";
|
|
totalUnderWriteInd = "1";
|
|
|
- }else if("9".contains(jqStatus) || "9".contains(syStatus)){
|
|
|
|
|
|
|
+ } else if ("9".contains(jqStatus) || "9".contains(syStatus)) {
|
|
|
totalUnderWriteInd = "9";
|
|
totalUnderWriteInd = "9";
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
totalUnderWriteInd = "6";
|
|
totalUnderWriteInd = "6";
|
|
|
}
|
|
}
|
|
|
- }else if((haveJQFlag && !haveSYFlag)||(!haveJQFlag && haveSYFlag)){//单保交强或单保商业
|
|
|
|
|
|
|
+ } else if ((haveJQFlag && !haveSYFlag) || (!haveJQFlag && haveSYFlag)) {//单保交强或单保商业
|
|
|
String status = jqStatus;
|
|
String status = jqStatus;
|
|
|
- if(StringUtils.isNotEmpty(syStatus)){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(syStatus)) {
|
|
|
status = syStatus;
|
|
status = syStatus;
|
|
|
}
|
|
}
|
|
|
- if("8".contains(status)){
|
|
|
|
|
|
|
+ if ("8".contains(status)) {
|
|
|
totalUnderWriteInd = "8";
|
|
totalUnderWriteInd = "8";
|
|
|
- }else if("1".contains(status)){
|
|
|
|
|
|
|
+ } else if ("1".contains(status)) {
|
|
|
totalUnderWriteInd = "1";
|
|
totalUnderWriteInd = "1";
|
|
|
- }else if("9".contains(status)){
|
|
|
|
|
|
|
+ } else if ("9".contains(status)) {
|
|
|
totalUnderWriteInd = "9";
|
|
totalUnderWriteInd = "9";
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
totalUnderWriteInd = "6";
|
|
totalUnderWriteInd = "6";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- String underWriteInd="";
|
|
|
|
|
|
|
+ String underWriteInd = "";
|
|
|
// 3. 通过返回核保状态修改状态
|
|
// 3. 通过返回核保状态修改状态
|
|
|
if ("8".equals(totalUnderWriteInd)) {
|
|
if ("8".equals(totalUnderWriteInd)) {
|
|
|
//再调用缴费接口获取缴费链接
|
|
//再调用缴费接口获取缴费链接
|
|
|
- String payUrl = getPaymentUrl(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
- if(StringUtils.isNotEmpty(payUrl)){
|
|
|
|
|
|
|
+ String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(payUrl)) {
|
|
|
insAreaCompany.setPaymentLink(payUrl);
|
|
insAreaCompany.setPaymentLink(payUrl);
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("核保成功");
|
|
return HttpResult.ok("核保成功");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.error("获取支付链接失败");
|
|
return HttpResult.error("获取支付链接失败");
|
|
|
}
|
|
}
|
|
|
- }else if("6".equals(underWriteInd)){//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
- String notion = jqNotion.toString()+syNotion.toString();
|
|
|
|
|
|
|
+ } else if ("6".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
+ String notion = jqNotion.toString() + syNotion.toString();
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- return HttpResult.error("核保不通过:"+notion);//需要处理放入核保原因
|
|
|
|
|
- }else if("9".equals(underWriteInd)){//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
|
|
+ return HttpResult.error("核保不通过:" + notion);//需要处理放入核保原因
|
|
|
|
|
+ } else if ("9".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
|
|
|
return HttpResult.ok("正在核保中");//需要处理放入核保原因
|
|
return HttpResult.ok("正在核保中");//需要处理放入核保原因
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.ok(underWriteInd);
|
|
return HttpResult.ok(underWriteInd);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 提交核保或核保查询接口
|
|
* 提交核保或核保查询接口
|
|
|
|
|
+ *
|
|
|
* @param insAreaCompany
|
|
* @param insAreaCompany
|
|
|
* @param huaTaiConfigureParameters
|
|
* @param huaTaiConfigureParameters
|
|
|
- * @param operateType 1为提交 2为查询
|
|
|
|
|
|
|
+ * @param operateType 1为提交 2为查询
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private HuaTaiSubmitStatusQueryResponse submitStatus(InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters,String operateType){
|
|
|
|
|
- HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany,huaTaiConfigureParameters,operateType);
|
|
|
|
|
|
|
+ private HuaTaiSubmitStatusQueryResponse submitStatus(InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters, String operateType) {
|
|
|
|
|
+ HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany, huaTaiConfigureParameters, operateType);
|
|
|
huaTaiSubmitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
huaTaiSubmitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(huaTaiSubmitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
|
|
HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(huaTaiSubmitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
|
|
|
return submitStatusQueryResponse;
|
|
return submitStatusQueryResponse;
|