Forráskód Böngészése

fix 国任财险 python 返回 车辆评分信息

liub 4 hónapja
szülő
commit
fa46e0f15c

+ 26 - 0
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/build/GuoRenCrawlerQuoteResultsVoBuild.java

@@ -1,11 +1,14 @@
 package com.jzg.quotation.guoren.crawler.build;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.constants.quote.enums.quote.KindCode;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
+import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.guoren.api.constant.enums.GuoRenRiskCode;
 import com.jzg.quotation.guoren.api.entity.Response.PremiumResponse;
 import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerBaseResponse;
@@ -58,6 +61,29 @@ public final class GuoRenCrawlerQuoteResultsVoBuild {
             quoteResultsVo.setKindInfoVo(kindInfoVo);
         }
 
+        QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
+        scoreVo.setLossRation(calculationPremium.getBc().getAutoPriceOutputXOMRespVo().getStrBillELR2());
+        scoreVo.setJqLossRation(calculationPremium.getBc().getAutoPriceOutputXOMRespVo().getStrBillCTPELR2());
+        scoreVo.setSyLossRation(calculationPremium.getBc().getAutoPriceOutputXOMRespVo().getStrBillCOMELR2());
+
+        // 保司评分
+        JSONArray scoreJson = new JSONArray();
+        //光博评分
+        scoreJson.add(new JSONObject()
+                .fluentPut("scoreName", "交强光博分")
+                .fluentPut("scoreKey", "score")
+                .fluentPut("score", calculationPremium.getCi().getPrpTmainRate().getBillcomeGroup()));
+
+        if (calculationPremium.getBi().getPrpTmainRate() != null) {
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "商业光博分")
+                    .fluentPut("scoreKey", "score")
+                    .fluentPut("score", calculationPremium.getBi().getPrpTmainRate().getBillcomeGroup()));
+        }
+
+        scoreVo.setScoreJson(scoreJson);
+        quoteResultsVo.setScoreVo(scoreVo);
+
         return quoteResultsVo;
     }
 

+ 8 - 0
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/dto/GuoRenBiDTO.java

@@ -7,10 +7,12 @@ import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.quotation.guoren.crawler.entity.request.GuoRenCrawlerCalculationPremiumRequest;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 
 import java.util.ArrayList;
 import java.util.List;
 
+@Slf4j
 @NoArgsConstructor
 @Data
 public class GuoRenBiDTO {
@@ -128,6 +130,12 @@ public class GuoRenBiDTO {
         this.ciInsureDemandWarningClaim = new ArrayList<>();
         this.prpTenGearAllocationFeeList = new ArrayList<>();
         this.prpTchargingPostData = new ArrayList<>();
+        for (KindInfoVo infoVo : kindInfoVo) {
+            if (infoVo.getKindName().contains("车损")) {
+                log.info("车损险金额:{}", prpTitemCar.getCompromisePrice());
+                infoVo.setAmount(prpTitemCar.getCompromisePrice());
+            }
+        }
         this.prptitemkindList = GuoRenCrawlerCalculationPremiumRequest.PrptitemkindListDTO.getBiPrptitemkindList(kindInfoVo, prpTmain);
         this.prptengageList = new ArrayList<>();
         this.prpDclause = new ArrayList<>();

+ 13 - 11
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/request/GuoRenCrawlerCalculationPremiumRequest.java

@@ -112,7 +112,7 @@ public class GuoRenCrawlerCalculationPremiumRequest {
         private String kindName;
 
         @JsonProperty("itemKindNo")
-        private String itemKindNo;
+        private Integer itemKindNo;
 
         @JsonProperty("shortRateFlag")
         private String shortRateFlag;
@@ -136,10 +136,10 @@ public class GuoRenCrawlerCalculationPremiumRequest {
         private Integer isDeductible;
 
         @JsonProperty("rate")
-        private String rate;
+        private Integer rate;
 
         @JsonProperty("amount")
-        private Integer amount;
+        private String amount;
 
         @JsonProperty("premium")
         private String premium;
@@ -273,16 +273,16 @@ public class GuoRenCrawlerCalculationPremiumRequest {
             this.checked = 1;
             this.kindCode = kindInfoVo.getKindCode();
             this.kindName = kindInfoVo.getKindName();
-            this.itemKindNo = insuranceItem.getItemKindNo();
+            this.itemKindNo = Integer.parseInt(insuranceItem.getItemKindNo());
             this.shortRateFlag = "2";
             this.shortRate = "100.0000";
             this.startDate = prpTmain.getStartDate();
             this.endDate = prpTmain.getEndDate();
             this.calculateFlag = "Y";
-            this.deductible = "";
+            this.deductible = "0";
             this.isDeductible = 0;
-            this.rate = "";
-            this.amount = Integer.parseInt(kindInfoVo.getAmount());
+            this.rate = 0;
+            this.amount = kindInfoVo.getAmount();
             this.unitAmount = Integer.parseInt(kindInfoVo.getUnitAmount());
             this.premium = "";
             this.basePremium = "";
@@ -295,8 +295,10 @@ public class GuoRenCrawlerCalculationPremiumRequest {
             this.value = "";
             this.modeCode = "";
             List<KindInfoVo.OptionsDTO> options = kindInfoVo.getOptions();
-            if (!CollectionUtils.isEmpty(options) || !options.get(0).getLabel().contains("次") ) {
+            if (!CollectionUtils.isEmpty(options) || !options.get(0).getLabel().contains("次")) {
                 this.quantity = Integer.parseInt(options.get(0).getValue());
+            } else {
+                this.quantity = Integer.parseInt(kindInfoVo.getServiceTimes());
             }
             this.adjustRate = "";
             this.channelrate = "";
@@ -330,7 +332,7 @@ public class GuoRenCrawlerCalculationPremiumRequest {
             PrptitemkindListDTO prptitemkindListDTO = new PrptitemkindListDTO();
             prptitemkindListDTO.setKindCode("BZ");
             prptitemkindListDTO.setKindName("机动车交通事故责任强制保险");
-            prptitemkindListDTO.setItemKindNo("0");
+            prptitemkindListDTO.setItemKindNo(0);
             prptitemkindListDTO.setDiscount("1");
             prptitemkindListDTO.setShortRateFlag("2");
             prptitemkindListDTO.setRiskCode("0507");
@@ -344,8 +346,8 @@ public class GuoRenCrawlerCalculationPremiumRequest {
             prptitemkindListDTO.setCalculateFlag("N");
             prptitemkindListDTO.setDeductible("");
             prptitemkindListDTO.setIsDeductible(0);
-            prptitemkindListDTO.setRate("0");
-            prptitemkindListDTO.setAmount(200000);
+            prptitemkindListDTO.setRate(0);
+            prptitemkindListDTO.setAmount("200000");
             prptitemkindListDTO.setPremium("0.0");
             prptitemkindListDTO.setBasePremium("0");
             prptitemkindListDTO.setDiscount("0.0");

+ 1 - 1
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerQuoteProcessServiceImpl.java

@@ -52,7 +52,7 @@ public class GuoRenCrawlerQuoteProcessServiceImpl implements GuoRenCrawlerQuoteP
     public HttpHeaders getHeaders(String username) {
         HttpHeaders headers = new HttpHeaders();
 //        String token = guoRenCrawlerCacheComponent.getToken(username);
-        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJXMzAwMDM5OSIsInVzZXJJZCI6IjQ5NjE4MSIsIm5hbWUiOiLmnY7mmKXmooUiLCJleHAiOjE3Nzg3MjI5NTB9.iRyriJoek5iqC3yCOJhFZL-yqDqNlXvpm6jSR-IuGX60oxGkEGLt0w_a4w55TGK7_jfRdFB47150-d_pw91lrG9b2zjaxFFtHaHx29BRoAGIvwLOZXqZBZwEfHBlyY9xf9L4EKvmqHR7kN_e4Ss3HMj5t6w0e5fK1LvNAsW6YK8";
+        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJXMzAwMDM5OSIsInVzZXJJZCI6IjQ5NjE4MSIsIm5hbWUiOiLmnY7mmKXmooUiLCJleHAiOjE3Nzg4MTAyNzh9.h_xSPQiUCs_yJDjjr_Dz6vtM4J5rmIteytOmjDrjOXDDjd-n0nEVkw6sdtJJIZ1Z8BUcucyfsTy5R1sR5KHrkvlOWUvGMcfh0rjf5WtyYkfjZIH68abjTQmBuvf3BnZqHgGhaS-75wyfJ2d0t7dSAZx1VDFYIUwP51tmOl4awX4";
         if (!StringUtils.hasText(token)) {
             throw new SystemException("登录失败,请重新登录");
         }

+ 77 - 77
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -293,83 +293,83 @@ public class UnifyOrderManager {
             //////////////////////////////////////////新增营销抽奖活动////////////////////////////////////////////////
             //远程调用活动列表
             //匹配规则 每报价()次,可得()次抽奖机会,每日最多()次抽奖
-            HttpResult<List<LotteryActivityVO>> result = localLivingClient.queryActivityRules(lotteryScene);
-            if (result == null || result.getCode() != 200 || result.getData() == null) {
-                log.error("统一报价,查询本地生活的活动列表异常");
-            } else {
-                for (LotteryActivityVO activity : result.getData()) {
-                    // 检查活动是否有效
-                    if (!LocalDate.now().isBefore(activity.getActivityStartTime())
-                            && !LocalDate.now().isAfter(activity.getActivityEndTime())) {
-                        continue;
-                    }
-
-                    if (activity.getLocalActivityTables() == null) {
-                        continue;
-                    }
-                    // 遍历所有本地活动表
-                    for (LocalActivityTableVO table : activity.getLocalActivityTables()) {
-                        // 只处理 type=6 的报价规则
-                        if (!"6".equals(table.getType())) {
-                            continue;
-                        }
-
-                        // 只处理本租户的报价规则
-                        if (!baseController.getUserSystemCode().equals(table.getTenantId())) {
-                            continue;
-                        }
-                        // 查询是否在一账通绑定
-                        UnifiedUserCenterDTO unifiedUserCenterDTO = new UnifiedUserCenterDTO();
-                        unifiedUserCenterDTO.setUserId(quoteVo.getOrder().getRealQuoteUserId());
-                        unifiedUserCenterDTO.setClientId(CLIENT_ID);
-                        unifiedUserCenterDTO.setTenantId(baseController.getUserSystemCode());
-                        HttpResult<UnifiedUserClientVO> unifiedUserClientVOHttpResult = null;
-                        try {
-                            unifiedUserClientVOHttpResult = localLivingClient.queryBind(unifiedUserCenterDTO);
-                        } catch (Exception e) {
-                            log.info("业务员报价,查询用户绑定一账通接口异常,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                            log.error("业务员报价,查询用户绑定一账通接口异常", e);
-                        }
-                        if (unifiedUserClientVOHttpResult == null || unifiedUserClientVOHttpResult.getCode() != 200 || unifiedUserClientVOHttpResult.getData() == null) {
-                            // 判断是否满足条件
-                            // 业务员报价次数是否大于等于本活动规定时间范围内的报价次数
-                            // 统计业务员的报价次数
-                            int count = insOrdersService.countQuoteNum(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), activity.getActivityStartTime(), activity.getActivityEndTime());
-                            if (count >= Integer.parseInt(table.getQutNum()) && count <= Integer.parseInt(table.getQutLotteryMax())) {
-                                // 存本地记录 等绑定后更新本地记录的同步状态字段即可
-                                completeRule(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), null, activity.getId(),
-                                        table.getId(), table.getQutNum() ,table.getQutLotteryNum() ,table.getQutLotteryMax() ,YesNoEnum.NO.getCode(), 6);
-                                log.info("业务员报价,满足条件插入记录,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                            }
-                        }else {
-                            Map<String, List<UnifiedUserClientVO>> userClientGroupMap = unifiedUserClientVOHttpResult.getData().getUserClients()
-                                    .stream()
-                                    .collect(Collectors.groupingBy(UnifiedUserClientVO::getClientId));
-                            // 首先查业务员是否在一账通绑定过本地生活  【已绑定过 远程调抽奖次数增加接口 标记已同步
-                            if (userClientGroupMap.containsKey(CLIENT_ID)) {
-                                LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
-                                lotteryCounDTO.setAppUserId(quoteVo.getOrder().getRealQuoteUserId());
-                                lotteryCounDTO.setActivityId(activity.getId());
-                                lotteryCounDTO.setCount(Integer.parseInt(table.getQutLotteryNum()));
-                                HttpResult<LotteryCountVO> lotteryCountVOHttpResult = null;
-                                try {
-                                    lotteryCountVOHttpResult = localLivingClient.addLotteryCount(lotteryCounDTO);
-                                } catch (Exception e) {
-                                    log.info("业务员报价,远程调用本地生活抽奖次数增加接口异常,userId:{},count:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), table.getQutLotteryNum(), baseController.getUserSystemCode());
-                                    log.error("业务员报价,远程调用本地生活抽奖次数增加异常", e);
-                                }
-                                if (lotteryCountVOHttpResult != null && lotteryCountVOHttpResult.getData().getSuccess()) {
-                                    // 记录规则完成  标记已同步
-                                    completeRule(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), null, activity.getId(),
-                                            table.getId(), table.getQutNum(), table.getQutLotteryNum(), table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 6);
-
-                                    log.info("业务员报价,满足条件插入记录并远程同步,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                                }
-                            }
-                        }
-                    }
-                }
-            }
+//            HttpResult<List<LotteryActivityVO>> result = localLivingClient.queryActivityRules(lotteryScene);
+//            if (result == null || result.getCode() != 200 || result.getData() == null) {
+//                log.error("统一报价,查询本地生活的活动列表异常");
+//            } else {
+//                for (LotteryActivityVO activity : result.getData()) {
+//                    // 检查活动是否有效
+//                    if (!LocalDate.now().isBefore(activity.getActivityStartTime())
+//                            && !LocalDate.now().isAfter(activity.getActivityEndTime())) {
+//                        continue;
+//                    }
+//
+//                    if (activity.getLocalActivityTables() == null) {
+//                        continue;
+//                    }
+//                    // 遍历所有本地活动表
+//                    for (LocalActivityTableVO table : activity.getLocalActivityTables()) {
+//                        // 只处理 type=6 的报价规则
+//                        if (!"6".equals(table.getType())) {
+//                            continue;
+//                        }
+//
+//                        // 只处理本租户的报价规则
+//                        if (!baseController.getUserSystemCode().equals(table.getTenantId())) {
+//                            continue;
+//                        }
+//                        // 查询是否在一账通绑定
+//                        UnifiedUserCenterDTO unifiedUserCenterDTO = new UnifiedUserCenterDTO();
+//                        unifiedUserCenterDTO.setUserId(quoteVo.getOrder().getRealQuoteUserId());
+//                        unifiedUserCenterDTO.setClientId(CLIENT_ID);
+//                        unifiedUserCenterDTO.setTenantId(baseController.getUserSystemCode());
+//                        HttpResult<UnifiedUserClientVO> unifiedUserClientVOHttpResult = null;
+//                        try {
+//                            unifiedUserClientVOHttpResult = localLivingClient.queryBind(unifiedUserCenterDTO);
+//                        } catch (Exception e) {
+//                            log.info("业务员报价,查询用户绑定一账通接口异常,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
+//                            log.error("业务员报价,查询用户绑定一账通接口异常", e);
+//                        }
+//                        if (unifiedUserClientVOHttpResult == null || unifiedUserClientVOHttpResult.getCode() != 200 || unifiedUserClientVOHttpResult.getData() == null) {
+//                            // 判断是否满足条件
+//                            // 业务员报价次数是否大于等于本活动规定时间范围内的报价次数
+//                            // 统计业务员的报价次数
+//                            int count = insOrdersService.countQuoteNum(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), activity.getActivityStartTime(), activity.getActivityEndTime());
+//                            if (count >= Integer.parseInt(table.getQutNum()) && count <= Integer.parseInt(table.getQutLotteryMax())) {
+//                                // 存本地记录 等绑定后更新本地记录的同步状态字段即可
+//                                completeRule(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), null, activity.getId(),
+//                                        table.getId(), table.getQutNum() ,table.getQutLotteryNum() ,table.getQutLotteryMax() ,YesNoEnum.NO.getCode(), 6);
+//                                log.info("业务员报价,满足条件插入记录,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
+//                            }
+//                        }else {
+//                            Map<String, List<UnifiedUserClientVO>> userClientGroupMap = unifiedUserClientVOHttpResult.getData().getUserClients()
+//                                    .stream()
+//                                    .collect(Collectors.groupingBy(UnifiedUserClientVO::getClientId));
+//                            // 首先查业务员是否在一账通绑定过本地生活  【已绑定过 远程调抽奖次数增加接口 标记已同步
+//                            if (userClientGroupMap.containsKey(CLIENT_ID)) {
+//                                LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
+//                                lotteryCounDTO.setAppUserId(quoteVo.getOrder().getRealQuoteUserId());
+//                                lotteryCounDTO.setActivityId(activity.getId());
+//                                lotteryCounDTO.setCount(Integer.parseInt(table.getQutLotteryNum()));
+//                                HttpResult<LotteryCountVO> lotteryCountVOHttpResult = null;
+//                                try {
+//                                    lotteryCountVOHttpResult = localLivingClient.addLotteryCount(lotteryCounDTO);
+//                                } catch (Exception e) {
+//                                    log.info("业务员报价,远程调用本地生活抽奖次数增加接口异常,userId:{},count:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), table.getQutLotteryNum(), baseController.getUserSystemCode());
+//                                    log.error("业务员报价,远程调用本地生活抽奖次数增加异常", e);
+//                                }
+//                                if (lotteryCountVOHttpResult != null && lotteryCountVOHttpResult.getData().getSuccess()) {
+//                                    // 记录规则完成  标记已同步
+//                                    completeRule(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), null, activity.getId(),
+//                                            table.getId(), table.getQutNum(), table.getQutLotteryNum(), table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 6);
+//
+//                                    log.info("业务员报价,满足条件插入记录并远程同步,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
+//                                }
+//                            }
+//                        }
+//                    }
+//                }
+//            }
 
 
         } catch (Exception e) {