diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java index 92474ffd..e602b777 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java @@ -73,7 +73,8 @@ public class TbShopUserServiceImpl implements TbShopUserService { shopUserInfoVo.setTotalScore(0); }); } - Integer orderNumber=tbOrderInfoRepository.countByUserIdAndStatusAndShopId(shopUserInfoVo.getUserId().toString(),criteria.getShopId()); + Integer orderNumber=tbOrderInfoRepository.countByUserIdAndStatusAndShopId( + shopUserInfoVo.getUserId() == null ? "0" : shopUserInfoVo.getUserId().toString(),criteria.getShopId()); shopUserInfoVo.setOrderNumber(Objects.isNull(orderNumber)?0:orderNumber); shopUserInfoVo.setInMoney(tbShopUserRepository.sumAmount(shopUserInfoVo.getId()));