userId 为null处理

This commit is contained in:
2024-08-30 11:49:42 +08:00
parent 33a0722c8c
commit 77f01cabdc

View File

@@ -72,15 +72,16 @@ public class TbShopUserServiceImpl implements TbShopUserService {
shopUserInfoVo.setTelephone(tbShopUser.getTelephone()); shopUserInfoVo.setTelephone(tbShopUser.getTelephone());
shopUserInfoVo.setTotalScore(0); shopUserInfoVo.setTotalScore(0);
}); });
}
if (shopUserInfoVo.getUserId() == null) { if (shopUserInfoVo.getUserId() == null) {
shopUserInfoVo.setUserId(0); shopUserInfoVo.setUserId(0);
} shopUserInfoVo.setOrderNumber(0);
} } else {
Integer orderNumber = tbOrderInfoRepository.countByUserIdAndStatusAndShopId(shopUserInfoVo.getUserId().toString(), criteria.getShopId()); Integer orderNumber = tbOrderInfoRepository.countByUserIdAndStatusAndShopId(shopUserInfoVo.getUserId().toString(), criteria.getShopId());
shopUserInfoVo.setOrderNumber(Objects.isNull(orderNumber) ? 0 : orderNumber); shopUserInfoVo.setOrderNumber(Objects.isNull(orderNumber) ? 0 : orderNumber);
}
shopUserInfoVo.setInMoney(tbShopUserRepository.sumAmount(shopUserInfoVo.getId())); shopUserInfoVo.setInMoney(tbShopUserRepository.sumAmount(shopUserInfoVo.getId()));
} }
return PageUtil.toPlusPage(iPage.getRecords(), Integer.valueOf(iPage.getTotal() + "")); return PageUtil.toPlusPage(iPage.getRecords(), Integer.valueOf(iPage.getTotal() + ""));
@@ -213,7 +214,6 @@ public class TbShopUserServiceImpl implements TbShopUserService {
} }
TbShopUser tbShopUser = tbShopUserRepository.getById(Integer.valueOf(map.get("id") + "")); TbShopUser tbShopUser = tbShopUserRepository.getById(Integer.valueOf(map.get("id") + ""));
if (ObjectUtil.isNull(tbShopUser)) { if (ObjectUtil.isNull(tbShopUser)) {
throw new BadRequestException("不存在的会员信息"); throw new BadRequestException("不存在的会员信息");
@@ -228,7 +228,6 @@ public class TbShopUserServiceImpl implements TbShopUserService {
} }
String type = map.get("type").toString(); String type = map.get("type").toString();
TbShopUserFlow flow = new TbShopUserFlow(); TbShopUserFlow flow = new TbShopUserFlow();
@@ -258,8 +257,6 @@ public class TbShopUserServiceImpl implements TbShopUserService {
tbShopUserFlowMapper.insert(flow); tbShopUserFlowMapper.insert(flow);
} }
} }