Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
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;