|
@@ -13,8 +13,10 @@ 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.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.constants.InsuranceTypeCorrespondence;
|
|
import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
|
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
@@ -24,13 +26,18 @@ import com.ydtech.modules.order.entity.api.huatai.request.HuaTaiQuotedPriceReque
|
|
|
import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiQuotedPriceResponse;
|
|
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.TimeConstants;
|
|
|
import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.SubmitStatus;
|
|
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.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.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.config.ZmConfigureParameters;
|
|
|
|
|
+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.*;
|
|
|
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;
|
|
@@ -71,6 +78,8 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
private final InsFeeOrderService insFeeOrderService;
|
|
private final InsFeeOrderService insFeeOrderService;
|
|
|
|
|
|
|
|
|
|
+ private final HuiTaiUploadImageComponents huiTaiUploadImageComponents;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Value("${upload.file.path}")
|
|
@Value("${upload.file.path}")
|
|
|
private String uploadFilePath;
|
|
private String uploadFilePath;
|
|
@@ -81,10 +90,15 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
@Value("${api.url}")
|
|
@Value("${api.url}")
|
|
|
private String apiUrl;
|
|
private String apiUrl;
|
|
|
|
|
|
|
|
- public HuaTaiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService,
|
|
|
|
|
|
|
+ public HuaTaiOrderApiServiceImpl(InsOrdersService insOrdersService,
|
|
|
|
|
+ InsAreaCompanyService insAreaCompanyService,
|
|
|
|
|
+ InsTaskImagesService insTaskImagesService,
|
|
|
HuaTaiRequestApiComponents huaTaiRequestApiComponents,
|
|
HuaTaiRequestApiComponents huaTaiRequestApiComponents,
|
|
|
- ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,
|
|
|
|
|
- FeeRuleSchemeService feeRuleSchemeService, InsFeeOrderService insFeeOrderService) {
|
|
|
|
|
|
|
+ ConfigureParametersComponents configureParametersComponents,
|
|
|
|
|
+ PtlAgreementAttributionService ptlAgreementAttributionService,
|
|
|
|
|
+ FeeRuleSchemeService feeRuleSchemeService,
|
|
|
|
|
+ InsFeeOrderService insFeeOrderService,
|
|
|
|
|
+ HuiTaiUploadImageComponents huiTaiUploadImageComponents) {
|
|
|
this.insOrdersService = insOrdersService;
|
|
this.insOrdersService = insOrdersService;
|
|
|
this.insAreaCompanyService = insAreaCompanyService;
|
|
this.insAreaCompanyService = insAreaCompanyService;
|
|
|
this.insTaskImagesService = insTaskImagesService;
|
|
this.insTaskImagesService = insTaskImagesService;
|
|
@@ -93,6 +107,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
|
this.feeRuleSchemeService = feeRuleSchemeService;
|
|
this.feeRuleSchemeService = feeRuleSchemeService;
|
|
|
this.insFeeOrderService = insFeeOrderService;
|
|
this.insFeeOrderService = insFeeOrderService;
|
|
|
|
|
+ this.huiTaiUploadImageComponents = huiTaiUploadImageComponents;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -183,7 +198,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
jqStatus = appliResult.getStatus();
|
|
jqStatus = appliResult.getStatus();
|
|
|
for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
|
- jqNotion.append(notion.getUWResult()+",");
|
|
|
|
|
|
|
+ jqNotion.append(notion.getUWNotion()+",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -192,7 +207,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
|
|
|
syStatus = appliResult.getStatus();
|
|
syStatus = appliResult.getStatus();
|
|
|
for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
|
|
|
- syNotion.append(notion.getUWResult()+",");
|
|
|
|
|
|
|
+ syNotion.append(notion.getUWNotion()+",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -256,6 +271,20 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 协议id获取配置实体
|
|
|
|
|
+ HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
|
|
|
+ InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+ List<InsUploadImagesDto> insUploadImagesDtoList = insTaskImagesService.findImageByOrderNo(insOrders.getOrderno());
|
|
|
|
|
+ if (insUploadImagesDtoList.isEmpty()) {
|
|
|
|
|
+ throw new SystemException("请检查影像是否上传了");
|
|
|
|
|
+ }
|
|
|
|
|
+ HuaTaiUploadImageRequest request = new HuaTaiUploadImageRequest(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
+ request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
|
|
+ HuaTaiUploadImageResponse response = huaTaiRequestApiComponents.uploadImage(request, HuaTaiUploadImageResponse.class);
|
|
|
|
|
+ response.getUrl();
|
|
|
|
|
+ huiTaiUploadImageComponents.uploadImage(response.getUrl(),insUploadImagesDtoList);
|
|
|
return HttpResult.ok("上传文件成功");
|
|
return HttpResult.ok("上传文件成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -275,13 +304,48 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
if (insAreaCompany.getOrderstatus().equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
|
|
if (insAreaCompany.getOrderstatus().equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
|
|
|
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);
|
|
|
- return HttpResult.ok("");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ boolean jqExistFlag = false;
|
|
|
|
|
+ boolean syExistFlag = false;
|
|
|
|
|
+ String jqFailReason = "";
|
|
|
|
|
+ String syFailReason = "";
|
|
|
|
|
+ List<HuaTaiOrderStatusResponse.PayDetaiDto> payDetaiList = orderStatusResponse.getPayDetaiList();
|
|
|
|
|
+ for(HuaTaiOrderStatusResponse.PayDetaiDto payDetai:payDetaiList){
|
|
|
|
|
+ insAreaCompany.getJqapplyno();
|
|
|
|
|
+ //交强保单号存值
|
|
|
|
|
+ if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno()) && insAreaCompany.getJqapplyno().equals(payDetai.getBUSINESSNO())){
|
|
|
|
|
+ if("1".equals(payDetai.getPOLICYSTATUS())){
|
|
|
|
|
+ jqExistFlag = true;
|
|
|
|
|
+ insAreaCompany.setJqpolicyno(payDetai.getPOLICYNO());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ jqFailReason = payDetai.getFAILREASON();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //商业保单号存值
|
|
|
|
|
+ if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(payDetai.getBUSINESSNO())){
|
|
|
|
|
+ if("1".equals(payDetai.getPOLICYSTATUS())){
|
|
|
|
|
+ syExistFlag = true;
|
|
|
|
|
+ insAreaCompany.setSypolicyno(payDetai.getPOLICYNO());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ syFailReason = payDetai.getFAILREASON();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(jqExistFlag||syExistFlag){
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("保单生成成功");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(StringUtils.isNotEmpty(jqFailReason)||StringUtils.isNotEmpty(syFailReason)){
|
|
|
|
|
+ return HttpResult.error("保单生成失败,原因为:"+jqFailReason+syFailReason);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return HttpResult.error("保单生成失败,华泰返回异常,请联系管理员排查!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -306,51 +370,54 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getById(policyPrintVo.getCompanyId());
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getById(policyPrintVo.getCompanyId());
|
|
|
// 1. 协议id获取配置实体
|
|
// 1. 协议id获取配置实体
|
|
|
HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
|
- InsOrders order = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
- String policyNo;
|
|
|
|
|
|
|
+ InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+ String licensePlate = insOrders.getLicenseno();
|
|
|
|
|
+ YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
|
|
|
|
|
+ String password = yaQuoteInfoVo.getInsuredPersonInfo().getIdentifyNumber();
|
|
|
String riskCode = policyPrintVo.getRiskCode();
|
|
String riskCode = policyPrintVo.getRiskCode();
|
|
|
|
|
+ // 2. 组装请求体
|
|
|
|
|
+ HuaTaiInsurancePolicyPrintRequest request = new HuaTaiInsurancePolicyPrintRequest();
|
|
|
if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
|
|
if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
|
|
|
- policyNo = insAreaCompany.getJqpolicyno();
|
|
|
|
|
|
|
+ request.setBusinessNo(insAreaCompany.getJqpolicyno());
|
|
|
} else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
} else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
|
- policyNo = insAreaCompany.getJqpolicyno();
|
|
|
|
|
|
|
+ request.setBusinessNo(insAreaCompany.getSypolicyno());
|
|
|
} else {
|
|
} else {
|
|
|
throw new SystemException("险种代码不存在");
|
|
throw new SystemException("险种代码不存在");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 2. 组装请求体
|
|
|
|
|
- HuaTaiInsurancePolicyPrintRequest request = new HuaTaiInsurancePolicyPrintRequest();
|
|
|
|
|
- request.setBusinessNo(policyNo);
|
|
|
|
|
|
|
+ request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
HuaTaiInsurancePolicyPrintResponse response = huaTaiRequestApiComponents.insurancePolicyPrint(request, HuaTaiInsurancePolicyPrintResponse.class);
|
|
HuaTaiInsurancePolicyPrintResponse response = huaTaiRequestApiComponents.insurancePolicyPrint(request, HuaTaiInsurancePolicyPrintResponse.class);
|
|
|
- if("0000".equals(response.getRegistResult())){
|
|
|
|
|
- List<String> urlList = response.getElecDownLoadResultList();
|
|
|
|
|
|
|
+ List<String> transferUrlList = new ArrayList<>();
|
|
|
|
|
+ if("0".equals(response.getHead().getReturnCode())){
|
|
|
|
|
+ List<HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto> urlList = response.getElecDownLoadResultList();
|
|
|
//接口文档与返回示例不一致,待联调后修改
|
|
//接口文档与返回示例不一致,待联调后修改
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- /* 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);
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+ if(urlList!=null && !urlList.isEmpty()){
|
|
|
|
|
+ for(HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto elecDownLoadResultDto :urlList){
|
|
|
|
|
+ String url = elecDownLoadResultDto.getDownURL();
|
|
|
|
|
+ String templateName = "";
|
|
|
|
|
+ if("1".equals(policyPrintVo.getType())){
|
|
|
|
|
+ templateName = "-交强险标志.pdf";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
|
|
|
|
|
+ templateName = "-交强险保单.pdf";
|
|
|
|
|
+ }else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
|
|
|
+ templateName = "-商业险保单.pdf";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, licensePlate,password);
|
|
|
|
|
+ transferUrlList.add(transferUrl) ;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
return HttpResult.error("获取华泰电子保单失败:"+response.getRegistResult());
|
|
return HttpResult.error("获取华泰电子保单失败:"+response.getRegistResult());
|
|
|
}
|
|
}
|
|
|
- return HttpResult.ok("下载成功"/*, response.getDownloadUrl()*/);
|
|
|
|
|
|
|
+ return HttpResult.ok("下载成功",transferUrlList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String gainCarInsPolicy(String url, String fileName, String licensePlate) {
|
|
|
|
|
|
|
+ public String gainCarInsPolicy(String url, String fileName, String licensePlate,String password) {
|
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
String dir = "carInsPolicy/" + licensePlate + "/";
|
|
|
|
|
+ String newFilePath = FileUtil.netUrlStoreToLocal(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
|
|
+ CompressUtil.unZip(newFilePath,dir+licensePlate,password);
|
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -363,7 +430,6 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo,insAreaCompany,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);
|
|
|
}
|
|
}
|
|
@@ -392,9 +458,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
syApplyNo = contractMain.getContractNo();
|
|
syApplyNo = contractMain.getContractNo();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
|
-
|
|
|
|
|
List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
|
// 报价险种放入保费
|
|
// 报价险种放入保费
|
|
|
List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
@@ -429,7 +493,6 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
kindList1.add(kind);
|
|
kindList1.add(kind);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
quoteRespVo.setRiskList(riskList1);
|
|
quoteRespVo.setRiskList(riskList1);
|
|
|
quoteRespVo.setKindList(kindList1);
|
|
quoteRespVo.setKindList(kindList1);
|
|
|
quoteRespVo.setJqPremium(jqPremium);
|
|
quoteRespVo.setJqPremium(jqPremium);
|
|
@@ -491,7 +554,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> auditStatusQuery(String companyId) {
|
|
public HttpResult<Object> auditStatusQuery(String companyId) {
|
|
|
- InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
|
|
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
|
|
|
// 1. 协议id获取配置实体
|
|
// 1. 协议id获取配置实体
|
|
|
HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
|
|
|
|
|
|
|
@@ -527,17 +590,65 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 0 初始状态默认值
|
|
|
|
|
+ * 1 已通过核保已实收
|
|
|
|
|
+ * 2 待修改
|
|
|
|
|
+ * 4 主动撤回(出单员撤回)
|
|
|
|
|
+ * 6 下发修改(核保员下发)
|
|
|
|
|
+ * 8 已通过核保未实收
|
|
|
|
|
+ * 9 待核保
|
|
|
|
|
+ */
|
|
|
|
|
+ String totalUnderWriteInd = "";
|
|
|
|
|
+ //同保交商
|
|
|
|
|
+ if(haveJQFlag && haveSYFlag){
|
|
|
|
|
+ //已通过核保未实收
|
|
|
|
|
+ if("8".contains(jqStatus) && "8".contains(syStatus)){
|
|
|
|
|
+ totalUnderWriteInd = "8";
|
|
|
|
|
+ }else if("1".contains(jqStatus) || "1".contains(syStatus)){
|
|
|
|
|
+ totalUnderWriteInd = "1";
|
|
|
|
|
+ }else if("9".contains(jqStatus) || "9".contains(syStatus)){
|
|
|
|
|
+ totalUnderWriteInd = "9";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ totalUnderWriteInd = "6";
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if((haveJQFlag && !haveSYFlag)||(!haveJQFlag && haveSYFlag)){//单保交强或单保商业
|
|
|
|
|
+ String status = jqStatus;
|
|
|
|
|
+ if(StringUtils.isNotEmpty(syStatus)){
|
|
|
|
|
+ status = syStatus;
|
|
|
|
|
+ }
|
|
|
|
|
+ if("8".contains(status)){
|
|
|
|
|
+ totalUnderWriteInd = "8";
|
|
|
|
|
+ }else if("1".contains(status)){
|
|
|
|
|
+ totalUnderWriteInd = "1";
|
|
|
|
|
+ }else if("9".contains(status)){
|
|
|
|
|
+ totalUnderWriteInd = "9";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ totalUnderWriteInd = "6";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
String underWriteInd="";
|
|
String underWriteInd="";
|
|
|
// 3. 通过返回核保状态修改状态
|
|
// 3. 通过返回核保状态修改状态
|
|
|
- if ("核保通过".equals(underWriteInd) || "自动核保".equals(underWriteInd)) {
|
|
|
|
|
-// insAreaCompany.setPaymentLink(submitStatusQueryResponse.getPayUrl());//需要调用接口获取支付链接
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());//当核保状态返回核保通过时,调整保单状态为已核保待缴费
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.ok(underWriteInd);
|
|
|
|
|
- }else if("核保不通过".equals(underWriteInd)){//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
|
|
+ if ("8".equals(totalUnderWriteInd)) {
|
|
|
|
|
+ //再调用缴费接口获取缴费链接
|
|
|
|
|
+ String payUrl = getPaymentUrl(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
+ if(StringUtils.isNotEmpty(payUrl)){
|
|
|
|
|
+ insAreaCompany.setPaymentLink(payUrl);
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("核保成功");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.error("获取支付链接失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }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("核保不通过:"/*+submitStatusQueryResponse.getIssuedReason()*/);//需要处理放入核保原因
|
|
|
|
|
|
|
+ return HttpResult.error("核保不通过:"+notion);//需要处理放入核保原因
|
|
|
|
|
+ }else if("9".equals(underWriteInd)){//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
+ return HttpResult.ok("正在核保中");//需要处理放入核保原因
|
|
|
}else {
|
|
}else {
|
|
|
return HttpResult.ok(underWriteInd);
|
|
return HttpResult.ok(underWriteInd);
|
|
|
}
|
|
}
|