0元支付

This commit is contained in:
墨大叔 2024-07-27 09:34:30 +08:00
parent 14c283a011
commit 9b59ab7e20
2 changed files with 7 additions and 1 deletions

View File

@ -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;
/** 详细说明 */

View File

@ -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());