Bläddra i källkod

修改渤海代码

wks 2 år sedan
förälder
incheckning
4b6b9b9922

+ 22 - 3
src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java

@@ -187,16 +187,35 @@ public class BoHaiRequestApiComponent {
     }
 
     /**
-     * 核保请求
+     * 单证查询
      *
-     * @param statusDocumentsRequest 核保请求
+     * @param statusDocumentsRequest 单证查询
      * @return 响应
      */
     public StatusDocumentsResponse statusDocuments(StatusDocumentsRequest statusDocumentsRequest) throws Exception {
-        return post(statusDocumentsRequest, properties.getUrl(), StatusDocumentsResponse.class);
+        StatusDocumentsResponse response = post(statusDocumentsRequest, properties.getUrl(), StatusDocumentsResponse.class);
+        verificationResponseCode(response.getResponseCode(), response.getResponseMsg());
+        return response;
     }
 
+    /**
+     * 验证响应
+     *
+     * @param responseCode 响应code
+     * @param responseMsg  响应内容
+     */
+    private void verificationResponseCode(String responseCode, String responseMsg) {
+        if (ResponseCode.R_Z00004.getCode().equals(responseCode)) {
+            throw new SystemException(responseMsg);
+        }
+    }
 
+    /**
+     * @param responseCode 渤海财险请求状态
+     * @param requestNo    请求内容
+     * @return
+     * @throws Exception
+     */
     public String encryptionCallbackResponse(ResponseCode responseCode, String requestNo) throws Exception {
         CallbackResponse callbackResponse = new CallbackResponse(responseCode, requestNo);
         String json = JSON.toJSONString(callbackResponse, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);

+ 2 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -368,6 +368,8 @@ public class InsAreaCompany implements Serializable {
         this.jqLossRation = quoteRespVo.getJqLossRation();
         this.syLossRation = quoteRespVo.getSyLossRation();
 
+        this.jqapplyno = quoteRespVo.getJqApplyNo();
+        this.syapplyno = quoteRespVo.getSyApplyNo();
     }
 
     public void setPaymentLink(String paymentLink) {

+ 7 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/StatusDocumentsRequest.java

@@ -7,10 +7,16 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 
+
+/**
+ * @description: 渤海财险 单证查询
+ * @author: wenks
+ * @date: 2024/3/14 10:12
+ **/
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 @Data
-public class StatusDocumentsRequest extends BoHaiBaseRequest{
+public class StatusDocumentsRequest extends BoHaiBaseRequest {
 
     private static final long serialVersionUID = 8373969827791168689L;
 

+ 7 - 5
src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java

@@ -322,7 +322,7 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
         BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
                 ptlAgreementAttribution);
 
-        String applyno = StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() : insAreaCompany.getSyapplyno();
+        String applyno = !StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() : insAreaCompany.getSyapplyno();
         StatusDocumentsRequest statusDocumentsRequest = new StatusDocumentsRequest(parameters, insAreaCompany.getId(), applyno);
         StatusDocumentsResponse response = boHaiRequestApiComponent.statusDocuments(statusDocumentsRequest);
         return response.getData().getDocumentList();
@@ -348,7 +348,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
         if (!ObjectUtils.isEmpty(trafficPolicy)) {
             sumPayTax = Double.parseDouble(trafficPolicy.getVehicleTax().getTotalAmount());
             jqPremium = Double.parseDouble(trafficPolicy.getPremium());
-            jqPolicyNo = response.getData().getTrafficPolicy().getPolicyNo();
+            jqPolicyNo = trafficPolicy.getPolicyNo();
+            quoteRespVo.setJqApplyNo(trafficPolicy.getApplicationNo());
         }
         // 交强
         quoteRespVo.setStartDateJq(trafficPolicy.getStartDate());
@@ -358,7 +359,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
         QuotationResponse.DataDTO.BusinessPolicyDTO businessPolicy = response.getData().getBusinessPolicy();
         if (!ObjectUtils.isEmpty(businessPolicy)) {
             syPremium = Double.parseDouble(businessPolicy.getPremium());
-            syPolicyNo = response.getData().getBusinessPolicy().getPolicyNo();
+            syPolicyNo = businessPolicy.getPolicyNo();
+            quoteRespVo.setSyApplyNo(businessPolicy.getApplicationNo());
             // 商业
             quoteRespVo.setStartDateSy(businessPolicy.getStartDate());
             quoteRespVo.setEndDateSy(businessPolicy.getEndDate());
@@ -420,8 +422,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
                                                  String syPolicyNo) {
         // 保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
-        insAreaCompany.setJqappoint(jqPolicyNo);
-        insAreaCompany.setSyappoint(syPolicyNo);
+        insAreaCompany.setJqpolicyno(jqPolicyNo);
+        insAreaCompany.setSypolicyno(syPolicyNo);
 
         // 渤海业务id
         String busUniqueId = response.getData().getBusUniqueId();