会员卡支付增加待支付中状态
This commit is contained in:
parent
8fb21d0a1b
commit
d118c922d3
|
|
@ -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";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,6 +144,15 @@ public class Result {
|
|||
dto.setIcon(CodeEnum.FAIL.getIcon());
|
||||
return dto;
|
||||
}
|
||||
public static Result failCode(String msg,String data) {
|
||||
Result dto = new Result();
|
||||
dto.setMsg(msg);
|
||||
dto.setEncrypt(false);
|
||||
dto.setCode("1");
|
||||
dto.setData(data);
|
||||
dto.setIcon(CodeEnum.FAIL.getIcon());
|
||||
return dto;
|
||||
}
|
||||
public static Result failure(IError error) {
|
||||
Result dto = new Result();
|
||||
dto.setMsg(error.getErrorMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue