소스 검색

Merge remote-tracking branch 'origin/master'

lixiaolong 2 달 전
부모
커밋
3d5ab9b604

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCalculatePremiumApplyMessage.java

@@ -35,7 +35,7 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
     public AnShengCrawlerCalculatePremiumApplyMessage(QuoteVo quoteVo, AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO,
                                                       AnShengCrawlerGetUserDetailResponse.DataDTO.AgentDefineDTO userDetailResponse, DepartmentPlanCode departmentPlanCode,
                                                       String checkVehicleCodeSecret) {
-        RiskInfoVo riskInfoVo = Optional.ofNullable(quoteVo.getCiRiskInfoVo()).orElse(quoteVo.getBiRiskInfoVo());
+        RiskInfoVo riskInfoVo = Optional.ofNullable(quoteVo.getBiRiskInfoVo()).orElseGet(() -> quoteVo.getCiRiskInfoVo() );
 
         String customerNegotiatePrice = CustomerNegotiatePriceUtils.calculateTheDepreciationValue(departmentPlanCode.getCode(), quoteVo.getCarInfoVo()
                         .getEnergyTypeCode(),

+ 2 - 1
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/request/GuoRenCrawlerQueryQuotationRequest.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.guoren.crawler.entity.request;
 
+import com.alibaba.excel.util.StringUtils;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.commons.entity.quote.vo.AccidentalDrivingVo;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
@@ -50,7 +51,7 @@ public class GuoRenCrawlerQueryQuotationRequest implements Serializable {
         DataDTO dataDTO = new DataDTO();
         GoodsListDTO goodsListDTO = new GoodsListDTO();
         goodsListDTO.setClassifyCode("A");
-        goodsListDTO.setGoodsCode(accidentalDriving.getParentProductCode());
+        goodsListDTO.setGoodsCode(StringUtils.isBlank(accidentalDriving.getParentProductCode()) ? accidentalDriving.getProductCode() : accidentalDriving.getParentProductCode());
         goodsListDTO.setProdCode(accidentalDriving.getProductCode());
         goodsListDTO.setStartDate(quoteVo.getCiRiskInfoVo() != null
                 ? TimeProcessing.dateTimeToDate(quoteVo.getCiRiskInfoVo().getStartDate()) + " 00:00:00"

+ 4 - 1
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/component/HengBangCrawlerRequestComponent.java

@@ -340,7 +340,10 @@ public class HengBangCrawlerRequestComponent {
                             } else {
                                 calculationRequest.setBegintimeBi(utcTime);
                             }
-                            calculationRequest.setBegintimeAccident(utcTime);
+                            // 驾意险不支持即时起保:北京时间0点则直接复用,非0点则自动设为下一日0点
+                            calculationRequest.setBegintimeAccident(DateUtil.isBeijingMidnight(utcTime)
+                                    ? utcTime
+                                    : DateUtil.getNextDayMidnightUtc(utcTime));
                             return getCalculationResult(calculationRequest, headers);
                         } else {
                             return StrUtil.isNotBlank(detail) ? detail : responseBody;

+ 4 - 1
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/service/Impl/HengBangCrawlerRequestImpl.java

@@ -197,7 +197,10 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
                 // 不含交强险标识则为商业险重复投保
                 calculationRequest.setBegintimeBi(utcTime);
             }
-            calculationRequest.setBegintimeAccident(utcTime);
+            // 驾意险不支持即时起保:北京时间0点则直接复用,非0点则自动设为下一日0点
+            calculationRequest.setBegintimeAccident(DateUtil.isBeijingMidnight(utcTime)
+                    ? utcTime
+                    : DateUtil.getNextDayMidnightUtc(utcTime));
 
             resJsonObj = callCalculation(calculationRequest, headers);
             if (resJsonObj == null) {

+ 17 - 3
tenant/insurance/quotation-huanong/src/main/java/com/jzg/quotation/huanong/crawler/entity/request/HuaNongCrawlerQuotedPriceRequestRequest.java

@@ -3227,8 +3227,8 @@ public class HuaNongCrawlerQuotedPriceRequestRequest implements HuaNongHeadReque
                 this.nativePlace = customerInfoVo.getAddr();
                 this.riskLevel = "0";
                 this.secrecyUnitFlag = false;
-                this.sex = customerInfoVo.getGender();
-                this.fxqSex = customerInfoVo.getGender();
+                this.sex = getSex(customerInfoVo.getIdentifyNumber());
+                this.fxqSex = getSex(customerInfoVo.getIdentifyNumber());
                /* this.sex = "2";
                 this.fxqSex = "2";*/
                 this.tandBRelationship = tandBRelationship;
@@ -3256,7 +3256,21 @@ public class HuaNongCrawlerQuotedPriceRequestRequest implements HuaNongHeadReque
                         new CustomerDTO(policyHolderInfo, "1", tandBRelationship, agentCode, comCode)
                 );
             }
-
+            /**
+             * 根据18位身份证获取性别
+             * @param idCard 身份证号
+             * @return 1-男  2-女
+             */
+            public static String getSex(String idCard) {
+                // 简单校验长度
+                if (idCard == null || idCard.length() != 18) {
+                    throw new IllegalArgumentException("身份证必须为18位");
+                }
+                // 取第17位字符,下标16
+                char sexChar = idCard.charAt(16);
+                int num = Character.getNumericValue(sexChar);
+                return num % 2 == 0 ? "2" : "1";
+            }
 
             @NoArgsConstructor
             @Data