Commit 485fdf5c by huangjy

fix:行为记录先造数据

parent cb64927e
......@@ -49,4 +49,5 @@ public interface PlatElderDayReportDayService {
List<PlatElderBehaviorDistributionVO> behaviorDistribution(PlatElderReportDTO platElderIdDTO);
void elderCoordinateListAnalysisTask();
}
......@@ -26,6 +26,7 @@ import com.makeit.utils.time.LocalDateTimeUtils;
import com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO;
import com.makeit.vo.platform.elder.realtime.PlatElderRealTimeHeartRespiratoryVO;
import com.makeit.vo.platform.elder.report.day.*;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -353,6 +354,11 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
}
@Override
public void elderCoordinateListAnalysisTask() {
}
@Override
public List<PlatElderCoordinateVO> coordinateList(String elderId, String deviceId, LocalDateTime start, LocalDateTime end) {
List<PlatDevice> platDeviceList = platElderRealTimeService.getSpaceDevice(elderId, deviceId);
......@@ -362,8 +368,27 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
List<PlatElderCoordinateVO> voList = new ArrayList<>(10);
int count = 20;
for (PlatDevice platDevice : platDeviceList) {
for (int i = 0; i < count; i++) {
PlatElderCoordinateVO vo = new PlatElderCoordinateVO();
int distance = RandomUtils.nextInt(0, 1000);
int angle = RandomUtils.nextInt(0,60) -120;
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);
}
}
/*
platDeviceList.forEach(e -> {
List<DeviceInfoContentSpace> spaceList = iotProductDeviceService.getDeviceLogByTimeRangeSpace(e.getOriDeviceId(), 2 * 24 * 3600, start, end);
List<DeviceInfoContentSpace> spaceList = iotProductDeviceService.getDeviceLogByTimeRangeSpace(e.getOriDeviceId(), 24 * 3600, start, end);
voList.addAll(StreamUtil.map(spaceList, i -> {
......@@ -382,7 +407,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
})
);
});
});*/
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