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
b9813778
authored
Dec 25, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:设备告警问题
parent
21882d5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
server-service/src/main/java/com/makeit/external/strategy/HuiNengStrategy.java
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
server-service/src/main/java/com/makeit/external/strategy/HuiNengStrategy.java
View file @
b9813778
package
com
.
makeit
.
external
.
strategy
;
package
com
.
makeit
.
external
.
strategy
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -82,7 +83,7 @@ public class HuiNengStrategy implements OpenApiBaseStrategy {
...
@@ -82,7 +83,7 @@ public class HuiNengStrategy implements OpenApiBaseStrategy {
reportInfo
.
setTurnState
(
bodymove
.
equals
(
"0"
)
?
"0"
:
"1"
);
reportInfo
.
setTurnState
(
bodymove
.
equals
(
"0"
)
?
"0"
:
"1"
);
data
.
add
(
reportInfo
);
data
.
add
(
reportInfo
);
dto
.
setData
(
data
);
dto
.
setData
(
data
);
String
reqJson
=
JSON
.
toJSONString
(
dto
);
String
reqJson
=
JSON
Util
.
toJsonStr
(
dto
);
String
url
=
platTenant
.
getOpenApiUrl
()
+
"/admin-api/v1/HealthMonitoringEquipment/TimingdataPush?token=aHVpbmVuZ2dhbnpoaV9wdXNoc2V0"
;
String
url
=
platTenant
.
getOpenApiUrl
()
+
"/admin-api/v1/HealthMonitoringEquipment/TimingdataPush?token=aHVpbmVuZ2dhbnpoaV9wdXNoc2V0"
;
log
.
info
(
"请求url:{},参数:{}"
,
url
,
reqJson
);
log
.
info
(
"请求url:{},参数:{}"
,
url
,
reqJson
);
String
result
=
HttpUtil
.
createPost
(
url
)
String
result
=
HttpUtil
.
createPost
(
url
)
...
...
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
View file @
b9813778
...
@@ -111,7 +111,7 @@ public class PushCallback implements MqttCallback {
...
@@ -111,7 +111,7 @@ public class PushCallback implements MqttCallback {
// 收到消息并设置返回字符串格式
// 收到消息并设置返回字符串格式
String
payload
=
new
String
(
message
.
getPayload
(),
"UTF-8"
);
String
payload
=
new
String
(
message
.
getPayload
(),
"UTF-8"
);
logger
.
info
(
"接收消息内容:payload格式:{}"
,
payload
);
//
logger.info("接收消息内容:payload格式:{}", payload);
// 解析数据
// 解析数据
DeviceInfo
device
=
JSON
.
parseObject
(
payload
,
DeviceInfo
.
class
);
DeviceInfo
device
=
JSON
.
parseObject
(
payload
,
DeviceInfo
.
class
);
...
@@ -210,13 +210,13 @@ public class PushCallback implements MqttCallback {
...
@@ -210,13 +210,13 @@ public class PushCallback implements MqttCallback {
PlatDevice
platDevice
=
deviceCacheUtil
.
get
(
deviceId
+
":"
+
iot_tenantId
);
PlatDevice
platDevice
=
deviceCacheUtil
.
get
(
deviceId
+
":"
+
iot_tenantId
);
if
(
platDevice
==
null
)
{
if
(
platDevice
==
null
)
{
logger
.
error
(
"获取设备信息异常,设备iot-id,iot_tenantId:"
+
deviceId
+
","
+
iot_tenantId
);
logger
.
error
(
"获取设备信息异常,设备iot-id,iot_tenantId:"
+
deviceId
+
","
+
iot_tenantId
);
return
;
continue
;
}
}
List
<
PlatAlarmConfig
>
deviceAlarmConfigList
=
alarmConfigCacheUtil
.
getDeviceAlarmConfigMap
(
platDevice
);
List
<
PlatAlarmConfig
>
deviceAlarmConfigList
=
alarmConfigCacheUtil
.
getDeviceAlarmConfigMap
(
platDevice
);
deviceAlarmConfigList
.
removeIf
(
Objects:
:
isNull
);
deviceAlarmConfigList
.
removeIf
(
Objects:
:
isNull
);
if
(
CollectionUtils
.
isEmpty
(
deviceAlarmConfigList
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceAlarmConfigList
))
{
logger
.
error
(
"该设备没有告警配置,设备iot-id,iot_tenantId:"
+
deviceId
+
","
+
iot_tenantId
);
logger
.
error
(
"该设备没有告警配置,设备iot-id,iot_tenantId:"
+
deviceId
+
","
+
iot_tenantId
);
return
;
continue
;
}
}
handleOffBed
(
platDevice
,
properties
,
messageType
);
handleOffBed
(
platDevice
,
properties
,
messageType
);
...
...
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