Просмотр исходного кода

Merge remote-tracking branch 'origin/test' into test

haoyu 2 лет назад
Родитель
Сommit
6c23c0384b

+ 1 - 1
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumReq.java

@@ -874,7 +874,7 @@ public class PremiumReq {
                 this.taxRelifFlag = flag.getCode();
 
                 //返回空
-                if (!"".equals(vehicleAndVesselTax.getRelifReason())) {
+                if (StringUtils.isNotEmpty(vehicleAndVesselTax.getRelifReason())) {
                     RelifReason reason = Enum.valueOf(RelifReason.class, RelifReason.TITLE + vehicleAndVesselTax.getRelifReason());
                     this.relifReason = reason.getCode();
 

+ 1 - 2
src/main/java/com/ydtech/modules/ins/model/zm/ZmCarModel.java

@@ -56,12 +56,11 @@ public class ZmCarModel {
     private String vehicleSeatMax;
     private String vehicleSeatMin;
 
-
     public static List<CarModelDTO> toCarModelDTOs(List<ZmCarModel> data) {
         return data.stream().map(ZmCarModel::toCarModelDTO).collect(Collectors.toList());
     }
 
-    public static CarModelDTO toCarModelDTO(ZmCarModel zmCarModel){
+    public static CarModelDTO toCarModelDTO(ZmCarModel zmCarModel) {
         CarModelDTO carModelDTO = new CarModelDTO();
         carModelDTO.setModelCode(zmCarModel.getLocalModelCode());
         carModelDTO.setModelName(zmCarModel.getModelName());

+ 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;
 

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/config/BoHaiConfigureParameters.java

@@ -5,6 +5,9 @@ import lombok.Data;
 @Data
 public class BoHaiConfigureParameters implements ConfigureParameters {
 
+    // 合作方代码
+    private String sysSourceCode;
+
     // 二级机构编码
     private String insurerBranchCode;
 

+ 4 - 1
src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java

@@ -10,8 +10,10 @@ import com.ydtech.modules.order.entity.TaxArrears;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.apache.commons.lang3.ObjectUtils;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.List;
 
 @EqualsAndHashCode(callSuper = true)
@@ -135,7 +137,8 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
             this.orderstatus = insAreaCompany.getOrderstatus();
             this.companyId = insAreaCompany.getId();
             this.inscompany = insAreaCompany.getInscompany();
-            this.kindList = insAreaCompany.getKindinfo().toJavaList(QuoteKindRespVo.class);
+            this.kindList = ObjectUtils.isEmpty(insAreaCompany.getKindinfo()) ? new ArrayList<>() :
+                    insAreaCompany.getKindinfo().toJavaList(QuoteKindRespVo.class);
             this.jqPremium = insAreaCompany.getJqpremium().doubleValue();
             this.syPremium = insAreaCompany.getSypremium().doubleValue();
             this.jyPremium = insAreaCompany.getJypremium().doubleValue();

+ 7 - 0
src/main/java/com/ydtech/modules/order/service/ZhongMeiOrderService.java

@@ -16,6 +16,13 @@ public interface ZhongMeiOrderService extends BaseOrderService<AccidentalDriving
 
     HttpResult getPolicyPrint(String companyId);
 
+
+    /**
+     * 车架号查询
+     *
+     * @param vin 车架号
+     * @return
+     */
     List<CarModelDTO> vinSearch(String vin);
 
     HttpResult submitImage(String companyId);

+ 11 - 7
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());
@@ -356,15 +357,17 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
         quoteRespVo.setJqApplyNo(trafficPolicy.getApplicationNo());
         // 商业险
         QuotationResponse.DataDTO.BusinessPolicyDTO businessPolicy = response.getData().getBusinessPolicy();
+        List<QuoteKindRespVo> kindList1 = new ArrayList<>();
+
         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());
             quoteRespVo.setSyApplyNo(businessPolicy.getApplicationNo());
             List<QuotationResponse.DataDTO.BusinessPolicyDTO.CoveragesDTO> coverages = businessPolicy.getCoverages();
-            List<QuoteKindRespVo> kindList1 = new ArrayList<>();
             // 商业险险种
             QuoteKindRespVo kind;
             List<KindInfoVo> kindList = yaQuoteInfoVo.getKindList();
@@ -387,9 +390,10 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
                 }
                 kindList1.add(kind);
             }
-            quoteRespVo.setKindList(kindList1);
         }
 
+        quoteRespVo.setKindList(kindList1);
+
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
         // 非车险
         QuotationResponse.DataDTO.UnAutoPremiumDTO unAutoPremium = response.getData().getUnAutoPremium();
@@ -420,8 +424,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();