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
78c3bc5a
authored
Dec 07, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 状态判断新增log
parent
c77769cd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 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 @
78c3bc5a
...
...
@@ -284,12 +284,15 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
Double
[]
doubleArrX
=
voList
.
stream
().
map
(
e
->
e
.
getX
().
doubleValue
()).
toArray
(
Double
[]::
new
);
double
x
=
StandardDeviationUtil
.
variance
(
doubleArrX
);
boolean
xFlag
=
new
BigDecimal
(
x
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
log
.
info
(
"空间设备算出来X方差为:{},是否大于2:{},设备id:{}"
,
x
,
xFlag
,
device
.
getOriDeviceId
());
Double
[]
doubleArrY
=
voList
.
stream
().
map
(
e
->
e
.
getY
().
doubleValue
()).
toArray
(
Double
[]::
new
);
double
y
=
StandardDeviationUtil
.
variance
(
doubleArrY
);
boolean
yFlag
=
new
BigDecimal
(
y
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
log
.
info
(
"空间设备算出来Y方差为:{},是否大于2:{},设备id:{}"
,
y
,
yFlag
,
device
.
getOriDeviceId
());
if
(
xFlag
&&
yFlag
)
{
log
.
info
(
"当前属于离床运动:"
+
platElderIdDTO
.
getElderId
());
log
.
info
(
"当前属于
空间设备
离床运动:"
+
platElderIdDTO
.
getElderId
());
platElderRealTimeNowVO
.
setStatus
(
PlatElderRealtimeReportEnum
.
NowStatus
.
RUN
.
getValue
());
return
platElderRealTimeNowVO
;
}
else
{
...
...
@@ -317,19 +320,23 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
boolean
noPersonFlag
=
voList
.
stream
().
allMatch
(
e
->
e
.
getPerson
()
==
0
);
if
(
noPersonFlag
)
{
log
.
info
(
"当前属于外出:"
+
platElderIdDTO
.
getElderId
());
log
.
info
(
"当前属于
跌倒设备
外出:"
+
platElderIdDTO
.
getElderId
());
platElderRealTimeNowVO
.
setStatus
(
PlatElderRealtimeReportEnum
.
NowStatus
.
OUT
.
getValue
());
return
platElderRealTimeNowVO
;
}
Double
[]
doubleArrX
=
voList
.
stream
().
map
(
e
->
e
.
getX
().
doubleValue
()).
toArray
(
Double
[]::
new
);
double
x
=
StandardDeviationUtil
.
variance
(
doubleArrX
);
boolean
xFlag
=
new
BigDecimal
(
x
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
log
.
info
(
"跌倒设备算出来X方差为:{},是否大于2:{},设备id:{}"
,
x
,
xFlag
,
device
.
getOriDeviceId
());
Double
[]
doubleArrY
=
voList
.
stream
().
map
(
e
->
e
.
getY
().
doubleValue
()).
toArray
(
Double
[]::
new
);
double
y
=
StandardDeviationUtil
.
variance
(
doubleArrY
);
boolean
yFlag
=
new
BigDecimal
(
y
+
""
).
compareTo
(
new
BigDecimal
(
2
))
>
0
;
log
.
info
(
"跌倒设备算出来Y方差为:{},是否大于2:{},设备id:{}"
,
y
,
yFlag
,
device
.
getOriDeviceId
());
if
(
xFlag
&&
yFlag
)
{
log
.
info
(
"当前属于离床运动:"
+
platElderIdDTO
.
getElderId
());
log
.
info
(
"当前属于
跌倒设备
离床运动:"
+
platElderIdDTO
.
getElderId
());
platElderRealTimeNowVO
.
setStatus
(
PlatElderRealtimeReportEnum
.
NowStatus
.
RUN
.
getValue
());
return
platElderRealTimeNowVO
;
}
else
{
...
...
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