|
|
@@ -233,6 +233,9 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String clauseCaseSwitch = indexResponse.getClauseCaseSwitch();
|
|
|
// 此处返回的 flowid 4.1.续保确认 4.2.车辆信息确认 001 平安车型搜索接口 需要使用
|
|
|
String flowid = indexResponse.getFlowid();
|
|
|
+
|
|
|
+ // carInfo.setModelcname("欧雅OCTAVIA 2.0L轿车");
|
|
|
+
|
|
|
// 2. 车型查询
|
|
|
SearchPAVehicleListRequest searchPAVehicleListRequest = new SearchPAVehicleListRequest(parameters.getUserId(), flowid,
|
|
|
carInfo.getModelcname() );
|
|
|
@@ -249,7 +252,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if (models != null && models.size() == 1) {
|
|
|
model = models.get(0);
|
|
|
} else if (models != null && models.size() > 1) {
|
|
|
- /**
|
|
|
//通过年款和新车购置价确定唯一
|
|
|
String purchasePrice = carInfo.getPurchasePrice();
|
|
|
String caryear = carInfo.getPurchasePrice();
|
|
|
@@ -276,19 +278,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
}else if(models.size()==1){
|
|
|
model = models.get(0);
|
|
|
}
|
|
|
- **/
|
|
|
- model = models.get(0);
|
|
|
- }
|
|
|
- // 3. 车辆信息确认
|
|
|
- pinganApiLog.setId(null);
|
|
|
- CarConfirmRequest carConfirmRequest = new CarConfirmRequest(parameters, quoteInfo, model, flowid);
|
|
|
- CarConfirmResponse carConfirmResponse = pinganRequestApiComponents.carConfirm(carConfirmRequest,pinganApiLog);
|
|
|
- if (carConfirmResponse == null || !"0".equals(carConfirmResponse.getResultCode())) {
|
|
|
- throw new SystemException(carConfirmResponse.getResultMessage());
|
|
|
+ //model = models.get(0);
|
|
|
}
|
|
|
- //4.报价 使用车辆确认返回的流程id
|
|
|
- pinganApiLog.setId(null);
|
|
|
- QuoteRequest quoteRequest = new QuoteRequest(parameters, quoteInfo,carConfirmResponse.getFlowid(), quoteVo.getAccommodationFlag(), quoteVo.getAmount22XNYChargingPostList(), quoteVo.getAmount23XNYChargingPostList(),quoteVo.getAccidentalDrivingVo());
|
|
|
//能源车 判断 赋值能源参数
|
|
|
String flag="";
|
|
|
if("1,2,3,".contains(carInfo.getEnergyType())){
|
|
|
@@ -298,6 +289,17 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//客车、货车传递
|
|
|
flag="FXNY";
|
|
|
}
|
|
|
+ // 3. 车辆信息确认
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ CarConfirmRequest carConfirmRequest = new CarConfirmRequest(parameters, quoteInfo, model, flowid,flag);
|
|
|
+ CarConfirmResponse carConfirmResponse = pinganRequestApiComponents.carConfirm(carConfirmRequest,pinganApiLog);
|
|
|
+ if (carConfirmResponse == null || !"0".equals(carConfirmResponse.getResultCode())) {
|
|
|
+ throw new SystemException(carConfirmResponse.getResultMessage());
|
|
|
+ }
|
|
|
+ //4.报价 使用车辆确认返回的流程id
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ QuoteRequest quoteRequest = new QuoteRequest(parameters, quoteInfo,carConfirmResponse.getFlowid(), quoteVo.getAccommodationFlag(), quoteVo.getAmount22XNYChargingPostList(), quoteVo.getAmount23XNYChargingPostList(),quoteVo.getAccidentalDrivingVo());
|
|
|
+
|
|
|
quoteRequest = PingAnQuoteRequestAnnotationParser.processAnnotationsQuoteRequest(quoteRequest, quoteInfo.getKindList(), carConfirmResponse.getBizQuoteConfig(), flag);
|
|
|
QuoteResponse quoteResponse = null;
|
|
|
try {
|
|
|
@@ -676,7 +678,12 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//查询核保状态
|
|
|
String bizApplyNo = submitApplyResponse.getBizApplyNo()==null?"":submitApplyResponse.getBizApplyNo();
|
|
|
String forceApplyNo = submitApplyResponse.getForceApplyNo()==null?"":submitApplyResponse.getForceApplyNo();
|
|
|
- String accidentApplyNo = submitApplyResponse.getAccidentApplyNo() == null ? "" : submitApplyResponse.getAccidentApplyNo();
|
|
|
+ List<SubmitApplyResponse.AccidentApplyPolicyNoDTO> accidentApplyPolicyNoList = submitApplyResponse.getAccidentApplyPolicyNoList();
|
|
|
+ String accidentApplyNo =null;
|
|
|
+ if(accidentApplyPolicyNoList!=null && accidentApplyPolicyNoList.size()>0){
|
|
|
+ SubmitApplyResponse.AccidentApplyPolicyNoDTO accidentApplyPolicyNoDTO = accidentApplyPolicyNoList.get(0);
|
|
|
+ accidentApplyNo = accidentApplyPolicyNoDTO.getPolicyAppNumber();
|
|
|
+ }
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
list.add(bizApplyNo);
|
|
|
@@ -685,7 +692,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
- list.add(accidentApplyNo);
|
|
|
+ // list.add(accidentApplyNo);
|
|
|
}
|
|
|
pinganApiLog.setId(null);
|
|
|
DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
@@ -842,7 +849,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String fileBZName="";
|
|
|
//驾意险
|
|
|
if(type==3){
|
|
|
- flag="true";
|
|
|
+ // flag="true";
|
|
|
fileName="_非车险保单";
|
|
|
}else if(type==1){
|
|
|
//交强
|
|
|
@@ -868,35 +875,38 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String flagPdf = policyPdfResponse.getFlagPdf();
|
|
|
String yqbdFileName = insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ policyno+fileName+".pdf";
|
|
|
jqbdPath = UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ policyno+fileName+"-decipher.pdf";;
|
|
|
- if(type==1){
|
|
|
- String yqbzFileName = insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ policyno+fileBZName+".pdf";
|
|
|
- jqbzPath = UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ policyno+fileBZName+"-decipher.pdf";;
|
|
|
- String jqBzTargertPath = saveFilePath+yqbzFileName;
|
|
|
+ if(policyPdfBase64Str!=null ){
|
|
|
+ if(type==1){
|
|
|
+ String yqbzFileName = insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ policyno+fileBZName+".pdf";
|
|
|
+ jqbzPath = UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ policyno+fileBZName+"-decipher.pdf";;
|
|
|
+ String jqBzTargertPath = saveFilePath+yqbzFileName;
|
|
|
+ try {
|
|
|
+ PDFUtil.decryptFileByPassword(flagPdf, jqBzTargertPath, properties.getPingAnPublicKey());
|
|
|
+ } catch (Exception e) {
|
|
|
+ jqbzPath=null;
|
|
|
+ }
|
|
|
+ crawlerPolicyPrintVo.setJqxFlagUrl(jqbzPath);
|
|
|
+ }
|
|
|
try {
|
|
|
- PDFUtil.decryptFileByPassword(flagPdf, jqBzTargertPath, properties.getPingAnPublicKey());
|
|
|
+ String jqBdTargertPath = saveFilePath+yqbdFileName;
|
|
|
+ PDFUtil.decryptFileByPassword(policyPdfBase64Str, jqBdTargertPath, properties.getPingAnPublicKey());
|
|
|
} catch (Exception e) {
|
|
|
- jqbzPath=null;
|
|
|
+ jqbdPath=null;
|
|
|
+ }
|
|
|
+ if(type==1){
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(jqbdPath);
|
|
|
+ }else if(type==2){
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(jqbdPath);
|
|
|
+ }else if(type==3){
|
|
|
+ List<CrawlerPolicyPrintVo.JyxInfoListDTO> jyxInfoListDTOS = new ArrayList<>();
|
|
|
+ CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
+ jyxInfoListDTO.setJyxPolicyUrl(jqbdPath);
|
|
|
+ jyxInfoListDTOS.add(jyxInfoListDTO);
|
|
|
+ crawlerPolicyPrintVo.setJyxInfoList(jyxInfoListDTOS);
|
|
|
}
|
|
|
- crawlerPolicyPrintVo.setJqxFlagUrl(jqbzPath);
|
|
|
- }
|
|
|
- try {
|
|
|
- String jqBdTargertPath = saveFilePath+yqbdFileName;
|
|
|
- PDFUtil.decryptFileByPassword(policyPdfBase64Str, jqBdTargertPath, properties.getPingAnPublicKey());
|
|
|
- } catch (Exception e) {
|
|
|
- jqbdPath=null;
|
|
|
- }
|
|
|
- if(type==1){
|
|
|
- crawlerPolicyPrintVo.setJqxPolicyUrl(jqbdPath);
|
|
|
- }else if(type==2){
|
|
|
- crawlerPolicyPrintVo.setSyxPolicyUrl(jqbdPath);
|
|
|
- }else if(type==3){
|
|
|
- List<CrawlerPolicyPrintVo.JyxInfoListDTO> jyxInfoListDTOS = new ArrayList<>();
|
|
|
- CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
- jyxInfoListDTO.setJyxPolicyUrl(jqbdPath);
|
|
|
- jyxInfoListDTOS.add(jyxInfoListDTO);
|
|
|
- crawlerPolicyPrintVo.setJyxInfoList(jyxInfoListDTOS);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1266,7 +1276,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
- list.add(accidentApplyNo);
|
|
|
+ // list.add(accidentApplyNo);
|
|
|
}
|
|
|
pinganApiLog.setId(null);
|
|
|
DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
@@ -1359,7 +1369,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
- list.add(accidentApplyNo);
|
|
|
+ // list.add(accidentApplyNo);
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
@@ -1373,7 +1383,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
* @Exception
|
|
|
*/
|
|
|
@Override
|
|
|
- public HttpResult<Object> repealDocument(String companyId,String documentType) {
|
|
|
+ public HttpResult<Object> repealDocument(String companyId,String documentType,String applyNo) {
|
|
|
try {
|
|
|
//调用
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
@@ -1385,10 +1395,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
// 通过 协议id获取配置实体
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
- if("1".equals(documentType)) {
|
|
|
- String jqpolicyno = insAreaCompany.getJqpolicyno();
|
|
|
- }
|
|
|
- RepealDocumentRequest repealDocumentRequest = new RepealDocumentRequest(insAreaCompany.getJqpolicyno(), parameters.getUserId(), parameters.getCityCode(), documentType);
|
|
|
+ RepealDocumentRequest repealDocumentRequest = new RepealDocumentRequest(applyNo, parameters.getUserId(), parameters.getCityCode(), documentType);
|
|
|
RepealDocumentResponse repealDocumentResponse = null;
|
|
|
try {
|
|
|
repealDocumentResponse = pinganRequestApiComponents.repealDocument(repealDocumentRequest,pinganApiLog);
|
|
|
@@ -1875,7 +1882,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
- list.add(accidentApplyNo);
|
|
|
+ // list.add(accidentApplyNo);
|
|
|
}
|
|
|
pinganApiLog.setId(null);
|
|
|
DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
@@ -1888,7 +1895,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
Boolean jqflag = false;
|
|
|
- Boolean sqflag = false;
|
|
|
+ Boolean syflag = false;
|
|
|
Boolean fcflag = false;
|
|
|
String status="";
|
|
|
String jqPlicyNo=null;
|
|
|
@@ -1898,17 +1905,24 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//B2 为 未缴费
|
|
|
for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
status =dto.getStatus();
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
- jqPlicyNo=dto.getPolicyNo();
|
|
|
- sqflag = true;
|
|
|
+ if (StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ syPlicyNo=dto.getPolicyNo();
|
|
|
+ syflag = true;
|
|
|
}
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ if (StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
jqflag = true;
|
|
|
- syPlicyNo=dto.getPolicyNo();
|
|
|
+ jqPlicyNo=dto.getPolicyNo();
|
|
|
}
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ List<DocumentStatusListResponse.DocumentDTO.UnAutoListInfoDTO> unAutoListInfo = dto.getUnAutoListInfo();
|
|
|
+ String applyNo=null;
|
|
|
+ String policyNo=null;
|
|
|
+ if(unAutoListInfo!=null && unAutoListInfo.size()>0){
|
|
|
+ applyNo = unAutoListInfo.get(0).getApplyNo();
|
|
|
+ policyNo = unAutoListInfo.get(0).getPolicyNo();
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(applyNo == null ? "" : applyNo)) {
|
|
|
fcflag = true;
|
|
|
- jyPlicyNo=dto.getPolicyNo();
|
|
|
+ jyPlicyNo=policyNo;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1916,7 +1930,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
insAreaCompany.setJqapplyno(forceApplyNo);
|
|
|
insAreaCompany.setJqpolicyno(jqPlicyNo);
|
|
|
}
|
|
|
- if (sqflag) {
|
|
|
+ if (syflag) {
|
|
|
insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
insAreaCompany.setSypolicyno(syPlicyNo);
|
|
|
}
|
|
|
@@ -1930,17 +1944,18 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
|
|
|
insAreaCompany.setCrossInsurance(objects);
|
|
|
}
|
|
|
- if(InsOrderStatusEnum.WAIT_PAY.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) )){
|
|
|
+ if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) )){
|
|
|
//说明核保成功,更新大订单和小订单的状态为1 更新为已核保待缴费
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode() );
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- }else if(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) || "2".equals(insAreaCompany.getOrderstatus()))) {
|
|
|
+ }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) || "2".equals(insAreaCompany.getOrderstatus()))) {
|
|
|
//承保
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insAreaCompany.setPayDate(LocalDateTime.now());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
}
|
|
|
}
|
|
|
- return HttpResult.error("支付成功");
|
|
|
+ return HttpResult.ok("支付成功");
|
|
|
}else{
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(null,null,null);
|
|
|
pinganApiLog.setId(null);
|