userId 为null处理

This commit is contained in:
yijiegong 2024-08-30 11:32:09 +08:00
parent 9ea2ecf552
commit b0392f70e1
1 changed files with 2 additions and 1 deletions

View File

@ -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()));