空指针问题
This commit is contained in:
@@ -106,13 +106,14 @@ public class MkShopConsumeDiscountRecordServiceImpl extends ServiceImpl<MkShopCo
|
|||||||
.eq(MkShopConsumeDiscountRecord::getIsUse, 1)
|
.eq(MkShopConsumeDiscountRecord::getIsUse, 1)
|
||||||
.eq(MkShopConsumeDiscountRecord::getShopUserId, shopUser.getId()));
|
.eq(MkShopConsumeDiscountRecord::getShopUserId, shopUser.getId()));
|
||||||
boolean exists = orderInfoService.exists(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
boolean exists = orderInfoService.exists(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
||||||
.eq(OrderInfo::getShopId, shopUser.getSourceShopId()).eq(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode()));
|
.eq(OrderInfo::getShopId, shopId).eq(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode()));
|
||||||
return !exists && discountRecord == null;
|
return !exists && discountRecord == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MkShopConsumeDiscountRecord getDiscount(Long shopId, Long userId, Long orderId) {
|
public MkShopConsumeDiscountRecord getDiscount(Long shopId, Long userId, Long orderId) {
|
||||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getUserId, userId).eq(ShopUser::getSourceShopId, shopId));
|
ShopUser shopUser = shopUserService.getUserInfo(shopId, userId);
|
||||||
|
AssertUtil.isTrue(shopUser == null, "用户不存在");
|
||||||
boolean newUser = isNewUser(shopUser, shopId);
|
boolean newUser = isNewUser(shopUser, shopId);
|
||||||
if (!newUser) {
|
if (!newUser) {
|
||||||
// throw new CzgException("新客立减仅新用户可用");
|
// throw new CzgException("新客立减仅新用户可用");
|
||||||
|
|||||||
Reference in New Issue
Block a user