Kaynağa Gözat

feature: 消费卡类验证

luo.yibo@datuai.com 1 yıl önce
ebeveyn
işleme
fc83783e9e

+ 3 - 2
ruoyi-server/ruoyi-server-consume/src/main/java/org/dromara/server/consume/business/CheckBusiness.java

@@ -442,14 +442,15 @@ public class CheckBusiness {
         // 每天最大消费金额
         BigDecimal termDayMoney = termVo.getDayMoney() == null ? BigDecimal.ZERO : termVo.getDayMoney();
         // 每餐最大消费次数
-        Integer termmealCount = termVo.getMealCount() == null ? 0 : termVo.getMealCount();
+        Integer termMealCount = termVo.getMealCount() == null ? 0 : termVo.getMealCount();
         // 单次最大消费金额
-        BigDecimal termSignleMoney = termVo.getSingleMoney() == null ? BigDecimal.ZERO : termVo.getSingleMoney();
+        BigDecimal termSingleMoney = termVo.getSingleMoney() == null ? BigDecimal.ZERO : termVo.getSingleMoney();
         // 二次可用最大时间间隔
         Integer termSwipeInterval = termVo.getSwipeInterval() == null ? 0 : termVo.getSwipeInterval();
         // 设备是否启用了卡有效
         Boolean termUseValidity = Objects.equals(termVo.getTermValidity(), "0") ? Boolean.FALSE : Boolean.TRUE;
 
+        // 消费卡类限制验证
         int offsetTypeId = (int) Math.pow(2, (cardTypeId - 1));
         if ((offsetTypeId & termCardTypeId) != offsetTypeId) {
             return R.fail(new ErrorInfo(400, ApiErrorTypeConstants.NOT_FOUND, "卡类限制", TradeStatusEnum.CardTypeLimit.getName()));