ソースを参照

诚泰报价增加投保人被报人的修改

dongxin 1 年間 前
コミット
43542fc274

+ 175 - 11
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java

@@ -3,10 +3,10 @@ package com.ydtech.modules.order.entity.api.chengtai.request;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.vo.PersonAreaVo;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
@@ -50,12 +50,171 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
     private String orderId;
     @JsonProperty("handlerCode")
     private String handlerCode;
+    @JsonProperty("applicant")
+    private ApplicantDTO applicant;
+    @JsonProperty("insured")
+    private InsuredDTO insured;
+
+    @Data
+    public static class InsuredDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+        @JsonProperty("relationWithInsured")
+        private String relationWithInsured;
+        @JsonProperty("relationWithCar")
+        private String relationWithCar;
+        @JsonProperty("organizationCode")
+        private String organizationCode;
+        @JsonProperty("tel")
+        private String tel;
+        @JsonProperty("linkerName")
+        private String linkerName;
+        @JsonProperty("unitTypeCode")
+        private String unitTypeCode;
+
+        public InsuredDTO(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo personAreaVo){
+            // 获取投保人信息
+            CustomerInfoVo insureInfo = quoteInfoVo.getInsuredPersonInfo();
+            if("0".equals(insureInfo.getProperty())){
+                this.type = "2";
+                this.identifyTypeCode = "4";
+                this.identifyNumber = insureInfo.getOrganizationCode();
+                this.organizationCode = insureInfo.getOrganizationCode();
+                this.tel = insureInfo.getTel();
+                this.linkerName = insureInfo.getName();
+                this.unitTypeCode = "900"; // 单位性质 900:其他
+            }else{
+                this.type = "1";
+                this.identifyTypeCode = "01";
+                this.identifyNumber = insureInfo.getIdentifyNumber();
+                this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+                this.birthday = IDCardUtils.GetBirthday(insureInfo.getIdentifyNumber());
+                this.relationWithInsured = "0";
+                this.relationWithCar = "1";
+            }
+            this.name = insureInfo.getName();
+            this.province = personAreaVo.getProvinceCode();
+            this.city = personAreaVo.getCityCode();
+            this.district = personAreaVo.getCountyCode();
+            this.addr = insureInfo.getAddr();
+            this.mobile = insureInfo.getMobile();
+            this.identifyValidDate = insureInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = insureInfo.getIdentifyValidEndDate();
+            this.longTerm = "0";
+        }
+    }
+
+    @Data
+    public static class ApplicantDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+        @JsonProperty("organizationCode")
+        private String organizationCode;
+        @JsonProperty("tel")
+        private String tel;
+        @JsonProperty("linkerName")
+        private String linkerName;
+        @JsonProperty("unitTypeCode")
+        private String unitTypeCode;
+
+
+        public ApplicantDTO(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo applyPersonAreaVo){
+            // 获取投保人信息
+            CustomerInfoVo applyInfo = quoteInfoVo.getPolicyHolderInfo();
+            if("0".equals(applyInfo.getProperty())){
+                this.type = "2";
+                this.identifyTypeCode = "4";
+                this.identifyNumber = applyInfo.getOrganizationCode();
+                this.organizationCode = applyInfo.getOrganizationCode();
+                this.tel = applyInfo.getTel();
+                this.linkerName = applyInfo.getName();
+                this.unitTypeCode = "900"; // 单位性质 900:其他
+            }else{
+                this.type = "1";
+                this.identifyTypeCode = "01";
+                this.identifyNumber = applyInfo.getIdentifyNumber();
+                this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+                this.birthday = IDCardUtils.GetBirthday(applyInfo.getIdentifyNumber());
+            }
+            this.name = applyInfo.getName();
+            this.province = applyPersonAreaVo.getProvinceCode();
+            this.city = applyPersonAreaVo.getCityCode();
+            this.district = applyPersonAreaVo.getCountyCode();
+            this.addr = applyInfo.getAddr();
+            this.mobile = applyInfo.getMobile();
+            this.identifyValidDate = applyInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = applyInfo.getIdentifyValidEndDate();
+            this.longTerm = "0";
+        }
+    }
 
     public InsurePremiumRequest(BaseQuoteInfoVo quoteInfoVo,
                                 CarInfoResponse.CarModelListDTO carModelListDTO,
                                 QueryCarActualValueResponse carActualValueResponse,
                                 ChengTaiConfigureParameters parameters,
-                                BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo){
+                                BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo,
+                                PersonAreaVo applyPersonAreaVo,
+                                PersonAreaVo insurePersonAreaVo){
         super(parameters.getPartnerCode());
         // 标的信息
         InsuredObjectDTO insuredObject = new InsuredObjectDTO(quoteInfoVo, carModelListDTO,carActualValueResponse);
@@ -97,7 +256,10 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
         }
 
         this.handlerCode = parameters.getUserId();
-
+        InsuredDTO insured = new InsuredDTO(quoteInfoVo,insurePersonAreaVo);
+        this.insured = insured;
+        ApplicantDTO applicant = new ApplicantDTO(quoteInfoVo, applyPersonAreaVo);
+        this.applicant = applicant;
     }
 
     @NoArgsConstructor
@@ -202,14 +364,16 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
                 coverageDTO2.setShortRateType("2");
                 coverageDTO2.setShortRate("100");
                 coverageDTOS.add(coverageDTO2);
-                CoverageDTO coverageDTO3 = new CoverageDTO();
-                coverageDTO3.setKindCode("ct_111603");
-                coverageDTO3.setIfMainKind("2");
-                coverageDTO3.setQuantity(0);
-                coverageDTO3.setCalculateFlag("1");
-                coverageDTO3.setShortRateType("2");
-                coverageDTO3.setShortRate("100");
-                coverageDTOS.add(coverageDTO3);
+                if(!ctQuoteAccidentVo.getProjectName().contains("1座")){
+                    CoverageDTO coverageDTO3 = new CoverageDTO();
+                    coverageDTO3.setKindCode("ct_111603");
+                    coverageDTO3.setIfMainKind("2");
+                    coverageDTO3.setQuantity(0);
+                    coverageDTO3.setCalculateFlag("1");
+                    coverageDTO3.setShortRateType("2");
+                    coverageDTO3.setShortRate("100");
+                    coverageDTOS.add(coverageDTO3);
+                }
                 return coverageDTOS;
             }
         }

+ 18 - 1
src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java

@@ -138,8 +138,25 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
         QueryCarActualValueRequest carActualValueRequest = new QueryCarActualValueRequest(quoteInfoVo,carModelListDTO, parameters);
         QueryCarActualValueResponse carActualValueResponse = chengTaiRequestApiComponents.queryActualValue(carActualValueRequest,httpHeaders);
 
+        CustomerInfoVo applyInfo = quoteInfoVo.getPolicyHolderInfo();
+        CustomerInfoVo insureInfo = quoteInfoVo.getInsuredPersonInfo();
+        String applyProperty = applyInfo.getProperty();
+        String insureProperty = insureInfo.getProperty();
+        PersonAreaVo applyPersonAreaVo;
+        PersonAreaVo insurePersonAreaVo;
+        if ("0".equals(applyProperty)) {
+            applyPersonAreaVo = new PersonAreaVo(applyInfo);
+        }else{
+            applyPersonAreaVo = sysAreaService.queryByAddressYc(applyInfo.getAddr(), applyInfo.getIdentifyNumber());
+        }
+        if ("0".equals(insureProperty)) {
+            insurePersonAreaVo = new PersonAreaVo(insureInfo);
+        }else{
+            insurePersonAreaVo = sysAreaService.queryByAddressYc(insureInfo.getAddr(), insureInfo.getIdentifyNumber());
+        }
+
         /** 4. 报价 */
-        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,parameters,quoteVo);
+        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,parameters,quoteVo,applyPersonAreaVo,insurePersonAreaVo);
         // 重复报价
         InsurePremiumResponse insurePremiumResponse = this.getResponse(insurePremiumRequest, httpHeaders,quoteInfoVo, quoteVo,maxQuoteNum,sysQuoteRecords);