From e030255c23c7ba3e2cbad1036a810d6d72fa864f Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期四, 26 十月 2023 18:04:58 +0800 Subject: [PATCH] 修改bug --- cloud-server-other/src/main/java/com/dsh/other/service/impl/StoreServiceImpl.java | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 102 insertions(+), 6 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/other/service/impl/StoreServiceImpl.java b/cloud-server-other/src/main/java/com/dsh/other/service/impl/StoreServiceImpl.java index ec71bcf..8d361d8 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/service/impl/StoreServiceImpl.java +++ b/cloud-server-other/src/main/java/com/dsh/other/service/impl/StoreServiceImpl.java @@ -3,9 +3,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dsh.other.entity.OperatorUser; import com.dsh.other.entity.Store; import com.dsh.other.mapper.StoreMapper; import com.dsh.other.model.BaseVo; +import com.dsh.other.model.ProvinceAndCityVo; import com.dsh.other.service.StoreService; import com.dsh.other.util.GDMapGeocodingUtil; import com.dsh.other.util.ToolUtil; @@ -29,7 +31,45 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper,Store> implements StoreService { @Autowired + private StoreMapper storeMapper; + @Autowired private GDMapGeocodingUtil gdMapGeocodingUtil; + + + /** + * 根据城市管理员id获取门店集合 + * @param id + * @return + */ + @Override + public List<Store> getStoreByCityManagerId(Integer id) { + return storeMapper.getStoreByCityManagerId(id); + } + /** + * 根据门店员工id获取门店集合 + * @param id + * @return + */ + @Override + public List<Store> getStoreByStoreStaffId(Integer id) { + return storeMapper.getStoreByStoreStaffId(id); + } + + @Override + public String getOName(Integer operatorId) { + + return this.baseMapper.getOName(operatorId); + } + + @Override + public List<Map<String, Object>> game(Integer appUserId) { + return this.baseMapper.game(appUserId); + } + + @Override + public OperatorUser queryByStoreId(Integer id) { + return this.baseMapper.queryByStoreId(id); + } /** @@ -61,19 +101,75 @@ * @throws Exception */ @Override - public List<BaseVo> queryStoreLists(String lon, String lat) throws Exception { - Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat); + public List<BaseVo> queryStoreLists(String lon, String lat,String cityCode) throws Exception { List<BaseVo> list = new ArrayList<>(); - if(null != geocode){ - String provinceCode = geocode.get("provinceCode"); - String cityCode = geocode.get("cityCode"); - List<Store> stores = this.queryStorsList(provinceCode, cityCode); + if(ToolUtil.isEmpty(lon) || ToolUtil.isEmpty(lat)){ + return list; + } + if(ToolUtil.isNotEmpty(cityCode)){ + List<Store> stores = this.queryStorsList(null, cityCode); for (Store store : stores) { BaseVo baseVo = new BaseVo(); BeanUtils.copyProperties(store, baseVo); list.add(baseVo); } + }else { + Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat); + if(null != geocode){ + String provinceCode = geocode.get("provinceCode"); + String cityCode1 = geocode.get("cityCode"); + + List<Store> stores = this.queryStorsList(provinceCode, cityCode1); + for (Store store : stores) { + BaseVo baseVo = new BaseVo(); + BeanUtils.copyProperties(store, baseVo); + list.add(baseVo); + } + } } return list; } + + + /** + * 获取开通省市 + * @param pcode + * @return + * @throws Exception + */ + @Override + public List<ProvinceAndCityVo> queryProvinceAndCity(String pcode) throws Exception { + if(ToolUtil.isEmpty(pcode)){ + return this.baseMapper.queryProvince(); + } + if(ToolUtil.isNotEmpty(pcode)){ + return this.baseMapper.queryCity(pcode); + } + return null; + } + + + /** + * 获取所有开通城市 + * @return + * @throws Exception + */ + @Override + public List<ProvinceAndCityVo> queryAllCity() throws Exception { + return this.baseMapper.queryCity(null); + } + + + /** + * 根据城市code获取城市列表 + * @param cityCode + * @return + * @throws Exception + */ + @Override + public List<BaseVo> queryStoreByCityCode(String cityCode) throws Exception { + return this.baseMapper.queryStoreByCityCode(cityCode); + } + + } -- Gitblit v1.7.1