Explorar el Código

Merge branch 'master' into wrq_dev

wangrq hace 3 meses
padre
commit
99298cd419

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/po/PtlSchemeInsuranceDrivingIntention.java

@@ -35,6 +35,13 @@ public class PtlSchemeInsuranceDrivingIntention {
     @Schema(description = "是否删除")
     @Schema(description = "是否删除")
     @TableLogic
     @TableLogic
     private Integer isDelete;
     private Integer isDelete;
+
+    @Schema(description = "最小座位数")
+    private Integer minSeatCount;
+
+    @Schema(description = "最大座位数")
+    private Integer maxSeatCount;
+
 }
 }
 
 
 
 

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java

@@ -285,6 +285,8 @@ public class PtlSchemeSaveVo {
                 ptlSchemeInsuranceDrivingIntention.setSelectedStatus(drivingIntention.getSelectedStatus());
                 ptlSchemeInsuranceDrivingIntention.setSelectedStatus(drivingIntention.getSelectedStatus());
                 ptlSchemeInsuranceDrivingIntention.setDrivingIntentionId(drivingIntention.getDrivingIntentionId());
                 ptlSchemeInsuranceDrivingIntention.setDrivingIntentionId(drivingIntention.getDrivingIntentionId());
                 ptlSchemeInsuranceDrivingIntention.setQuantity(drivingIntention.getQuantity());
                 ptlSchemeInsuranceDrivingIntention.setQuantity(drivingIntention.getQuantity());
+                ptlSchemeInsuranceDrivingIntention.setMinSeatCount(drivingIntention.getMinSeatCount());
+                ptlSchemeInsuranceDrivingIntention.setMaxSeatCount(drivingIntention.getMaxSeatCount());
                 ptlSchemeInsuranceDrivingIntentionList.add(ptlSchemeInsuranceDrivingIntention);
                 ptlSchemeInsuranceDrivingIntentionList.add(ptlSchemeInsuranceDrivingIntention);
             });
             });
         }
         }

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/SchemeResultVo.java

@@ -99,5 +99,7 @@ public class SchemeResultVo {
         private String premium;
         private String premium;
         private String quantity;
         private String quantity;
         private String selectedStatus;
         private String selectedStatus;
+        private Integer minSeatCount;
+        private Integer maxSeatCount;
     }
     }
 }
 }

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/vo/RuleAttrMappingVo.java

@@ -92,6 +92,8 @@ public class RuleAttrMappingVo {
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("OwnersInfoAge", ownerInfo.getAge().toString()));
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("OwnersInfoAge", ownerInfo.getAge().toString()));
             //车主 性别
             //车主 性别
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("OwnersInfoSex", ownerInfo.getGender().equals("男") ? "1" : "2"));
             ruleAttrMappingVoList.add(new RuleAttrMappingVo("OwnersInfoSex", ownerInfo.getGender().equals("男") ? "1" : "2"));
+            //车主 地址
+            ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersAddress", ownerInfo.getAddr()));
         }
         }
         // 投保人
         // 投保人
         InsOrdersCarUserInfo policyHolderInfo = insOrdersCarUserInfos.stream()
         InsOrdersCarUserInfo policyHolderInfo = insOrdersCarUserInfos.stream()

+ 7 - 2
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/service/impl/ChengTaiApiRequestImpl.java

@@ -306,13 +306,18 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
                     break;
                     break;
                 }
                 }
             }
             }
+            if (premiumCalculationResponse.getHead().getErrorMessage().contains("投保查询校验信息已经校验成功") || premiumCalculationResponse.getHead().getErrorMessage().contains("投保查询校验信息不存在或已经校验成功")) {
+                premiumCalculationRequest.getBasePart().setCommRenewalAnswer("");
+                premiumCalculationRequest.getBasePart().setCompRenewalAnswer("");
+            }
             //处理订单号
             //处理订单号
-            if( premiumCalculationResponse.getCompRisk() != null && premiumCalculationResponse.getCompRisk().getFtrno() != null){
+            if(premiumCalculationResponse.getCompRisk() != null && premiumCalculationResponse.getCompRisk().getFtrno() != null){
                 premiumCalculationRequest.getBasePart().setOrderNumber(premiumCalculationResponse.getCompRisk().getFtrno().getOrderNumber());
                 premiumCalculationRequest.getBasePart().setOrderNumber(premiumCalculationResponse.getCompRisk().getFtrno().getOrderNumber());
             }
             }
-            if( premiumCalculationResponse.getCommRisk() != null && premiumCalculationResponse.getCommRisk().getFtrno() != null){
+            if(premiumCalculationResponse.getCommRisk() != null && premiumCalculationResponse.getCommRisk().getFtrno() != null){
                 premiumCalculationRequest.getBasePart().setOrderNumber(premiumCalculationResponse.getCommRisk().getFtrno().getOrderNumber());
                 premiumCalculationRequest.getBasePart().setOrderNumber(premiumCalculationResponse.getCommRisk().getFtrno().getOrderNumber());
             }
             }
+
         }
         }
         return premiumCalculationResponse;
         return premiumCalculationResponse;
     }
     }

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

@@ -283,7 +283,7 @@ public class GuoRenCrawlerCalculationPremiumRequest {
             this.isDeductible = 0;
             this.isDeductible = 0;
             this.rate = 0;
             this.rate = 0;
             this.amount = kindInfoVo.getAmount();
             this.amount = kindInfoVo.getAmount();
-            this.unitAmount = Integer.parseInt(kindInfoVo.getUnitAmount());
+            this.unitAmount = StringUtils.isEmpty(kindInfoVo.getUnitAmount()) ? 0 : Integer.parseInt(kindInfoVo.getUnitAmount());
             this.premium = "";
             this.premium = "";
             this.basePremium = "";
             this.basePremium = "";
             this.benchMarkPremium = "";
             this.benchMarkPremium = "";

+ 53 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -20,7 +20,6 @@ import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
 import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.costs.vo.ValidateSchemeRuleVo;
 import com.jzg.commons.entity.costs.vo.ValidateSchemeRuleVo;
 import com.jzg.commons.entity.po.*;
 import com.jzg.commons.entity.po.*;
-import com.jzg.commons.entity.po.jyxSetting;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.SalespersonInfoVo;
 import com.jzg.commons.entity.quote.vo.SalespersonInfoVo;
 import com.jzg.commons.entity.scheme.po.*;
 import com.jzg.commons.entity.scheme.po.*;
@@ -29,6 +28,7 @@ import com.jzg.commons.entity.vo.CompanyClauseVo;
 import com.jzg.commons.entity.vo.EsmInsCompanyResVo;
 import com.jzg.commons.entity.vo.EsmInsCompanyResVo;
 import com.jzg.commons.entity.vo.InsCompanyClauseVo;
 import com.jzg.commons.entity.vo.InsCompanyClauseVo;
 import com.jzg.commons.exception.NoneException;
 import com.jzg.commons.exception.NoneException;
+import com.jzg.commons.exception.ValidateException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.commons.util.idgen.IdGenerate;
@@ -149,6 +149,8 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
 
 
         //驾意险信息
         //驾意险信息
         List<PtlSchemeInsuranceDrivingIntention> ptlSchemeInsuranceDrivingIntentionList = ptlSchemeSaveVo.getPtlSchemeInsuranceDrivingIntentionList();
         List<PtlSchemeInsuranceDrivingIntention> ptlSchemeInsuranceDrivingIntentionList = ptlSchemeSaveVo.getPtlSchemeInsuranceDrivingIntentionList();
+        //校验驾意险座位数范围不可重复
+        validateDrivingIntentionSeatRange(ptlSchemeInsuranceDrivingIntentionList);
         //清空驾意险信息
         //清空驾意险信息
         cleanDrivingIntention(ptlSchemeInfoList);
         cleanDrivingIntention(ptlSchemeInfoList);
         ptlSchemeInsuranceDrivingIntentionMapper.insertOrUpdate(ptlSchemeInsuranceDrivingIntentionList);
         ptlSchemeInsuranceDrivingIntentionMapper.insertOrUpdate(ptlSchemeInsuranceDrivingIntentionList);
@@ -175,6 +177,46 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         ptlSchemeInsuranceDrivingIntentionMapper.delete(new LambdaQueryWrapper<PtlSchemeInsuranceDrivingIntention>().in(PtlSchemeInsuranceDrivingIntention::getSchemeInfoId, ids));
         ptlSchemeInsuranceDrivingIntentionMapper.delete(new LambdaQueryWrapper<PtlSchemeInsuranceDrivingIntention>().in(PtlSchemeInsuranceDrivingIntention::getSchemeInfoId, ids));
     }
     }
 
 
+    /**
+     * 校验驾意险座位数范围不可重复
+     * 两组座位数范围 [a_min, a_max] 和 [b_min, b_max] 存在重叠即判定为重复
+     * @param drivingIntentionList 驾意险列表
+     */
+    private void validateDrivingIntentionSeatRange(List<PtlSchemeInsuranceDrivingIntention> drivingIntentionList) {
+        if (CollUtil.isEmpty(drivingIntentionList)) {
+            return;
+        }
+        for (int i = 0; i < drivingIntentionList.size(); i++) {
+            PtlSchemeInsuranceDrivingIntention a = drivingIntentionList.get(i);
+            Integer aMin = a.getMinSeatCount();
+            Integer aMax = a.getMaxSeatCount();
+            for (int j = i + 1; j < drivingIntentionList.size(); j++) {
+                PtlSchemeInsuranceDrivingIntention b = drivingIntentionList.get(j);
+                Integer bMin = b.getMinSeatCount();
+                Integer bMax = b.getMaxSeatCount();
+
+                // null 视为无限制:min=null 视为0, max=null 视为∞
+                boolean overlap = isSeatRangeOverlap(aMin, aMax, bMin, bMax);
+                if (overlap) {
+                    throw new ValidateException("驾意险座位数范围存在重叠,请检查!");
+                }
+            }
+        }
+    }
+
+    /**
+     * 判断两个座位数范围是否重叠
+     */
+    private boolean isSeatRangeOverlap(Integer min1, Integer max1, Integer min2, Integer max2) {
+        // 有效下界:null 视为 -∞(即不限制下限)
+        // 有效上界:null 视为 +∞(即不限制上限)
+        // 不重叠条件:max1 < min2 或 max2 < min1
+        // 因此重叠条件:!(max1 < min2) && !(max2 < min1)
+        boolean leftDisjoint = max1 != null && min2 != null && max1 < min2;
+        boolean rightDisjoint = max2 != null && min1 != null && max2 < min1;
+        return !leftDisjoint && !rightDisjoint;
+    }
+
     /**
     /**
      * 清空险种数据
      * 清空险种数据
      *
      *
@@ -521,6 +563,16 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
                         driving.setCoverage(setting.getCoverage() != null ? setting.getCoverage().toString() : null);
                         driving.setCoverage(setting.getCoverage() != null ? setting.getCoverage().toString() : null);
                     }
                     }
                 });
                 });
+                // 根据座位数范围过滤驾意险:只保留座位数在 minSeatCount~maxSeatCount 范围内的
+                drivings.removeIf(driving -> {
+                    if (driving.getMinSeatCount() != null && seats < driving.getMinSeatCount()) {
+                        return true;
+                    }
+                    if (driving.getMaxSeatCount() != null && seats > driving.getMaxSeatCount()) {
+                        return true;
+                    }
+                    return false;
+                });
             });
             });
         }
         }
 
 

+ 3 - 1
tenant/organization/src/main/resources/mapper/PtlSchemeInsuranceDrivingIntentionMapper.xml

@@ -9,7 +9,9 @@
         psidi.selected_status,
         psidi.selected_status,
         psidi.quantity,
         psidi.quantity,
         psidi.scheme_info_id,
         psidi.scheme_info_id,
-        psidi.driving_intention_id
+        psidi.driving_intention_id,
+        psidi.min_seat_count,
+        psidi.max_seat_count
         FROM
         FROM
         ptl_scheme_insurance_driving_intention psidi
         ptl_scheme_insurance_driving_intention psidi
         LEFT JOIN jyx_config jc ON psidi.driving_intention_id = jc.id AND jc.is_delete = 0
         LEFT JOIN jyx_config jc ON psidi.driving_intention_id = jc.id AND jc.is_delete = 0

+ 5 - 1
tenant/organization/src/main/resources/mapper/PtlSchemeMapper.xml

@@ -46,6 +46,8 @@
                 <result column="premium" property="premium"/>
                 <result column="premium" property="premium"/>
                 <result column="quantity" property="quantity"/>
                 <result column="quantity" property="quantity"/>
                 <result column="selected_status" property="selectedStatus"/>
                 <result column="selected_status" property="selectedStatus"/>
+                <result column="min_seat_count" property="minSeatCount"/>
+                <result column="max_seat_count" property="maxSeatCount"/>
             </collection>
             </collection>
         </collection>
         </collection>
     </resultMap>
     </resultMap>
@@ -160,7 +162,9 @@
             jc.parent_id,
             jc.parent_id,
             jc1.product_code as parent_product_code,
             jc1.product_code as parent_product_code,
             psidi.quantity,
             psidi.quantity,
-            psidi.selected_status
+            psidi.selected_status,
+            psidi.min_seat_count,
+            psidi.max_seat_count
         FROM
         FROM
             ptl_scheme ps
             ptl_scheme ps
                 left JOIN ptl_scheme_info psi ON ps.id = psi.scheme_id AND psi.is_delete = 0
                 left JOIN ptl_scheme_info psi ON ps.id = psi.scheme_id AND psi.is_delete = 0