|
|
@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service.impl;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.ydtech.components.ZhongmeiRequestComponents;
|
|
|
import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
@@ -22,6 +23,7 @@ import com.ydtech.modules.order.convert.SimpleStadarCarDTOConvert;
|
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
import com.ydtech.modules.order.entity.TaxArrears;
|
|
|
+import com.ydtech.modules.order.entity.api.dajia.response.NVHLODR1001Response;
|
|
|
import com.ydtech.modules.order.entity.api.zhongmei.BaseRequestHead;
|
|
|
import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.AuditStatusEnum;
|
|
|
import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.DocumentTypeEnum;
|
|
|
@@ -240,7 +242,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
insAreaCompany.setPaymentLink(response.getPayUrl());
|
|
|
insAreaCompany.setJqapplyno(response.getForceProposalNo());
|
|
|
insAreaCompany.setSyapplyno(response.getBizProposalNo());
|
|
|
-// insAreaCompany.setJyapplyno(response.getAccidentProposalNo());
|
|
|
+ if(response.getAccidentNos()!=null){
|
|
|
+ insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(response.getAccidentNos())));
|
|
|
+ }
|
|
|
insAreaCompany.setInsOrderNo(response.getProposalNo());
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
@@ -282,7 +286,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
// 保单号
|
|
|
insAreaCompany.setJqpolicyno(coverageRequest.getForcePolicyNo());
|
|
|
insAreaCompany.setSypolicyno(coverageRequest.getBizPolicyNo());
|
|
|
-// insAreaCompany.setJypolicyno(coverageRequest.getAccidentPolicyNo());
|
|
|
+ if(coverageRequest.getAccidentPolicyNos()!=null){
|
|
|
+ insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(coverageRequest.getAccidentPolicyNos())));
|
|
|
+ }
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
}
|
|
|
@@ -302,7 +308,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
if (AuditStatusEnum.S_1.getCode().equals(approvedRequest.getStatusCode())) {
|
|
|
insAreaCompany.setJqapplyno(approvedRequest.getProposalNoJ());
|
|
|
insAreaCompany.setSyapplyno(approvedRequest.getProposalNoS());
|
|
|
-// insAreaCompany.setJyapplyno(approvedRequest.getProposalNoCP());
|
|
|
+ if(approvedRequest.getAccidentNos()!=null ){
|
|
|
+ insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(approvedRequest.getAccidentNos())));
|
|
|
+ }
|
|
|
insAreaCompany.setPaymentLink(approvedRequest.getPayUrl());
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
} else {
|
|
|
@@ -347,7 +355,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
if (StringUtils.isNotEmpty(payDate)) {
|
|
|
insAreaCompany.setPayDate(LocalDateTime.parse(payDate, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
}
|
|
|
-// insAreaCompany.setJypolicyno(orderStatusResponse.getAccidentNo());
|
|
|
+ if(orderStatusResponse.getAccidentPolicyNos()!=null ){
|
|
|
+ insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(orderStatusResponse.getAccidentPolicyNos())));
|
|
|
+ }
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
|
@@ -372,6 +382,16 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
policyNo = insAreaCompany.getJqpolicyno();
|
|
|
} else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
|
|
|
policyNo = insAreaCompany.getSypolicyno();
|
|
|
+ } else if (InsuranceRisk.ACCIDENT.getCode().equals(riskCode)) {
|
|
|
+ List<OrderStatusResponse.AccidentPolicyNo> accidentPolicyNos = null;
|
|
|
+ if (!Objects.isNull(insAreaCompany.getCrossInsurance())) {
|
|
|
+ accidentPolicyNos = JSON.parseArray(JSON.toJSONString(insAreaCompany.getCrossInsurance()),
|
|
|
+ OrderStatusResponse.AccidentPolicyNo.class);
|
|
|
+ OrderStatusResponse.AccidentPolicyNo accidentPolicyNo = accidentPolicyNos.get(0);
|
|
|
+ policyNo = accidentPolicyNo.getRidePolicyNo();
|
|
|
+ }else{
|
|
|
+ throw new SystemException("险种代码不存在");
|
|
|
+ }
|
|
|
} else {
|
|
|
throw new SystemException("险种代码不存在");
|
|
|
}
|
|
|
@@ -380,7 +400,9 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
InsurancePolicyPrintRequest request = new InsurancePolicyPrintRequest();
|
|
|
//获取能源种类
|
|
|
CarInfoVo carInfoVo = JSON.toJavaObject(order.getCarinfo(), CarInfoVo.class);
|
|
|
- request.setRiskCode(InsuranceTypeCorrespondence.getZhongMei_RISK().get(carInfoVo.getEnergyType()).get(riskCode));
|
|
|
+ if (!InsuranceRisk.ACCIDENT.getCode().equals(riskCode)) {//非车险不传险种代码
|
|
|
+ request.setRiskCode(InsuranceTypeCorrespondence.getZhongMei_RISK().get(carInfoVo.getEnergyType()).get(riskCode));
|
|
|
+ }
|
|
|
request.setPolicyNo(policyNo);
|
|
|
request.setDocumentType(code);
|
|
|
request.setHead(new BaseRequestHead(zmConfigureParameters));
|
|
|
@@ -395,11 +417,16 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
if ("DZ_AJ".equals(code)) {
|
|
|
templateName = "-交强险标志.pdf";
|
|
|
} else if ("DZ_AE".equals(code)) {
|
|
|
- if ("0330".equals(request.getRiskCode())) {
|
|
|
- templateName = "-交强险保单.pdf";
|
|
|
- } else {
|
|
|
- templateName = "-商业险保单.pdf";
|
|
|
+ if(StringUtils.isNotEmpty(request.getRiskCode())){
|
|
|
+ if ("0330".equals(request.getRiskCode())) {
|
|
|
+ templateName = "-交强险保单.pdf";
|
|
|
+ } else {
|
|
|
+ templateName = "-商业险保单.pdf";
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ templateName = "-非车险保单.pdf";
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, licensePlate);
|
|
|
List<String> transferUrlList = new ArrayList<>();
|
|
|
@@ -509,17 +536,21 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
quoteRespVo.setILogPreUdwMess(zmScore);//评分
|
|
|
quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo()); //订单号
|
|
|
|
|
|
- /*QuotedPriceResponse.AccidentPrimium accidentPrimium = quotedPriceResponse.getRideAccidentPrimium();
|
|
|
- if(accidentPrimium!=null){
|
|
|
+ List<QuotedPriceResponse.AccidentPrimium> accidentPrimiumList = quotedPriceResponse.getAccidentPremium();
|
|
|
+ if(accidentPrimiumList!=null && accidentPrimiumList.size()>0){
|
|
|
+ QuotedPriceResponse.AccidentPrimium accidentPrimium = accidentPrimiumList.get(0);
|
|
|
AccidentResponseVo accidentResponseVo = new AccidentResponseVo();
|
|
|
accidentResponseVo.setProjectCode(accidentPrimium.getRideRiskCode());
|
|
|
accidentResponseVo.setProjectName(accidentPrimium.getRideRiskName());
|
|
|
- accidentResponseVo.setQuantity(accidentPrimium.getQuantity());
|
|
|
- accidentResponseVo.setPremium(accidentPrimium.getUnitPremium());
|
|
|
- accidentResponseVo.setActualPremium(accidentPrimium.getSumPremium());
|
|
|
+ accidentResponseVo.setQuantity(String.valueOf(accidentPrimium.getQuantity()));
|
|
|
+ accidentResponseVo.setPremium(String.valueOf(accidentPrimium.getUnitPremium()));
|
|
|
+ accidentResponseVo.setActualPremium(String.valueOf(accidentPrimium.getSumPremium()));
|
|
|
+ quoteRespVo.setJyPremium(accidentPrimium.getSumPremium());
|
|
|
+ quoteRespVo.setSumPermium(CalculateUtils.add(quoteRespVo.getSumPermium(), quoteRespVo.getJyPremium()));//重算保费合计
|
|
|
List<AccidentResponseVo> accidentResponseVoList = new ArrayList<>();
|
|
|
- quoteRespVo.setAccident();
|
|
|
- }*/
|
|
|
+ accidentResponseVoList.add(accidentResponseVo);
|
|
|
+ quoteRespVo.setAccident(accidentResponseVoList);
|
|
|
+ }
|
|
|
return quoteRespVo;
|
|
|
}
|
|
|
|
|
|
@@ -580,7 +611,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpResult<Object> rideAccidentQuery(AccidentalDrivingQueryVo accidentalDrivingVo) {
|
|
|
+ public HttpResult<List<RideAccidentQueryResponse.RideAccident>> rideAccidentQuery(AccidentalDrivingQueryVo accidentalDrivingVo) {
|
|
|
// 1. 协议id获取配置实体
|
|
|
ZmConfigureParameters zmConfigureParameters = configureParametersComponents.toEntity(ZmConfigureParameters.class,
|
|
|
accidentalDrivingVo.getAgreementId());
|
|
|
@@ -593,7 +624,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
|
|
|
RideAccidentQueryResponse rideAccidentQueryResponse = zhongmeiRequestApiComponents.rideAccidentQuery(rideAccidentQueryRequest,
|
|
|
RideAccidentQueryResponse.class);
|
|
|
|
|
|
- return HttpResult.ok("");
|
|
|
+ return HttpResult.ok(rideAccidentQueryResponse.getRideAccidents());
|
|
|
}
|
|
|
|
|
|
/**
|