From bfa0b11dfbfe5b71e11f4544e688e4d9f325d1b5 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 09 六月 2025 10:26:51 +0800
Subject: [PATCH] 修改bug和管理后台报表
---
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java | 34 ++++++++++++++--------------------
1 files changed, 14 insertions(+), 20 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 a3ccf8f..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
@@ -6,11 +6,13 @@
import com.stylefeng.guns.modular.system.dao.PhoneMapper;
import com.stylefeng.guns.modular.system.model.Company;
import com.stylefeng.guns.modular.system.model.Phone;
+import com.stylefeng.guns.modular.system.service.ICompanyCityService;
import com.stylefeng.guns.modular.system.service.ICompanyService;
import com.stylefeng.guns.modular.system.service.IPhoneService;
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;
@@ -25,9 +27,12 @@
@Resource
private PhoneMapper phoneMapper;
-
+
+ @Autowired
+ private ICompanyCityService companyCityService;
+
@Resource
- private CompanyMapper companyMapper;
+ private RedisUtil redisUtil;
/**
* 获取所有系统电话
@@ -56,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() : "");
-
- List<Company> companies = companyMapper.queryList(city, null);
- if(companies.size() > 0){
- Integer id = companies.get(0).getId();
+
+ 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