Commit 0e53f7c2 by 汪志阳

fix:起床清醒时间判断

parent 7e54fc62
...@@ -12,6 +12,7 @@ import com.makeit.global.annotation.AuthIgnore; ...@@ -12,6 +12,7 @@ import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore; import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.device.PlatDeviceService; import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.platform.elder.*; import com.makeit.service.platform.elder.*;
import com.makeit.vo.platform.elder.wakeUpAnalysisVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -151,5 +152,14 @@ public class PlatElderSleepController { ...@@ -151,5 +152,14 @@ public class PlatElderSleepController {
huiNengService.bodyAlarm("1712384736845950978","219A04X1856F6D8",jsonObject); huiNengService.bodyAlarm("1712384736845950978","219A04X1856F6D8",jsonObject);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
@ApiOperation("起床测试")
@GetMapping("getup")
@AuthIgnore
@TenantIdIgnore
public ApiResponseEntity<List<wakeUpAnalysisVO>> elderGetUpAnalysisTask(@RequestParam Integer month,
@RequestParam Integer day) {
return ApiResponseUtils.success(platElderBreatheAnalysisService.elderGetUpAnalysisTask(month, day));
}
} }
...@@ -2,6 +2,7 @@ package com.makeit.service.platform.elder; ...@@ -2,6 +2,7 @@ package com.makeit.service.platform.elder;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.entity.platform.elder.PlatElderBreatheAnalysis; import com.makeit.entity.platform.elder.PlatElderBreatheAnalysis;
import com.makeit.vo.platform.elder.wakeUpAnalysisVO;
import java.util.List; import java.util.List;
...@@ -16,4 +17,6 @@ import java.util.List; ...@@ -16,4 +17,6 @@ import java.util.List;
public interface PlatElderBreatheAnalysisService extends IService<PlatElderBreatheAnalysis> { public interface PlatElderBreatheAnalysisService extends IService<PlatElderBreatheAnalysis> {
List<PlatElderBreatheAnalysis> elderHeartRespiratoryAnalysisTask(Integer month, Integer day); List<PlatElderBreatheAnalysis> elderHeartRespiratoryAnalysisTask(Integer month, Integer day);
List<wakeUpAnalysisVO> elderGetUpAnalysisTask(Integer month, Integer day);
} }
...@@ -89,11 +89,6 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper, ...@@ -89,11 +89,6 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
public List<PlatElderSleepAnalysis> elderSleepSleepAnalysisTask(Integer month,Integer day) { public List<PlatElderSleepAnalysis> elderSleepSleepAnalysisTask(Integer month,Integer day) {
List<String> dayHourRangeList = getLastDayHourRange(month,day); List<String> dayHourRangeList = getLastDayHourRange(month,day);
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(new Date());
// calendar.add(Calendar.DAY_OF_MONTH, -1);
// Date previousDate = calendar.getTime();
// String currentDate = DateUtil.format(previousDate, DatePattern.NORM_DATE_PATTERN);
String currentDate = LocalDate.now().minusDays(1).toString(); String currentDate = LocalDate.now().minusDays(1).toString();
if(month != null && day != null){ if(month != null && day != null){
currentDate = LocalDate.of(2023, month, day).minusDays(1).toString(); currentDate = LocalDate.of(2023, month, day).minusDays(1).toString();
...@@ -155,6 +150,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper, ...@@ -155,6 +150,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
.filter(deviceOperationLogEntity -> deviceOperationLogEntity.getType().contains("reportProperty")) .filter(deviceOperationLogEntity -> deviceOperationLogEntity.getType().contains("reportProperty"))
.map(deviceOperationLogEntity -> { .map(deviceOperationLogEntity -> {
DeviceInfoContentBreathe deviceInfoContentBreathe = JsonUtil.toObj((String) deviceOperationLogEntity.getContent(), DeviceInfoContentBreathe.class); DeviceInfoContentBreathe deviceInfoContentBreathe = JsonUtil.toObj((String) deviceOperationLogEntity.getContent(), DeviceInfoContentBreathe.class);
assert deviceInfoContentBreathe != null;
deviceInfoContentBreathe.setReportTime(formatLongTime(deviceInfoContentBreathe.getTimestamp())); deviceInfoContentBreathe.setReportTime(formatLongTime(deviceInfoContentBreathe.getTimestamp()));
return deviceInfoContentBreathe; return deviceInfoContentBreathe;
}) })
......
package com.makeit.vo.platform.elder;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author wangzy
* @description
* @createDate 2023-12-29-14:48
*/
@Data
public class wakeUpAnalysisVO {
private List<LocalDateTime> wakeUpList;
private List<LocalDateTime> leaveOverTimeList;
private String elderId;
private String name;
}
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