diff --git a/luoo_user/src/main/java/com/luoo/user/service/StoreService.java b/luoo_user/src/main/java/com/luoo/user/service/StoreService.java index 80db7e5..d02686b 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/StoreService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/StoreService.java @@ -193,14 +193,15 @@ public class StoreService { qStore.tel, qStore.openingHours, qStore.background, - qStore.description + qStore.description, + qStore.visitCount )).from(qStore) .where(booleanBuilder) .orderBy(qStore.createTime.desc()) .fetch(); - double lng = Double.parseDouble(storeSearchDto.getLng()); - double lat = Double.parseDouble(storeSearchDto.getLat()); + double lng = storeSearchDto.getLng() == null ? 0 : Double.parseDouble(storeSearchDto.getLng()); + double lat = storeSearchDto.getLng() == null ? 0 : Double.parseDouble(storeSearchDto.getLat()); UUID uuid = UUID.randomUUID(); redisTemplate.opsForGeo().add(String.valueOf(uuid), new Point(lng, lat), "current"); @@ -209,8 +210,8 @@ public class StoreService { String contact = store.getContact(); if (StringUtils.isNotBlank(contact)) { UserInfo byId = userInfoService.findById(contact); - store.setContactNickName(byId.getNickName()); - store.setContactAvatar(byId.getAvatar()); + store.setContactNickName(byId == null ? "" : byId.getNickName()); + store.setContactAvatar(byId == null ? "" : byId.getAvatar()); } redisTemplate.opsForGeo().add(String.valueOf(uuid),