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
75baeac4
authored
Dec 08, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 状态bug
parent
c07c639d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
View file @
75baeac4
...
@@ -305,17 +305,22 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
...
@@ -305,17 +305,22 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
return
vo
;
return
vo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
boolean
xFlag
=
false
;
fallNoPersonFlag
=
voList
.
stream
().
allMatch
(
e
->
e
.
getPersonState
()
==
0
);
fallNoPersonFlag
=
voList
.
stream
().
allMatch
(
e
->
e
.
getPersonState
()
==
0
);
Double
[]
doubleArrX
=
voList
.
stream
().
map
(
PlatElderCoordinateVO:
:
getX
).
filter
(
Objects:
:
nonNull
).
toArray
(
Double
[]::
new
);
Double
[]
doubleArrX
=
voList
.
stream
().
map
(
PlatElderCoordinateVO:
:
getX
).
filter
(
Objects:
:
nonNull
).
toArray
(
Double
[]::
new
);
double
x
=
StandardDeviationUtil
.
variance
(
doubleArrX
);
if
(
doubleArrX
.
length
>
0
)
{
boolean
xFlag
=
new
BigDecimal
(
x
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
double
x
=
StandardDeviationUtil
.
variance
(
doubleArrX
);
log
.
info
(
"跌倒设备算出来X方差为:{},是否大于2:{},设备id:{}"
,
x
,
xFlag
,
device
.
getOriDeviceId
());
xFlag
=
new
BigDecimal
(
x
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
log
.
info
(
"跌倒设备算出来X方差为:{},是否大于2:{},设备id:{}"
,
x
,
xFlag
,
device
.
getOriDeviceId
());
}
boolean
yFlag
=
false
;
Double
[]
doubleArrY
=
voList
.
stream
().
map
(
PlatElderCoordinateVO:
:
getY
).
filter
(
Objects:
:
nonNull
).
toArray
(
Double
[]::
new
);
Double
[]
doubleArrY
=
voList
.
stream
().
map
(
PlatElderCoordinateVO:
:
getY
).
filter
(
Objects:
:
nonNull
).
toArray
(
Double
[]::
new
);
double
y
=
StandardDeviationUtil
.
variance
(
doubleArrY
);
if
(
doubleArrY
.
length
>
0
)
{
boolean
yFlag
=
new
BigDecimal
(
y
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
double
y
=
StandardDeviationUtil
.
variance
(
doubleArrY
);
yFlag
=
new
BigDecimal
(
y
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
log
.
info
(
"跌倒设备算出来Y方差为:{},是否大于2:{},设备id:{}"
,
y
,
yFlag
,
device
.
getOriDeviceId
());
log
.
info
(
"跌倒设备算出来Y方差为:{},是否大于2:{},设备id:{}"
,
y
,
yFlag
,
device
.
getOriDeviceId
());
}
if
(
xFlag
&&
yFlag
)
{
if
(
xFlag
&&
yFlag
)
{
log
.
info
(
"当前属于跌倒设备离床运动:"
+
platElderIdDTO
.
getElderId
());
log
.
info
(
"当前属于跌倒设备离床运动:"
+
platElderIdDTO
.
getElderId
());
...
...
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