|
|
@@ -1,11 +1,10 @@
|
|
|
package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.ydtech.config.properties.PingAnApiConfigurationProperties;
|
|
|
-import com.ydtech.constants.enums.InsurKind;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
@@ -49,12 +48,14 @@ import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
|
|
|
import com.ydtech.modules.order.service.*;
|
|
|
import com.ydtech.modules.order.utils.MD5Util;
|
|
|
import com.ydtech.modules.order.utils.PingAnUpLoadUtils;
|
|
|
+import com.ydtech.modules.order.utils.pingan.PingAnQuoteRequestAnnotationParser;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.utils.CalculateUtils;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
@@ -95,7 +96,12 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
|
|
|
private final InsTaskImagesMapper insTaskImagesMapper;
|
|
|
|
|
|
+ @Value("${upload.file.path}")
|
|
|
+ private String uploadPath;
|
|
|
|
|
|
+ private String EXCEL_PATH = "excel//";
|
|
|
+
|
|
|
+ private String UPLOAD_PATH = "/upload//excel//";
|
|
|
/**
|
|
|
* @Description 获取财意险险种套餐列表 调用 4.4
|
|
|
* @Author hxl
|
|
|
@@ -206,6 +212,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
|
|
|
//验证参数
|
|
|
checkData(quoteVo);
|
|
|
+ //补充身份证信息
|
|
|
+ quoteInfo = getQuoteInfoData(quoteInfo);
|
|
|
// 车型查询
|
|
|
CarInfoVo carInfo = quoteInfo.getCarInfo();
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(quoteVo.getOrderNo(),null,quoteVo.getAgreementId());
|
|
|
@@ -218,6 +226,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
// 1. 标的信息
|
|
|
IndexRequest indexRequest = new IndexRequest(parameters, carInfo);
|
|
|
IndexResponse indexResponse = pinganRequestApiComponents.index(indexRequest,pinganApiLog);
|
|
|
+ if (indexResponse == null || !"0".equals(indexResponse.getResultCode())) {
|
|
|
+ throw new SystemException(indexResponse.getResultMessage());
|
|
|
+ }
|
|
|
+ //增值服务核保传入开关,打开时保费计算无需传入,保费计算返回增值服务信息,核保传入
|
|
|
+ String clauseCaseSwitch = indexResponse.getClauseCaseSwitch();
|
|
|
// 此处返回的 flowid 4.1.续保确认 4.2.车辆信息确认 001 平安车型搜索接口 需要使用
|
|
|
String flowid = indexResponse.getFlowid();
|
|
|
// 2. 车型查询
|
|
|
@@ -235,14 +248,36 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
SearchPAVehicleListResponse.ModelsDto model = new SearchPAVehicleListResponse.ModelsDto();
|
|
|
if (models != null && models.size() == 1) {
|
|
|
model = models.get(0);
|
|
|
- //通过年款和新车购置价确定唯一
|
|
|
} else if (models != null && models.size() > 1) {
|
|
|
- //List<SearchPAVehicleListResponse.ModelsDto> list = models.stream()
|
|
|
- // .filter(p -> p.getMarketDate().equals(carInfo.getCaryear()==null?carInfo.getCaryear().substring(0,3):"") && p.getPrice().equals(carInfo.getPurchasePrice()))
|
|
|
- // .collect(Collectors.toList());
|
|
|
- // if(list!=null && list.size()>0){
|
|
|
+ /**
|
|
|
+ //通过年款和新车购置价确定唯一
|
|
|
+ String purchasePrice = carInfo.getPurchasePrice();
|
|
|
+ String caryear = carInfo.getPurchasePrice();
|
|
|
+ Iterator<SearchPAVehicleListResponse.ModelsDto> it = models.iterator();
|
|
|
+ while(it.hasNext()){
|
|
|
+ SearchPAVehicleListResponse.ModelsDto x = it.next();
|
|
|
+ if(!purchasePrice.equals(x.getPrice())){
|
|
|
+ it.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(caryear) && models.size()>1){
|
|
|
+ Iterator<SearchPAVehicleListResponse.ModelsDto> itNew = models.iterator();
|
|
|
+ while(it.hasNext()){
|
|
|
+ SearchPAVehicleListResponse.ModelsDto x = itNew.next();
|
|
|
+ if(!caryear.contains(x.getMarketDate())){
|
|
|
+ it.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(models.size()>1){
|
|
|
+ throw new SystemException("请确认车型,检索出多个下车型,请填写正确信息");
|
|
|
+ }else if(models.size()==0){
|
|
|
+ throw new SystemException("未匹配到车型");
|
|
|
+ }else if(models.size()==1){
|
|
|
+ model = models.get(0);
|
|
|
+ }
|
|
|
+ **/
|
|
|
model = models.get(0);
|
|
|
- //}
|
|
|
}
|
|
|
// 3. 车辆信息确认
|
|
|
pinganApiLog.setId(null);
|
|
|
@@ -255,13 +290,15 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
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())){
|
|
|
//新能源参数传递
|
|
|
- quoteRequest = quoteRequest.transferPingAnRequestMsgNY(quoteInfo.getKindList(), quoteRequest,carConfirmResponse.getBizQuoteConfig());
|
|
|
+ flag="XNY";
|
|
|
}else{
|
|
|
//客车、货车传递
|
|
|
- quoteRequest = quoteRequest.transferPingAnRequestMsg(quoteInfo.getKindList(), quoteRequest,carConfirmResponse.getBizQuoteConfig());
|
|
|
+ flag="FXNY";
|
|
|
}
|
|
|
+ quoteRequest = PingAnQuoteRequestAnnotationParser.processAnnotationsQuoteRequest(quoteRequest, quoteInfo.getKindList(), carConfirmResponse.getBizQuoteConfig(), flag);
|
|
|
QuoteResponse quoteResponse = null;
|
|
|
try {
|
|
|
quoteResponse = pinganRequestApiComponents.quote(quoteRequest,pinganApiLog);
|
|
|
@@ -278,6 +315,34 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/9 10:29
|
|
|
+ * @Description: 补充信息
|
|
|
+ */
|
|
|
+ private static BaseQuoteInfoVo getQuoteInfoData(BaseQuoteInfoVo quoteInfo) {
|
|
|
+ // 车主
|
|
|
+ CustomerInfoVo ownerInfo = quoteInfo.getOwnerInfo();
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(ownerInfo.getIdentifyType())){
|
|
|
+ ownerInfo.setIdentifyType("01");
|
|
|
+ quoteInfo.setOwnerInfo(ownerInfo);
|
|
|
+ }
|
|
|
+ // 投保人信息
|
|
|
+ CustomerInfoVo policyHolderInfo = quoteInfo.getPolicyHolderInfo();
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(policyHolderInfo.getIdentifyType())){
|
|
|
+ policyHolderInfo.setIdentifyType("01");
|
|
|
+ quoteInfo.setPolicyHolderInfo(policyHolderInfo);
|
|
|
+ }
|
|
|
+ // 被保人信息
|
|
|
+ CustomerInfoVo insuredPersonInfo = quoteInfo.getInsuredPersonInfo();
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(insuredPersonInfo.getIdentifyType())){
|
|
|
+ insuredPersonInfo.setIdentifyType("01");
|
|
|
+ quoteInfo.setInsuredPersonInfo(insuredPersonInfo);
|
|
|
+ }
|
|
|
+ return quoteInfo;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @version
|
|
|
* @author: hxl
|
|
|
@@ -286,6 +351,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
*/
|
|
|
private static void checkData(PingAnQuoteVo<Map<String, Object>> quoteVo) {
|
|
|
String agreementId = quoteVo.getAgreementId();
|
|
|
+
|
|
|
if(StringUtils.isBlank(agreementId)){
|
|
|
throw new SystemException("未选择协议不能报价");
|
|
|
}
|
|
|
@@ -318,9 +384,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
PingAnQuoteRespVo quoteRespVo = new PingAnQuoteRespVo();
|
|
|
CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
//新能源返回参数不一样
|
|
|
- Boolean xnyFlag=false;
|
|
|
+ String xnyFlag="";
|
|
|
if("1,2,3,".contains(carInfo.getEnergyType())){
|
|
|
- xnyFlag=true;
|
|
|
+ xnyFlag="XNY";
|
|
|
+ }else{
|
|
|
+ xnyFlag="FXNY";
|
|
|
}
|
|
|
// 交强险保费信息
|
|
|
QuoteResponse.ForceQuoteResultDTO forceQuoteResult = response.getForceQuoteResult();
|
|
|
@@ -368,7 +436,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
kind.setKindCode(kindInfoVo.getKindCode());
|
|
|
kind.setKindName(kindInfoVo.getKindName());
|
|
|
kind.setAmount(kindInfoVo.getAmount());
|
|
|
- kind.setCoveragePremium(getPremium(bizQuoteResult,xnyFlag,kindInfoVo.getKindCode()));
|
|
|
+ kind.setCoveragePremium(PingAnQuoteRequestAnnotationParser.processAnnotationsQuoteResponse(bizQuoteResult,kindInfoVo.getKindCode(),xnyFlag));
|
|
|
kind.setUnitAmount(kindInfoVo.getUnitAmount());
|
|
|
kind.setServiceTimes(String.valueOf(kindInfoVo.getServiceTimes()));
|
|
|
if (!ObjectUtils.isEmpty(kindInfoVo.getDeductibleRate())) {
|
|
|
@@ -428,170 +496,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
quoteRespVo.setCoreModels(modelsDto.toCoreModelsVo());
|
|
|
return responseOrder(response, quoteRespVo, ptlAgreementAttribution, carConfirmResponse,quoteVo);
|
|
|
}
|
|
|
- /**
|
|
|
- * @version
|
|
|
- * @author: hxl
|
|
|
- * @Date: 2024/8/6 17:46
|
|
|
- * @Description: 赋值新能源、非新能源的商业险信息
|
|
|
- */
|
|
|
- private double getPremium(QuoteResponse.BizQuoteResultDTO bizQuoteResult, Boolean xnyFlag,String code) {
|
|
|
- double val=0;
|
|
|
- //机动车损失保险保费
|
|
|
- if (InsurKind.A.getCode().equalsIgnoreCase(code)) {
|
|
|
- //能源车
|
|
|
- if(xnyFlag){
|
|
|
- //premium01XNY C 新能源汽车损失保险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium01XNY())?0:Double.parseDouble(bizQuoteResult.getPremium01XNY());
|
|
|
- }else{
|
|
|
- // premium01 C 机动车损失保险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium01())?0:Double.parseDouble(bizQuoteResult.getPremium01());
|
|
|
- }
|
|
|
- }
|
|
|
- //三者险
|
|
|
- if (InsurKind.B.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- //premium02XNY C 新能源汽车第三者责任保险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium02XNY())?0:Double.parseDouble(bizQuoteResult.getPremium02XNY());
|
|
|
- }else{
|
|
|
- // premium02 C 机动车第三者责任保险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium02())?0:Double.parseDouble(bizQuoteResult.getPremium02());
|
|
|
- }
|
|
|
- }
|
|
|
- //乘客责任险
|
|
|
- if (InsurKind.D4.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- //premium03XNY C 新能源汽车车上人员责任保险(司机)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium03XNY())?0:Double.parseDouble(bizQuoteResult.getPremium03XNY());
|
|
|
- }else{
|
|
|
- //premium04 C 机动车车上人员责任保险(司机)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium04())?0:Double.parseDouble(bizQuoteResult.getPremium04());
|
|
|
- }
|
|
|
- }
|
|
|
- //司机责任险
|
|
|
- if (InsurKind.D3.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium04XNY C单座保费*乘客座位数 新能源汽车车上人员责任保险(乘客)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium04XNY())?0:Double.parseDouble(bizQuoteResult.getPremium04XNY());
|
|
|
- }else{
|
|
|
- //premium05 C单座保费*乘客座位数 机动车车上人员责任保险(乘客)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium05())?0:Double.parseDouble(bizQuoteResult.getPremium05());
|
|
|
- }
|
|
|
- }
|
|
|
- // 客车 premium06 C * 附加车上货物责任险保费 能源无
|
|
|
- // 附加医保外用药责任险(第三者责任保险)
|
|
|
- if (InsurKind.SY_FJ_YBW1.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium18XNY C 附加医保外用药责任险保额(三者)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium18XNY())?0:Double.parseDouble(bizQuoteResult.getPremium18XNY());
|
|
|
- }else{
|
|
|
- // premium07 C 附加医保外用药责任险保费(三者)
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium07())?0:Double.parseDouble(bizQuoteResult.getPremium07());
|
|
|
- }
|
|
|
- }
|
|
|
- // 附加医保外用药责任险(车上人员责任保险(乘客))
|
|
|
- if (InsurKind.SY_FJ_YBW2.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium19XNY C 附加医保外用药责任险保额(司机)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium19XNY())?0:Double.parseDouble(bizQuoteResult.getPremium19XNY());
|
|
|
- }else{
|
|
|
- // premium08 C 附加医保外用药责任险保费(司机)
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium08())?0:Double.parseDouble(bizQuoteResult.getPremium08());
|
|
|
- }
|
|
|
- }
|
|
|
- // 附加医保外用药责任险(车上人员责任保险(司机))
|
|
|
- if (InsurKind.SY_FJ_YBW3.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium20XNY C 附加医保外用药责任险保额(乘客)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium20XNY())?0:Double.parseDouble(bizQuoteResult.getPremium20XNY());
|
|
|
- }else{
|
|
|
- // premium09 C 附加医保外用药责任险保费(乘客)
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium09())?0:Double.parseDouble(bizQuoteResult.getPremium09());
|
|
|
- }
|
|
|
- }
|
|
|
- // 附加绝对免赔率特约条款(车损)
|
|
|
- if (InsurKind.MJ1.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium05XNY C * 附加绝对免赔率特约险(车损)保费 能源车
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium05XNY())?0:Double.parseDouble(bizQuoteResult.getPremium05XNY());
|
|
|
- }else{
|
|
|
- //premium53 C 附加绝对免赔率特约险(车损)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium53())?0:Double.parseDouble(bizQuoteResult.getPremium53());
|
|
|
- }
|
|
|
- }
|
|
|
- // 附加绝对免赔率特约条款(机动车第三者责任保险)
|
|
|
- if (InsurKind.MJ2.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium06XNY C 附加绝对免赔率特约险(三者)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium06XNY())?0:Double.parseDouble(bizQuoteResult.getPremium06XNY());
|
|
|
- }else{
|
|
|
- // premium54 C 附加绝对免赔率特约险(三者)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium54())?0:Double.parseDouble(bizQuoteResult.getPremium54());
|
|
|
- }
|
|
|
- }
|
|
|
- // 附加绝对免赔率特约条款(机动车车上人员责任保险(司机))
|
|
|
- if (InsurKind.MJ3.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // //premium07XNY C 附加绝对免赔率特约险(车上人员司机)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium07XNY())?0:Double.parseDouble(bizQuoteResult.getPremium07XNY());
|
|
|
- }else{
|
|
|
- //premium55 C 附加绝对免赔率特约险(车上人员司机)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium55())?0:Double.parseDouble(bizQuoteResult.getPremium55());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // 附加绝对免赔率特约条款(机动车车上人员责任保险(乘客))
|
|
|
- if (InsurKind.MJ4.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // premium08XNY C 附加绝对免赔率特约险(车上人员乘客)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium08XNY())?0:Double.parseDouble(bizQuoteResult.getPremium08XNY());
|
|
|
- }else{
|
|
|
- // * premium56 C 附加绝对免赔率特约险(车上人员乘客)保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium56())?0:Double.parseDouble(bizQuoteResult.getPremium56());
|
|
|
- }
|
|
|
- }
|
|
|
- //附加修理期间费用补偿险 premium10 C 附加修理期间费用补偿险保费 非能源 无
|
|
|
- // premium09XNY C 附加车轮单独损失险保费 能源车 无
|
|
|
- // premium10XNY C 附加新增加设备损失险保费 能源车 无
|
|
|
- // premium11 C 附加新增加设备损失险保费 非能源 无
|
|
|
- // 附加新增加设备损失险 暂时没有
|
|
|
- //附加车身划痕损失险
|
|
|
- if (InsurKind.L.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- //premium11XNY C 附加车身划痕损失险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium11XNY())?0:Double.parseDouble(bizQuoteResult.getPremium11XNY());
|
|
|
- }else{
|
|
|
- //premium17 C 附加车身划痕损失险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium17())?0:Double.parseDouble(bizQuoteResult.getPremium17());
|
|
|
- }
|
|
|
- }
|
|
|
- //附加法定节假日限额翻倍险
|
|
|
- if (InsurKind.BD.getCode().equalsIgnoreCase(code)) {
|
|
|
- if(xnyFlag){
|
|
|
- // * premium17XNY C 附加法定节假日限额翻倍险保费
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium17XNY())?0:Double.parseDouble(bizQuoteResult.getPremium17XNY());
|
|
|
- }else{
|
|
|
- //premium74 C 附加法定节假日限额翻倍险保费 能源无
|
|
|
- val = StringUtils.isBlank(bizQuoteResult.getPremium74())?0:Double.parseDouble(bizQuoteResult.getPremium74());
|
|
|
- }
|
|
|
- }
|
|
|
- //premium32 C 附加精神损害抚慰金责任险(三者)保费 能源无
|
|
|
- //premium30 C 附加精神损害抚慰金责任险(司机)保费 能源无
|
|
|
- // * premium31 C 附加精神损害抚慰金责任险(乘客)保费 能源无
|
|
|
- // * premium52 C 附加车轮单独损失险保费 能源无
|
|
|
- // * premium73 C 机动车钥匙丢失或损坏费用补偿险保费 能源无
|
|
|
- // *
|
|
|
- // * premium75 C 附加发动机损坏除外特约条款保费 能源无
|
|
|
- // premium12XNY C 附加修理期间费用补偿险保费 新能源 无
|
|
|
- //premium13XNY C 附加车上货物责任险保费
|
|
|
- // * premium14XNY C 附加精神损害抚慰金责任险(三者保费
|
|
|
- // * premium15XNY C 附加精神损害抚慰金责任险(司机保费
|
|
|
- //* premium16XNY C 附加精神损害抚慰金责任险(乘客保费
|
|
|
- //* premium21XNY C 附加外部电网故障损失险保费
|
|
|
- // * premium22XNY C 附加自用充电桩损失保险保费
|
|
|
- // * premium23XNY C 附加自用充电桩责任保险保费
|
|
|
- return val;
|
|
|
- }
|
|
|
|
|
|
public HttpResult<QuoteRespVo> responseOrder(QuoteResponse response,
|
|
|
PingAnQuoteRespVo quoteRespVo,
|
|
|
@@ -729,8 +633,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
//此处的流程id必须传入 获取报价流程的返回的流程id
|
|
|
- String flowid = insAreaCompany.getInsOrderNo();
|
|
|
-
|
|
|
+ String flowid = insAreaCompany.getFlowid();
|
|
|
InsOrders insOrders = insOrdersService.existOrder(insAreaCompany.getOrderno());
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
|
|
|
//组装上传的资料信息提交
|
|
|
@@ -773,6 +676,7 @@ 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<String> list = new ArrayList<String>();
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
list.add(bizApplyNo);
|
|
|
@@ -780,6 +684,9 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
+ list.add(accidentApplyNo);
|
|
|
+ }
|
|
|
pinganApiLog.setId(null);
|
|
|
DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
DocumentStatusListResponse documentStatusListResponse = null;
|
|
|
@@ -793,23 +700,35 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if (documentList != null && documentList.size() > 0) {
|
|
|
Boolean jqflag = false;
|
|
|
Boolean sqflag = false;
|
|
|
+ Boolean fcflag = false;
|
|
|
//B2 为 未缴费
|
|
|
for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && bizApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
sqflag = true;
|
|
|
}
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && forceApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
jqflag = true;
|
|
|
}
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
+ fcflag = true;
|
|
|
+ }
|
|
|
}
|
|
|
- if ("单交".equals(insAreaCompany.getProduct()) && jqflag) {
|
|
|
+ if (jqflag) {
|
|
|
insAreaCompany.setJqapplyno(forceApplyNo);
|
|
|
- } else if (("交三".equals(insAreaCompany.getProduct()) || "交商".equals(insAreaCompany.getProduct())) && jqflag && sqflag) {
|
|
|
- insAreaCompany.setJqpolicyno(forceApplyNo);
|
|
|
- insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
- } else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && sqflag) {
|
|
|
+ }
|
|
|
+ if(sqflag){
|
|
|
insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
}
|
|
|
+ if(fcflag){
|
|
|
+ List<Map<String,String>> jyList =new ArrayList<Map<String,String>>();
|
|
|
+ Map<String,String> map =new HashMap<String,String>();
|
|
|
+ //投保单号
|
|
|
+ map.put("application",accidentApplyNo);
|
|
|
+ map.put("policy","");
|
|
|
+ jyList.add(map);
|
|
|
+ JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
|
|
|
+ insAreaCompany.setCrossInsurance(objects);
|
|
|
+ }
|
|
|
//说明核保成功,更新大订单和小订单的状态为1 更新为已核保待缴费
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
@@ -847,43 +766,138 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
CustomerInfoVo ownerInfo = insOrders.getOwnerinfo().toJavaObject(CustomerInfoVo.class);
|
|
|
CarInfoVo carInfoVo = insOrders.getCarinfo().toJavaObject(CarInfoVo.class);
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),subOrderNo,insAreaCompany.getAgreementId());
|
|
|
+ //交强保单号
|
|
|
String jqpolicyno = insAreaCompany.getJqpolicyno();
|
|
|
- //调用 电子保单pdf 001
|
|
|
- PolicyPdfRequest policyPdfRequest = new PolicyPdfRequest(parameters.getUserId(), jqpolicyno, ownerInfo.getIdentifyNumber(), carInfoVo.getLicenseNo(), carInfoVo.getFrameNo());
|
|
|
+ //商业保单号
|
|
|
+ String sypolicyno = insAreaCompany.getSypolicyno();
|
|
|
+ JSONArray crossInsurance = insAreaCompany.getCrossInsurance();
|
|
|
+ //非车保单号
|
|
|
+ String application = null;
|
|
|
+ if(crossInsurance!=null && crossInsurance.size() > 0) {
|
|
|
+ application = crossInsurance.getJSONObject(0).getString("application");
|
|
|
+ }
|
|
|
+ CrawlerPolicyPrintVo crawlerPolicyPrintVo =new CrawlerPolicyPrintVo();
|
|
|
+ //交强
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(jqpolicyno) ){
|
|
|
+ String fileName="_交强险保单";
|
|
|
+ String fileBZName="-交强险标志";
|
|
|
+ String jqbdUrl= uploadPath+"//" + EXCEL_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ jqpolicyno+fileName+"-decipher.pdf";
|
|
|
+ String jqbzUrl= uploadPath+"//" + EXCEL_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ jqpolicyno+fileBZName+"-decipher.pdf";
|
|
|
+ String jqbdUrl_= UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ jqpolicyno+fileName+"-decipher.pdf";
|
|
|
+ String jqbzUrl_= UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ jqpolicyno+fileBZName+"-decipher.pdf";
|
|
|
+ File jqbdURL = new File(jqbdUrl);
|
|
|
+ File jqbzURL = new File(jqbzUrl);
|
|
|
+ if(jqbdURL.exists()){
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(jqbdUrl_);
|
|
|
+ }
|
|
|
+ if(jqbzURL.exists()){
|
|
|
+ crawlerPolicyPrintVo.setJqxFlagUrl(jqbzUrl_);
|
|
|
+ }
|
|
|
+ if(!jqbdURL.exists() && !jqbzURL.exists() ){
|
|
|
+ getPdfUrl(parameters, jqpolicyno,ownerInfo,carInfoVo, pinganApiLog, insAreaCompany, crawlerPolicyPrintVo,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sypolicyno)){
|
|
|
+ String fileName="_商业险保单";
|
|
|
+ String sybdUrl= uploadPath+"//" + EXCEL_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ sypolicyno+fileName+"-decipher.pdf";
|
|
|
+ String sybdUrl_= UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ sypolicyno+fileName+"-decipher.pdf";
|
|
|
+ File sybdURL = new File(sybdUrl);
|
|
|
+ if(sybdURL.exists()){
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(sybdUrl_);
|
|
|
+ }
|
|
|
+ if(!sybdURL.exists()) {
|
|
|
+ getPdfUrl(parameters, sypolicyno, ownerInfo, carInfoVo, pinganApiLog, insAreaCompany, crawlerPolicyPrintVo, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(application)){
|
|
|
+ String fileName="_非车险保单";
|
|
|
+ String fcxbdUrl= uploadPath+"//" + EXCEL_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ application+fileName+"-decipher.pdf";
|
|
|
+ String fcxbdUrl_= UPLOAD_PATH + insAreaCompany.getOrderno()+"-"+ insAreaCompany.getId()+"-"+ application+fileName+"-decipher.pdf";
|
|
|
+ File fcxbdURL = new File(fcxbdUrl);
|
|
|
+ if(fcxbdURL.exists()){
|
|
|
+ List<CrawlerPolicyPrintVo.JyxInfoListDTO> jyxInfoListDTOS = new ArrayList<>();
|
|
|
+ CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = new CrawlerPolicyPrintVo.JyxInfoListDTO();
|
|
|
+ jyxInfoListDTO.setJyxPolicyUrl(fcxbdUrl_);
|
|
|
+ jyxInfoListDTOS.add(jyxInfoListDTO);
|
|
|
+ crawlerPolicyPrintVo.setJyxInfoList(jyxInfoListDTOS);
|
|
|
+ }
|
|
|
+ if(!fcxbdURL.exists()) {
|
|
|
+ getPdfUrl(parameters, application,ownerInfo,carInfoVo, pinganApiLog, insAreaCompany, crawlerPolicyPrintVo,3);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/9 15:07
|
|
|
+ * @Description: 获取保单地址
|
|
|
+ */
|
|
|
+ private void getPdfUrl(PingAnConfigureParameters parameters, String policyno, CustomerInfoVo ownerInfo, CarInfoVo carInfoVo, PinganApiLog pinganApiLog, InsAreaCompany insAreaCompany, CrawlerPolicyPrintVo crawlerPolicyPrintVo,int type) {
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ String flag ="false";
|
|
|
+ String fileName="";
|
|
|
+ String fileBZName="";
|
|
|
+ //驾意险
|
|
|
+ if(type==3){
|
|
|
+ flag="true";
|
|
|
+ fileName="_非车险保单";
|
|
|
+ }else if(type==1){
|
|
|
+ //交强
|
|
|
+ fileName="_交强险保单";
|
|
|
+ fileBZName="-交强险标志";
|
|
|
+ }else if(type==2){
|
|
|
+ //商业
|
|
|
+ fileName="_商业险保单";
|
|
|
+ }
|
|
|
+ PolicyPdfRequest policyPdfRequest = new PolicyPdfRequest(parameters.getUserId(), policyno, ownerInfo.getIdentifyNumber(), carInfoVo.getLicenseNo(), carInfoVo.getFrameNo(),flag);
|
|
|
PolicyPdfResponse policyPdfResponse = null;
|
|
|
try {
|
|
|
- policyPdfResponse = pinganRequestApiComponents.getPolicyPdf(policyPdfRequest,pinganApiLog);
|
|
|
+ policyPdfResponse = pinganRequestApiComponents.getPolicyPdf(policyPdfRequest, pinganApiLog);
|
|
|
} catch (Exception e) {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
+ String saveFilePath = uploadPath+"//" + EXCEL_PATH;
|
|
|
+ String jqbdPath = "";
|
|
|
+ String jqbzPath = "";
|
|
|
if (policyPdfResponse != null) {
|
|
|
if (PolicyPdfResponseCodeEnum.POLICY_PDF_CODE_MSG_0.getCode().equals(policyPdfResponse.getResultCode())) {
|
|
|
- CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
|
|
|
String policyPdfBase64Str = policyPdfResponse.getPolicyPdf();
|
|
|
- //存储系统临时文件
|
|
|
- // 获取当前项目的目录
|
|
|
- File projectFile =new File(System.getProperty("user.dir"));
|
|
|
- // 获取上级目录
|
|
|
- String parentPath = projectFile.getParent();
|
|
|
- StringBuffer filePath = new StringBuffer();
|
|
|
- filePath.append(parentPath).append(jqpolicyno).append(File.separator).append(System.currentTimeMillis()).append(".pdf");
|
|
|
- String targertPath = filePath.toString();
|
|
|
- try {
|
|
|
- PDFUtil.decryptFileByPassword(policyPdfBase64Str, targertPath, properties.getPingAnPublicKey());
|
|
|
- if (Boolean.parseBoolean(policyPdfResponse.getPolicyPdf())) {
|
|
|
- crawlerPolicyPrintVo.setJqxPolicyUrl(targertPath);
|
|
|
- } else {
|
|
|
- crawlerPolicyPrintVo.setSyxPolicyUrl(targertPath);
|
|
|
+ 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;
|
|
|
+ try {
|
|
|
+ PDFUtil.decryptFileByPassword(flagPdf, jqBzTargertPath, properties.getPingAnPublicKey());
|
|
|
+ } catch (Exception e) {
|
|
|
+ jqbzPath=null;
|
|
|
}
|
|
|
- return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
+ crawlerPolicyPrintVo.setJqxFlagUrl(jqbzPath);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ String jqBdTargertPath = saveFilePath+yqbdFileName;
|
|
|
+ PDFUtil.decryptFileByPassword(policyPdfBase64Str, jqBdTargertPath, properties.getPingAnPublicKey());
|
|
|
} catch (Exception e) {
|
|
|
- return HttpResult.error("文件解密失败!!!");
|
|
|
+ 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);
|
|
|
}
|
|
|
- } else {
|
|
|
- return HttpResult.error(PinAnEnumUtils.getEnumValueByCode(PolicyPdfResponseCodeEnum.class, policyPdfResponse.getResultCode()));
|
|
|
}
|
|
|
}
|
|
|
- return HttpResult.error("获取保单地址失败");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1018,7 +1032,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
} else {
|
|
|
return HttpResult.error("二维码支付接口报错");
|
|
|
}
|
|
|
- insAreaCompany.setPaymentLink(payUrl);
|
|
|
+ insAreaCompany.setNoticeNo(noticeNo);
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
}
|
|
|
}
|
|
|
@@ -1237,14 +1251,24 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
ArrayList<String> list =new ArrayList<>();
|
|
|
- String forceApplyNo = insAreaCompany.getJqapplyno();
|
|
|
- String bizApplyNo= insAreaCompany.getSyapplyno();
|
|
|
+ String bizApplyNo = insAreaCompany.getJqapplyno();
|
|
|
+ String forceApplyNo =insAreaCompany.getSyapplyno();
|
|
|
+ JSONArray crossInsurance = insAreaCompany.getCrossInsurance();
|
|
|
+ //非车投保单号
|
|
|
+ String accidentApplyNo = null;
|
|
|
+ if(crossInsurance!=null && crossInsurance.size() > 0) {
|
|
|
+ accidentApplyNo = crossInsurance.getJSONObject(0).getString("application");
|
|
|
+ }
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
list.add(bizApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
+ list.add(accidentApplyNo);
|
|
|
+ }
|
|
|
+ pinganApiLog.setId(null);
|
|
|
DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
DocumentStatusListResponse documentStatusListResponse = null;
|
|
|
try {
|
|
|
@@ -1252,56 +1276,93 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
} catch (Exception e) {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
- if(documentStatusListResponse!=null && documentStatusListResponse.getDocumentList().size()>0){
|
|
|
+ if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
Boolean jqflag = false;
|
|
|
Boolean sqflag = false;
|
|
|
- String jqpolicyno=null;
|
|
|
- String sypolicyno=null;
|
|
|
+ Boolean fcflag = false;
|
|
|
String status="";
|
|
|
- String noticeNo="";
|
|
|
- //B5 为 承保
|
|
|
- for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
- status = dto.getStatus();
|
|
|
- noticeNo=dto.getNoticeNo();
|
|
|
- if ((bizApplyNo==null?"":bizApplyNo).equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
- jqpolicyno=dto.getPolicyNo();
|
|
|
- sqflag = true;
|
|
|
- }
|
|
|
- if ((forceApplyNo==null?"":forceApplyNo).equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
- sypolicyno=dto.getPolicyNo();
|
|
|
- jqflag = true;
|
|
|
+ String jqPlicyNo=null;
|
|
|
+ String syPlicyNo=null;
|
|
|
+ String jyPlicyNo=null;
|
|
|
+ if (documentList != null && documentList.size() > 0) {
|
|
|
+ //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 (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ jqflag = true;
|
|
|
+ syPlicyNo=dto.getPolicyNo();
|
|
|
+ }
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ fcflag = true;
|
|
|
+ jyPlicyNo=dto.getPolicyNo();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if ("单交".equals(insAreaCompany.getProduct()) && jqflag) {
|
|
|
- insAreaCompany.setJqpolicyno(jqpolicyno);
|
|
|
- } else if (("交三".equals(insAreaCompany.getProduct()) || "交商".equals(insAreaCompany.getProduct())) && jqflag && sqflag) {
|
|
|
- insAreaCompany.setJqpolicyno(jqpolicyno);
|
|
|
- insAreaCompany.setSypolicyno(sypolicyno);
|
|
|
- } else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && sqflag) {
|
|
|
- insAreaCompany.setSypolicyno(sypolicyno);
|
|
|
+ if (jqflag) {
|
|
|
+ insAreaCompany.setJqapplyno(forceApplyNo);
|
|
|
+ insAreaCompany.setJqpolicyno(jqPlicyNo);
|
|
|
}
|
|
|
- String orderstatus = insAreaCompany.getOrderstatus();
|
|
|
- if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) && ("0".equals(orderstatus) || "1".equals(orderstatus)) ){
|
|
|
- //已核保待缴费
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
- }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status) && ("0".equals(orderstatus) || "1".equals(orderstatus) || "2".equals(orderstatus)) ){
|
|
|
- //说明核保成功,更新大订单和小订单的状态为3 更新为已承保
|
|
|
- if(StringUtils.isNotBlank(noticeNo)){
|
|
|
- insAreaCompany.setNoticeNo(noticeNo);
|
|
|
- }
|
|
|
+ if (sqflag) {
|
|
|
+ insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
+ insAreaCompany.setSypolicyno(syPlicyNo);
|
|
|
+ }
|
|
|
+ if (fcflag) {
|
|
|
+ List<Map<String, String>> jyList = new ArrayList<Map<String, String>>();
|
|
|
+ Map<String, String> map = new HashMap<String, String>();
|
|
|
+ //投保单号
|
|
|
+ map.put("application", accidentApplyNo);
|
|
|
+ map.put("policy", jyPlicyNo);
|
|
|
+ jyList.add(map);
|
|
|
+ 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()) )){
|
|
|
+ //说明核保成功,更新大订单和小订单的状态为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()))) {
|
|
|
+ //承保
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
}
|
|
|
-
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- return HttpResult.ok("更新状态成功");
|
|
|
-
|
|
|
}
|
|
|
return HttpResult.ok(documentStatusListResponse);
|
|
|
} catch (Exception e) {
|
|
|
return HttpResult.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/9 17:33
|
|
|
+ * @Description: 获取单证的集合
|
|
|
+ */
|
|
|
+ public List<String> getDocmentList(InsAreaCompany insAreaCompany){
|
|
|
+ ArrayList<String> list =new ArrayList<>();
|
|
|
+ String bizApplyNo = insAreaCompany.getJqapplyno();
|
|
|
+ String forceApplyNo =insAreaCompany.getSyapplyno();
|
|
|
+ JSONArray crossInsurance = insAreaCompany.getCrossInsurance();
|
|
|
+ //非车投保单号
|
|
|
+ String accidentApplyNo = null;
|
|
|
+ if(crossInsurance!=null && crossInsurance.size() > 0) {
|
|
|
+ accidentApplyNo = crossInsurance.getJSONObject(0).getString("application");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
+ list.add(bizApplyNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
+ list.add(forceApplyNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
+ list.add(accidentApplyNo);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @Description 撤销单证 9.2
|
|
|
@@ -1377,12 +1438,12 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
List<InsDrivingIntentionInsuranceVo> xwList = getCYAndXWList(xiaoWeiListInfo, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
|
|
|
List<InsDrivingIntentionInsuranceVo> zhList = getCHList(combinationInfoList, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
|
|
|
map.put("1",cyList);
|
|
|
- if(xwList==null || xwList.size()==0){
|
|
|
- xwList=cyList;
|
|
|
- }
|
|
|
- if(zhList==null || zhList.size()==0){
|
|
|
- zhList=cyList;
|
|
|
- }
|
|
|
+ //if(xwList==null || xwList.size()==0){
|
|
|
+ // xwList=cyList;
|
|
|
+ // }
|
|
|
+ //if(zhList==null || zhList.size()==0){
|
|
|
+ // zhList=cyList;
|
|
|
+ // }
|
|
|
map.put("2",xwList);
|
|
|
map.put("3",zhList);
|
|
|
}
|
|
|
@@ -1515,6 +1576,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
noticeNo = noticeDoResponse.getNoticeNo();
|
|
|
+ insAreaCompany.setNoticeNo(noticeNo);
|
|
|
+ insAreaCompanyService.updateById(insAreaCompany);
|
|
|
}
|
|
|
|
|
|
// 获取支付的链接 只支持通知单号类型07 单证类型(01投保单02保单03批改申请单04批单05赔案号06报案号07通知单号)
|
|
|
@@ -1796,15 +1859,24 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//查询单证状态
|
|
|
PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
ptlAgreementAttribution);
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- String bizApplyNo = insAreaCompany.getSyapplyno();
|
|
|
- String forceApplyNo = insAreaCompany.getJqapplyno();
|
|
|
+ ArrayList<String> list =new ArrayList<>();
|
|
|
+ String bizApplyNo = insAreaCompany.getJqapplyno();
|
|
|
+ String forceApplyNo =insAreaCompany.getSyapplyno();
|
|
|
+ JSONArray crossInsurance = insAreaCompany.getCrossInsurance();
|
|
|
+ //非车投保单号
|
|
|
+ String accidentApplyNo = null;
|
|
|
+ if(crossInsurance!=null && crossInsurance.size() > 0) {
|
|
|
+ accidentApplyNo = crossInsurance.getJSONObject(0).getString("application");
|
|
|
+ }
|
|
|
if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
list.add(bizApplyNo);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
list.add(forceApplyNo);
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
+ list.add(accidentApplyNo);
|
|
|
+ }
|
|
|
pinganApiLog.setId(null);
|
|
|
DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
DocumentStatusListResponse documentStatusListResponse = null;
|
|
|
@@ -1813,30 +1885,62 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
} catch (Exception e) {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
- if (documentStatusListResponse != null) {
|
|
|
- if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
- ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
- String status = "";
|
|
|
- String policyNo ="";
|
|
|
- if (documentList != null && documentList.size() > 0) {
|
|
|
- Boolean flag = false;
|
|
|
- for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
- status = dto.getStatus();
|
|
|
- policyNo = dto.getPolicyNo();
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(dto.getStatus())) {
|
|
|
- flag = false;
|
|
|
- }
|
|
|
+ if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
+ ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
+ Boolean jqflag = false;
|
|
|
+ Boolean sqflag = false;
|
|
|
+ Boolean fcflag = false;
|
|
|
+ String status="";
|
|
|
+ String jqPlicyNo=null;
|
|
|
+ String syPlicyNo=null;
|
|
|
+ String jyPlicyNo=null;
|
|
|
+ if (documentList != null && documentList.size() > 0) {
|
|
|
+ //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 (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ jqflag = true;
|
|
|
+ syPlicyNo=dto.getPolicyNo();
|
|
|
}
|
|
|
- insAreaCompany.setJqpolicyno(policyNo);
|
|
|
- //已承保更新承保状态
|
|
|
- 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());
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- return HttpResult.ok("支付成功");
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(dto.getApplyNo() == null ? "" : dto.getApplyNo())) {
|
|
|
+ fcflag = true;
|
|
|
+ jyPlicyNo=dto.getPolicyNo();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (jqflag) {
|
|
|
+ insAreaCompany.setJqapplyno(forceApplyNo);
|
|
|
+ insAreaCompany.setJqpolicyno(jqPlicyNo);
|
|
|
+ }
|
|
|
+ if (sqflag) {
|
|
|
+ insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
+ insAreaCompany.setSypolicyno(syPlicyNo);
|
|
|
+ }
|
|
|
+ if (fcflag) {
|
|
|
+ List<Map<String, String>> jyList = new ArrayList<Map<String, String>>();
|
|
|
+ Map<String, String> map = new HashMap<String, String>();
|
|
|
+ //投保单号
|
|
|
+ map.put("application", accidentApplyNo);
|
|
|
+ map.put("policy", jyPlicyNo);
|
|
|
+ jyList.add(map);
|
|
|
+ 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()) )){
|
|
|
+ //说明核保成功,更新大订单和小订单的状态为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()))) {
|
|
|
+ //承保
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ }
|
|
|
}
|
|
|
+ return HttpResult.error("支付成功");
|
|
|
}else{
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(null,null,null);
|
|
|
pinganApiLog.setId(null);
|
|
|
@@ -1845,8 +1949,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
pinganApiLog.setRequestParam(new Gson().toJson(payReturnRequest));
|
|
|
pinganApiLog.setResponseBody(payReturnRequest.getResultMsg()+"-"+payReturnRequest.getErrorMsg());
|
|
|
pinganApiLogService.save(pinganApiLog);
|
|
|
+ return HttpResult.error("支付失败");
|
|
|
}
|
|
|
- return HttpResult.error("支付失败");
|
|
|
}
|
|
|
|
|
|
/**
|