| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.GeodesyUtil; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | |
| | | |
| | | @Override |
| | | public List<NearbyShopVO> nearbyShopList(BigDecimal longitude, BigDecimal latitude) { |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser appUser = appUserClient.getAppUserById(userid); |
| | | String token = SecurityUtils.getToken(ServletUtils.getRequest()); |
| | | AppUser appUser = null; |
| | | if(StringUtils.isNotEmpty(token)){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | appUser = appUserClient.getAppUserById(userid); |
| | | } |
| | | |
| | | List<NearbyShopVO> nearbyShopVOS = shopMapper.selectNearbyShopList(longitude, longitude); |
| | | if(null != appUser.getShopId()){ |
| | | NearbyShopVO nearbyShopVO = nearbyShopVOS.stream().filter(s -> s.getId().equals(appUser.getShopId().longValue())).findFirst().get(); |
| | | if(null != appUser && null != appUser.getShopId()){ |
| | | AppUser finalAppUser = appUser; |
| | | NearbyShopVO nearbyShopVO = nearbyShopVOS.stream().filter(s -> s.getId().equals(finalAppUser.getShopId().longValue())).findFirst().get(); |
| | | if(null != nearbyShopVO){ |
| | | nearbyShopVOS.remove(nearbyShopVO); |
| | | } |