空值判断

This commit is contained in:
2025-12-10 17:54:19 +08:00
parent adea09b0fe
commit 2362de5600

View File

@@ -62,7 +62,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
.eq(MkPointsGoodsRecord::getPointsGoodsId, param.getPointsGoodsId())
.ne(MkPointsGoodsRecord::getStatus, "已退款")
.eq(MkPointsGoodsRecord::getUserId, param.getUserId()), Integer.class);
if (goods.getLimitQuota() > 0 && boughtCount != null && boughtCount >= goods.getLimitQuota()) {
if (goods.getLimitQuota() != null && goods.getLimitQuota() > 0 && boughtCount != null && boughtCount >= goods.getLimitQuota()) {
throw new CzgException("兑换失败,该商品每人限制兑换" + goods.getLimitQuota() + "");
}
MkPointsUser pointsUser = pointsUserService.getPointsUser(param.getShopId(), null, param.getUserId());
@@ -161,7 +161,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
.setSource("积分兑换");
couponRecordService.receiveCoupon(giftDTO, record.getNumber(), false);
return record;
}else {
} else {
record.setStatus("待核销");
record.setCouponCode(RandomUtil.randomNumbers(12));
}