cuixinpeng 2 лет назад
Родитель
Сommit
e9c80504af

+ 1 - 1
src/main/java/com/ydtech/modules/order/components/huatai/HuaTaiRequestApiComponents.java

@@ -214,7 +214,7 @@ public class HuaTaiRequestApiComponents {
      * 核保状态查询 传入单号查询该单核保状态
      */
     public HuaTaiSubmitStatusQueryResponse submitStatus(HuaTaiSubmitStatusQueryRequest request, Class<HuaTaiSubmitStatusQueryResponse> tClass) {
-        return routineRequest(request, tClass, true, HuaTaiTransCode.SUBMIT_STATUS);
+        return routineRequest(request, tClass, true, HuaTaiTransCode.SUBMIT);
     }
 
 

+ 7 - 21
src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/HuaTaiTransCode.java

@@ -17,34 +17,20 @@ public class HuaTaiTransCode {
     //报价
     public static final String QUOTE_PRICE = "QuotedPrice";
 
+    //转投保
+    public static final String SAVE = "Save";
+
     //提交核保
     public static final String SUBMIT = "Submit";
 
-    //缴费查询
-    public static final String ORDER_STATUS = "OrderStatus";
-
-    //投保单核保状态查询
-    public static final String SUBMIT_STATUS_QUERY = "SubmitStatusQuery";
+    //见费出单结果查询接口
+    public static final String ORDER_CONFIRM = "OrderConfirm";
 
-    // 投保单核保状态 url 参数
-    public static final String SUBMIT_STATUS = "SubmitStatus";
+    //非电子投保单缴费申请接口
+    public static final String ORDER_APPLY = "OrderApply";
 
     //电子保单下载
     public static final String INSURANCE_POLICY_PRINT = "InsurancePolicyPrint";
 
-    //影像上传
-    public static final String UPLOAD_IMAGE = "UploadImage";
-
-    //校验是否发送短信验证码
-    public static final String CHECK_SMS_CODE = "CheckSMScode";
-
-    //校验验证码是否正确
-    public static final String VALID_SMS_CODE = "ValidSMScode";
-
-    //续保查询
-    public static final String RENEWAL_QUERY = "RenewalQuery";
-
-    // 非车可投保产品查询
-    public static final String Ride_Accident_Query = "RideAccidentQuery";
 
 }

+ 16 - 2
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiOrderStatusRequest.java

@@ -1,13 +1,17 @@
 package com.ydtech.modules.order.entity.api.huatai.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequest;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
 import com.ydtech.modules.order.entity.api.huatai.constants.HuaTaiTransCode;
+import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @EqualsAndHashCode(callSuper = true)
@@ -20,7 +24,7 @@ public class HuaTaiOrderStatusRequest extends HuaTaiBaseRequest {
     @Override
     public void setHead(HuaTaiBaseRequestHead head) {
         super.setHead(head);
-        super.getHead().setTransCode(HuaTaiTransCode.ORDER_STATUS);
+        super.getHead().setTransCode(HuaTaiTransCode.ORDER_CONFIRM);
     }
 
     //支付交易号
@@ -39,6 +43,16 @@ public class HuaTaiOrderStatusRequest extends HuaTaiBaseRequest {
     @JsonProperty("contractNo")
     private List<String> contractNo;
 
-
+    public HuaTaiOrderStatusRequest (InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters){
+        this.loginCom = huaTaiConfigureParameters.getComCode();
+        this.operatorCode = huaTaiConfigureParameters.getOperatorCode();
+        this. contractNo = new ArrayList<>();
+        if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
+            this.contractNo.add(insAreaCompany.getJqapplyno());
+        }
+        if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno())){
+            this.contractNo.add(insAreaCompany.getSyapplyno());
+        }
+    }
 
 }

+ 19 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiPaymentUrlRequest.java

@@ -1,13 +1,17 @@
 package com.ydtech.modules.order.entity.api.huatai.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequest;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
 import com.ydtech.modules.order.entity.api.huatai.constants.HuaTaiTransCode;
+import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @EqualsAndHashCode(callSuper = true)
@@ -21,7 +25,7 @@ public class HuaTaiPaymentUrlRequest extends HuaTaiBaseRequest {
     @Override
     public void setHead(HuaTaiBaseRequestHead head) {
         super.setHead(head);
-        super.getHead().setTransCode(HuaTaiTransCode.ORDER_STATUS);
+        super.getHead().setTransCode(HuaTaiTransCode.ORDER_APPLY);
     }
 
     //操作员代码
@@ -43,4 +47,18 @@ public class HuaTaiPaymentUrlRequest extends HuaTaiBaseRequest {
     //是否发送短信,1-是,0-否,当等于0时会返回电子投保单链接(当为北京电子投保单短信时该短信由平台发送,所以必传1)
     @JsonProperty("sendMessageFlag")
     private String sendMessageFlag;
+
+    public HuaTaiPaymentUrlRequest (InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters){
+        this.loginCom = huaTaiConfigureParameters.getComCode();
+        this.operatorCode = huaTaiConfigureParameters.getOperatorCode();
+        this.flag = "1";
+        this. contractNo = new ArrayList<>();
+        if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
+            this.contractNo.add(insAreaCompany.getJqapplyno());
+        }
+        if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno())){
+            this.contractNo.add(insAreaCompany.getSyapplyno());
+        }
+        this. sendMessageFlag = "0";
+    }
 }

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

@@ -47,7 +47,7 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
     @Override
     public void setHead(HuaTaiBaseRequestHead head) {
         super.setHead(head);
-        super.getHead().setTransCode(HuaTaiTransCode.SUBMIT);
+        super.getHead().setTransCode(HuaTaiTransCode.SAVE);
     }
 
     public HuaTaiSubmitRequest (YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters){
@@ -83,7 +83,7 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
             // 保险信息
             this.contract = new ContractDto().getContract(riskList,insAreaCompany,huaTaiConfigureParameters);
             // 客户信息
-            this.customer = new CustomerDto().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo);
+            this.customer = new CustomerDto().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo,huaTaiConfigureParameters);
             //销售信息
             this.saleInfo = new SaleInfoDto(huaTaiConfigureParameters);
 
@@ -187,7 +187,6 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
                 this.expiryDate = expiryDateTime.format(formatter);
             }
 
-
         }
     }
 
@@ -362,11 +361,11 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
         @JSONField(name="otherWorkAddress")
         private String otherWorkAddress;
         //CY	联系人信息
-        @JSONField(name="contact")
+        @JSONField(name="insuredLinkerList")
         private List<InsuredLinkerBean> insuredLinkerList;
 
 
-        public CustomerDto(CustomerInfoVo customerInfoVo, String role) {
+        public CustomerDto(CustomerInfoVo customerInfoVo, String role, HuaTaiConfigureParameters huaTaiConfigureParameters) {
             this.identifyNumber = customerInfoVo.getIdentifyNumber();
             this.identifyType = "01";
             this.name = customerInfoVo.getName();
@@ -381,14 +380,15 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
             if("2".equals(role)){
                 this.carInsuredRelation = "1";
             }
-            this.aiRelation = "";
-            this.workUnit = "";
-            this.workAddress = "";
-            this.otherWorkAddress = "";
+            this.aiRelation = "01";
+            this.workUnit = "其他";
+            this.workAddress = customerInfoVo.getAddr();
+            this.otherWorkAddress = customerInfoVo.getAddr();
+            this.insuredLinkerList = Arrays.asList(new InsuredLinkerBean(customerInfoVo,huaTaiConfigureParameters));
         }
 
-        public List<CustomerDto> getCustomers(CustomerInfoVo ownerInfo, CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo) {
-            return Arrays.asList(new CustomerDto(ownerInfo, "3"), new CustomerDto(policyHolderInfo, "1"), new CustomerDto(insuredPersonInfo, "2"));
+        public List<CustomerDto> getCustomers(CustomerInfoVo ownerInfo, CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo, HuaTaiConfigureParameters huaTaiConfigureParameters) {
+            return Arrays.asList(new CustomerDto(ownerInfo, "3",huaTaiConfigureParameters), new CustomerDto(policyHolderInfo, "1",huaTaiConfigureParameters), new CustomerDto(insuredPersonInfo, "2",huaTaiConfigureParameters));
         }
 
     }
@@ -429,7 +429,16 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
         @JSONField(name="email")
         private String email;
 
-
+        public InsuredLinkerBean(CustomerInfoVo customerInfoVo, HuaTaiConfigureParameters huaTaiConfigureParameters) {
+            this.linkName = customerInfoVo.getName();
+            this.linkerRelation = "01";
+            this.province = huaTaiConfigureParameters.getProvince();
+            this.city = huaTaiConfigureParameters.getCity();
+            this.district = huaTaiConfigureParameters.getDistrict();
+            this.street = customerInfoVo.getAddr();
+            this.mobile = customerInfoVo.getMobile();
+            this.email = customerInfoVo.getEmail();
+        }
 
     }
 

+ 6 - 6
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSubmitStatusQueryRequest.java

@@ -32,7 +32,7 @@ public class HuaTaiSubmitStatusQueryRequest extends HuaTaiBaseRequest {
     @Override
     public void setHead(HuaTaiBaseRequestHead head) {
         super.setHead(head);
-        super.getHead().setTransCode(HuaTaiTransCode.SUBMIT_STATUS_QUERY);
+        super.getHead().setTransCode(HuaTaiTransCode.SUBMIT);
     }
     //机构代码
     @JsonProperty("loginCom")
@@ -52,14 +52,14 @@ public class HuaTaiSubmitStatusQueryRequest extends HuaTaiBaseRequest {
 
     public HuaTaiSubmitStatusQueryRequest ( InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters,String operateType){
         this.loginCom = huaTaiConfigureParameters.getComCode();
-        userCode = huaTaiConfigureParameters.getOperatorCode();
-        operateType= operateType;
-        contractMain = new ArrayList<>();
+        this.userCode = huaTaiConfigureParameters.getOperatorCode();
+        this.operateType= operateType;
+        this.contractMain = new ArrayList<>();
         if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
-            contractMain.add(new ContractMainDto(insAreaCompany.getJqapplyno()));
+            this.contractMain.add(new ContractMainDto(insAreaCompany.getJqapplyno()));
         }
         if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno())){
-            contractMain.add(new ContractMainDto(insAreaCompany.getSyapplyno()));
+            this.contractMain.add(new ContractMainDto(insAreaCompany.getSyapplyno()));
         }
     }
     @AllArgsConstructor

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

@@ -25,6 +25,7 @@ import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiQuotedPriceResp
 import com.ydtech.modules.order.entity.api.huatai.request.*;
 import com.ydtech.modules.order.entity.api.huatai.response.*;
 import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
+import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.SubmitStatus;
 import com.ydtech.modules.order.entity.api.zhongmei.request.ModelsQueryRequest;
 import com.ydtech.modules.order.entity.api.zhongmei.response.ModelsQueryResponse;
 import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
@@ -159,24 +160,47 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
         // 2. 提交核保
         HuaTaiSubmitResponse response = submitForUnderwriting(yaQuoteInfoVo,insAreaCompany, huaTaiConfigureParameters);
-//        // 3. 人工核保
-//        if (SubmitStatus.S_3.getCode().equals(response.getSubmitStatus())) {
-//            insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
-//            if(StringUtils.isNotEmpty(response.getSubmitNotion())){
-//                insAreaCompany.setAuditopinion(response.getSubmitNotion());
-//            }
-//            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-//            return HttpResult.error(response.getSubmitNotion());
-//        }
-//       // huaTaiRequestApiComponents.validationResults(response);
-//        // 4. 投保单号
-//        insAreaCompany.setPaymentLink(response.getPayUrl());
-//        insAreaCompany.setJqapplyno(response.getForceProposalNo());
-//        insAreaCompany.setSyapplyno(response.getBizProposalNo());
-////        insAreaCompany.setJyapplyno(response.getAccidentProposalNo());
-//        insAreaCompany.setInsOrderNo(response.getProposalNo());
+
+        HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany,huaTaiConfigureParameters,"1");
+
+        boolean haveJQFlag = false;
+        boolean haveSYFlag = false;
+        for(HuaTaiSubmitResponse.AppliResult appliResult:response.getAppliResult()){
+            appliResult.getStatus();
+            if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
+                haveJQFlag = true;
+                if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
+
+                    if(appliResult.getStatus()==""){
+
+                    }
+                }
+            }
+            if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())){
+                haveSYFlag = true;
+                if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
+
+                }
+            }
+        }
+        // 3. 人工核保
+        /*if (SubmitStatus.S_3.getCode().equals(response.getSubmitStatus())) {
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
+            if(StringUtils.isNotEmpty(response.getSubmitNotion())){
+                insAreaCompany.setAuditopinion(response.getSubmitNotion());
+            }
+            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+            return HttpResult.error(response.getSubmitNotion());
+        }
+       // huaTaiRequestApiComponents.validationResults(response);
+        // 4. 投保单号
+        insAreaCompany.setPaymentLink(response.getPayUrl());
+        insAreaCompany.setJqapplyno(response.getForceProposalNo());
+        insAreaCompany.setSyapplyno(response.getBizProposalNo());
+        insAreaCompany.setJyapplyno(response.getAccidentProposalNo());
+        insAreaCompany.setInsOrderNo(response.getProposalNo());
         insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
-        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);*/
         return HttpResult.ok("核保成功");
     }