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
1a551633
authored
Jan 11, 2024
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 坐标数据
parent
633e0bdf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
27 deletions
server-service/src/main/java/com/makeit/dto/platform/elder/es/PlatElderCoordinateDTO.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
server-service/src/main/java/com/makeit/dto/platform/elder/es/PlatElderCoordinateDTO.java
View file @
1a551633
package
com
.
makeit
.
dto
.
platform
.
elder
.
es
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
...
...
@@ -21,7 +20,6 @@ public class PlatElderCoordinateDTO {
*/
private
String
tenantId
;
/**
* 创建时间
*/
...
...
@@ -33,6 +31,21 @@ public class PlatElderCoordinateDTO {
private
Integer
type
;
/**
* 人体目标距离雷达位置
*/
private
Integer
distance
;
/**
* 人体目标偏离雷达法线角度范围:±60,单位°
*/
private
Integer
angle
;
/**
* 安装方式
*/
private
Integer
mount
;
/**
* 空间人感:0表示无人,1表示活动, 2表示微动 ,3表示静止 ,跌倒设备:0无人,1跌倒
*/
private
Integer
personState
;
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderDayReportDayServiceImpl.java
View file @
1a551633
...
...
@@ -469,44 +469,54 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
@Override
public
List
<
PlatElderCoordinateVO
>
coordinateList
(
String
elderId
,
String
deviceId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
// 主要为了获取track,空间设备没有该字段,所以去除
// List<PlatDevice> platDeviceListSpace = platElderRealTimeService.getSpaceDevice(elderId, deviceId);
List
<
PlatDevice
>
platDeviceListSpace
=
platElderRealTimeService
.
getSpaceDevice
(
elderId
,
deviceId
);
List
<
PlatDevice
>
platDeviceListFall
=
platElderRealTimeService
.
getFallDevice
(
elderId
,
deviceId
);
if
(
CollectionUtils
.
isEmpty
(
platDeviceListFall
))
{
return
new
ArrayList
<>(
10
);
if
(
CollectionUtils
.
isEmpty
(
platDeviceList
Space
)
&&
CollectionUtils
.
isEmpty
(
platDeviceList
Fall
))
{
return
new
ArrayList
<>();
}
List
<
PlatElderCoordinateVO
>
voList
=
new
ArrayList
<>(
10
);
// platDeviceListSpace.forEach(e -> {
// List<DeviceInfoContentSpace> spaceList = iotProductDeviceService.getDeviceLogByTimeRangeSpace(e.getOriDeviceId(), 24 * 3600, start, end);
// voList.addAll(StreamUtil.map(spaceList, i -> {
//
// PlatElderCoordinateVO vo = new PlatElderCoordinateVO();
// vo.setTimestamp(i.getTimestamp());
// vo.setDistance(i.getProperties().getDistance());
// vo.setAngle(i.getProperties().getAngle());
// vo.setType(1);
// vo.setPersonState(i.getProperties().getPersonState());
// vo.setMount(i.getProperties().getMount());
// vo.setDeviceId(e.getId());
// vo.setOriDeviceId(e.getOriDeviceId());
//
// return vo;
//
// })
// );
//
// });
platDeviceListSpace
.
forEach
(
e
->
{
List
<
DeviceInfoContentSpace
>
spaceList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeSpace
(
e
.
getOriDeviceId
(),
24
*
3600
,
start
,
end
);
Map
<
String
,
Boolean
>
existMap
=
new
HashMap
<>();
for
(
DeviceInfoContentSpace
deviceInfoContentSpace
:
spaceList
)
{
DeviceInfoContentSpace
.
Properties
properties
=
deviceInfoContentSpace
.
getProperties
();
// 侧装 0 轨迹模式1 才有距离和角度
if
(
properties
==
null
||
properties
.
getMount
()
==
null
||
properties
.
getMode
()
==
null
)
{
continue
;
}
if
(!(
properties
.
getMount
()
==
0
&&
properties
.
getMode
()
==
1
))
{
continue
;
}
if
(
properties
.
getAngle
()
==
null
||
properties
.
getDistance
()
==
null
)
{
continue
;
}
String
key
=
deviceInfoContentSpace
.
getDeviceId
()
+
"_"
+
properties
.
getDistance
()
+
"_"
+
properties
.
getAngle
();
if
(!
existMap
.
containsKey
(
key
))
{
existMap
.
put
(
key
,
true
);
PlatElderCoordinateVO
vo
=
new
PlatElderCoordinateVO
();
vo
.
setTimestamp
(
deviceInfoContentSpace
.
getTimestamp
());
vo
.
setAngle
(
properties
.
getAngle
());
vo
.
setDistance
(
properties
.
getDistance
());
vo
.
setDeviceId
(
e
.
getId
());
vo
.
setType
(
2
);
vo
.
setPersonState
(
properties
.
getPersonState
());
vo
.
setMount
(
properties
.
getMount
());
vo
.
setOriDeviceId
(
e
.
getOriDeviceId
());
voList
.
add
(
vo
);
}
}
});
platDeviceListFall
.
forEach
(
e
->
{
List
<
DeviceInfoContentFall
>
fallList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeFall
(
e
.
getOriDeviceId
(),
2
*
24
*
3600
,
start
,
end
);
Map
<
String
,
Boolean
>
existMap
=
new
HashMap
<>();
for
(
DeviceInfoContentFall
deviceInfoContentFall
:
fallList
)
{
DeviceInfoContentFall
.
Properties
properties
=
deviceInfoContentFall
.
getProperties
();
if
(
properties
==
null
||
CollectionUtils
.
isEmpty
(
properties
.
getTrack
(
)))
{
if
(
properties
==
null
||
(
CollectionUtils
.
isEmpty
(
properties
.
getTrack
()
)))
{
continue
;
}
String
key
=
deviceInfoContentFall
.
getDeviceId
()
+
"_"
+
JSONObject
.
toJSONString
(
properties
.
getTrack
());
...
...
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