| | |
| | | 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; |
| | | |
| | |
| | | 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 if(StringUtils.isNotBlank(appNearbyShopDto.getLatitude())&&StringUtils.isNotBlank(appNearbyShopDto.getLongitude())){ |
| | | AppNearShopVo appNearShopVo = shopMapper.getNearbyShop(appNearbyShopDto); |
| | | shop = this.getById(appNearShopVo.getShopId()); |
| | | }else{ |
| | | //获取附近商户 |
| | | shop = this.getById(1L); |
| | | return appNearbyShopVo; |
| | | } |
| | | if(member.getBindingFlag()!=1){ |
| | | if(member!=null&&member.getBindingFlag()!=1){ |
| | | AppMemberBindingDto appMemberBindingDto = new AppMemberBindingDto(); |
| | | appMemberBindingDto.setShopId(shop.getShopId()); |
| | | appMemberBindingDto.setUserId(member.getUserId()); |
| | |
| | | List<MerAgencyPageVo> merAgencyPageVoList = shopMapper.pageMerAgencyVo(page, merAgencyPageDto); |
| | | return merAgencyPageVoList; |
| | | } |
| | | |
| | | |
| | | } |