Ver Fonte

提交收费系统展示优化

chenxiaofei há 23 horas atrás
pai
commit
c5ad19536a

+ 7 - 8
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ParkingWalletFeeService.java

@@ -366,12 +366,11 @@ public class ParkingWalletFeeService {
      * 查询服务费余额、本次预计服务费与最大可购买数量。
      * <p>
      * 业务规则:
-     * 1. 服务费余额、本次预计服务费仅当收费策略总开关开启时展示,并通过 showServiceFee 标识告知前端;
-     * 2. 服务费余额取当前登录采购企业的可用服务费余额;
-     * 3. 收费策略总开关关闭时,不计算预计服务费,最大可购买数量返回 null,表示不做余额约束;
-     * 4. 收费策略总开关开启时,按企业绑定的当前收费策略计算预计服务费;无企业策略时使用开关表 default_fee;
-     * 5. 策略 method 为 0.00 时,实际单价使用 kwt_parking_strategy_switch.default_fee;
-     * 6. 最大可购买数量 = 服务费余额 / 实际策略单价,向下取整,避免超出余额。
+     * 1. 服务费余额取当前登录采购企业的可用服务费余额;
+     * 2. 收费策略总开关关闭时,不计算预计服务费,最大可购买数量返回 null,表示不做余额约束;
+     * 3. 收费策略总开关开启时,按企业绑定的当前收费策略计算预计服务费;无企业策略时使用开关表 default_fee;
+     * 4. 策略 method 为 0.00 时,实际单价使用 kwt_parking_strategy_switch.default_fee;
+     * 5. 最大可购买数量 = 服务费余额 / 实际策略单价,向下取整,避免超出余额。
      *
      * @param param 服务费预估查询参数,purchaseQuantity 为本次采购数量
      * @return 服务费余额、本次预计服务费与最大可购买数量
@@ -420,8 +419,8 @@ public class ParkingWalletFeeService {
 
         ParkingWalletFeeEstimateResp resp = new ParkingWalletFeeEstimateResp();
         resp.setShowServiceFee(chargeStrategySwitchOpen);
-        resp.setServiceFeeBalance(formatMoney(serviceFeeBalance));
-        resp.setEstimatedServiceFee(estimatedServiceFee);
+        resp.setServiceFeeBalance(chargeStrategySwitchOpen ? formatMoney(serviceFeeBalance) : null);
+        resp.setEstimatedServiceFee(chargeStrategySwitchOpen ? estimatedServiceFee : null);
         resp.setMaxPurchaseQuantity(maxPurchaseQuantity);
         return resp;
     }