|
@@ -19,6 +19,7 @@ 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.zm.constants.InsuranceTypeCorrespondence;
|
|
import com.ydtech.modules.order.entity.api.zm.constants.InsuranceTypeCorrespondence;
|
|
|
import com.ydtech.modules.order.entity.api.zm.constants.enums.AuditStatusEnum;
|
|
import com.ydtech.modules.order.entity.api.zm.constants.enums.AuditStatusEnum;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.zm.constants.enums.DocumentTypeEnum;
|
|
|
import com.ydtech.modules.order.entity.api.zm.request.*;
|
|
import com.ydtech.modules.order.entity.api.zm.request.*;
|
|
|
|
|
|
|
|
import com.ydtech.modules.order.entity.api.zm.response.*;
|
|
import com.ydtech.modules.order.entity.api.zm.response.*;
|
|
@@ -115,18 +116,27 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
JSONObject ownerinfo = insOrders.getOwnerinfo();
|
|
JSONObject ownerinfo = insOrders.getOwnerinfo();
|
|
|
CustomerInfoVo customerInfoVo = JSON.toJavaObject(ownerinfo, CustomerInfoVo.class);
|
|
CustomerInfoVo customerInfoVo = JSON.toJavaObject(ownerinfo, CustomerInfoVo.class);
|
|
|
// 第二次 提交核保
|
|
// 第二次 提交核保
|
|
|
- SubmitResponse response = submitForUnderwriting(insAreaCompany.getInsOrderNo(), insOrders.getFrameno(), customerInfoVo);
|
|
|
|
|
- zhongmeiRequestApiComponents.validationResults(response);
|
|
|
|
|
- // 投保单号
|
|
|
|
|
- insAreaCompany.setPaymentLink(response.getPayUrl());
|
|
|
|
|
- insAreaCompany.setJqapplyno(response.getForceProposalNo());
|
|
|
|
|
- insAreaCompany.setSyapplyno(response.getBizProposalNo());
|
|
|
|
|
- insAreaCompany.setJyapplyno(response.getAccidentProposalNo());
|
|
|
|
|
- insAreaCompany.setInsOrderNo(response.getProposalNo());
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatus.S_2.getCode()); // 2
|
|
|
|
|
|
|
+ SubmitResponse response = submitForUnderwriting(insAreaCompany.getId(), insOrders.getFrameno(), customerInfoVo);
|
|
|
|
|
+ HttpResult httpResult;
|
|
|
|
|
+ // 人工核保
|
|
|
|
|
+ if (response.getHead().getReturnMessage().indexOf(InsuranceTypeCorrespondence.MANUAL_UNDERWRITING) > 0) {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatus.S_1.getCode());
|
|
|
|
|
+ httpResult = HttpResult.error(response.getHead().getReturnMessage());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ zhongmeiRequestApiComponents.validationResults(response);
|
|
|
|
|
+ // 投保单号
|
|
|
|
|
+ insAreaCompany.setPaymentLink(response.getPayUrl());
|
|
|
|
|
+ insAreaCompany.setJqapplyno(response.getForceProposalNo());
|
|
|
|
|
+ insAreaCompany.setSyapplyno(response.getBizProposalNo());
|
|
|
|
|
+ insAreaCompany.setJyapplyno(response.getAccidentProposalNo());
|
|
|
|
|
+ insAreaCompany.setInsOrderNo(response.getProposalNo());
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatus.S_2.getCode());
|
|
|
|
|
+ httpResult = HttpResult.ok("核保成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
|
insOrdersService.updateByOrderStatus(insAreaCompany.getOrderno(), insAreaCompany.getOrderstatus());
|
|
insOrdersService.updateByOrderStatus(insAreaCompany.getOrderno(), insAreaCompany.getOrderstatus());
|
|
|
- return HttpResult.ok("核保成功");
|
|
|
|
|
|
|
+ return httpResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -136,6 +146,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
// 投保单号(总)
|
|
// 投保单号(总)
|
|
|
String insOrderNo = insAreaCompany.getInsOrderNo();
|
|
String insOrderNo = insAreaCompany.getInsOrderNo();
|
|
|
List<InsTaskImage> insTaskImages = insTaskImageService.selectByTaskId(insOrders.getQuoteno());
|
|
List<InsTaskImage> insTaskImages = insTaskImageService.selectByTaskId(insOrders.getQuoteno());
|
|
|
|
|
+ if(insTaskImages.size() == 0){
|
|
|
|
|
+ throw new SystemException("请检查影像是否上传了");
|
|
|
|
|
+ }
|
|
|
UploadImageRequest request = new UploadImageRequest(insTaskImages, insOrderNo);
|
|
UploadImageRequest request = new UploadImageRequest(insTaskImages, insOrderNo);
|
|
|
zhongmeiRequestApiComponents.uploadImage(request, UploadImageResponse.class);
|
|
zhongmeiRequestApiComponents.uploadImage(request, UploadImageResponse.class);
|
|
|
return HttpResult.ok("上传文件成功");
|
|
return HttpResult.ok("上传文件成功");
|
|
@@ -168,13 +181,13 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
// 主投保单号
|
|
// 主投保单号
|
|
|
String contractNo = approvedRequest.getContractNo();
|
|
String contractNo = approvedRequest.getContractNo();
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(contractNo);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(contractNo);
|
|
|
- if(AuditStatusEnum.S_1.getCode().equals(approvedRequest.getStatusCode())){
|
|
|
|
|
|
|
+ if (AuditStatusEnum.S_1.getCode().equals(approvedRequest.getStatusCode())) {
|
|
|
insAreaCompany.setJqapplyno(approvedRequest.getProposalNoJ());
|
|
insAreaCompany.setJqapplyno(approvedRequest.getProposalNoJ());
|
|
|
insAreaCompany.setSyapplyno(approvedRequest.getProposalNoS());
|
|
insAreaCompany.setSyapplyno(approvedRequest.getProposalNoS());
|
|
|
insAreaCompany.setJyapplyno(approvedRequest.getProposalNoCP());
|
|
insAreaCompany.setJyapplyno(approvedRequest.getProposalNoCP());
|
|
|
insAreaCompany.setPaymentLink(approvedRequest.getPayUrl());
|
|
insAreaCompany.setPaymentLink(approvedRequest.getPayUrl());
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatus.S_2.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatus.S_2.getCode());
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatus.S_4.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatus.S_4.getCode());
|
|
|
}
|
|
}
|
|
|
insOrdersService.updateByOrderStatus(insAreaCompany.getOrderno(), insAreaCompany.getOrderstatus());
|
|
insOrdersService.updateByOrderStatus(insAreaCompany.getOrderno(), insAreaCompany.getOrderstatus());
|
|
@@ -183,25 +196,23 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpResult getPolicyPrint(String companyId) {
|
|
|
|
|
- String riskCode = "";
|
|
|
|
|
- String type = "";
|
|
|
|
|
|
|
+ public HttpResult getPolicyPrint(String companyId, String riskCode, String type) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
- String policyNo;
|
|
|
|
|
- String documentType = "DZ_AE";
|
|
|
|
|
- if (InsuranceTypeCorrespondence.TRAFFIC.equals(riskCode)){
|
|
|
|
|
|
|
+ String policyNo;
|
|
|
|
|
+ String code = DocumentTypeEnum.code(type);
|
|
|
|
|
+
|
|
|
|
|
+ if (InsuranceTypeCorrespondence.TRAFFIC.equals(riskCode)) {
|
|
|
policyNo = insAreaCompany.getJqpolicyno();
|
|
policyNo = insAreaCompany.getJqpolicyno();
|
|
|
- }
|
|
|
|
|
- else if (InsuranceTypeCorrespondence.BUSINESS.equals(riskCode)){
|
|
|
|
|
|
|
+ } else if (InsuranceTypeCorrespondence.BUSINESS.equals(riskCode)) {
|
|
|
policyNo = insAreaCompany.getJqpolicyno();
|
|
policyNo = insAreaCompany.getJqpolicyno();
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
throw new SystemException("险种代码不存在");
|
|
throw new SystemException("险种代码不存在");
|
|
|
}
|
|
}
|
|
|
InsurancePolicyPrintRequest request = new InsurancePolicyPrintRequest();
|
|
InsurancePolicyPrintRequest request = new InsurancePolicyPrintRequest();
|
|
|
request.setPolicyNo(policyNo);
|
|
request.setPolicyNo(policyNo);
|
|
|
- InsurancePolicyPrintResponse insurancePolicyPrintResponse = zhongmeiRequestApiComponents.insurancePolicyPrint(request, InsurancePolicyPrintResponse.class);
|
|
|
|
|
-
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ request.setDocumentType(code);
|
|
|
|
|
+ InsurancePolicyPrintResponse response = zhongmeiRequestApiComponents.insurancePolicyPrint(request, InsurancePolicyPrintResponse.class);
|
|
|
|
|
+ return HttpResult.ok("下载成功", response.getDownloadUrl());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|