|
@@ -20,7 +20,6 @@ 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.dajia.DaJiaConfigureParameters;
|
|
import com.ydtech.modules.order.entity.api.dajia.DaJiaConfigureParameters;
|
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.CCvrgNo;
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.CCvrgNo;
|
|
|
-import com.ydtech.modules.order.entity.api.dajia.constants.CPayTaxType;
|
|
|
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.CProdNo;
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.CProdNo;
|
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.Message;
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.Message;
|
|
|
import com.ydtech.modules.order.entity.api.dajia.request.*;
|
|
import com.ydtech.modules.order.entity.api.dajia.request.*;
|
|
@@ -28,6 +27,7 @@ import com.ydtech.modules.order.entity.api.dajia.response.*;
|
|
|
import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.CoreModelsVo;
|
|
|
import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
|
|
import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
|
|
|
import com.ydtech.modules.order.entity.vo.dajia.AccidentalInsuranceQueryVo;
|
|
import com.ydtech.modules.order.entity.vo.dajia.AccidentalInsuranceQueryVo;
|
|
|
import com.ydtech.modules.order.entity.vo.dajia.InsAccidentalDrivingDajia;
|
|
import com.ydtech.modules.order.entity.vo.dajia.InsAccidentalDrivingDajia;
|
|
@@ -43,7 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
-import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.Period;
|
|
import java.time.Period;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
@@ -129,16 +128,17 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
* @param orderNo
|
|
* @param orderNo
|
|
|
* @param quoteInfoVo
|
|
* @param quoteInfoVo
|
|
|
* @param daJiaConfigureParameters
|
|
* @param daJiaConfigureParameters
|
|
|
|
|
+ * @param coreModelsVo
|
|
|
* @return
|
|
* @return
|
|
|
* @throws Exception
|
|
* @throws Exception
|
|
|
*/
|
|
*/
|
|
|
private ODR1008Response ConfirmationVehicleCustomerInformation(String orderNo, String busiId, BaseQuoteInfoVo quoteInfoVo,
|
|
private ODR1008Response ConfirmationVehicleCustomerInformation(String orderNo, String busiId, BaseQuoteInfoVo quoteInfoVo,
|
|
|
DaJiaConfigureParameters daJiaConfigureParameters,
|
|
DaJiaConfigureParameters daJiaConfigureParameters,
|
|
|
ODR2009Response odr2009Request, PersonAreaVo policyHolderPersonArea,
|
|
ODR2009Response odr2009Request, PersonAreaVo policyHolderPersonArea,
|
|
|
- PersonAreaVo insuredPersonArea,PersonAreaVo ownerPersonArea) throws Exception {
|
|
|
|
|
|
|
+ PersonAreaVo insuredPersonArea, PersonAreaVo ownerPersonArea, CoreModelsVo coreModelsVo) throws Exception {
|
|
|
|
|
|
|
|
ODR1008Request odr1008Request = new ODR1008Request(orderNo, busiId, quoteInfoVo, daJiaConfigureParameters, odr2009Request,
|
|
ODR1008Request odr1008Request = new ODR1008Request(orderNo, busiId, quoteInfoVo, daJiaConfigureParameters, odr2009Request,
|
|
|
- policyHolderPersonArea, insuredPersonArea,ownerPersonArea);
|
|
|
|
|
|
|
+ policyHolderPersonArea, insuredPersonArea, ownerPersonArea, coreModelsVo);
|
|
|
ODR1008Response odr1008Response = daJiaRequestApiComponents.carOrCustomInfoConfirm(odr1008Request);
|
|
ODR1008Response odr1008Response = daJiaRequestApiComponents.carOrCustomInfoConfirm(odr1008Request);
|
|
|
if (odr1008Response.getStatus().equals(Message.M0000.getCode())) {
|
|
if (odr1008Response.getStatus().equals(Message.M0000.getCode())) {
|
|
|
//车辆与客户信息确认返回
|
|
//车辆与客户信息确认返回
|
|
@@ -150,6 +150,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 报价
|
|
* 报价
|
|
|
|
|
+ *
|
|
|
* @param quoteInfoVo 报价实体
|
|
* @param quoteInfoVo 报价实体
|
|
|
* @param t
|
|
* @param t
|
|
|
* @return
|
|
* @return
|
|
@@ -189,8 +190,11 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
ODR2009Response odr2009Response = daJiaRequestApiComponents.queryVehicleTypes(odr2009Request);
|
|
ODR2009Response odr2009Response = daJiaRequestApiComponents.queryVehicleTypes(odr2009Request);
|
|
|
|
|
|
|
|
// 3.车辆与客户信息确认
|
|
// 3.车辆与客户信息确认
|
|
|
|
|
+ CoreModelsVo coreModelsVo = new CoreModelsVo();
|
|
|
|
|
+
|
|
|
ODR1008Response odr1008Response = ConfirmationVehicleCustomerInformation(orderNo, busiId, quoteInfoVo,
|
|
ODR1008Response odr1008Response = ConfirmationVehicleCustomerInformation(orderNo, busiId, quoteInfoVo,
|
|
|
- daJiaConfigureParameters, odr2009Response, policyHolderPersonArea, insuredPersonArea,ownerPersonArea);
|
|
|
|
|
|
|
+ daJiaConfigureParameters, odr2009Response, policyHolderPersonArea, insuredPersonArea, ownerPersonArea,
|
|
|
|
|
+ coreModelsVo);
|
|
|
if (!odr1008Response.getStatus().equals(Message.M0000.getCode())) {
|
|
if (!odr1008Response.getStatus().equals(Message.M0000.getCode())) {
|
|
|
return HttpResult.error("车辆与客户信息确认接口失败");
|
|
return HttpResult.error("车辆与客户信息确认接口失败");
|
|
|
}
|
|
}
|
|
@@ -248,11 +252,14 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
//保费计算接口返回
|
|
//保费计算接口返回
|
|
|
QuoteRespVo quoteRespVo = getQuoteRespVo(odr1009Response, quoteInfoVo, nvhlodr1001Response);
|
|
QuoteRespVo quoteRespVo = getQuoteRespVo(odr1009Response, quoteInfoVo, nvhlodr1001Response);
|
|
|
|
|
+
|
|
|
|
|
+ // 设置报价车型
|
|
|
|
|
+ quoteRespVo.setCoreModels(coreModelsVo);
|
|
|
HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(odr1009Response, quoteRespVo, ptlAgreementAttribution,
|
|
HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(odr1009Response, quoteRespVo, ptlAgreementAttribution,
|
|
|
orderNo, quoteInfoVo, busiId, nvhlodr1001Response);
|
|
orderNo, quoteInfoVo, busiId, nvhlodr1001Response);
|
|
|
return quoteRespVoHttpResult;
|
|
return quoteRespVoHttpResult;
|
|
|
} else {
|
|
} else {
|
|
|
- if(Message.M0003.getCode().equals(odr1009Response.getStatus())){
|
|
|
|
|
|
|
+ if (Message.M0003.getCode().equals(odr1009Response.getStatus())) {
|
|
|
return HttpResult.error("报价失败,原因:" + odr1009Response.getMessage());
|
|
return HttpResult.error("报价失败,原因:" + odr1009Response.getMessage());
|
|
|
}
|
|
}
|
|
|
if ("0".equals(odr1009Response.getResult().getJqAppStatus()) && "0002".equals(odr1009Response.getStatus())) {
|
|
if ("0".equals(odr1009Response.getResult().getJqAppStatus()) && "0002".equals(odr1009Response.getStatus())) {
|
|
@@ -269,12 +276,13 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取重复投保时间
|
|
* 获取重复投保时间
|
|
|
|
|
+ *
|
|
|
* @param startDateStr
|
|
* @param startDateStr
|
|
|
* @param endDateStr
|
|
* @param endDateStr
|
|
|
* @param newStDate
|
|
* @param newStDate
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public List<String> getDuplicateDate(String startDateStr,String endDateStr,String newStDate){
|
|
|
|
|
|
|
+ public List<String> getDuplicateDate(String startDateStr, String endDateStr, String newStDate) {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
//处理23:59:59
|
|
//处理23:59:59
|
|
|
if (endDateStr.endsWith("23:59:59")) {
|
|
if (endDateStr.endsWith("23:59:59")) {
|
|
@@ -300,6 +308,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 报价 处理重复投保
|
|
* 报价 处理重复投保
|
|
|
|
|
+ *
|
|
|
* @param orderNo
|
|
* @param orderNo
|
|
|
* @param kindInfoVos
|
|
* @param kindInfoVos
|
|
|
* @param riskInfoVos
|
|
* @param riskInfoVos
|
|
@@ -312,29 +321,33 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
* @return
|
|
* @return
|
|
|
* @throws Exception
|
|
* @throws Exception
|
|
|
*/
|
|
*/
|
|
|
- public ODR1009Response quotation(String orderNo, List<KindInfoVo> kindInfoVos, List<RiskInfoVo> riskInfoVos, BaseQuoteInfoVo quoteInfoVo,
|
|
|
|
|
|
|
+ public ODR1009Response quotation(String orderNo, List<KindInfoVo> kindInfoVos, List<RiskInfoVo> riskInfoVos,
|
|
|
|
|
+ BaseQuoteInfoVo quoteInfoVo,
|
|
|
ODR1016Response odr1016Response, InsAccidentalDrivingDajia insAccidentalDrivingDajia,
|
|
ODR1016Response odr1016Response, InsAccidentalDrivingDajia insAccidentalDrivingDajia,
|
|
|
- List<InsAccidentalDrivingSubDajia> insAccidentalDrivingSubDajias,DaJiaConfigureParameters daJiaConfigureParameters,
|
|
|
|
|
|
|
+ List<InsAccidentalDrivingSubDajia> insAccidentalDrivingSubDajias,
|
|
|
|
|
+ DaJiaConfigureParameters daJiaConfigureParameters,
|
|
|
boolean isEnergy) throws Exception {
|
|
boolean isEnergy) throws Exception {
|
|
|
|
|
|
|
|
ODR1009Request odr1009Request = new ODR1009Request(orderNo, kindInfoVos, riskInfoVos, quoteInfoVo, odr1016Response,
|
|
ODR1009Request odr1009Request = new ODR1009Request(orderNo, kindInfoVos, riskInfoVos, quoteInfoVo, odr1016Response,
|
|
|
insAccidentalDrivingDajia, insAccidentalDrivingSubDajias, daJiaConfigureParameters, isEnergy);
|
|
insAccidentalDrivingDajia, insAccidentalDrivingSubDajias, daJiaConfigureParameters, isEnergy);
|
|
|
ODR1009Response odr1009Response = daJiaRequestApiComponents.newPremiumXnyCalculation(odr1009Request);
|
|
ODR1009Response odr1009Response = daJiaRequestApiComponents.newPremiumXnyCalculation(odr1009Request);
|
|
|
- if(odr1009Response.getStatus().equals(Message.M0002.getCode())) {
|
|
|
|
|
|
|
+ if (odr1009Response.getStatus().equals(Message.M0002.getCode())) {
|
|
|
//获取重复投保信息
|
|
//获取重复投保信息
|
|
|
- String jqAppStatusMessage = odr1009Response.getResult().getJqAppStatusMessage() == null ? "" : odr1009Response.getResult().getJqAppStatusMessage().toString();
|
|
|
|
|
- String syAppStatusMessage = odr1009Response.getResult().getReInsuredInfo() == null ? "" : odr1009Response.getResult().getReInsuredInfo();
|
|
|
|
|
- if(jqAppStatusMessage.contains("重复投保") || syAppStatusMessage.contains("重复投保")){
|
|
|
|
|
|
|
+ String jqAppStatusMessage = odr1009Response.getResult().getJqAppStatusMessage() == null ? "" :
|
|
|
|
|
+ odr1009Response.getResult().getJqAppStatusMessage().toString();
|
|
|
|
|
+ String syAppStatusMessage = odr1009Response.getResult().getReInsuredInfo() == null ? "" :
|
|
|
|
|
+ odr1009Response.getResult().getReInsuredInfo();
|
|
|
|
|
+ if (jqAppStatusMessage.contains("重复投保") || syAppStatusMessage.contains("重复投保")) {
|
|
|
//交强重复投保
|
|
//交强重复投保
|
|
|
- for(RiskInfoVo riskInfoVo : riskInfoVos){
|
|
|
|
|
- if(riskInfoVo.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode()) && !jqAppStatusMessage.isEmpty()){
|
|
|
|
|
|
|
+ for (RiskInfoVo riskInfoVo : riskInfoVos) {
|
|
|
|
|
+ if (riskInfoVo.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode()) && !jqAppStatusMessage.isEmpty()) {
|
|
|
String jqEndDate = getTheExpiryDate(jqAppStatusMessage, THE_FIRST_REGEX);
|
|
String jqEndDate = getTheExpiryDate(jqAppStatusMessage, THE_FIRST_REGEX);
|
|
|
List<String> duplicateDate = getDuplicateDate(riskInfoVo.getStartDate(), riskInfoVo.getEndDate(), jqEndDate);
|
|
List<String> duplicateDate = getDuplicateDate(riskInfoVo.getStartDate(), riskInfoVo.getEndDate(), jqEndDate);
|
|
|
riskInfoVo.setStartDate(duplicateDate.get(0));
|
|
riskInfoVo.setStartDate(duplicateDate.get(0));
|
|
|
riskInfoVo.setEndDate(duplicateDate.get(1));
|
|
riskInfoVo.setEndDate(duplicateDate.get(1));
|
|
|
}
|
|
}
|
|
|
//商业重复投保
|
|
//商业重复投保
|
|
|
- if(riskInfoVo.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode()) && !syAppStatusMessage.isEmpty()){
|
|
|
|
|
|
|
+ if (riskInfoVo.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode()) && !syAppStatusMessage.isEmpty()) {
|
|
|
String syEndDate = getTheExpiryDate(syAppStatusMessage, THE_SECOND_REGEX);
|
|
String syEndDate = getTheExpiryDate(syAppStatusMessage, THE_SECOND_REGEX);
|
|
|
List<String> duplicateDate = getDuplicateDate(riskInfoVo.getStartDate(), riskInfoVo.getEndDate(), syEndDate);
|
|
List<String> duplicateDate = getDuplicateDate(riskInfoVo.getStartDate(), riskInfoVo.getEndDate(), syEndDate);
|
|
|
riskInfoVo.setStartDate(duplicateDate.get(0));
|
|
riskInfoVo.setStartDate(duplicateDate.get(0));
|
|
@@ -362,22 +375,20 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
insAreaCompany.setId(companyId);
|
|
insAreaCompany.setId(companyId);
|
|
|
insAreaCompany.setOrderno(quoteInfoVo.getOrderNo());
|
|
insAreaCompany.setOrderno(quoteInfoVo.getOrderNo());
|
|
|
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(odr1009Response.getResult()));
|
|
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(odr1009Response.getResult()));
|
|
|
- jsonObject.put("busiId",busiId);
|
|
|
|
|
|
|
+ jsonObject.put("busiId", busiId);
|
|
|
insAreaCompany.setReptxt(jsonObject);
|
|
insAreaCompany.setReptxt(jsonObject);
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
insAreaCompany.setInsOrderNo(orderId);
|
|
insAreaCompany.setInsOrderNo(orderId);
|
|
|
//交强投保单号
|
|
//交强投保单号
|
|
|
- if(!Objects.isNull(odr1009Response.getResult().getBasePart().getJqProposalNo()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (!Objects.isNull(odr1009Response.getResult().getBasePart().getJqProposalNo())) {
|
|
|
insAreaCompany.setJqapplyno(odr1009Response.getResult().getBasePart().getJqProposalNo().toString());
|
|
insAreaCompany.setJqapplyno(odr1009Response.getResult().getBasePart().getJqProposalNo().toString());
|
|
|
}
|
|
}
|
|
|
//商业投保单号
|
|
//商业投保单号
|
|
|
- if(!Objects.isNull(odr1009Response.getResult().getBasePart().getSyProposalNo()))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (!Objects.isNull(odr1009Response.getResult().getBasePart().getSyProposalNo())) {
|
|
|
insAreaCompany.setSyapplyno(odr1009Response.getResult().getBasePart().getSyProposalNo().toString());
|
|
insAreaCompany.setSyapplyno(odr1009Response.getResult().getBasePart().getSyProposalNo().toString());
|
|
|
}
|
|
}
|
|
|
//驾意险信息
|
|
//驾意险信息
|
|
|
- if(!Objects.isNull(nvhlodr1001Response)){
|
|
|
|
|
|
|
+ if (!Objects.isNull(nvhlodr1001Response)) {
|
|
|
insAreaCompany.setCrossInsurance(JSONArray.parseArray(JSON.toJSONString(nvhlodr1001Response.getPolicyInfos())));
|
|
insAreaCompany.setCrossInsurance(JSONArray.parseArray(JSON.toJSONString(nvhlodr1001Response.getPolicyInfos())));
|
|
|
}
|
|
}
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
@@ -385,7 +396,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
quoteRespVo.setOrderno(quoteInfoVo.getOrderNo());
|
|
quoteRespVo.setOrderno(quoteInfoVo.getOrderNo());
|
|
|
// 车船税
|
|
// 车船税
|
|
|
ODR1009Response.ResultDTO.VehicleTaxationDTO carShipTax = odr1009Response.getResult().getVehicleTaxation();
|
|
ODR1009Response.ResultDTO.VehicleTaxationDTO carShipTax = odr1009Response.getResult().getVehicleTaxation();
|
|
|
- if(!Objects.isNull(carShipTax)) {
|
|
|
|
|
|
|
+ if (!Objects.isNull(carShipTax)) {
|
|
|
TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(carShipTax.getTaxableAmt()),
|
|
TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(carShipTax.getTaxableAmt()),
|
|
|
Double.parseDouble(carShipTax.getTaxOverdueAmt()));
|
|
Double.parseDouble(carShipTax.getTaxOverdueAmt()));
|
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
@@ -399,13 +410,14 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取CCvrgNo Code
|
|
* 获取CCvrgNo Code
|
|
|
|
|
+ *
|
|
|
* @param code
|
|
* @param code
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public CCvrgNo getCCvrgNoByCode(String code){
|
|
|
|
|
|
|
+ public CCvrgNo getCCvrgNoByCode(String code) {
|
|
|
CCvrgNo[] values = CCvrgNo.values();
|
|
CCvrgNo[] values = CCvrgNo.values();
|
|
|
for (CCvrgNo value : values) {
|
|
for (CCvrgNo value : values) {
|
|
|
- if(value.getCode().equals(code)){
|
|
|
|
|
|
|
+ if (value.getCode().equals(code)) {
|
|
|
return value;
|
|
return value;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -414,11 +426,12 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据id 获取驾意险信息
|
|
* 根据id 获取驾意险信息
|
|
|
|
|
+ *
|
|
|
* @param id
|
|
* @param id
|
|
|
* @param quantity
|
|
* @param quantity
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public InsAccidentalDrivingDajia getAccidentalDrivingByCode(String id,Integer quantity){
|
|
|
|
|
|
|
+ public InsAccidentalDrivingDajia getAccidentalDrivingByCode(String id, Integer quantity) {
|
|
|
InsAccidentalDrivingDajia byId = insAccidentalDrivingDaJiaService.getById(id);
|
|
InsAccidentalDrivingDajia byId = insAccidentalDrivingDaJiaService.getById(id);
|
|
|
byId.setQuantity(quantity);
|
|
byId.setQuantity(quantity);
|
|
|
return byId;
|
|
return byId;
|
|
@@ -436,7 +449,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
|
|
|
|
|
|
// 交强
|
|
// 交强
|
|
|
- if(odr1009Response.getResult().getBasePart().getJqEffectiveDate() != null) {
|
|
|
|
|
|
|
+ if (odr1009Response.getResult().getBasePart().getJqEffectiveDate() != null) {
|
|
|
quoteRespVo.setStartDateJq(String.valueOf(odr1009Response.getResult().getBasePart().getJqEffectiveDate()));
|
|
quoteRespVo.setStartDateJq(String.valueOf(odr1009Response.getResult().getBasePart().getJqEffectiveDate()));
|
|
|
quoteRespVo.setEndDateJq(String.valueOf(odr1009Response.getResult().getBasePart().getJqExpireDate()));
|
|
quoteRespVo.setEndDateJq(String.valueOf(odr1009Response.getResult().getBasePart().getJqExpireDate()));
|
|
|
quoteRespVo.setJqScore(String.valueOf(odr1009Response.getResult().getRiskRatio().getJqPubScores()));
|
|
quoteRespVo.setJqScore(String.valueOf(odr1009Response.getResult().getRiskRatio().getJqPubScores()));
|
|
@@ -444,7 +457,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 商业
|
|
// 商业
|
|
|
- if(odr1009Response.getResult().getBasePart().getSyEffectiveDate() != null){
|
|
|
|
|
|
|
+ if (odr1009Response.getResult().getBasePart().getSyEffectiveDate() != null) {
|
|
|
quoteRespVo.setStartDateSy(odr1009Response.getResult().getBasePart().getSyEffectiveDate());
|
|
quoteRespVo.setStartDateSy(odr1009Response.getResult().getBasePart().getSyEffectiveDate());
|
|
|
quoteRespVo.setEndDateSy(odr1009Response.getResult().getBasePart().getSyExpireDate());
|
|
quoteRespVo.setEndDateSy(odr1009Response.getResult().getBasePart().getSyExpireDate());
|
|
|
quoteRespVo.setSyScore(odr1009Response.getResult().getRiskRatio().getSyPubScores());
|
|
quoteRespVo.setSyScore(odr1009Response.getResult().getRiskRatio().getSyPubScores());
|
|
@@ -459,22 +472,22 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
// 报价险种放入保费
|
|
// 报价险种放入保费
|
|
|
List<QuoteRiskRespVo> riskList = new ArrayList<>();
|
|
List<QuoteRiskRespVo> riskList = new ArrayList<>();
|
|
|
// risk列表
|
|
// risk列表
|
|
|
- if(odr1009Response.getResult().getBasePart().getJqProposalNo() != null){
|
|
|
|
|
|
|
+ if (odr1009Response.getResult().getBasePart().getJqProposalNo() != null) {
|
|
|
QuoteRiskRespVo jqRisk = new QuoteRiskRespVo();
|
|
QuoteRiskRespVo jqRisk = new QuoteRiskRespVo();
|
|
|
jqRisk.setRiskCode(InsuranceRisk.TRAFFIC.getCode());
|
|
jqRisk.setRiskCode(InsuranceRisk.TRAFFIC.getCode());
|
|
|
jqRisk.setRiskName(InsuranceRisk.TRAFFIC.getDesc());
|
|
jqRisk.setRiskName(InsuranceRisk.TRAFFIC.getDesc());
|
|
|
- if(!Objects.isNull(odr1009Response.getResult().getBasePart().getJqPremium())) {
|
|
|
|
|
|
|
+ if (!Objects.isNull(odr1009Response.getResult().getBasePart().getJqPremium())) {
|
|
|
jqRisk.setPremium(Double.parseDouble(odr1009Response.getResult().getBasePart().getJqPremium().toString()));
|
|
jqRisk.setPremium(Double.parseDouble(odr1009Response.getResult().getBasePart().getJqPremium().toString()));
|
|
|
jqRisk.setStartDate(odr1009Response.getResult().getBasePart().getJqEffectiveDate().toString());
|
|
jqRisk.setStartDate(odr1009Response.getResult().getBasePart().getJqEffectiveDate().toString());
|
|
|
jqRisk.setEndDate(odr1009Response.getResult().getBasePart().getJqExpireDate().toString());
|
|
jqRisk.setEndDate(odr1009Response.getResult().getBasePart().getJqExpireDate().toString());
|
|
|
}
|
|
}
|
|
|
riskList.add(jqRisk);
|
|
riskList.add(jqRisk);
|
|
|
}
|
|
}
|
|
|
- if(odr1009Response.getResult().getBasePart().getSyProposalNo() != null){
|
|
|
|
|
|
|
+ if (odr1009Response.getResult().getBasePart().getSyProposalNo() != null) {
|
|
|
QuoteRiskRespVo syRisk = new QuoteRiskRespVo();
|
|
QuoteRiskRespVo syRisk = new QuoteRiskRespVo();
|
|
|
syRisk.setRiskCode(InsuranceRisk.BUSINESS.getCode());
|
|
syRisk.setRiskCode(InsuranceRisk.BUSINESS.getCode());
|
|
|
syRisk.setRiskName(InsuranceRisk.BUSINESS.getDesc());
|
|
syRisk.setRiskName(InsuranceRisk.BUSINESS.getDesc());
|
|
|
- if(!Objects.isNull(odr1009Response.getResult().getBasePart().getSyPremium())) {
|
|
|
|
|
|
|
+ if (!Objects.isNull(odr1009Response.getResult().getBasePart().getSyPremium())) {
|
|
|
syRisk.setPremium(Double.parseDouble(odr1009Response.getResult().getBasePart().getSyPremium().toString()));
|
|
syRisk.setPremium(Double.parseDouble(odr1009Response.getResult().getBasePart().getSyPremium().toString()));
|
|
|
syRisk.setStartDate(odr1009Response.getResult().getBasePart().getSyEffectiveDate().toString());
|
|
syRisk.setStartDate(odr1009Response.getResult().getBasePart().getSyEffectiveDate().toString());
|
|
|
syRisk.setEndDate(odr1009Response.getResult().getBasePart().getSyExpireDate().toString());
|
|
syRisk.setEndDate(odr1009Response.getResult().getBasePart().getSyExpireDate().toString());
|
|
@@ -531,11 +544,10 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
//判断是否出险
|
|
//判断是否出险
|
|
|
String EscNum = "";
|
|
String EscNum = "";
|
|
|
- if(odr1009Response.getResult().getRiskRatio().getJqPreEscNum() != null && odr1009Response.getResult().getRiskRatio().getJqPreEscNum() > 0)
|
|
|
|
|
- {
|
|
|
|
|
- EscNum += "交强险出险次数:" + odr1009Response.getResult().getRiskRatio().getJqPreEscNum()+"次 ";
|
|
|
|
|
|
|
+ if (odr1009Response.getResult().getRiskRatio().getJqPreEscNum() != null && odr1009Response.getResult().getRiskRatio().getJqPreEscNum() > 0) {
|
|
|
|
|
+ EscNum += "交强险出险次数:" + odr1009Response.getResult().getRiskRatio().getJqPreEscNum() + "次 ";
|
|
|
}
|
|
}
|
|
|
- if(odr1009Response.getResult().getRiskRatio().getSyPreEscNum() != null && odr1009Response.getResult().getRiskRatio().getSyPreEscNum() > 0){
|
|
|
|
|
|
|
+ if (odr1009Response.getResult().getRiskRatio().getSyPreEscNum() != null && odr1009Response.getResult().getRiskRatio().getSyPreEscNum() > 0) {
|
|
|
EscNum += "商业险出险次数:" + odr1009Response.getResult().getRiskRatio().getSyPreEscNum() + "次";
|
|
EscNum += "商业险出险次数:" + odr1009Response.getResult().getRiskRatio().getSyPreEscNum() + "次";
|
|
|
}
|
|
}
|
|
|
quoteRespVo.setAccidentInfoStr(EscNum);
|
|
quoteRespVo.setAccidentInfoStr(EscNum);
|
|
@@ -580,20 +592,20 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
insOrders);
|
|
insOrders);
|
|
|
ODR1010Response odr1010Response = daJiaRequestApiComponents.underwriting(odr1010Request);
|
|
ODR1010Response odr1010Response = daJiaRequestApiComponents.underwriting(odr1010Request);
|
|
|
if (odr1010Response.getStatus().equals(Message.M0000.getCode())) {
|
|
if (odr1010Response.getStatus().equals(Message.M0000.getCode())) {
|
|
|
- if("0".equals(odr1010Response.getResult().getJqAppStatus()) || "0".equals(odr1010Response.getResult().getSyAppStatus())){
|
|
|
|
|
- if("0".equals(odr1010Response.getResult().getJqAppStatus())) {
|
|
|
|
|
|
|
+ if ("0".equals(odr1010Response.getResult().getJqAppStatus()) || "0".equals(odr1010Response.getResult().getSyAppStatus())) {
|
|
|
|
|
+ if ("0".equals(odr1010Response.getResult().getJqAppStatus())) {
|
|
|
return HttpResult.error("自核失败,原因:" + odr1010Response.getResult().getJqAppStatusMessage());
|
|
return HttpResult.error("自核失败,原因:" + odr1010Response.getResult().getJqAppStatusMessage());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("自核失败,原因:" + odr1010Response.getResult().getSyAppStatusMessage());
|
|
return HttpResult.error("自核失败,原因:" + odr1010Response.getResult().getSyAppStatusMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if("1".equals(odr1010Response.getResult().getJqAppStatus()) || "1".equals(odr1010Response.getResult().getSyAppStatus())){
|
|
|
|
|
|
|
+ if ("1".equals(odr1010Response.getResult().getJqAppStatus()) || "1".equals(odr1010Response.getResult().getSyAppStatus())) {
|
|
|
//修改状态 转人工
|
|
//修改状态 转人工
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
|
- if("1".equals(odr1010Response.getResult().getJqAppStatus())) {
|
|
|
|
|
|
|
+ if ("1".equals(odr1010Response.getResult().getJqAppStatus())) {
|
|
|
return HttpResult.error("自核转人工,原因:" + odr1010Response.getResult().getJqAppStatusMessage());
|
|
return HttpResult.error("自核转人工,原因:" + odr1010Response.getResult().getJqAppStatusMessage());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("自核转人工,原因:" + odr1010Response.getResult().getSyAppStatusMessage());
|
|
return HttpResult.error("自核转人工,原因:" + odr1010Response.getResult().getSyAppStatusMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -604,13 +616,13 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
ODR1011Response payNo = null;
|
|
ODR1011Response payNo = null;
|
|
|
boolean flag = true;
|
|
boolean flag = true;
|
|
|
Integer frequencyControl = 0;
|
|
Integer frequencyControl = 0;
|
|
|
- while(flag){
|
|
|
|
|
|
|
+ while (flag) {
|
|
|
payNo = daJiaRequestApiComponents.getPayNo(odr1011Request);
|
|
payNo = daJiaRequestApiComponents.getPayNo(odr1011Request);
|
|
|
- if("0000".equals(payNo.getStatus())){
|
|
|
|
|
|
|
+ if ("0000".equals(payNo.getStatus())) {
|
|
|
flag = false;
|
|
flag = false;
|
|
|
}
|
|
}
|
|
|
frequencyControl += 1;
|
|
frequencyControl += 1;
|
|
|
- if(frequencyControl > 20){
|
|
|
|
|
|
|
+ if (frequencyControl > 20) {
|
|
|
throw new RuntimeException("获取支付二维码失败");
|
|
throw new RuntimeException("获取支付二维码失败");
|
|
|
}
|
|
}
|
|
|
Thread.sleep(500);
|
|
Thread.sleep(500);
|
|
@@ -624,7 +636,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
return HttpResult.ok("核保成功");
|
|
return HttpResult.ok("核保成功");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if(Message.M0003.getCode().equals(odr1010Response.getStatus()) || Message.M0002.getCode().equals(odr1010Response.getStatus())){
|
|
|
|
|
|
|
+ if (Message.M0003.getCode().equals(odr1010Response.getStatus()) || Message.M0002.getCode().equals(odr1010Response.getStatus())) {
|
|
|
return HttpResult.error("核保失败,原因:" + odr1010Response.getMessage());
|
|
return HttpResult.error("核保失败,原因:" + odr1010Response.getMessage());
|
|
|
}
|
|
}
|
|
|
if ("0".equals(odr1010Response.getResult().getJqAppStatus()) && "0003".equals(odr1010Response.getStatus())) {
|
|
if ("0".equals(odr1010Response.getResult().getJqAppStatus()) && "0003".equals(odr1010Response.getStatus())) {
|
|
@@ -634,13 +646,14 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return HttpResult.error("核保失败");
|
|
return HttpResult.error("核保失败");
|
|
|
- }catch(Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
throw new RuntimeException(e.getMessage());
|
|
throw new RuntimeException(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 上传影像
|
|
* 上传影像
|
|
|
|
|
+ *
|
|
|
* @param companyId
|
|
* @param companyId
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -648,7 +661,8 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
|
try {
|
|
try {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
|
|
|
- List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insAreaCompany.getOrderno(), insAreaCompany.getId());
|
|
|
|
|
|
|
+ List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insAreaCompany.getOrderno(),
|
|
|
|
|
+ insAreaCompany.getId());
|
|
|
//获取公司配置信息
|
|
//获取公司配置信息
|
|
|
DaJiaConfigureParameters daJiaConfigureParameters = new DaJiaConfigureParameters();
|
|
DaJiaConfigureParameters daJiaConfigureParameters = new DaJiaConfigureParameters();
|
|
|
configureParametersComponents.toEntity(daJiaConfigureParameters, insAreaCompany.getAgreementId());
|
|
configureParametersComponents.toEntity(daJiaConfigureParameters, insAreaCompany.getAgreementId());
|
|
@@ -670,35 +684,39 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
//region 订单状态查询
|
|
//region 订单状态查询
|
|
|
|
|
|
|
|
//检测是否进入人工
|
|
//检测是否进入人工
|
|
|
- public boolean checkArtificial(List<ODR2010Response.ResultDTO> result){
|
|
|
|
|
- List<ODR2010Response.ResultDTO> artificialCollect = result.stream().filter(x -> x.getNotifyType().equals("2002")).collect(Collectors.toList());
|
|
|
|
|
- if(artificialCollect.size() > 0){
|
|
|
|
|
|
|
+ public boolean checkArtificial(List<ODR2010Response.ResultDTO> result) {
|
|
|
|
|
+ List<ODR2010Response.ResultDTO> artificialCollect =
|
|
|
|
|
+ result.stream().filter(x -> x.getNotifyType().equals("2002")).collect(Collectors.toList());
|
|
|
|
|
+ if (artificialCollect.size() > 0) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//检测是否核保退回
|
|
//检测是否核保退回
|
|
|
- public boolean checkBack(List<ODR2010Response.ResultDTO> result){
|
|
|
|
|
- List<ODR2010Response.ResultDTO> backCollect = result.stream().filter(x -> x.getNotifyType().equals("2003") || x.getNotifyType().equals("2004")).collect(Collectors.toList());
|
|
|
|
|
- if(backCollect.size() > 0){
|
|
|
|
|
|
|
+ public boolean checkBack(List<ODR2010Response.ResultDTO> result) {
|
|
|
|
|
+ List<ODR2010Response.ResultDTO> backCollect =
|
|
|
|
|
+ result.stream().filter(x -> x.getNotifyType().equals("2003") || x.getNotifyType().equals("2004")).collect(Collectors.toList());
|
|
|
|
|
+ if (backCollect.size() > 0) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//检测核保通过是否存在支付连接
|
|
//检测核保通过是否存在支付连接
|
|
|
- public boolean checkPayLink(List<ODR2010Response.ResultDTO> result,InsAreaCompany insAreaCompany){
|
|
|
|
|
- List<ODR2010Response.ResultDTO> traverseCollect = result.stream().filter(x -> x.getNotifyType().equals("2005")).collect(Collectors.toList());
|
|
|
|
|
- if(traverseCollect.size() > 0 && ("".equals(insAreaCompany.getPaymentLink()) || insAreaCompany.getPaymentLink() != null)) {
|
|
|
|
|
|
|
+ public boolean checkPayLink(List<ODR2010Response.ResultDTO> result, InsAreaCompany insAreaCompany) {
|
|
|
|
|
+ List<ODR2010Response.ResultDTO> traverseCollect =
|
|
|
|
|
+ result.stream().filter(x -> x.getNotifyType().equals("2005")).collect(Collectors.toList());
|
|
|
|
|
+ if (traverseCollect.size() > 0 && ("".equals(insAreaCompany.getPaymentLink()) || insAreaCompany.getPaymentLink() != null)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//检测是否存在保单生成状态
|
|
//检测是否存在保单生成状态
|
|
|
- public boolean checkBdGen(List<ODR2010Response.ResultDTO> result){
|
|
|
|
|
- List<ODR2010Response.ResultDTO> collect = result.stream().filter(x -> x.getNotifyType().equals("2009")).collect(Collectors.toList());
|
|
|
|
|
|
|
+ public boolean checkBdGen(List<ODR2010Response.ResultDTO> result) {
|
|
|
|
|
+ List<ODR2010Response.ResultDTO> collect =
|
|
|
|
|
+ result.stream().filter(x -> x.getNotifyType().equals("2009")).collect(Collectors.toList());
|
|
|
return !collect.isEmpty();
|
|
return !collect.isEmpty();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -715,46 +733,47 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
//获取公司配置信息
|
|
//获取公司配置信息
|
|
|
DaJiaConfigureParameters daJiaConfigureParameters = new DaJiaConfigureParameters();
|
|
DaJiaConfigureParameters daJiaConfigureParameters = new DaJiaConfigureParameters();
|
|
|
configureParametersComponents.toEntity(daJiaConfigureParameters, insAreaCompany.getAgreementId());
|
|
configureParametersComponents.toEntity(daJiaConfigureParameters, insAreaCompany.getAgreementId());
|
|
|
- ODR2010Request odr2010Request = new ODR2010Request(insAreaCompany.getInsOrderNo(),daJiaConfigureParameters);
|
|
|
|
|
|
|
+ ODR2010Request odr2010Request = new ODR2010Request(insAreaCompany.getInsOrderNo(), daJiaConfigureParameters);
|
|
|
ODR2010Response odr2010Response = daJiaRequestApiComponents.verifyPayment(odr2010Request);
|
|
ODR2010Response odr2010Response = daJiaRequestApiComponents.verifyPayment(odr2010Request);
|
|
|
- if(odr2010Response.getStatus().equals(Message.M0000.getCode())){
|
|
|
|
|
|
|
+ if (odr2010Response.getStatus().equals(Message.M0000.getCode())) {
|
|
|
List<ODR2010Response.ResultDTO> result = odr2010Response.getResult();
|
|
List<ODR2010Response.ResultDTO> result = odr2010Response.getResult();
|
|
|
//是否人工核保
|
|
//是否人工核保
|
|
|
- if(checkArtificial(result))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (checkArtificial(result)) {
|
|
|
//是否存在核保退回
|
|
//是否存在核保退回
|
|
|
- if(checkBack(result)){
|
|
|
|
|
|
|
+ if (checkBack(result)) {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
|
- }else
|
|
|
|
|
|
|
+ } else
|
|
|
//存在 核保通过 并且 不存在支付连接 则 生成支付连接
|
|
//存在 核保通过 并且 不存在支付连接 则 生成支付连接
|
|
|
- if(!checkPayLink(result,insAreaCompany)){
|
|
|
|
|
|
|
+ if (!checkPayLink(result, insAreaCompany)) {
|
|
|
//核保成功 获取支付二维码
|
|
//核保成功 获取支付二维码
|
|
|
//驾意险 返回数据
|
|
//驾意险 返回数据
|
|
|
List<NVHLODR1001Response.policyInfosDTO> policyInfosDTOS = null;
|
|
List<NVHLODR1001Response.policyInfosDTO> policyInfosDTOS = null;
|
|
|
- if(!Objects.isNull(insAreaCompany.getCrossInsurance())){
|
|
|
|
|
- policyInfosDTOS = JSON.parseArray(JSON.toJSONString(insAreaCompany.getCrossInsurance()),NVHLODR1001Response.policyInfosDTO.class);
|
|
|
|
|
|
|
+ if (!Objects.isNull(insAreaCompany.getCrossInsurance())) {
|
|
|
|
|
+ policyInfosDTOS = JSON.parseArray(JSON.toJSONString(insAreaCompany.getCrossInsurance()),
|
|
|
|
|
+ NVHLODR1001Response.policyInfosDTO.class);
|
|
|
}
|
|
}
|
|
|
- ODR1011Request odr1011Request = new ODR1011Request(insAreaCompany.getInsOrderNo(),daJiaConfigureParameters,policyInfosDTOS);
|
|
|
|
|
|
|
+ ODR1011Request odr1011Request = new ODR1011Request(insAreaCompany.getInsOrderNo(), daJiaConfigureParameters,
|
|
|
|
|
+ policyInfosDTOS);
|
|
|
ODR1011Response payNo = daJiaRequestApiComponents.getPayNo(odr1011Request);
|
|
ODR1011Response payNo = daJiaRequestApiComponents.getPayNo(odr1011Request);
|
|
|
- if(payNo.getStatus().equals(Message.M0000.getCode())) {
|
|
|
|
|
|
|
+ if (payNo.getStatus().equals(Message.M0000.getCode())) {
|
|
|
//获取支付二维码成功 保存支付二维码
|
|
//获取支付二维码成功 保存支付二维码
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
insAreaCompany.setPaymentLink(payNo.getResult().getSignInfoUrl());
|
|
insAreaCompany.setPaymentLink(payNo.getResult().getSignInfoUrl());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("获取支付二维码失败");
|
|
return HttpResult.error("获取支付二维码失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//是否存在保单生成
|
|
//是否存在保单生成
|
|
|
- if(checkBdGen(result) && !"3".equals(insAreaCompany.getOrderstatus()))
|
|
|
|
|
- {
|
|
|
|
|
- List<ODR2010Response.ResultDTO> collect = result.stream().filter(x -> x.getNotifyType().equals("2009")).collect(Collectors.toList());
|
|
|
|
|
|
|
+ if (checkBdGen(result) && !"3".equals(insAreaCompany.getOrderstatus())) {
|
|
|
|
|
+ List<ODR2010Response.ResultDTO> collect =
|
|
|
|
|
+ result.stream().filter(x -> x.getNotifyType().equals("2009")).collect(Collectors.toList());
|
|
|
|
|
|
|
|
//如果交强和商业都不为空
|
|
//如果交强和商业都不为空
|
|
|
- if(insAreaCompany.getJqapplyno() != null && insAreaCompany.getSyapplyno() != null){
|
|
|
|
|
- if(collect.size() < 2){
|
|
|
|
|
|
|
+ if (insAreaCompany.getJqapplyno() != null && insAreaCompany.getSyapplyno() != null) {
|
|
|
|
|
+ if (collect.size() < 2) {
|
|
|
return HttpResult.ok("查询订单状态成功");
|
|
return HttpResult.ok("查询订单状态成功");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -765,7 +784,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
insAreaCompany.setJqpolicyno(collect.get(i).getPlyNo());
|
|
insAreaCompany.setJqpolicyno(collect.get(i).getPlyNo());
|
|
|
} else if (collect.get(i).getProdNo().equals(CProdNo.SY.getCode())) {
|
|
} else if (collect.get(i).getProdNo().equals(CProdNo.SY.getCode())) {
|
|
|
insAreaCompany.setSypolicyno(collect.get(i).getPlyNo());
|
|
insAreaCompany.setSypolicyno(collect.get(i).getPlyNo());
|
|
|
- } else if(collect.get(i).getProdNo().equals(CProdNo.SY_XNY.getCode())){
|
|
|
|
|
|
|
+ } else if (collect.get(i).getProdNo().equals(CProdNo.SY_XNY.getCode())) {
|
|
|
//新能源保单号
|
|
//新能源保单号
|
|
|
insAreaCompany.setSypolicyno(collect.get(i).getPlyNo());
|
|
insAreaCompany.setSypolicyno(collect.get(i).getPlyNo());
|
|
|
}
|
|
}
|
|
@@ -780,7 +799,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return HttpResult.ok("查询订单状态成功");
|
|
return HttpResult.ok("查询订单状态成功");
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
throw new RuntimeException(e.getMessage());
|
|
throw new RuntimeException(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -789,6 +808,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取保单
|
|
* 获取保单
|
|
|
|
|
+ *
|
|
|
* @param policyPrintVo
|
|
* @param policyPrintVo
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -883,29 +903,32 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
|
|
|
|
|
|
|
|
ODR1014Request odr1014Request = new ODR1014Request(insAreaCompany.getInsOrderNo(), daJiaConfigureParameters);
|
|
ODR1014Request odr1014Request = new ODR1014Request(insAreaCompany.getInsOrderNo(), daJiaConfigureParameters);
|
|
|
ODR1014Response odr1014Response = daJiaRequestApiComponents.orderBack(odr1014Request);
|
|
ODR1014Response odr1014Response = daJiaRequestApiComponents.orderBack(odr1014Request);
|
|
|
- if("0000".equals(odr1014Response.getStatus())){
|
|
|
|
|
|
|
+ if ("0000".equals(odr1014Response.getStatus())) {
|
|
|
return HttpResult.ok("退单成功");
|
|
return HttpResult.ok("退单成功");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("退单失败");
|
|
return HttpResult.error("退单失败");
|
|
|
}
|
|
}
|
|
|
- }catch(Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
throw new RuntimeException(e.getMessage());
|
|
throw new RuntimeException(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取驾意险列表
|
|
* 获取驾意险列表
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> accidentalDrivingList(AccidentalInsuranceQueryVo queryVo) {
|
|
public HttpResult<Object> accidentalDrivingList(AccidentalInsuranceQueryVo queryVo) {
|
|
|
- List<InsAccidentalDrivingDajia> list = insAccidentalDrivingDaJiaService.list(new LambdaQueryWrapper<InsAccidentalDrivingDajia>().eq(InsAccidentalDrivingDajia::getAgreementId, queryVo.getAgreementId()));
|
|
|
|
|
|
|
+ List<InsAccidentalDrivingDajia> list =
|
|
|
|
|
+ insAccidentalDrivingDaJiaService.list(new LambdaQueryWrapper<InsAccidentalDrivingDajia>().eq(InsAccidentalDrivingDajia::getAgreementId, queryVo.getAgreementId()));
|
|
|
return HttpResult.ok("获取驾意险列表成功", list);
|
|
return HttpResult.ok("获取驾意险列表成功", list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> accidentalDrivingInfo(String accidentalId) {
|
|
public HttpResult<Object> accidentalDrivingInfo(String accidentalId) {
|
|
|
- List<InsAccidentalDrivingSubDajia> list = insAccidentalDrivingSubDaJiaService.list(new LambdaQueryWrapper<InsAccidentalDrivingSubDajia>().eq(InsAccidentalDrivingSubDajia::getAccId, accidentalId));
|
|
|
|
|
|
|
+ List<InsAccidentalDrivingSubDajia> list =
|
|
|
|
|
+ insAccidentalDrivingSubDaJiaService.list(new LambdaQueryWrapper<InsAccidentalDrivingSubDajia>().eq(InsAccidentalDrivingSubDajia::getAccId, accidentalId));
|
|
|
return HttpResult.ok("获取驾意险详情成功", list);
|
|
return HttpResult.ok("获取驾意险详情成功", list);
|
|
|
}
|
|
}
|
|
|
|
|
|