diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/Suit.java b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/Suit.java index a5e2eb38..9cced319 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/Suit.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/Suit.java @@ -55,7 +55,7 @@ public class Suit extends BaseEntity @Excel(name = "价格(元)") @JsonView({DeviceView.SuitList.class, JsonViewProfile.AppMch.class}) @NotNull(message = "价格不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class}) - @DecimalMin(value = "0.01", message = "价格不允许小于0.01") + @Min(value = 0, message = "价格不允许小于0") private BigDecimal price; /** 详细说明 */ diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java index 85ac3051..4f3dad69 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java @@ -225,8 +225,14 @@ public class TransactionBillServiceImpl implements TransactionBillService { // 服务费处理 this.handleService(order); + // 插入数据库 ServiceUtil.assertion(this.insertSmTransactionBill(order) != 1, "下单失败"); + // 若订单金额为0元,则直接充值成功 + if (order.getMoney().compareTo(BigDecimal.ZERO) == 0) { + this.rechargeSuccess(order.getBillNo(), DateUtils.getNowDate()); + } + // 加入延时队列,超时取消 billDelayedManager.add(order.getBillNo(), order.getExpireTime().getTime());