Commit 179d4f4e by 黄小葱

增加wifi定位配置

1 parent cca83d8b
......@@ -10,6 +10,7 @@ import cn.com.glsx.devicemonitor.modules.convert.DataLocationConvert;
import cn.com.glsx.devicemonitor.modules.entity.inner.DataGpsLocation;
import cn.com.glsx.devicemonitor.modules.model.*;
import cn.com.glsx.devicemonitor.modules.service.GpsBsLocationService;
import com.glsx.plat.context.utils.PropertiesUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -104,7 +105,19 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
*/
public DataGpsLocation getDeviceLastWifiInfoBySn(String sn) {
// 75开头的设备是沃达孚的无线设备,需要显示wifi定位
if (StringUtils.isBlank(sn) || !sn.startsWith("75")) {
//具有wifi定位的设备起始号
String wifiSns = PropertiesUtils.getProperty("wifi.sn.start.location");
boolean hasWifi = false;
if (StringUtils.isNotBlank(wifiSns)) {
String[] snArr = wifiSns.split(",");
for (String snStart : snArr) {
if (sn.startsWith(snStart)) {
hasWifi = true;
break;
}
}
}
if (!hasWifi) {
return null;
}
DataGpsLocation wifiLocation = hdaoGpsComponent.getWifiLocation(sn);
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.devicemonitor.modules.utils;
import cn.com.glsx.devicemonitor.modules.model.WifiMapInfoModel;
import com.alibaba.fastjson.JSONObject;
import com.glsx.plat.common.utils.HttpUtils;
import com.glsx.plat.context.utils.PropertiesUtils;
import io.micrometer.core.instrument.util.JsonUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -21,8 +22,13 @@ public class MapUtil {
*/
public static WifiMapInfoModel getWifiLoactionByMac(String macs) {
String url = "http://apilocate.amap.com/position";
Map<String, Object> map = new HashMap<>();
map.put("key", "d0059dce9808bf2c1344c9ffe09c118a");
String gaoDeKey = PropertiesUtils.getProperty("gao.de.map.key");
if (StringUtils.isBlank(gaoDeKey)) {
//旧的key:d0059dce9808bf2c1344c9ffe09c118a
gaoDeKey = "dc05ae40dade9f84b1768166e67b1162";
}
Map<String, Object> map = new HashMap<String, Object>();
map.put("key", gaoDeKey);
map.put("imei", "00000000000000000000");
map.put("accesstype", "1");
map.put("macs", macs);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!