From 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 28 三月 2025 19:57:56 +0800 Subject: [PATCH] 修改bug --- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java index 7ea069f..e91d8de 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java @@ -12,6 +12,7 @@ import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; +import com.stylefeng.guns.modular.system.util.RedisUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,6 +30,9 @@ @Autowired private ICompanyCityService companyCityService; + + @Resource + private RedisUtil redisUtil; /** * 获取所有系统电话 @@ -57,30 +61,19 @@ * @throws Exception */ @Override - public Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception { - ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat, null); - if(null == reverseGeocode){ - System.err.println("获取地图信息出错"); - return new HashMap<>(); - } - AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); - String[] city = new String[addressComponentsVos.length]; - for (int i = 0; i < addressComponentsVos.length; i++) { - city[i] = addressComponentsVos[i].getLongName(); - } - + public Map<String, Object> queryCustomerPhone(Integer uid, Double lat, Double lnt) throws Exception { Map<String, Object> map = new HashMap<>(); //平台电话 Phone query = phoneMapper.query(2, 1, null, null, null); map.put("platform", null != query ? query.getPhone() : ""); - Company companies = companyCityService.query(city); + Company companies = companyCityService.query1(uid, lnt.toString(), lat.toString()); if(null != companies){ Integer id = companies.getId(); Phone phone = this.selectOne(new EntityWrapper<Phone>().eq("type", 2).eq("companyId", id)); - map.put("company", phone.getPhone()); + map.put("company", null == phone ? "" : phone.getPhone()); phone = this.selectOne(new EntityWrapper<Phone>().eq("type", 3).eq("companyId", id)); - map.put("scheduling", phone.getPhone()); + map.put("scheduling", null == phone ? "" : phone.getPhone()); } return map; -- Gitblit v1.7.1