Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
glsx-smart-message-channel
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 94625a6d
authored
Apr 22, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]pulsar消费服务
1 parent
def3b734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
src/main/java/cn/com/glsx/consumer/service/InfoService.java
src/main/java/cn/com/glsx/consumer/service/InfoService.java
View file @
94625a6
...
@@ -115,8 +115,19 @@ public class InfoService {
...
@@ -115,8 +115,19 @@ public class InfoService {
List
<
SmartDevideStatus
>
list
=
new
ArrayList
<>();
List
<
SmartDevideStatus
>
list
=
new
ArrayList
<>();
List
<
DeviceStatusDetail
>
status
=
deviceStatus
.
getStatus
();
List
<
DeviceStatusDetail
>
status
=
deviceStatus
.
getStatus
();
if
(
CollectionUtils
.
isNotEmpty
(
status
))
{
if
(
CollectionUtils
.
isNotEmpty
(
status
))
{
list
=
status
.
stream
().
map
(
index
->
{
status
.
forEach
(
index
->
{
SmartDevideStatus
smartDevideStatus
=
smartDevideStatusMapper
.
findDevStatusByIdAndCode
(
deviceStatus
.
getDevId
(),
index
.
getCode
());
SmartDevideStatus
smartDevideStatus
=
smartDevideStatusMapper
.
findDevStatusByIdAndCode
(
deviceStatus
.
getDevId
(),
index
.
getCode
());
// 温度特殊处理
if
(
smartDevideStatus
!=
null
){
String
code
=
index
.
getCode
();
String
deviceOrderValue
=
smartDevideStatus
.
getDeviceOrderValue
();
if
(
code
.
equals
(
"va_temperature"
)
||
code
.
equals
(
"va_humidity"
)){
if
(
deviceOrderValue
.
substring
(
0
,
deviceOrderValue
.
length
()-
1
).
equals
(
index
.
getValue
().
substring
(
0
,
deviceOrderValue
.
length
()-
1
))){
log
.
info
(
"温湿度误差在0.1之内,不用触发场景"
);
return
;
}
}
}
if
(
smartDevideStatus
==
null
)
{
if
(
smartDevideStatus
==
null
)
{
smartDevideStatus
=
new
SmartDevideStatus
();
smartDevideStatus
=
new
SmartDevideStatus
();
smartDevideStatus
.
setDeviceId
(
deviceStatus
.
getDevId
());
smartDevideStatus
.
setDeviceId
(
deviceStatus
.
getDevId
());
...
@@ -127,8 +138,8 @@ public class InfoService {
...
@@ -127,8 +138,8 @@ public class InfoService {
}
}
smartDevideStatus
.
setUpdatetime
(
new
Date
(
index
.
getT
()));
smartDevideStatus
.
setUpdatetime
(
new
Date
(
index
.
getT
()));
smartDevideStatus
.
setDeviceOrderValue
(
index
.
getValue
());
smartDevideStatus
.
setDeviceOrderValue
(
index
.
getValue
());
return
smartDevideStatus
;
list
.
add
(
smartDevideStatus
)
;
})
.
collect
(
Collectors
.
toList
())
;
});
}
}
return
list
;
return
list
;
}
}
...
@@ -181,6 +192,7 @@ public class InfoService {
...
@@ -181,6 +192,7 @@ public class InfoService {
log
.
info
(
"温湿度值为{}"
,
paramValue
.
getValue
());
log
.
info
(
"温湿度值为{}"
,
paramValue
.
getValue
());
Value
=
Integer
.
parseInt
(
paramValue
.
getValue
())
*
10
+
""
;
Value
=
Integer
.
parseInt
(
paramValue
.
getValue
())
*
10
+
""
;
}
}
// 处理特殊温度时候情况
}
else
{
}
else
{
Value
=
paramValue
.
getValue
();
Value
=
paramValue
.
getValue
();
}
}
...
@@ -192,6 +204,8 @@ public class InfoService {
...
@@ -192,6 +204,8 @@ public class InfoService {
}
}
}
}
//根据logic逻辑码,判断触发条件与数据库中实际的值,判断是否满足
//根据logic逻辑码,判断触发条件与数据库中实际的值,判断是否满足
return
ELogic
.
getValueByCode
(
logic
,
Value
,
smartDevideStatus
.
getDeviceOrderValue
()
==
null
?
""
:
smartDevideStatus
.
getDeviceOrderValue
());
boolean
valueByCode
=
ELogic
.
getValueByCode
(
logic
,
Value
,
smartDevideStatus
.
getDeviceOrderValue
()
==
null
?
""
:
smartDevideStatus
.
getDeviceOrderValue
());
log
.
info
(
"deviceOrderCode为{}的判断是{}"
,
deviceOrderCode
,
valueByCode
);
return
valueByCode
;
}
}
}
}
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