| | |
| | | package com.ruoyi.shop.service.impl.shop; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.pojo.shop.*; |
| | | import com.ruoyi.shop.domain.vo.AppNearbyShopVo; |
| | | import com.ruoyi.shop.mapper.shop.ShopMapper; |
| | | import com.ruoyi.shop.service.shop.*; |
| | | import com.ruoyi.shop.util.CodeFactoryUtil; |
| | | import com.ruoyi.system.api.RemoteActivityService; |
| | | import com.ruoyi.system.api.RemoteConfigService; |
| | | import com.ruoyi.system.api.RemoteUserService; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.shop.domain.dto.MgtChangeCoopDto; |
| | | import com.ruoyi.shop.domain.dto.MgtEditShopDto; |
| | | import com.ruoyi.shop.domain.dto.MgtEditShopTagDto; |
| | | import com.ruoyi.shop.domain.dto.MgtShopPageDto; |
| | | import com.ruoyi.system.domain.pojo.config.SysTag; |
| | | import com.ruoyi.system.domain.pojo.shop.*; |
| | | import com.ruoyi.shop.domain.vo.AppShopInfoVo; |
| | | import com.ruoyi.shop.domain.vo.MgtShopInfoVo; |
| | | import com.ruoyi.shop.domain.vo.MgtShopPageVo; |
| | | import com.ruoyi.system.service.config.SysTagService; |
| | | import com.ruoyi.system.service.shop.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.service.sys.ISysUserService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ShopCertificateService shopCertificateService; |
| | | |
| | | @Resource |
| | | private SysTagService sysTagService; |
| | | private RemoteConfigService configService; |
| | | |
| | | @Resource |
| | | private RemoteUserService sysUserService; |
| | | |
| | | @Resource |
| | | private ShopRelTagService shopRelTagService; |
| | |
| | | @Resource |
| | | private ShopRelUserService shopRelUserService; |
| | | |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | |
| | | for(String str : shopTagIdArray){ |
| | | shopRelTag = new ShopRelTag(); |
| | | tagid = Long.valueOf(str); |
| | | sysTag = sysTagService.getById(tagid); |
| | | sysTag = configService.getSysTag(tagid).getData(); |
| | | shopRelTag.setDelFlag(0); |
| | | shopRelTag.setShopId(shop.getShopId()); |
| | | shopRelTag.setTagId(tagid); |
| | |
| | | for(String str : relUserIdArray){ |
| | | shopRelUser = new ShopRelUser(); |
| | | userId = Long.valueOf(str); |
| | | sysUser = sysUserService.selectUserById(userId); |
| | | sysUser = sysUserService.getSysUser(userId).getData(); |
| | | shopRelUser.setDelFlag(0); |
| | | shopRelUser.setShopId(shop.getShopId()); |
| | | shopRelUser.setUserId(userId); |
| | |
| | | StringJoiner shopTagSj = new StringJoiner(","); |
| | | for(String str : shopTagIdArray){ |
| | | tagId = Long.valueOf(str); |
| | | sysTag = sysTagService.getById(tagId); |
| | | sysTag = configService.getSysTag(tagId).getData(); |
| | | shopRelTag = new ShopRelTag(); |
| | | shopRelTag.setDelFlag(0); |
| | | shopRelTag.setShopId(shopId); |
| | |
| | | this.saveOrUpdate(shop); |
| | | } |
| | | |
| | | /** |
| | | * 获取附近门店 |
| | | * @param appNearbyShopDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AppNearbyShopVo getNearbyShop(AppNearbyShopDto appNearbyShopDto,Member member){ |
| | | AppNearbyShopVo appNearbyShopVo = new AppNearbyShopVo(); |
| | | Shop shop = null; |
| | | if(member.getRealtionShopId()!=null){ |
| | | //获取绑定商户 |
| | | shop = this.getById(member.getRealtionShopId()); |
| | | }else{ |
| | | //获取附近商户 |
| | | shop = this.getById(1L); |
| | | } |
| | | appNearbyShopVo.setShopId(shop.getShopId()); |
| | | appNearbyShopVo.setShopName(shop.getShopName()); |
| | | appNearbyShopVo.setShopAddress(shop.getShopAreaName()+shop.getShopAddress()); |
| | | appNearbyShopVo.setShopLatitude(shop.getShopLatitude()); |
| | | appNearbyShopVo.setShopLongitude(shop.getShopLongitude()); |
| | | return appNearbyShopVo; |
| | | } |
| | | } |