会员卡支付增加待支付中状态

This commit is contained in:
wangguocheng
2024-05-21 17:38:55 +08:00
parent 8fb21d0a1b
commit d118c922d3
2 changed files with 15 additions and 3 deletions

View File

@@ -310,11 +310,11 @@ public class PayService {
TbShopUser user = tbShopUserMapper.selectByPrimaryKey(memberId);
if (ObjectUtil.isEmpty(user) || !"1".equals(user.getIsVip().toString())) {
return Result.fail("用户非会员");
return Result.failCode("会员卡余额不足","1");
}
if (N.gt(orderInfo.getPayAmount(), user.getAmount())) {
return Result.fail("会员卡余额不足");
return Result.failCode("会员卡余额不足","2");
}
user.setAmount(user.getAmount().subtract(orderInfo.getOrderAmount()));
@@ -883,7 +883,10 @@ public class PayService {
log.info("发送打印数据");
producer.printMechine(orderInfo.getId() + "");
JSONObject coupons = new JSONObject();
coupons.put("type","buy");
coupons.put("orderId",orderInfo.getId().toString());
producer.printCoupons(coupons.toJSONString());
return "SUCCESS";
}