Ver código fonte

协议费用因子中吨位数、核定载质量、交强商业折扣、保司评分、预期赔付率 调整为可录入小数

li.pengfei 2 anos atrás
pai
commit
495b9bfff2

+ 2 - 2
src/main/java/com/ydtech/modules/fee/dto/FeeFactorInfoDto.java

@@ -21,9 +21,9 @@ public class FeeFactorInfoDto {
     @ApiModelProperty("匹配顺序")
     private Integer matchSequence;
     @ApiModelProperty("区间最小值")
-    private Integer minRangeVal;
+    private Double minRangeVal;
     @ApiModelProperty("区间最大值")
-    private Integer maxRangeVal;
+    private Double maxRangeVal;
     @ApiModelProperty("多选字符串列表")
     private String multipleSelectVal;
     @ApiModelProperty("单选字符串")

+ 47 - 20
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -479,8 +479,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor6.setMatchSequence(6);
         if(checkFactorConfigWithArea(factorCost.getMinSeats(),factorCost.getMaxSeats(),factor6,factorCost)){
             factor6.setNeedMatch(true);
-            factor6.setMinRangeVal(factorCost.getMinSeats());
-            factor6.setMaxRangeVal(factorCost.getMaxSeats());
+            factor6.setMinRangeVal((double)factorCost.getMinSeats());
+            factor6.setMaxRangeVal((double)factorCost.getMaxSeats());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor6.setNeedMatch(false);
@@ -493,8 +493,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor7.setMatchSequence(7);
         if(checkFactorConfigWithArea(factorCost.getMinPurchasePrice(),factorCost.getMaxPurchasePrice(),factor7,factorCost)){
             factor7.setNeedMatch(true);
-            factor7.setMinRangeVal(factorCost.getMinPurchasePrice());
-            factor7.setMaxRangeVal(factorCost.getMaxPurchasePrice());
+            factor7.setMinRangeVal((double)factorCost.getMinPurchasePrice());
+            factor7.setMaxRangeVal((double)factorCost.getMaxPurchasePrice());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor7.setNeedMatch(false);
@@ -507,8 +507,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor8.setMatchSequence(8);
         if(checkFactorConfigWithArea(factorCost.getMinApprovedLoadCapacity(),factorCost.getMaxApprovedLoadCapacity(),factor8,factorCost)){
             factor8.setNeedMatch(true);
-            factor8.setMinRangeVal(factorCost.getMinApprovedLoadCapacity());
-            factor8.setMaxRangeVal(factorCost.getMaxApprovedLoadCapacity());
+            factor8.setMinRangeVal((double)factorCost.getMinApprovedLoadCapacity());
+            factor8.setMaxRangeVal((double)factorCost.getMaxApprovedLoadCapacity());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor8.setNeedMatch(false);
@@ -521,8 +521,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor9.setMatchSequence(9);
         if(checkFactorConfigWithArea(factorCost.getMinCompulsoryInsurancePremium(),factorCost.getMaxCompulsoryInsurancePremium(),factor9,factorCost)){
             factor9.setNeedMatch(true);
-            factor9.setMinRangeVal(factorCost.getMinCompulsoryInsurancePremium());
-            factor9.setMaxRangeVal(factorCost.getMaxCompulsoryInsurancePremium());
+            factor9.setMinRangeVal((double)factorCost.getMinCompulsoryInsurancePremium());
+            factor9.setMaxRangeVal((double)factorCost.getMaxCompulsoryInsurancePremium());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor9.setNeedMatch(false);
@@ -535,8 +535,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor10.setMatchSequence(10);
         if(checkFactorConfigWithArea(factorCost.getMinTaxAmount(),factorCost.getMaxTaxAmount(),factor10,factorCost)){
             factor10.setNeedMatch(true);
-            factor10.setMinRangeVal(factorCost.getMinTaxAmount());
-            factor10.setMaxRangeVal(factorCost.getMaxTaxAmount());
+            factor10.setMinRangeVal((double)factorCost.getMinTaxAmount());
+            factor10.setMaxRangeVal((double)factorCost.getMaxTaxAmount());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor10.setNeedMatch(false);
@@ -549,8 +549,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor11.setMatchSequence(11);
         if(checkFactorConfigWithArea(factorCost.getMinTheThreePremium(),factorCost.getMaxTheThreePremium(),factor11,factorCost)){
             factor11.setNeedMatch(true);
-            factor11.setMinRangeVal(factorCost.getMinTheThreePremium()*10000);
-            factor11.setMaxRangeVal(factorCost.getMaxTheThreePremium()*10000);
+            factor11.setMinRangeVal((double)factorCost.getMinTheThreePremium()*10000);
+            factor11.setMaxRangeVal((double)factorCost.getMaxTheThreePremium()*10000);
         }else{
             //如果方案中未录入,则不校验该项因子
             factor11.setNeedMatch(false);
@@ -563,8 +563,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor12.setMatchSequence(12);
         if(checkFactorConfigWithArea(factorCost.getMinOnboardProductsPremium(),factorCost.getMaxOnboardProductsPremium(),factor12,factorCost)){
             factor12.setNeedMatch(true);
-            factor12.setMinRangeVal(factorCost.getMinOnboardProductsPremium());
-            factor12.setMaxRangeVal(factorCost.getMaxOnboardProductsPremium());
+            factor12.setMinRangeVal((double)factorCost.getMinOnboardProductsPremium());
+            factor12.setMaxRangeVal((double)factorCost.getMaxOnboardProductsPremium());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor12.setNeedMatch(false);
@@ -578,8 +578,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor13.setMatchSequence(13);
         if(checkFactorConfigWithArea(factorCost.getMinCommercialInsuranceDiscount(),factorCost.getMaxCommercialInsuranceDiscount(),factor13,factorCost)){
             factor13.setNeedMatch(true);
-            factor13.setMinRangeVal(factorCost.getMinCommercialInsuranceDiscount());
-            factor13.setMaxRangeVal(factorCost.getMaxCommercialInsuranceDiscount());
+            factor13.setMinRangeVal((double)factorCost.getMinCommercialInsuranceDiscount());
+            factor13.setMaxRangeVal((double)factorCost.getMaxCommercialInsuranceDiscount());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor13.setNeedMatch(false);
@@ -606,8 +606,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor15.setMatchSequence(15);
         if(checkFactorConfigWithArea(factorCost.getMinScore(),factorCost.getMaxScore(),factor15,factorCost)){
             factor15.setNeedMatch(true);
-            factor15.setMinRangeVal(factorCost.getMinScore());
-            factor15.setMaxRangeVal(factorCost.getMaxScore());
+            factor15.setMinRangeVal((double)factorCost.getMinScore());
+            factor15.setMaxRangeVal((double)factorCost.getMaxScore());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor15.setNeedMatch(false);
@@ -620,8 +620,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor16.setMatchSequence(16);
         if(checkFactorConfigWithArea(factorCost.getMinLossRation(),factorCost.getMaxLossRation(),factor16,factorCost)){
             factor16.setNeedMatch(true);
-            factor16.setMinRangeVal(factorCost.getMinLossRation());
-            factor16.setMaxRangeVal(factorCost.getMaxLossRation());
+            factor16.setMinRangeVal((double)factorCost.getMinLossRation());
+            factor16.setMaxRangeVal((double)factorCost.getMaxLossRation());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor16.setNeedMatch(false);
@@ -717,6 +717,33 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         return result;
     }
 
+    /**
+     * 判断区间类因子是否需要匹配
+     * @param minVal
+     * @param maxVal
+     * @param factorInfoDto
+     * @param productCosts
+     * @return
+     */
+    private boolean checkFactorConfigWithArea(Double minVal, Double maxVal,FeeFactorInfoDto factorInfoDto,PtlAgreementProductCosts productCosts) {
+        boolean result=false; //默认不需要匹配
+        if(minVal!=null&&maxVal!=null){
+            if(minVal==0&&maxVal==0){//初始化没有配置的时候,全部默认的0,这种不需要匹配
+                result=false;
+            }else{
+                if(minVal<=maxVal){
+                    result=true;
+                }else{
+                    throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+                }
+            }
+        }else if(minVal!=null && maxVal==null){
+            throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+        }else if(minVal==null&&maxVal!=null){
+            throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+        }
+        return result;
+    }
 
 
 

+ 12 - 12
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementProductCostsSaveDto.java

@@ -96,10 +96,10 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     private Integer maxSeats;
 
     @ApiModelProperty("货车吨位数(最小)")
-    private Integer minTruckTonnage;
+    private Double minTruckTonnage;
 
     @ApiModelProperty("货车吨位数(最大)")
-    private Integer maxTruckTonnage;
+    private Double maxTruckTonnage;
 
     @ApiModelProperty("新车购置价(最小)")
     private Integer minPurchasePrice;
@@ -108,10 +108,10 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     private Integer maxPurchasePrice;
 
     @ApiModelProperty("核定载质量(最小)")
-    private Integer minApprovedLoadCapacity;
+    private Double minApprovedLoadCapacity;
 
     @ApiModelProperty("核定载质量(最大)")
-    private Integer maxApprovedLoadCapacity;
+    private Double maxApprovedLoadCapacity;
 
     @ApiModelProperty("交强险保费(最小)")
     private Integer minCompulsoryInsurancePremium;
@@ -138,28 +138,28 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     private Integer maxOnboardProductsPremium;
 
     @ApiModelProperty("商业险折扣(最小)")
-    private Integer minCommercialInsuranceDiscount;
+    private Double minCommercialInsuranceDiscount;
 
     @ApiModelProperty("商业险折扣(最大)")
-    private Integer maxCommercialInsuranceDiscount;
+    private Double maxCommercialInsuranceDiscount;
 
     @ApiModelProperty("交强险折扣(最小)")
-    private Integer minCompulsoryInsuranceDiscount;
+    private Double minCompulsoryInsuranceDiscount;
 
     @ApiModelProperty("交强险折扣(最大)")
-    private Integer maxCompulsoryInsuranceDiscount;
+    private Double maxCompulsoryInsuranceDiscount;
 
     @ApiModelProperty("保司评分(最小)")
-    private Integer minScore;
+    private Double minScore;
 
     @ApiModelProperty("保司评分(最大)")
-    private Integer maxScore;
+    private Double maxScore;
 
     @ApiModelProperty("预期赔付率(最小)")
-    private Integer minLossRation;
+    private Double minLossRation;
 
     @ApiModelProperty("预期赔付率(最大)")
-    private Integer maxLossRation;
+    private Double maxLossRation;
 
     @ApiModelProperty("车牌号")
     private String licenseNumber;

+ 12 - 12
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementProductCosts.java

@@ -217,13 +217,13 @@ public class PtlAgreementProductCosts implements Serializable {
      * 货车吨位数(最小)
      */
     @TableField(value = "min_truck_tonnage")
-    private Integer minTruckTonnage;
+    private Double minTruckTonnage;
 
     /**
      * 货车吨位数(最大)
      */
     @TableField(value = "max_truck_tonnage")
-    private Integer maxTruckTonnage;
+    private Double maxTruckTonnage;
 
     /**
      * 新车购置价(最小)
@@ -241,13 +241,13 @@ public class PtlAgreementProductCosts implements Serializable {
      * 核定载质量(最小)
      */
     @TableField(value = "min_approved_load_capacity")
-    private Integer minApprovedLoadCapacity;
+    private Double minApprovedLoadCapacity;
 
     /**
      * 核定载质量(最大)
      */
     @TableField(value = "max_approved_load_capacity")
-    private Integer maxApprovedLoadCapacity;
+    private Double maxApprovedLoadCapacity;
 
     /**
      * 交强险保费(最小)
@@ -301,49 +301,49 @@ public class PtlAgreementProductCosts implements Serializable {
      * 商业险折扣(最小)
      */
     @TableField(value = "min_commercial_insurance_discount")
-    private Integer minCommercialInsuranceDiscount;
+    private Double minCommercialInsuranceDiscount;
 
     /**
      * 商业险折扣(最大)
      */
     @TableField(value = "max_commercial_insurance_discount")
-    private Integer maxCommercialInsuranceDiscount;
+    private Double maxCommercialInsuranceDiscount;
 
     /**
      * 交强险折扣(最小)
      */
     @TableField(value = "min_compulsory_insurance_discount")
-    private Integer minCompulsoryInsuranceDiscount;
+    private Double minCompulsoryInsuranceDiscount;
 
     /**
      * 交强险折扣(最大)
      */
     @TableField(value = "max_compulsory_insurance_discount")
-    private Integer maxCompulsoryInsuranceDiscount;
+    private Double maxCompulsoryInsuranceDiscount;
 
     /**
      * 保司评分(最小)
      */
     @TableField(value = "min_score")
-    private Integer minScore;
+    private Double minScore;
 
     /**
      * 保司评分(最大)
      */
     @TableField(value = "max_score")
-    private Integer maxScore;
+    private Double maxScore;
 
     /**
      * 预期赔付率(最小)
      */
     @TableField(value = "min_loss_ration")
-    private Integer minLossRation;
+    private Double minLossRation;
 
     /**
      * 预期赔付率(最大)
      */
     @TableField(value = "max_loss_ration")
-    private Integer maxLossRation;
+    private Double maxLossRation;
 
     /**
      * 车牌号