Commit b2048f88 by huangjy

fix: 修复

parent edb9d060
...@@ -450,8 +450,26 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -450,8 +450,26 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
List<PlatDevice> deviceListSpace = getSpaceDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId()); List<PlatDevice> deviceListSpace = getSpaceDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
List<PlatDevice> deviceListFall = getFallDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId()); List<PlatDevice> deviceListFall = getFallDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
int count = 20;
for (PlatDevice platDevice : deviceListSpace) {
for (int i = 0; i < count; i++) {
PlatElderCoordinateVO vo = new PlatElderCoordinateVO();
int distance = RandomUtils.nextInt(1, 1000);
int angle = RandomUtils.nextInt(1,180) -120;
if (CollectionUtils.isNotEmpty(deviceListSpace)) { // vo.setX(new BigDecimal(distance).multiply(new BigDecimal(Math.cos(angle) + "")).setScale(2, RoundingMode.HALF_UP));
// vo.setY(new BigDecimal(distance).multiply(new BigDecimal(Math.sin(angle) + "")).setScale(2, RoundingMode.HALF_UP));
vo.setDistance(distance);
vo.setAngle(angle);
vo.setDeviceId(platDevice.getId());
vo.setOriDeviceId(platDevice.getOriDeviceId());
voList.add(vo);
}
}
/* if (CollectionUtils.isNotEmpty(deviceListSpace)) {
deviceListSpace.forEach(e -> { deviceListSpace.forEach(e -> {
DeviceInfoContentSpace i = iotProductDeviceService.getLastDeviceLogSpace(e.getOriDeviceId(), 10); DeviceInfoContentSpace i = iotProductDeviceService.getLastDeviceLogSpace(e.getOriDeviceId(), 10);
if (i == null) { if (i == null) {
...@@ -491,7 +509,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -491,7 +509,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
voList.add(vo); voList.add(vo);
}); });
} }*/
return voList; return voList;
} }
......
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