Commit 1a551633 by 罗志长

fix: 坐标数据

parent 633e0bdf
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;
......
......@@ -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(platDeviceListSpace) && CollectionUtils.isEmpty(platDeviceListFall)) {
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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment