Эх сурвалжийг харах

修改充值消费分倍率计算规则

Yangzw 2 сар өмнө
parent
commit
2d5325a2a4

+ 4 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentagePageReqVO.java

@@ -64,4 +64,8 @@ public class OrderPercentagePageReqVO extends PageParam {
 
     @Schema(description = "用户充值消费分的额度")
     private String userTopUpConsumptionPoints;
+
+    @Schema(description = "触发倍率的最低金额")
+    private String triggerMagnificationPoints;
+
 }

+ 4 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentageRespVO.java

@@ -23,4 +23,8 @@ public class OrderPercentageRespVO {
     @Schema(description = "用户充值消费分的额度")
     @ExcelProperty("用户充值消费分的额度")
     private String userTopUpConsumptionPoints;
+
+    @Schema(description = "触发倍率的最低金额")
+    @ExcelProperty("触发倍率的最低金额")
+    private String triggerMagnificationPoints;
 }

+ 3 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentageSaveReqVO.java

@@ -58,4 +58,7 @@ public class OrderPercentageSaveReqVO {
 
     @Schema(description = "用户充值消费分的额度")
     private String userTopUpConsumptionPoints;
+
+    @Schema(description = "触发倍率的最低金额")
+    private String triggerMagnificationPoints;
 }

+ 4 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/orderpercentage/OrderPercentageDO.java

@@ -114,4 +114,8 @@ public class OrderPercentageDO extends BaseDO {
      */
     private String userTopUpConsumptionPoints;
 
+    /**
+     * 触发倍率的最低金额
+     */
+    private String triggerMagnificationPoints;
 }

+ 6 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderServiceImpl.java

@@ -128,7 +128,13 @@ public class UserTopUpConsumptionPointsOrderServiceImpl implements UserTopUpCons
         // 转换金额
         createReqVO.setPayPrice(createReqVO.getPayPrice() * DistriConstants.ONE_HUNDRED);
         createReqVO.setTopUpConsumptionPoints(createReqVO.getPayPrice() * DistriConstants.PERCENT);
+
+        // 根据充值金额计算实际到账金额
+        if(createReqVO.getTopUpConsumptionPoints() >= Double.parseDouble(orderPercentageDO.getTriggerMagnificationPoints()) * DistriConstants.INTEGRAL_PAGE2DB){
         createReqVO.setPracticalConsumptionPoints((long) (createReqVO.getTopUpConsumptionPoints() * Double.parseDouble(orderPercentageDO.getConsumptionMagnification())));
+        } else {
+            createReqVO.setPracticalConsumptionPoints(createReqVO.getTopUpConsumptionPoints().longValue());
+        }
         createReqVO.setPercentTemplate(JSON.toJSONString(orderPercentageDO));
     }