ソースを参照

驾意险保单号

Qchen 1 年間 前
コミット
f2486e2508

+ 10 - 1
src/main/java/com/ydtech/modules/order/entity/api/yangguang/response/YangGuangSubmitResponse.java

@@ -2,6 +2,8 @@ package com.ydtech.modules.order.entity.api.yangguang.response;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.annotation.JSONField;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -94,7 +96,7 @@ public class YangGuangSubmitResponse extends YangGuangBaseResponse {
     private List<Clause> Clause;
 
     @JSONField(name = "PtptNonVehicleProductInformationList")
-    private JSONArray PtptNonVehicleProductInformationList;
+    private List<PtptNonVehicleProductInformationList> PtptNonVehicleProductInformationList;
 
     @Data
     public static class Clause implements Serializable {
@@ -129,5 +131,12 @@ public class YangGuangSubmitResponse extends YangGuangBaseResponse {
         private String FcSumPremium;
 
         private String FcProposalNo;
+
+        public DrivingInsuranceDto toDrivingInsuranceDto() {
+            DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
+            drivingInsuranceDto.setCode(this.getFcProduct());
+            drivingInsuranceDto.setApplicationNumber(this.getFcProposalNo());
+            return drivingInsuranceDto;
+        }
     }
 }

+ 21 - 3
src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java

@@ -25,6 +25,7 @@ import com.ydtech.modules.order.entity.api.yangguang.request.*;
 import com.ydtech.modules.order.entity.api.yangguang.response.*;
 import com.ydtech.modules.order.entity.api.zijin.constants.enums.BusType;
 import com.ydtech.modules.order.entity.config.YangGuangConfigureParameters;
+import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
 import com.ydtech.modules.order.entity.filter.CarModelsFilterUtils;
 import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
@@ -43,6 +44,7 @@ import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.baidu.FileUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.bcel.generic.LSTORE;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -243,7 +245,12 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
         }
         if (yangGuangSubmitResponse.getPtptNonVehicleProductInformationList() != null) {
-            insAreaCompany.setCrossInsurance(yangGuangSubmitResponse.getPtptNonVehicleProductInformationList());
+            List<DrivingInsuranceDto> collect =
+                    yangGuangSubmitResponse.getPtptNonVehicleProductInformationList()
+                                    .stream().map(YangGuangSubmitResponse.PtptNonVehicleProductInformationList::toDrivingInsuranceDto)
+                                    .collect(Collectors.toList());
+            JSONArray objects = JSON.parseArray(JSON.toJSONString(collect));
+            insAreaCompany.setCrossInsurance(objects);
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
         }
         // 核保转人工
@@ -275,7 +282,12 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         insAreaCompany.setJqapplyno(yangGuangSubmitResponse.getCiProposalNo() != null ? yangGuangSubmitResponse.getCiProposalNo() :"");
         insAreaCompany.setSyapplyno(yangGuangSubmitResponse.getBiProposalNo() != null ? yangGuangSubmitResponse.getBiProposalNo() :"");
         if (yangGuangSubmitResponse.getPtptNonVehicleProductInformationList() != null) {
-            insAreaCompany.setCrossInsurance(yangGuangSubmitResponse.getPtptNonVehicleProductInformationList());
+            List<DrivingInsuranceDto> collect =
+                    yangGuangSubmitResponse.getPtptNonVehicleProductInformationList()
+                            .stream().map(YangGuangSubmitResponse.PtptNonVehicleProductInformationList::toDrivingInsuranceDto)
+                            .collect(Collectors.toList());
+            JSONArray objects = JSON.parseArray(JSON.toJSONString(collect));
+            insAreaCompany.setCrossInsurance(objects);
         }
         insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
 
@@ -425,7 +437,13 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
             insAreaCompany.setSypolicyno(yangGuangProposalStatusQueryResponse.getBiPolicyNo());
             insAreaCompany.setJqapplyno(yangGuangProposalStatusQueryResponse.getCiProposalNo());
             insAreaCompany.setSyapplyno(yangGuangProposalStatusQueryResponse.getBiProposalNo());
-            insAreaCompany.setAccidentStrInfo(yangGuangProposalStatusQueryResponse.getFCPolicyNo());
+            // 保存非车保单号
+            String fc = yangGuangProposalStatusQueryResponse.getFCPolicyNo();
+            JSONArray object = insAreaCompany.getCrossInsurance();
+            JSONObject newObj = new JSONObject();
+            newObj.put("policyNumber", fc);
+            object.add(newObj);
+            insAreaCompany.setCrossInsurance(object);
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
             return HttpResult.ok("更新状态成功");

+ 5 - 0
src/main/java/com/ydtech/utils/OrderUtils.java

@@ -92,6 +92,11 @@ public class OrderUtils {
                 List<AccidentResponseVo> javaList = crossInsuranceJson.toJavaList(AccidentResponseVo.class);
                 return javaList.get(0).getPolicyNumber();
             }
+            //阳光
+            if (companyId.contains(InsuranceEnum.YGBX.getCode())) {
+                List<AccidentResponseVo> javaList = crossInsuranceJson.toJavaList(AccidentResponseVo.class);
+                return javaList.get(0).getPolicyNumber();
+            }
         }
 
         return "";