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
d7046ca6
authored
Oct 10, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
坐标定位和轨迹更新
parent
30bb5321
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
25 deletions
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
server-service/src/main/java/com/makeit/vo/platform/elder/realtime/PlatElderCoordinateVO.java
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
View file @
d7046ca6
...
@@ -158,6 +158,24 @@ public class IotProductDeviceService extends IotCommonService {
...
@@ -158,6 +158,24 @@ public class IotProductDeviceService extends IotCommonService {
}
}
public
DeviceInfoContentFall
getLastDeviceLogFall
(
String
deviceId
,
Integer
ignoreDuration
)
{
//秒
DeviceOperationLogEntity
deviceOperationLogEntity
=
getLastDeviceLogByType
(
deviceId
,
REPORT_PROPERTY
);
if
(
deviceOperationLogEntity
==
null
)
{
return
null
;
}
DeviceInfoContentFall
fall
=
JsonUtil
.
toObj
((
String
)
deviceOperationLogEntity
.
getContent
(),
DeviceInfoContentFall
.
class
);
LocalDateTime
time
=
LongTimestampUtil
.
toLocalDateTime
(
fall
.
getTimestamp
());
if
(
ignoreDuration
!=
null
&&
Duration
.
between
(
time
,
LocalDateTime
.
now
()).
getSeconds
()
>
ignoreDuration
)
{
return
null
;
}
return
fall
;
}
public
List
<
String
>
getLastDayHourRange
(
LocalDateTime
startDateTime
)
{
public
List
<
String
>
getLastDayHourRange
(
LocalDateTime
startDateTime
)
{
int
count
=
24
;
int
count
=
24
;
List
<
String
>
list
=
Lists
.
newArrayList
();
List
<
String
>
list
=
Lists
.
newArrayList
();
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
View file @
d7046ca6
...
@@ -354,22 +354,25 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
...
@@ -354,22 +354,25 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
@Override
@Override
public
List
<
PlatElderCoordinateVO
>
coordinateList
(
String
elderId
,
String
deviceId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
public
List
<
PlatElderCoordinateVO
>
coordinateList
(
String
elderId
,
String
deviceId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
List
<
PlatDevice
>
platDeviceList
=
platElderRealTimeService
.
getSpaceDevice
(
elderId
,
deviceId
);
List
<
PlatDevice
>
platDeviceList
Space
=
platElderRealTimeService
.
getSpaceDevice
(
elderId
,
deviceId
);
if
(
CollectionUtils
.
isEmpty
(
platDeviceList
))
{
List
<
PlatDevice
>
platDeviceListFall
=
platElderRealTimeService
.
getFallDevice
(
elderId
,
deviceId
);
if
(
CollectionUtils
.
isEmpty
(
platDeviceListSpace
)
&&
CollectionUtils
.
isEmpty
(
platDeviceListFall
))
{
return
new
ArrayList
<>(
10
);
return
new
ArrayList
<>(
10
);
}
}
List
<
PlatElderCoordinateVO
>
voList
=
new
ArrayList
<>(
10
);
List
<
PlatElderCoordinateVO
>
voList
=
new
ArrayList
<>(
10
);
platDeviceList
.
forEach
(
e
->
{
platDeviceList
Space
.
forEach
(
e
->
{
List
<
DeviceInfoContentSpace
>
spaceList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeSpace
(
e
.
getOriDeviceId
(),
2
*
24
*
3600
,
start
,
end
);
List
<
DeviceInfoContentSpace
>
spaceList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeSpace
(
e
.
getOriDeviceId
(),
2
*
24
*
3600
,
start
,
end
);
voList
.
addAll
(
StreamUtil
.
map
(
spaceList
,
i
->
{
voList
.
addAll
(
StreamUtil
.
map
(
spaceList
,
i
->
{
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
vo
.
setX
(
new
BigDecimal
(
i
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
cos
(
i
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
vo
.
setY
(
new
BigDecimal
(
i
.
getProperties
().
getDistance
()).
multiply
(
new
BigDecimal
(
Math
.
sin
(
i
.
getProperties
().
getAngle
())
+
""
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
// vo.setX(new BigDecimal(i.getProperties().getDistance()).multiply(new BigDecimal(Math.cos(i.getProperties().getAngle()) + "")).setScale(2, RoundingMode.HALF_UP));
// vo.setY(new BigDecimal(i.getProperties().getDistance()).multiply(new BigDecimal(Math.sin(i.getProperties().getAngle()) + "")).setScale(2, RoundingMode.HALF_UP));
vo
.
setDistance
(
i
.
getProperties
().
getDistance
());
vo
.
setDistance
(
i
.
getProperties
().
getDistance
());
vo
.
setAngle
(
i
.
getProperties
().
getAngle
());
vo
.
setAngle
(
i
.
getProperties
().
getAngle
());
...
@@ -384,6 +387,25 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
...
@@ -384,6 +387,25 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
});
});
platDeviceListFall
.
forEach
(
e
->
{
List
<
DeviceInfoContentFall
>
fallList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeFall
(
e
.
getOriDeviceId
(),
2
*
24
*
3600
,
start
,
end
);
voList
.
addAll
(
StreamUtil
.
map
(
fallList
,
i
->
{
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
vo
.
setTrack
(
i
.
getProperties
().
getTrack
());
vo
.
setDeviceId
(
e
.
getId
());
vo
.
setOriDeviceId
(
e
.
getOriDeviceId
());
return
vo
;
})
);
});
return
voList
;
return
voList
;
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
View file @
d7046ca6
This diff is collapsed.
Click to expand it.
server-service/src/main/java/com/makeit/vo/platform/elder/realtime/PlatElderCoordinateVO.java
View file @
d7046ca6
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
@Data
public
class
PlatElderCoordinateVO
{
public
class
PlatElderCoordinateVO
{
...
@@ -14,11 +15,11 @@ public class PlatElderCoordinateVO {
...
@@ -14,11 +15,11 @@ public class PlatElderCoordinateVO {
@ApiModelProperty
(
value
=
"原始设备ID"
)
@ApiModelProperty
(
value
=
"原始设备ID"
)
private
String
oriDeviceId
;
private
String
oriDeviceId
;
@ApiModelProperty
(
"x"
)
//
@ApiModelProperty("x")
private
BigDecimal
x
;
//
private BigDecimal x;
//
@ApiModelProperty
(
"y"
)
//
@ApiModelProperty("y")
private
BigDecimal
y
;
//
private BigDecimal y;
@ApiModelProperty
(
"人体目标距离雷达位置 范围:0-1000,单位cm"
)
@ApiModelProperty
(
"人体目标距离雷达位置 范围:0-1000,单位cm"
)
private
Integer
distance
;
private
Integer
distance
;
...
@@ -26,5 +27,8 @@ public class PlatElderCoordinateVO {
...
@@ -26,5 +27,8 @@ public class PlatElderCoordinateVO {
@ApiModelProperty
(
"人体目标偏离雷达法线角度范围:±60,单位°"
)
@ApiModelProperty
(
"人体目标偏离雷达法线角度范围:±60,单位°"
)
private
Integer
angle
;
private
Integer
angle
;
@ApiModelProperty
(
"跌倒设备轨迹"
)
private
List
<
Integer
>
track
;
}
}
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