Commit 1a551633 by 罗志长

fix: 坐标数据

parent 633e0bdf
package com.makeit.dto.platform.elder.es; package com.makeit.dto.platform.elder.es;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -21,7 +20,6 @@ public class PlatElderCoordinateDTO { ...@@ -21,7 +20,6 @@ public class PlatElderCoordinateDTO {
*/ */
private String tenantId; private String tenantId;
/** /**
* 创建时间 * 创建时间
*/ */
...@@ -33,6 +31,21 @@ public class PlatElderCoordinateDTO { ...@@ -33,6 +31,21 @@ public class PlatElderCoordinateDTO {
private Integer type; private Integer type;
/** /**
* 人体目标距离雷达位置
*/
private Integer distance;
/**
* 人体目标偏离雷达法线角度范围:±60,单位°
*/
private Integer angle;
/**
* 安装方式
*/
private Integer mount;
/**
* 空间人感:0表示无人,1表示活动, 2表示微动 ,3表示静止 ,跌倒设备:0无人,1跌倒 * 空间人感:0表示无人,1表示活动, 2表示微动 ,3表示静止 ,跌倒设备:0无人,1跌倒
*/ */
private Integer personState; private Integer personState;
......
...@@ -469,44 +469,54 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe ...@@ -469,44 +469,54 @@ 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) {
// 主要为了获取track,空间设备没有该字段,所以去除 List<PlatDevice> platDeviceListSpace = platElderRealTimeService.getSpaceDevice(elderId, deviceId);
// List<PlatDevice> platDeviceListSpace = platElderRealTimeService.getSpaceDevice(elderId, deviceId);
List<PlatDevice> platDeviceListFall = platElderRealTimeService.getFallDevice(elderId, deviceId); List<PlatDevice> platDeviceListFall = platElderRealTimeService.getFallDevice(elderId, deviceId);
if (CollectionUtils.isEmpty(platDeviceListFall)) { if (CollectionUtils.isEmpty(platDeviceListSpace) && CollectionUtils.isEmpty(platDeviceListFall)) {
return new ArrayList<>(10); return new ArrayList<>();
} }
List<PlatElderCoordinateVO> voList = new ArrayList<>(10); List<PlatElderCoordinateVO> voList = new ArrayList<>(10);
// platDeviceListSpace.forEach(e -> { platDeviceListSpace.forEach(e -> {
// List<DeviceInfoContentSpace> spaceList = iotProductDeviceService.getDeviceLogByTimeRangeSpace(e.getOriDeviceId(), 24 * 3600, start, end); List<DeviceInfoContentSpace> spaceList = iotProductDeviceService.getDeviceLogByTimeRangeSpace(e.getOriDeviceId(), 24 * 3600, start, end);
// voList.addAll(StreamUtil.map(spaceList, i -> { Map<String, Boolean> existMap = new HashMap<>();
// for (DeviceInfoContentSpace deviceInfoContentSpace : spaceList) {
// PlatElderCoordinateVO vo = new PlatElderCoordinateVO(); DeviceInfoContentSpace.Properties properties = deviceInfoContentSpace.getProperties();
// vo.setTimestamp(i.getTimestamp()); // 侧装 0 轨迹模式1 才有距离和角度
// vo.setDistance(i.getProperties().getDistance()); if (properties == null || properties.getMount() == null || properties.getMode() == null) {
// vo.setAngle(i.getProperties().getAngle()); continue;
// vo.setType(1); }
// vo.setPersonState(i.getProperties().getPersonState()); if (!(properties.getMount() == 0 && properties.getMode() == 1)) {
// vo.setMount(i.getProperties().getMount()); continue;
// vo.setDeviceId(e.getId()); }
// vo.setOriDeviceId(e.getOriDeviceId()); if (properties.getAngle() == null || properties.getDistance() == null) {
// continue;
// return vo; }
// 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 -> { platDeviceListFall.forEach(e -> {
List<DeviceInfoContentFall> fallList = iotProductDeviceService.getDeviceLogByTimeRangeFall(e.getOriDeviceId(), 2 * 24 * 3600, start, end); List<DeviceInfoContentFall> fallList = iotProductDeviceService.getDeviceLogByTimeRangeFall(e.getOriDeviceId(), 2 * 24 * 3600, start, end);
Map<String, Boolean> existMap = new HashMap<>(); Map<String, Boolean> existMap = new HashMap<>();
for (DeviceInfoContentFall deviceInfoContentFall : fallList) { for (DeviceInfoContentFall deviceInfoContentFall : fallList) {
DeviceInfoContentFall.Properties properties = deviceInfoContentFall.getProperties(); DeviceInfoContentFall.Properties properties = deviceInfoContentFall.getProperties();
if (properties == null || CollectionUtils.isEmpty(properties.getTrack())) { if (properties == null || (CollectionUtils.isEmpty(properties.getTrack()))) {
continue; continue;
} }
String key = deviceInfoContentFall.getDeviceId() + "_" + JSONObject.toJSONString(properties.getTrack()); 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