liujie
2023-08-02 b64d67ef01e81a857046f19dd556b4e4f0695e1c
cloud-server-other/src/main/java/com/dsh/other/service/impl/StoreServiceImpl.java
@@ -6,6 +6,7 @@
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;
@@ -62,8 +63,11 @@
     */
    @Override
    public List<BaseVo> queryStoreLists(String lon, String lat) throws Exception {
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat);
        List<BaseVo> list = new ArrayList<>();
        if(ToolUtil.isEmpty(lon) || ToolUtil.isEmpty(lat)){
            return list;
        }
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat);
        if(null != geocode){
            String provinceCode = geocode.get("provinceCode");
            String cityCode = geocode.get("cityCode");
@@ -76,4 +80,45 @@
        }
        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);
    }
}