瀏覽代碼

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

Qchen 1 年之前
父節點
當前提交
fef643296f

+ 1 - 1
src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java

@@ -41,7 +41,7 @@ public class RestTemplateConfig {
     private static final int IDLE_CONNECTIONS = 30;
 
     // 返回数据的超时时间
-    private static final int SOCKET_TIMEOUT = 90 * 1000;
+    private static final int SOCKET_TIMEOUT = 180 * 1000;
 
     // 连接上服务器的超时时间
     private static final int CONNECT_TIMEOUT = 3 * 1000;

+ 15 - 7
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.fee.dto.vo;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.enums.InsurKind;
 import com.ydtech.constants.enums.dict.ZmTransferType;
 import com.ydtech.constants.enums.dict.insurance.VehicleType;
@@ -434,13 +435,20 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("TotalPayoutRate", String.valueOf(insAreaCompany.getLossRation())));
         //太平绿黄红区
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("GreenYellowAndRedAreas", insAreaCompany.getTpColorScore()));
-        if (insAreaCompany.getAccidentalDriving() != null) {
-            //非车名称
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving()
-                    .getRideRiskName()));
-            //非车份数
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity",
-                    String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));
+        if (insAreaCompany.getApiType() == 2) {
+            if (insAreaCompany.getAccidentInfo() != null && !insAreaCompany.getAccidentInfo().isEmpty()) {
+                //非车名称
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", ((JSONObject) insAreaCompany.getAccidentInfo().get(0)).getString("projectName")));
+                //非车份数
+                Integer quantity = ((JSONObject) insAreaCompany.getAccidentInfo().get(0)).getInteger("quantity");
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity",
+                        String.valueOf(quantity)));
+            }
+        }else if(insAreaCompany.getApiType() == 1){
+            if (Objects.nonNull(insAreaCompany.getAccidentalDriving())){
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving().getRideRiskName()));
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity", String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));
+            }
         }
         //真假单交
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("IsDJQ", insAreaCompany.getIsDjq()));

+ 7 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyAccidentalDriving.java

@@ -118,6 +118,13 @@ public class InsAreaCompanyAccidentalDriving implements Serializable {
             this.setRideRiskCode(jsonObject.getString("rideRiskCode"));
             this.setQuantity(jsonObject.getInteger("quantity"));
             this.setCompanyId(t.getCompanyId());
+        }else if(t.getCompanyId().equals("XDCX1000000")){
+            //国任
+            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo()));
+            this.setRideRiskCode(jsonObject.getString("goodsCode"));
+            this.setRideRiskName(jsonObject.getString("goodsName"));
+            this.setQuantity(jsonObject.getInteger("quantity"));
+            this.setCompanyId(t.getCompanyId());
         }
     }
 }

+ 17 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java

@@ -362,6 +362,23 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
         @JsonProperty("BiDiscount")
         private String biDiscount;
 
+        /**
+         * 总赔付率
+         */
+        @JsonProperty("loss_ration")
+        private String lossRation;
+
+        /**
+         * 交强赔付率
+         */
+        @JsonProperty("jq_loss_ration")
+        private String jqLossRation;
+
+        /**
+         * 商业赔付率
+         */
+        @JsonProperty("sy_loss_ration")
+        private String syLossRation;
 
 
         public String getDiscount() {

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

@@ -648,9 +648,19 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                                       PtlAgreementAttribution ptlAgreementAttribution,
                                       InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving,
                                       BaseQuoteInfoVo quoteInfoVo) {
+
+        // 赋值非车份数
+        if (quoteRespVo.getAccidentInfo() != null && !quoteRespVo.getAccidentInfo().isEmpty()) {
+            AccidentResponseVo o = quoteRespVo.getAccidentInfo().get(0);
+            if (Objects.nonNull(o)) {
+                o.setQuantity(String.valueOf(insAreaCompanyAccidentalDriving.getQuantity()));
+            }
+        }
+
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
-//在修改中
+
+        //在修改中
         insAreaCompany.setCarInfo(JSON.toJSONString(quoteInfoVo.getCarInfo()));
         insAreaCompany.setOwnerInfo(JSON.toJSONString(quoteInfoVo.getOwnerInfo()));
         insAreaCompany.setApplyInfo(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo()));
@@ -719,6 +729,11 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             insAreaCompany.setExtendInfo(extendInfo.toString());
         }
 
+        // 赔付率
+        quoteRespVo.setLossRation(Double.parseDouble(response.getOther().getLossRation()));
+        // 交强赔付率
+        quoteRespVo.setJqLossRation(Double.parseDouble(response.getOther().getJqLossRation()));
+        quoteRespVo.setSyLossRation(Double.parseDouble(response.getOther().getSyLossRation()));
 
 
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDriving);