Commit 90bdb9e2 by 汪志阳

fix:bug fix

parent ab17c79d
......@@ -386,8 +386,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
*/
private void deepSleepData(TreeMap<String, TreeMap<String, AnalysisVO>> sleepTypeMap, SaasSleepAnalysisModel analysisModel,
List<SleepTimeAnalysisVO> sleepTimeAnalysisVOList) {
int sleepDeepMinute = 0;
String startSleepDeepTime = null;
int sleepDeepActionThreshold = Integer.parseInt(analysisModel.getSleepDeepActionThreshold());
int sleepDeepActionTimeBegin = Integer.parseInt(analysisModel.getSleepDeepActionTimeBegin());
int sleepDeepBreatheMin = Integer.parseInt(analysisModel.getSleepDeepBreatheMin());
......@@ -395,10 +394,12 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
if (CollUtil.isEmpty(sleepTypeMap)) {
return;
}
boolean isDeepSleep = false;
for (Map.Entry<String, TreeMap<String, AnalysisVO>> entry : sleepTypeMap.entrySet()) {
TreeMap<String, AnalysisVO> sleepMap = entry.getValue();
String key = entry.getKey();
int sleepDeepMinute = 0;
String startSleepDeepTime = null;
boolean isDeepSleep = false;
for (Map.Entry<String, AnalysisVO> voEntry : sleepMap.entrySet()) {
AnalysisVO analysisVO = voEntry.getValue();
boolean actionFlag = analysisVO.getActionCount() == sleepDeepActionThreshold;
......@@ -512,14 +513,13 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
int sleepModerateActionThreshold = Integer.parseInt(analysisModel.getSleepModerateActionThreshold());
// 10minute
int sleepModerateActionTimeBegin = Integer.parseInt(analysisModel.getSleepModerateActionTimeBegin());
int sleepMidMinute = 0;
int size = 0;
String startSleepMidTime = null;
boolean isMiddleSleep = false;
for (Map.Entry<String, TreeMap<String, AnalysisVO>> entry : sleepTypeMap.entrySet()) {
TreeMap<String, AnalysisVO> sleepMap = entry.getValue();
String key = entry.getKey();
int sleepMidMinute = 0;
int size = 0;
String startSleepMidTime = null;
for (Map.Entry<String, AnalysisVO> voEntry : sleepMap.entrySet()) {
AnalysisVO analysisVO = voEntry.getValue();
String key1 = voEntry.getKey();
......@@ -570,11 +570,12 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
*/
private void sober(TreeMap<String, TreeMap<String, AnalysisVO>> sleepTypeMap,
List<SleepTimeAnalysisVO> sleepTimeAnalysisVOList) {
int awakeMinute = 0;
String startAwakeTime = null;
for (Map.Entry<String, TreeMap<String, AnalysisVO>> entry : sleepTypeMap.entrySet()) {
TreeMap<String, AnalysisVO> sleepMap = entry.getValue();
String key = entry.getKey();
int awakeMinute = 0;
String startAwakeTime = null;
for (Map.Entry<String, AnalysisVO> voEntry : sleepMap.entrySet()) {
AnalysisVO analysisVO = voEntry.getValue();
if (analysisVO.getAwakeMinuteActionFlag() || analysisVO.getIsMoveBed()) {
......@@ -872,9 +873,13 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
public List<ElderSleepAnalysisVO> elderSleepSleepAnalysisTask(Integer month, Integer day) {
List<String> dayHourRangeList = getLastDayHourRange(month, day);
String currentDate = LocalDate.now().minusDays(1).toString();
LocalDate now = LocalDate.now();
String currentDate = now.minusDays(1).toString();
if (month != null && day != null) {
currentDate = LocalDate.of(2024, month, day).minusDays(1).toString();
}else {
month = now.getMonth().getValue();
day = now.getDayOfMonth();
}
SaasSleepAnalysisModel analysisModel = saasSleepAnalysisModelService.getOne(new QueryWrapper<SaasSleepAnalysisModel>().lambda()
.orderByDesc(BaseEntity::getCreateBy)
......@@ -893,12 +898,12 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
PlatElder elder = platElderService.getOne(new QueryWrapper<PlatElder>().lambda()
.eq(PlatElder::getBedId, bedId));
// || !"1712648603580764161".equals(elder.getId())
if (elder == null|| !"1712648603580764161".equals(elder.getId())) {
if (elder == null) {
continue;
}
PlatDevice platDevice = platDeviceService.getById(platRoomBedDevice.getDeviceId());
// || !"218A00XE2669104".equals(platDevice.getOriDeviceId())
if (platDevice == null|| !"218A00XE2669104".equals(platDevice.getOriDeviceId())) {
if (platDevice == null) {
continue;
}
String tenantId = elder.getTenantId();
......
......@@ -115,7 +115,7 @@ iot:
clientId: fyxmb5h52iKwE2Hi
secureKey: 22fZbnH36wdHn7ZTyKKHraFw233npcez
sync:
enable: false
enable: true
mqtt:
username: admin|1693982115969
......
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