فهرست منبع

协议费用方案匹配功能调整

li.pengfei 3 سال پیش
والد
کامیت
f0e9ab0dc0

+ 12 - 4
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -529,10 +529,14 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
     private boolean checkFactorConfigWithArea(Integer minVal, Integer maxVal,FeeFactorInfoDto factorInfoDto,PtlAgreementProductCosts productCosts) {
         boolean result=false; //默认不需要匹配
         if(minVal!=null&&maxVal!=null){
-            if(minVal<=maxVal){
-                result=true;
+            if(minVal==0&&maxVal==0){//初始化没有配置的时候,全部默认的0,这种不需要匹配
+                result=false;
             }else{
-                throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+                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()+"配置有问题,请检查!");
@@ -563,6 +567,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         String isNewCar = "0";
         String isRenewal = "0";
         String useNature = "";
+        String carType="";
         String isNewEnergy = "0";
         feeSchemeReqDto.setBusType(productId);//"业务类型:单交0330、单商034001、单三034002、交三0330034002、交商0330034001"
         feeSchemeReqDto.setAgreementId(agreementId);//协议ID
@@ -580,7 +585,10 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         feeSchemeReqDto.setIsNewEnergy(isNewEnergy);//是否新能源    1是  0否
         feeSchemeReqDto.setIsRenewal("0");//是否续保    1是  0否    续保取值有争议 默认送否 暂时搁置
         //页面要素及中煤交互请求返参没有,先默认写死
-        feeSchemeReqDto.setVehicleCategory(carInfoVo.getCartype());//车辆大类: 客车、货车、特种车、挂车、摩托车、拖拉机
+        if("A0".equals(carInfoVo.getCartype())){
+            carType="客车";
+        }
+        feeSchemeReqDto.setVehicleCategory(carType);//车辆大类: 客车、货车、特种车、挂车、摩托车、拖拉机
         if("8A".equals(carInfoVo.getCarnature())){
             useNature = "家庭自用";
         }

+ 3 - 6
src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java

@@ -153,14 +153,11 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         QuoteRespVo quoteRespVo = getQuoteRespVo(quotedPriceResponse, quoteInfo);
 
         //这里调用费用匹配功能
-       /* InsOrders insOrders = insOrdersService.getById(quoteRespVo.getOrderno());
+        InsOrders insOrders = insOrdersService.getById(quoteRespVo.getOrderno());
         FeeSchemeReqDto feeSchemeReqDto = feeRuleSchemeService.getFeeSchemeInfo(quoteInfo,quoteRespVo,ptlAgreementAttribution.getId(),insOrders.getProductid());
-       // FeeSchemeResDto feeSchemeResDto = feeRuleSchemeService.matchTheAppropriateFees(feeSchemeReqDto);
-        FeeSchemeResDto feeSchemeResDto = new FeeSchemeResDto();
-        feeSchemeResDto.setJqCostsProportion("50");
-        feeSchemeResDto.setSyCostsProportion("55");
+        FeeSchemeResDto feeSchemeResDto = feeRuleSchemeService.matchTheAppropriateFees(feeSchemeReqDto);
         InsFeeOrder insFeeOrder = new InsFeeOrder(feeSchemeReqDto,feeSchemeResDto,quotedPriceResponse.getBusinessNo());
-        insFeeOrderService.insertCompanyAndOrders(insFeeOrder);*/
+        insFeeOrderService.insertCompanyAndOrders(insFeeOrder);
         return responseOrder(quotedPriceResponse, quoteRespVo, ptlAgreementAttribution);
     }
 

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

@@ -23,17 +23,6 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
 
     private static final long serialVersionUID = 6664608977040180685L;
 
-    @ApiModelProperty("费用描述(交强)")
-    private String jqCostsDescription;
-
-    @ApiModelProperty("费用起期(交强)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime jqCostsStartDate;
-
-    @ApiModelProperty("费用止期(交强)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime jqCostsEndDate;
-
     @ApiModelProperty("溢出保费(交强)")
     private String jqSpilloverPremiums;
 
@@ -58,14 +47,6 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     @ApiModelProperty("旧车其他费用比例(交强)")
     private String jqOldCarOtherCostsProportion;
 
-    @ApiModelProperty("费用起期(商业)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime syCostsStartDate;
-
-    @ApiModelProperty("费用止期(商业)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime syCostsEndDate;
-
     @ApiModelProperty("溢出保费(商业)")
     private String sySpilloverPremiums;
 
@@ -183,6 +164,17 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     @ApiModelProperty("车牌号")
     private String licenseNumber;
 
+    @ApiModelProperty("费用描述")
+    private String costsDescription;
+
+    @ApiModelProperty("费用起期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime costsStartDate;
+
+    @ApiModelProperty("费用止期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime costsEndDate;
+
     public static List<PtlAgreementProductCosts> toPtlAgreementProductCosts(String agreementId, List<PltAgreementSchemeSaveDto> scheme) {
         return scheme.stream().map(x -> PtlAgreementProductCosts.toPtlAgreementProductCostsList(agreementId, x.getProductId(), x.getName(), x.getProductCosts())).flatMap(Collection::stream).collect(Collectors.toList());
     }

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

@@ -52,22 +52,22 @@ public class PtlAgreementProductCosts implements Serializable {
     private String productName;
 
     /**
-     * 费用描述(交强)
+     * 费用描述
      */
-    @TableField(value = "jq_costs_description")
-    private String jqCostsDescription;
+    @TableField(value = "costs_description")
+    private String costsDescription;
 
     /**
-     * 费用起期(交强)
+     * 费用起期
      */
-    @TableField(value = "jq_costs_start_date")
-    private LocalDateTime jqCostsStartDate;
+    @TableField(value = "costs_start_date")
+    private LocalDateTime costsStartDate;
 
     /**
-     * 费用止期(交强)
+     * 费用止期
      */
-    @TableField(value = "jq_costs_end_date")
-    private LocalDateTime jqCostsEndDate;
+    @TableField(value = "costs_end_date")
+    private LocalDateTime costsEndDate;
 
     /**
      * 溢出保费(交强)
@@ -117,18 +117,6 @@ public class PtlAgreementProductCosts implements Serializable {
     @TableField(value = "jq_old_car_other_costs_proportion")
     private String jqOldCarOtherCostsProportion;
 
-    /**
-     * 费用起期(商业)
-     */
-    @TableField(value = "sy_costs_start_date")
-    private LocalDateTime syCostsStartDate;
-
-    /**
-     * 费用止期(商业)
-     */
-    @TableField(value = "sy_costs_end_date")
-    private LocalDateTime syCostsEndDate;
-
     /**
      * 溢出保费(商业)
      */
@@ -408,9 +396,6 @@ public class PtlAgreementProductCosts implements Serializable {
         result = getObjectHashCode(this.agreementId, result);
         result = getObjectHashCode(this.productId, result);
         result = getObjectHashCode(this.productName, result);
-        result = getObjectHashCode(this.jqCostsDescription, result);
-        result = getObjectHashCode(this.jqCostsStartDate, result);
-        result = getObjectHashCode(this.jqCostsEndDate, result);
         result = getObjectHashCode(this.jqSpilloverPremiums, result);
         result = getObjectHashCode(this.jqSpilloverProportion, result);
         result = getObjectHashCode(this.jqNewCarCostsProportion, result);
@@ -419,8 +404,6 @@ public class PtlAgreementProductCosts implements Serializable {
         result = getObjectHashCode(this.jqCostsLevel, result);
         result = getObjectHashCode(this.jqNewCarOtherCostsProportion, result);
         result = getObjectHashCode(this.jqOldCarOtherCostsProportion, result);
-        result = getObjectHashCode(this.syCostsStartDate, result);
-        result = getObjectHashCode(this.syCostsEndDate, result);
         result = getObjectHashCode(this.sySpilloverPremiums, result);
         result = getObjectHashCode(this.sySpilloverProportion, result);
         result = getObjectHashCode(this.syNewCarCostsProportion, result);
@@ -460,6 +443,9 @@ public class PtlAgreementProductCosts implements Serializable {
         result = getObjectHashCode(this.minLossRation, result);
         result = getObjectHashCode(this.maxLossRation, result);
         result = getObjectHashCode(this.licenseNumber, result);
+        result = getObjectHashCode(this.costsDescription, result);
+        result = getObjectHashCode(this.costsStartDate, result);
+        result = getObjectHashCode(this.costsEndDate, result);
         return result;
     }
 

+ 3 - 3
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementProductCostsServiceImpl.java

@@ -111,14 +111,14 @@ public class PtlAgreementProductCostsServiceImpl extends ServiceImpl<PtlAgreemen
     public List<PtlAgreementProductCosts> selectVliadFeeFactor(String busType,String agreementId){
         //获取当前时间,用来卡费用方案中有效期区间
         Date date=new Date();
-        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
+        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String nowDate=sdf.format(date);
         //组织查询条件
         LambdaQueryWrapper<PtlAgreementProductCosts> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PtlAgreementProductCosts::getAgreementId, agreementId);
         wrapper.eq(PtlAgreementProductCosts::getProductId,busType);
-        wrapper.le(PtlAgreementProductCosts::getJqCostsStartDate,nowDate);//有效起期小于等于当前时间
-        wrapper.ge(PtlAgreementProductCosts::getJqCostsEndDate,nowDate);//有效止期大于等于当前时间
+        wrapper.le(PtlAgreementProductCosts::getCostsStartDate,nowDate);//有效起期小于等于当前时间
+        wrapper.ge(PtlAgreementProductCosts::getCostsEndDate,nowDate);//有效止期大于等于当前时间
         wrapper.eq(PtlAgreementProductCosts::getHistory, 0);//查询所有非历史记录的
         List<PtlAgreementProductCosts> ptlAgreementProductCosts = baseMapper.selectList(wrapper);
         return ptlAgreementProductCosts;

+ 8 - 9
src/main/resources/mapper/modules/protocol/PtlAgreementProductCostsMapper.xml

@@ -9,9 +9,9 @@
             <result property="agreementId" column="agreement_id" jdbcType="BIGINT"/>
             <result property="productId" column="product_id" jdbcType="VARCHAR"/>
             <result property="productName" column="product_name" jdbcType="VARCHAR"/>
-            <result property="jqCostsDescription" column="jq_costs_description" jdbcType="VARCHAR"/>
-            <result property="jqCostsStartDate" column="jq_costs_start_date" jdbcType="TIMESTAMP"/>
-            <result property="jqCostsEndDate" column="jq_costs_end_date" jdbcType="TIMESTAMP"/>
+            <result property="costsDescription" column="costs_description" jdbcType="VARCHAR"/>
+            <result property="costsStartDate" column="costs_start_date" jdbcType="TIMESTAMP"/>
+            <result property="costsEndDate" column="costs_end_date" jdbcType="TIMESTAMP"/>
             <result property="jqSpilloverPremiums" column="jq_spillover_premiums" jdbcType="VARCHAR"/>
             <result property="jqSpilloverProportion" column="jq_spillover_proportion" jdbcType="VARCHAR"/>
             <result property="jqNewCarCostsProportion" column="jq_new_car_costs_proportion" jdbcType="VARCHAR"/>
@@ -20,8 +20,6 @@
             <result property="jqCostsLevel" column="jq_costs_level" jdbcType="VARCHAR"/>
             <result property="jqNewCarOtherCostsProportion" column="jq_new_car_other_costs_proportion" jdbcType="VARCHAR"/>
             <result property="jqOldCarOtherCostsProportion" column="jq_old_car_other_costs_proportion" jdbcType="VARCHAR"/>
-            <result property="syCostsStartDate" column="sy_costs_start_date" jdbcType="TIMESTAMP"/>
-            <result property="syCostsEndDate" column="sy_costs_end_date" jdbcType="TIMESTAMP"/>
             <result property="sySpilloverPremiums" column="sy_spillover_premiums" jdbcType="VARCHAR"/>
             <result property="sySpilloverProportion" column="sy_spillover_proportion" jdbcType="VARCHAR"/>
             <result property="syNewCarCostsProportion" column="sy_new_car_costs_proportion" jdbcType="VARCHAR"/>
@@ -65,11 +63,11 @@
 
     <sql id="Base_Column_List">
         id,agreement_id,product_id,
-        product_name,jq_costs_description,jq_costs_start_date,
-        jq_costs_end_date,jq_spillover_premiums,jq_spillover_proportion,
+        product_name,
+        jq_spillover_premiums,jq_spillover_proportion,
         jq_new_car_costs_proportion,jq_old_car_costs_proportion,jq_costs_proportion,
         jq_costs_level,jq_new_car_other_costs_proportion,jq_old_car_other_costs_proportion,
-        sy_costs_start_date,sy_costs_end_date,sy_spillover_premiums,
+        sy_spillover_premiums,
         sy_spillover_proportion,sy_new_car_costs_proportion,sy_old_car_costs_proportion,
         sy_costs_proportion,sy_costs_level,sy_new_car_other_costs_proportion,
         sy_old_car_other_costs_proportion,transfer,old_and_new,
@@ -82,6 +80,7 @@
         min_onboard_products_premium,max_onboard_products_premium,min_commercial_insurance_discount,
         max_commercial_insurance_discount,min_compulsory_insurance_discount,max_compulsory_insurance_discount,
         min_score,max_score,min_loss_ration,
-        max_loss_ration,license_number
+        max_loss_ration,license_number,costs_description,costs_start_date,
+        costs_end_date
     </sql>
 </mapper>