Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
22210e5f
authored
Jan 18, 2024
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 呼吸上报过滤组织
parent
d56be410
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
server-service/src/main/java/com/makeit/external/strategy/HuiNengStrategy.java
server-service/src/main/java/com/makeit/external/strategy/HuiNengStrategy.java
View file @
22210e5f
...
...
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Arrays
;
import
java.util.List
;
@Service
...
...
@@ -42,6 +43,9 @@ public class HuiNengStrategy implements OpenApiBaseStrategy {
if
(
platDevice
==
null
)
{
return
;
}
if
(!
isSupportAlarm
(
platTenant
,
platDevice
))
{
return
;
}
if
(
StringUtils
.
isEmpty
(
platTenant
.
getUrl
()))
{
log
.
info
(
"当前租户为配置openapi地址"
);
return
;
...
...
@@ -95,6 +99,15 @@ public class HuiNengStrategy implements OpenApiBaseStrategy {
log
.
info
(
"接口:{},返回信息:{}"
,
url
,
JSON
.
toJSONString
(
responseMessage
));
}
private
boolean
isSupportAlarm
(
PlatTenant
platTenant
,
PlatDevice
platDevice
)
{
String
reportOrgIds
=
platTenant
.
getReportOrgIds
();
if
(
StringUtils
.
isBlank
(
reportOrgIds
))
{
return
false
;
}
List
<
String
>
orgIds
=
Arrays
.
asList
(
StringUtils
.
split
(
reportOrgIds
,
","
));
return
orgIds
.
contains
(
platDevice
.
getOrgId
());
}
@Override
@TenantIdIgnore
public
void
alarm
(
PlatTenant
platTenant
,
String
deviceId
,
JSONObject
jsonObject
)
{
...
...
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