店铺信息不存在

This commit is contained in:
2024-08-08 16:57:24 +08:00
parent a789eea6b0
commit f4af3a279f

View File

@@ -64,8 +64,10 @@ public class UserContoller {
@GetMapping("/shopUserInfo") @GetMapping("/shopUserInfo")
public Result shopUserInfo(@RequestParam("userId") String userId, @RequestHeader("openId") String openId, @RequestParam("shopId") String shopId) throws Exception { public Result shopUserInfo(@RequestParam("userId") String userId, @RequestHeader("openId") String openId, @RequestParam("shopId") String shopId) throws Exception {
TbShopUser shopUser = new TbShopUser(); TbShopUser shopUser = new TbShopUser();
TbShopInfo tbShopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId)); TbShopInfo tbShopInfo = new TbShopInfo();
if (StringUtils.isNotBlank(shopId) && !shopId.equals("null")) { if (StringUtils.isNotBlank(shopId) && !shopId.equals("null")) {
tbShopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
if(tbShopInfo!=null){
shopUser = shopUserMapper.selectByUserIdAndShopId(userId, shopId); shopUser = shopUserMapper.selectByUserIdAndShopId(userId, shopId);
if (ObjectUtil.isEmpty(shopUser)) { if (ObjectUtil.isEmpty(shopUser)) {
TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(Integer.valueOf(userId)); TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
@@ -98,6 +100,9 @@ public class UserContoller {
// shopUserMapper.updateByPrimaryKey(shopUser); // shopUserMapper.updateByPrimaryKey(shopUser);
// } // }
} }
}else {
return Result.fail("店铺信息不存在");
}
} else { } else {
shopUser.setAmount(BigDecimal.ZERO); shopUser.setAmount(BigDecimal.ZERO);
} }