فهرست منبع

华泰企业车

Qchen 1 سال پیش
والد
کامیت
677f8519aa

+ 3 - 3
src/main/java/com/ydtech/modules/admin/service/SysAreaService.java

@@ -39,7 +39,7 @@ public interface SysAreaService extends IService<SysArea> {
      * @param address 地址
      * @return
      */
-    PersonAreaVo queryByAddress(String address, String idcard);
+    PersonAreaVo queryByAddress(String address, String idcard,String leaderIdcard);
 
     /**
      * 使用永诚提供地省市区 地址身份证号 获取省市区
@@ -50,7 +50,7 @@ public interface SysAreaService extends IService<SysArea> {
      */
     @DynamicName(tableName = "ins_yongcheng_area")
     default PersonAreaVo queryByAddressYc(String address, String idcard) {
-        return queryByAddress(address, idcard);
+        return queryByAddress(address, idcard,"");
     }
 
     /**
@@ -62,7 +62,7 @@ public interface SysAreaService extends IService<SysArea> {
      */
     @DynamicName(tableName = "ins_bohai_area")
     default PersonAreaVo queryByAddressBoHai(String address, String idcard) {
-        return queryByAddress(address, idcard);
+        return queryByAddress(address, idcard,"");
     }
 
 

+ 16 - 5
src/main/java/com/ydtech/modules/admin/service/impl/SysAreaServiceImpl.java

@@ -53,14 +53,19 @@ public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea>
 
     //查询所有的上级
     @Override
-    public PersonAreaVo queryByAddress(String address, String idcard) {
+    public PersonAreaVo queryByAddress(String address, String idcard, String leaderIdcard) {
         PersonAreaVo personAreaVo = new PersonAreaVo();
         //获取县级全部区划数据
         List<SysArea> sysAreaVos = this.queryByLevel(3);
         //被保人 赛选出的地址条件
         List<SysArea> collect = sysAreaVos.stream().filter(item -> address.contains(item.getAreaCname())).collect(Collectors.toList());
         //截取身份证的省级代码
-        String provincesCode = idcard.substring(0, 3);
+        String provincesCode;
+        if (idcard != null) {
+            provincesCode = idcard.substring(0, 3);
+        } else {
+            provincesCode = leaderIdcard.substring(0, 3);
+        }
         //获取省级的区划
         if (!collect.isEmpty()) {
             List<SysArea> provincesArea = collect.stream()
@@ -92,10 +97,16 @@ public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea>
                 return personAreaVo;
             }
         }
+        if (idcard != null) {
+            personAreaVo.setProvinceCode(idcard.substring(0, 2) + "0000");
+            personAreaVo.setCityCode(idcard.substring(0, 4) + "00");
+            personAreaVo.setCountyCode(idcard.substring(0, 6));
+        } else {
+            personAreaVo.setProvinceCode(leaderIdcard.substring(0, 2) + "0000");
+            personAreaVo.setCityCode(leaderIdcard.substring(0, 4) + "00");
+            personAreaVo.setCountyCode(leaderIdcard.substring(0, 6));
+        }
 
-        personAreaVo.setProvinceCode(idcard.substring(0, 2) + "0000");
-        personAreaVo.setCityCode(idcard.substring(0, 4) + "00");
-        personAreaVo.setCountyCode(idcard.substring(0, 6));
 
         return personAreaVo;
     }

+ 7 - 1
src/main/java/com/ydtech/modules/ins/model/vo/CustomerInfoVo.java

@@ -94,9 +94,15 @@ public class CustomerInfoVo {
     @ApiModelProperty(value = "经营范围")
     private String scope;
 
-    @ApiModelProperty(value = "联系人")
+    @ApiModelProperty(value = "人")
     private String legalPerson;
 
+    @ApiModelProperty(value = "法人身份证号")
+    private String leaderIdentifyNumber;
+
+    @ApiModelProperty(value = "法人身份证止期")
+    private String leaderOtherEffectiveDate;
+
 
     public boolean contrastInfo(CustomerInfoVo customerInfoVo) {
         if (!ObjectUtils.nullSafeEquals(this.name, customerInfoVo.getName())) {

+ 2 - 2
src/main/java/com/ydtech/modules/order/components/huatai/HuiTaiUploadImageComponents.java

@@ -35,7 +35,7 @@ import java.util.*;
 public class HuiTaiUploadImageComponents {
 
     private final RestTemplate restTemplate;
-    private static final String INIT_PARAM = "/h5img/app/ImgManager/initParam.cmd?t=";
+    private static final String INIT_PARAM = "/h5img/app/ImgManager/initParam.cdo?t=";
     private static final String FILE_UPLOAD = "/h5img/fileupload";
     private static final String SAVE_FILE_IDX = "/h5img/app/ImgManager/saveFileIdx.cmd";
 
@@ -109,7 +109,7 @@ public class HuiTaiUploadImageComponents {
         HttpHeaders httpHeaders = new HttpHeaders();
         // token
         httpHeaders.set("Cookie", "token=" + token);
-        String initParamUrl = domain + INIT_PARAM + System.currentTimeMillis();
+        String initParamUrl = domain + INIT_PARAM + System.currentTimeMillis() + "&token" + token;
         HttpEntity<Object> httpEntity = new HttpEntity<>(null, httpHeaders);
         ResponseEntity<HuaTaiImageInitParamResponse> response = restTemplate.exchange(initParamUrl, HttpMethod.GET, httpEntity,
                 HuaTaiImageInitParamResponse.class);

+ 5 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/ImageTypeCode.java

@@ -39,7 +39,11 @@ public enum ImageTypeCode {
             InsuranceImageEnum.C02.getCode(),
             InsuranceImageEnum.D02.getCode(),
     }),
-    I_1001("1001", "组织机构代码证", new String[]{}),
+    I_1001("1001", "组织机构代码证", new String[]{
+            InsuranceImageEnum.Y02.getCode(),
+            InsuranceImageEnum.Y03.getCode(),
+            InsuranceImageEnum.Y04.getCode(),
+    }),
     I_1999("1999", "其他", new String[]{}),
     I_3001("3001", "行驶证", new String[]{
             InsuranceImageEnum.C01.getCode(),

+ 41 - 13
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiQuotedPriceRequest.java

@@ -352,7 +352,17 @@ public class HuaTaiQuotedPriceRequest extends HuaTaiBaseRequest {
                     this.motorTypeCode = motorTypeCode1.getCode();
 
                     this.plateType = "02";
-                    this.property = "04";
+                    switch (carInfoVo.getProperty()) {
+                        case "1":  //个人
+                            this.property = "04";
+                            break;
+                        case "2":  // 一般企业
+                            this.property = "03";
+                            break;
+                        case "3":  //机关
+                            this.property = "01";
+                            break;
+                    }
                     this.colorCode = null;
                     this.carCheckStatus = "2";
                     this.vehicleCondition = "0";
@@ -774,19 +784,37 @@ public class HuaTaiQuotedPriceRequest extends HuaTaiBaseRequest {
         private String carInsuredRelation;
 
         public CustomerDto(CustomerInfoVo customerInfoVo, String role) {
-            this.name = customerInfoVo.getName();
-            this.identifyType = "01";
-            this.identifyNumber = customerInfoVo.getIdentifyNumber();
-            this.mobile = customerInfoVo.getMobile();
-            this.type = "1";
-            this.role = role;
-            int randomNum = new Random().nextInt(HuaTaiBaseCode.getOccupation().size());
-            this.occupationCode = HuaTaiBaseCode.getOccupation().get(randomNum);//后续需要根据接口维护返参到表里
-            this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
-            this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
-            if ("2".equals(role)) {
-                this.carInsuredRelation = "1";
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("1")) {
+                this.name = customerInfoVo.getName();
+                this.identifyType = "01";
+                this.identifyNumber = customerInfoVo.getIdentifyNumber();
+                this.mobile = customerInfoVo.getMobile();
+                this.type = "1";
+                this.role = role;
+                int randomNum = new Random().nextInt(HuaTaiBaseCode.getOccupation().size());
+                this.occupationCode = HuaTaiBaseCode.getOccupation().get(randomNum);//后续需要根据接口维护返参到表里
+                this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+                if ("2".equals(role)) {
+                    this.carInsuredRelation = "1";
+                }
+            } else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("0")){
+                this.name = customerInfoVo.getName();
+                this.identifyType = "99";
+                this.organizeCode = customerInfoVo.getOrganizationCode();
+                this.mobile = customerInfoVo.getMobile();
+                this.type = "2";
+                this.role = role;
+                int randomNum = new Random().nextInt(HuaTaiBaseCode.getOccupation().size());
+                this.occupationCode = HuaTaiBaseCode.getOccupation().get(randomNum);//后续需要根据接口维护返参到表里
+                this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+                this.transactorName = customerInfoVo.getLegalPerson();
+                if ("2".equals(role)) {
+                    this.carInsuredRelation = "1";
+                }
             }
+
         }
 
         public List<CustomerDto> getCustomers(CustomerInfoVo ownerInfo, CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo) {

+ 86 - 4
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSubmitRequest.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.order.entity.api.huatai.request;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
@@ -18,6 +19,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -69,6 +71,10 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
         @JSONField(name = "saleInfo")
         private SaleInfoDto saleInfo;
 
+        //  投保车辆信息
+        @JSONField(name = "insuredObject")
+        private InsuredObjectDto insuredObject;
+
         public BusinessDataDto(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,
                                HuaTaiConfigureParameters huaTaiConfigureParameters, List<InsHuataiContributingVo> engageList) {
             List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
@@ -85,7 +91,8 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
             this.customer = new CustomerDto().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo, huaTaiConfigureParameters);
             //销售信息
             this.saleInfo = new SaleInfoDto(huaTaiConfigureParameters);
-
+            // 投保车辆信息
+            this.insuredObject = new InsuredObjectDto(yaQuoteInfoVo.getCarInfo());
         }
     }
 
@@ -261,6 +268,9 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
         //Y	手机号码
         @JSONField(name = "mobile")
         private String mobile;
+        // CY 单位电话(机构客户出单必传)
+        @JSONField(name = "unitPhoneNumber")
+        private String unitPhoneNumber;
         //Y	证件有效起期(格式:YYYY-MM-DD HH24:MI:SS)
         @JSONField(name = "identifyValidDate")
         private String identifyValidDate;
@@ -402,12 +412,43 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
 
 
         public CustomerDto(CustomerInfoVo customerInfoVo, String role, HuaTaiConfigureParameters huaTaiConfigureParameters) {
-            this.identifyNumber = customerInfoVo.getIdentifyNumber();
-            this.identifyType = "01";
+            if (customerInfoVo.getProperty() != null && "0".equals(customerInfoVo.getProperty())) {
+                this.organizeCode = customerInfoVo.getOrganizationCode();
+                this.identifyType = "99";
+                this.type = "2";
+                this.businessSource = "L749";
+                this.equityStructure = "3";
+                this.businessDetail = customerInfoVo.getScope();
+                this.leaderName = customerInfoVo.getLegalPerson();
+                this.leaderOtherIdentifyType = "01";
+                this.leaderOtherEffectiveDate = customerInfoVo.getLeaderOtherEffectiveDate();
+                this.leaderOtherIdentifyNumber = customerInfoVo.getLeaderIdentifyNumber();
+                this.leaderIdentifyNumber = customerInfoVo.getLeaderIdentifyNumber();
+                this.nationalityCode = customerInfoVo.getProvince().substring(0, 4);
+                this.registCurrency = "CNY";
+                this.registFund = customerInfoVo.getRegisteredCapital();
+                this.revenueCode = customerInfoVo.getOrganizationCode();
+                this.supportDocuName = customerInfoVo.getName();
+                this.supportDocuNumber = customerInfoVo.getOrganizationCode();
+                this.supportDocuValidDate = customerInfoVo.getIdentifyValidEndDate();
+                this.transactorName = customerInfoVo.getLegalPerson();
+                this.transactorIdentifyType = "01";
+                this.transactorIdentifyCode = customerInfoVo.getLeaderIdentifyNumber();
+                this.transactorMobile = customerInfoVo.getMobile();
+                this.transactorExpiryDate = customerInfoVo.getLeaderOtherEffectiveDate();
+                this.unitPhoneNumber = customerInfoVo.getMobile();
+            }
+            if (customerInfoVo.getProperty() != null && "1".equals(customerInfoVo.getProperty())) {
+                this.identifyNumber = customerInfoVo.getIdentifyNumber();
+                this.identifyType = "01";
+                this.type = "1";
+            }
+            this.province = huaTaiConfigureParameters.getProvince();
+            this.city = huaTaiConfigureParameters.getCity();
+            this.district = huaTaiConfigureParameters.getDistrict();
             this.name = customerInfoVo.getName();
             this.mobile = customerInfoVo.getMobile();
             this.role = role;
-            this.type = "1";
             this.occupationCode = "20114";//后续需要根据接口维护返参到表里
             this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
             this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
@@ -438,6 +479,47 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
 
     }
 
+    @NoArgsConstructor
+    @Data
+    public static class InsuredObjectDto implements Serializable {
+        @JSONField(name = "policyCar")
+        private PolicyCarDto policyCar;
+
+        public InsuredObjectDto(CarInfoVo carInfoVo) {
+            this.policyCar = new PolicyCarDto(carInfoVo);
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class PolicyCarDto implements Serializable {
+
+            // Y 验车状态(1-未验车;2-免验车;4-已验车)
+            @JSONField(name = "CarCheckStatus")
+            private String carCheckStatus;
+
+            // CY  验车人(已验车必传)
+            @JSONField(name = "CarChecker")
+            private String carChecker;
+
+            // CY  验车时间(已验车必传)(格式:YYYY-MM-DD HH24:MI:SS)
+            @JSONField(name = "CarCheckTime")
+            private DateTime carCheckTime;
+
+            // CY 验车记录(已验车必传)
+            @JSONField(name = "CarCheckRecord")
+            private String carCheckRecord;
+
+            // N 车况(0-好;1-中;2-差)
+            @JSONField(name = "VehicleCondition")
+            private String vehicleCondition;
+
+            public PolicyCarDto(CarInfoVo carInfoVo) {
+                this.carCheckStatus = "2";
+                this.vehicleCondition = "0";
+            }
+        }
+    }
+
 
     @AllArgsConstructor
     @NoArgsConstructor

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

@@ -186,17 +186,17 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
             PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(t.getAgreementId());
 
             //车主区划信息
-            PersonAreaVo ownerPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getOwnerInfo().getAddr(), quoteInfoVo.getOwnerInfo().getIdentifyNumber());
+            PersonAreaVo ownerPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getOwnerInfo().getAddr(), quoteInfoVo.getOwnerInfo().getIdentifyNumber(),"");
 
             //投保人区划信息
-            PersonAreaVo policyHolderPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getPolicyHolderInfo().getAddr(), quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber());
+            PersonAreaVo policyHolderPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getPolicyHolderInfo().getAddr(), quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber(),"");
             PersonAreaVo insuredPersonArea;
             //投保人等于被保人
             if (quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber().equals(quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber())) {
                 insuredPersonArea = policyHolderPersonArea;
             } else {
                 //被保人区划信息
-                insuredPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getInsuredPersonInfo().getAddr(), quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber());
+                insuredPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getInsuredPersonInfo().getAddr(), quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber(),"");
             }
 
             // 1.获取业务订单号接口

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

@@ -214,7 +214,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
         //查找车主的区划信息
         PersonAreaVo ownerPersonArea = sysAreaService.queryByAddress(yaQuoteInfoVo.getOwnerInfo().getAddr(),
-                yaQuoteInfoVo.getOwnerInfo().getIdentifyNumber());
+                yaQuoteInfoVo.getOwnerInfo().getIdentifyNumber(),yaQuoteInfoVo.getOwnerInfo().getLeaderIdentifyNumber());
         huaTaiConfigureParameters.setCity(ownerPersonArea.getCityCode());
         huaTaiConfigureParameters.setProvince(ownerPersonArea.getProvinceCode());
         huaTaiConfigureParameters.setDistrict(ownerPersonArea.getCountyCode());