Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
c76556a2
Commit
c76556a2
authored
Apr 27, 2022
by
yanHeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[修改] 轨迹获取
parent
dc907b22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
IotPlatformUtils.java
...in/java/com/beecode/inz/common/util/IotPlatformUtils.java
+26
-2
WatershedCameraPlayController.java
.../xyst/dinas/camera/web/WatershedCameraPlayController.java
+11
-0
No files found.
backend/inz.common/src/main/java/com/beecode/inz/common/util/IotPlatformUtils.java
View file @
c76556a2
...
...
@@ -60,7 +60,7 @@ public class IotPlatformUtils {
/**
* 历史轨迹URL
*/
private
static
final
String
HISTORY_URL
=
GPS_WU_LING_DOMAIN_API
+
"
/
api/v1/gateways/%1$s/metrics"
;
private
static
final
String
HISTORY_URL
=
GPS_WU_LING_DOMAIN_API
+
"api/v1/gateways/%1$s/metrics"
;
//跟踪url
...
...
@@ -184,7 +184,7 @@ public class IotPlatformUtils {
}
String
accessToken
=
postStr
.
getString
(
"access_token"
);
if
(
accessToken
!=
null
)
{
RedisUtils
.
getInstance
().
set
(
getGpsWuLingTokenRedisKey
(
CLIET_ID
,
CLIENT_SECRET
),
accessToken
,
postStr
.
getInt
(
"expires_in"
)-
3
);
RedisUtils
.
getInstance
().
set
(
getGpsWuLingTokenRedisKey
(
CLIET_ID
,
CLIENT_SECRET
),
accessToken
,
postStr
.
getInt
(
"expires_in"
)-
3
0
);
map
.
put
(
"status"
,
0
);
map
.
put
(
"data"
,
accessToken
);
return
map
;
...
...
@@ -246,4 +246,28 @@ public class IotPlatformUtils {
}
return
datas
;
}
public
static
String
findGatewayId
(
String
deviceNumber
,
String
token
)
{
if
(
token
==
null
||
""
.
equals
(
token
)){
return
"token为空"
;
}
if
(
""
.
equals
(
deviceNumber
)){
return
"设备序列号为空"
;
}
String
param
=
"serialNumber="
+
deviceNumber
;
//根据设备序号 查询网关id
String
findGatewayId
=
HttpSendUtil
.
sendGet
(
FIND_GATEWAY_ID_URL
,
param
,
token
);
JSONObject
findStr
=
new
JSONObject
(
findGatewayId
);
int
findCode
=
findStr
.
getInt
(
"code"
);
String
id
=
""
;
if
(
20000
==(
findCode
))
{
id
=
findStr
.
get
(
"data"
).
toString
();
}
else
{
id
=
findStr
.
get
(
"message"
).
toString
();
}
if
(
""
.
equals
(
id
)){
return
null
;
}
return
id
;
}
}
backend/xyst.dinas.camera/src/main/java/com/xyst/dinas/camera/web/WatershedCameraPlayController.java
View file @
c76556a2
...
...
@@ -4,6 +4,7 @@ package com.xyst.dinas.camera.web;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.inz.common.util.IotPlatformUtils
;
import
com.beecode.util.StringUtils
;
import
com.xyst.dinas.biz.service.SandMiningAreaService
;
import
com.xyst.dinas.biz.service.ShipInfoService
;
import
com.xyst.dinas.camera.entity.RegionalCompanyWatershedCameraTree
;
...
...
@@ -107,5 +108,15 @@ public class WatershedCameraPlayController {
}
}
@GetMapping
(
"/findGatewayId"
)
public
ResponseObj
findGatewayId
(
@RequestParam
(
name
=
"deviceNumber"
)
String
deviceNumber
,
@RequestParam
(
name
=
"token"
)
String
token
)
throws
Exception
{
String
gatewayId
=
IotPlatformUtils
.
findGatewayId
(
deviceNumber
,
token
);
boolean
numeric
=
StringUtils
.
isNumeric
(
gatewayId
);
if
(
""
.
equals
(
gatewayId
)
||
!
numeric
){
return
ResponseObj
.
error
(
500
,
"查询失败"
,
gatewayId
);
}
return
ResponseObj
.
response
(
200
,
"查询成功"
,
gatewayId
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment