From 65816321c28dab1f43d0563af67dbcbad2c5bdca Mon Sep 17 00:00:00 2001 From: jiangqs <jiangqs> Date: 星期一, 22 五月 2023 18:15:39 +0800 Subject: [PATCH] demo补完 --- ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java index c7d149e..502dffa 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java @@ -22,7 +22,7 @@ import com.ruoyi.system.api.domain.poji.sys.SysUser; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; -import org.apache.commons.lang3.StringUtils; +import com.ruoyi.common.core.utils.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -334,15 +334,17 @@ public AppNearbyShopVo getNearbyShop(AppNearbyShopDto appNearbyShopDto,Member member){ AppNearbyShopVo appNearbyShopVo = new AppNearbyShopVo(); Shop shop = null; - if(member.getRelationShopId()!=null){ + //获取附近商户 + if(member!=null&&member.getRelationShopId()!=null&&member.getBindingFlag()==1){ //获取绑定商户 shop = this.getById(member.getRelationShopId()); - }else{ - //获取附近商户 + }else if(StringUtils.isNotBlank(appNearbyShopDto.getLatitude())&&StringUtils.isNotBlank(appNearbyShopDto.getLongitude())){ AppNearShopVo appNearShopVo = shopMapper.getNearbyShop(appNearbyShopDto); shop = this.getById(appNearShopVo.getShopId()); + }else{ + return appNearbyShopVo; } - if(member.getBindingFlag()!=1){ + if(member!=null&&member.getBindingFlag()!=1){ AppMemberBindingDto appMemberBindingDto = new AppMemberBindingDto(); appMemberBindingDto.setShopId(shop.getShopId()); appMemberBindingDto.setUserId(member.getUserId()); -- Gitblit v1.7.1