Commit e199c0f3 by huangjy

Merge remote-tracking branch 'origin/dev' into dev

parents bf60a7ad c3c545d0
...@@ -10,7 +10,6 @@ import com.makeit.common.response.ApiResponseEntity; ...@@ -10,7 +10,6 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO; import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.enums.report.PlatformTypeEnum; import com.makeit.enums.report.PlatformTypeEnum;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.service.platform.alarm.PlatAlarmRecordService; import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.utils.user.common.CommonUserUtil; import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO; import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
...@@ -34,7 +33,7 @@ public class PlatAlarmRecordWechatController { ...@@ -34,7 +33,7 @@ public class PlatAlarmRecordWechatController {
@ApiOperation("列表") @ApiOperation("列表")
@PostMapping("page") @PostMapping("page")
@AuthIgnore // @AuthIgnore
public ApiResponseEntity<Map<String,Object>> page(@RequestBody PageReqDTO<PlatAlarmRecordQueryDTO> dto) { public ApiResponseEntity<Map<String,Object>> page(@RequestBody PageReqDTO<PlatAlarmRecordQueryDTO> dto) {
//小程序告警记录只看到发给自己的告警 //小程序告警记录只看到发给自己的告警
String userId = CommonUserUtil.getUserId(); String userId = CommonUserUtil.getUserId();
......
...@@ -159,17 +159,13 @@ public class OffBedAlarm implements IAlarm { ...@@ -159,17 +159,13 @@ public class OffBedAlarm implements IAlarm {
LocalTime endTimeLimit = endTime.plusMinutes(-duration); LocalTime endTimeLimit = endTime.plusMinutes(-duration);
// 离床时间在范围内 // 离床时间在范围内
if (isInTime && isOverTime) { if (isInTime && isOverTime) {
if (firstTime.isAfter(endTimeLimit)) {
log.info("handleCrossDay 第一次离床时间,{}+持续时间:{}将超过范围,{}", firstTime, duration, endTime);
return;
}
platAlarmCheckDTO.setAbnormalValue(String.valueOf(currentTimeMillis - firstOffBedLong)); platAlarmCheckDTO.setAbnormalValue(String.valueOf(currentTimeMillis - firstOffBedLong));
platAlarmCheckDTO.setPlatAlarmConfig(config); platAlarmCheckDTO.setPlatAlarmConfig(config);
log.info("cross离床告警离床时间在范围时间内,配置:{}", config.getRuleConfig()); log.info("cross离床告警离床时间在范围时间内,配置:{}", config.getRuleConfig());
noticeAlarm(alarmRedisDTO, platAlarmCheckDTO, deviceId); noticeAlarm(alarmRedisDTO, platAlarmCheckDTO, deviceId);
return; return;
} }
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now().plusHours(12).plusMinutes(50);
LocalDateTime startLocalDteTime = LocalDateTime.of(LocalDate.now(), startTime); LocalDateTime startLocalDteTime = LocalDateTime.of(LocalDate.now(), startTime);
if (!isInTime) { if (!isInTime) {
long mills = Duration.between(startLocalDteTime, now).toMillis() / 1000; long mills = Duration.between(startLocalDteTime, now).toMillis() / 1000;
...@@ -198,7 +194,7 @@ public class OffBedAlarm implements IAlarm { ...@@ -198,7 +194,7 @@ public class OffBedAlarm implements IAlarm {
LocalTime startTime = ruleConfig.getOffBedStart(); LocalTime startTime = ruleConfig.getOffBedStart();
LocalDateTime startLocalDteTime = LocalDateTime.of(LocalDate.now(), startTime); LocalDateTime startLocalDteTime = LocalDateTime.of(LocalDate.now(), startTime);
LocalTime endTime = ruleConfig.getOffBedEnd(); LocalTime endTime = ruleConfig.getOffBedEnd();
LocalDateTime endLocalDteTime = LocalDateTime.of(LocalDate.now(), endTime); // LocalDateTime endLocalDteTime = LocalDateTime.of(LocalDate.now(), endTime);
Long firstOffBedLong = alarmRedisDTO.getStartLong(); Long firstOffBedLong = alarmRedisDTO.getStartLong();
long currentTimeMillis = System.currentTimeMillis(); long currentTimeMillis = System.currentTimeMillis();
...@@ -222,7 +218,7 @@ public class OffBedAlarm implements IAlarm { ...@@ -222,7 +218,7 @@ public class OffBedAlarm implements IAlarm {
return; return;
} }
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now().plusHours(12).plusMinutes(50);
LocalTime localTime = LocalTime.now(); LocalTime localTime = LocalTime.now();
if (!isInTime && localTime.isAfter(startTime) && localTime.isBefore(endTime)) { if (!isInTime && localTime.isAfter(startTime) && localTime.isBefore(endTime)) {
long mills = Duration.between(startLocalDteTime, now).toMillis() / 1000; long mills = Duration.between(startLocalDteTime, now).toMillis() / 1000;
......
package com.makeit.iotapi; package com.makeit.iotapi;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO; import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO;
import com.makeit.entity.platform.device.PlatDevice; import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.module.admin.vo.plat.PlatTenantVO; import com.makeit.module.admin.vo.plat.PlatTenantVO;
...@@ -89,6 +91,14 @@ public class IotDeviceInfoContentFall { ...@@ -89,6 +91,14 @@ public class IotDeviceInfoContentFall {
platDevice.setOrgId("1712384736845950978"); platDevice.setOrgId("1712384736845950978");
platDevice.setId("1732609639364812811"); platDevice.setId("1732609639364812811");
platAlarmCheckDTO.setPlatDevice(platDevice); platAlarmCheckDTO.setPlatDevice(platDevice);
JSONObject properties = JSON.parseObject("{\n" +
" \"person\": 0,\n" +
" \"personState\": 0,\n" +
" \"distance\": 50,\n" +
" \"hr\": 80,\n" +
" \"br\": 20,\n" +
" \"bodymove\": 50,\n}");
platAlarmCheckDTO.setProperties(properties);
offBedAlarm.checkConfig(platAlarmCheckDTO); offBedAlarm.checkConfig(platAlarmCheckDTO);
} }
} }
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