Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-devicemonitor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 179d4f4e
authored
Sep 14, 2021
by
黄小葱
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加wifi定位配置
1 parent
cca83d8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
src/main/java/cn/com/glsx/devicemonitor/modules/utils/MapUtil.java
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
View file @
179d4f4
...
...
@@ -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
);
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/utils/MapUtil.java
View file @
179d4f4
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment