Commit 067657db by 汪志阳

fix:去除日志打印

parent ebc05efb
...@@ -12,6 +12,7 @@ import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO; ...@@ -12,6 +12,7 @@ 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.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.vo.platform.alarm.PlatAlarmRecordVO; import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -36,7 +37,8 @@ public class PlatAlarmRecordWechatController { ...@@ -36,7 +37,8 @@ public class PlatAlarmRecordWechatController {
@AuthIgnore @AuthIgnore
public ApiResponseEntity<Map<String,Object>> page(@RequestBody PageReqDTO<PlatAlarmRecordQueryDTO> dto) { public ApiResponseEntity<Map<String,Object>> page(@RequestBody PageReqDTO<PlatAlarmRecordQueryDTO> dto) {
//小程序告警记录只看到发给自己的告警 //小程序告警记录只看到发给自己的告警
String userId = "1700085146788667394"; String userId = CommonUserUtil.getUserId();
// String userId = "1700085146788667394";
PlatAlarmRecordQueryDTO data = dto.getData(); PlatAlarmRecordQueryDTO data = dto.getData();
data.setNotifyUser(userId); data.setNotifyUser(userId);
......
package com.makeit.service.platform.alarm.alarmStrategy; package com.makeit.service.platform.alarm.alarmStrategy;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO; import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO;
import com.makeit.dto.platform.alarm.PlatAlarmConfigOffBedDTOVO; import com.makeit.dto.platform.alarm.PlatAlarmConfigOffBedDTOVO;
...@@ -60,26 +59,26 @@ public class OffBedAlarm implements IAlarm { ...@@ -60,26 +59,26 @@ public class OffBedAlarm implements IAlarm {
} }
PlatAlarmConfig config = alarmConfigCacheUtil.get(platDevice.getOrgId(), PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED.getValue()); PlatAlarmConfig config = alarmConfigCacheUtil.get(platDevice.getOrgId(), PlatAlarmConfigEnum.AlarmTypeEnum.OFF_BED.getValue());
if (config == null || StringUtils.isBlank(config.getRuleConfig()) || !"5".equals(config.getAlarmType())) { if (config == null || StringUtils.isBlank(config.getRuleConfig()) || !"5".equals(config.getAlarmType())) {
log.error("离床告警配置不存在,config:{}", JSONUtil.toJsonStr(config)); // log.error("离床告警配置不存在,config:{}", JSONUtil.toJsonStr(config));
return; return;
} }
if (CommonEnum.NO.getValue().equals(config.getStatus())) { if (CommonEnum.NO.getValue().equals(config.getStatus())) {
log.error("离床告警配置为禁用,告警配置id:" + config.getId()); // log.error("离床告警配置为禁用,告警配置id:" + config.getId());
return; return;
} }
// String ruleConfigStr = "{\"offBedStart\":\"23:07:00\",\"offBedEnd\":\"00:00:00\",\"duration\":\"1\"}"; // String ruleConfigStr = "{\"offBedStart\":\"23:07:00\",\"offBedEnd\":\"00:00:00\",\"duration\":\"1\"}";
String ruleConfigStr = config.getRuleConfig(); String ruleConfigStr = config.getRuleConfig();
if (StringUtils.isBlank(ruleConfigStr)) { if (StringUtils.isBlank(ruleConfigStr)) {
log.error("离床告警配置未配置,告警配置id:" + config.getId()); // log.error("离床告警配置未配置,告警配置id:" + config.getId());
return; return;
} }
PlatAlarmConfigOffBedDTOVO ruleConfig = JsonUtil.toObj(ruleConfigStr, PlatAlarmConfigOffBedDTOVO.class); PlatAlarmConfigOffBedDTOVO ruleConfig = JsonUtil.toObj(ruleConfigStr, PlatAlarmConfigOffBedDTOVO.class);
if (ruleConfig == null) { if (ruleConfig == null) {
log.error("离床告警配置解析失败,config:{}", JSONUtil.toJsonStr(config)); // log.error("离床告警配置解析失败,config:{}", JSONUtil.toJsonStr(config));
return; return;
} }
if (ruleConfig.getOffBedStart() == null || ruleConfig.getOffBedEnd() == null) { if (ruleConfig.getOffBedStart() == null || ruleConfig.getOffBedEnd() == null) {
log.error("离床告警配置时间不能为空,config:{}", JSONUtil.toJsonStr(config)); // log.error("离床告警配置时间不能为空,config:{}", JSONUtil.toJsonStr(config));
return; return;
} }
JSONObject properties = platAlarmCheckDTO.getProperties(); JSONObject properties = platAlarmCheckDTO.getProperties();
...@@ -90,7 +89,7 @@ public class OffBedAlarm implements IAlarm { ...@@ -90,7 +89,7 @@ public class OffBedAlarm implements IAlarm {
LocalTime startTime = ruleConfig.getOffBedStart(); LocalTime startTime = ruleConfig.getOffBedStart();
LocalTime endTime = ruleConfig.getOffBedEnd(); LocalTime endTime = ruleConfig.getOffBedEnd();
if (startTime == null || endTime == null || startTime.equals(endTime)) { if (startTime == null || endTime == null || startTime.equals(endTime)) {
log.error("离床告警配置时间段解析失败,config:{}", JSONUtil.toJsonStr(ruleConfig)); // log.error("离床告警配置时间段解析失败,config:{}", JSONUtil.toJsonStr(ruleConfig));
return; return;
} }
// 00:00 -> 23:59:59999 // 00:00 -> 23:59:59999
...@@ -101,7 +100,6 @@ public class OffBedAlarm implements IAlarm { ...@@ -101,7 +100,6 @@ public class OffBedAlarm implements IAlarm {
String personState = Convert.toStr(properties.get("person")); String personState = Convert.toStr(properties.get("person"));
boolean isOffBed = "0".equals(personState); boolean isOffBed = "0".equals(personState);
// 1-有人 0-无人 // 1-有人 0-无人
log.info("离床告警config:{}", JSONUtil.toJsonStr(properties));
AlarmRedisDTO alarmRedisDTO = RedisUtil.get(RedisConst.ALARM_DEVICE_OFF_BED_ID + deviceId); AlarmRedisDTO alarmRedisDTO = RedisUtil.get(RedisConst.ALARM_DEVICE_OFF_BED_ID + deviceId);
if (!isOffBed && alarmRedisDTO != null) { if (!isOffBed && alarmRedisDTO != null) {
log.info("离床告警有人状态下,删除redis!"); log.info("离床告警有人状态下,删除redis!");
...@@ -122,7 +120,7 @@ public class OffBedAlarm implements IAlarm { ...@@ -122,7 +120,7 @@ public class OffBedAlarm implements IAlarm {
Long firstOffBedLong = alarmRedisDTO.getStartLong(); Long firstOffBedLong = alarmRedisDTO.getStartLong();
LocalDateTime firstOffBedTime = longToTime(firstOffBedLong); LocalDateTime firstOffBedTime = longToTime(firstOffBedLong);
log.info("离床警第一次离床时间为:" + firstOffBedTime); log.info("离床警第一次离床时间为:" + firstOffBedTime);
if ("1".equals(alarmRedisDTO.getAlarm())) { if ("1".equals(alarmRedisDTO.getAlarm())) {
log.info("离床告警已发送预警过!"); log.info("离床告警已发送预警过!");
return; return;
...@@ -197,9 +195,6 @@ public class OffBedAlarm implements IAlarm { ...@@ -197,9 +195,6 @@ 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();
if (LocalTime.MIN.equals(endTime)) {
endTime = LocalTime.MAX;
}
// LocalDateTime endLocalDteTime = LocalDateTime.of(LocalDate.now(), endTime); // LocalDateTime endLocalDteTime = LocalDateTime.of(LocalDate.now(), endTime);
Long firstOffBedLong = alarmRedisDTO.getStartLong(); Long firstOffBedLong = alarmRedisDTO.getStartLong();
...@@ -286,23 +281,23 @@ public class OffBedAlarm implements IAlarm { ...@@ -286,23 +281,23 @@ public class OffBedAlarm implements IAlarm {
List<PlatElder> platElderList = platAlarmCheckDTO.getPlatElderList(); List<PlatElder> platElderList = platAlarmCheckDTO.getPlatElderList();
PlatAlarmConfig config = platAlarmCheckDTO.getPlatAlarmConfig(); PlatAlarmConfig config = platAlarmCheckDTO.getPlatAlarmConfig();
if (CommonEnum.NO.getValue().equals(config.getStatus())) { if (CommonEnum.NO.getValue().equals(config.getStatus())) {
log.error("离床告警配置为禁用,告警配置id:" + config.getId()); // log.error("离床告警配置为禁用,告警配置id:" + config.getId());
return; return;
} }
if (StringUtils.isBlank(config.getRuleConfig())) { if (StringUtils.isBlank(config.getRuleConfig())) {
log.error("离床告警配置未配置,告警配置id:" + config.getId()); // log.error("离床告警配置未配置,告警配置id:" + config.getId());
return; return;
} }
if (CollectionUtils.isEmpty(platElderList)) { if (CollectionUtils.isEmpty(platElderList)) {
log.error("离床告警配置未关联长者,设备plat_id:" + platDevice.getId()); // log.error("离床告警配置未关联长者,设备plat_id:" + platDevice.getId());
return; return;
} }
// PlatRoom platRoom = platAlarmCheckDTO.getPlatRoom(); // PlatRoom platRoom = platAlarmCheckDTO.getPlatRoom();
for (PlatElder platElder : platElderList) { for (PlatElder platElder : platElderList) {
if (!platElder.getOrgId().equals(config.getOrgId())) { // if (!platElder.getOrgId().equals(config.getOrgId())) {
log.info("长者不再配置组织内:长者:{},config:{}", platElder.getName(), config.getRuleConfig()); // log.info("长者不再配置组织内:长者:{},config:{}", platElder.getName(), config.getRuleConfig());
continue; // continue;
} // }
List<String> param = new ArrayList<>(); List<String> param = new ArrayList<>();
// param.add(platRoom.getName()); // param.add(platRoom.getName());
param.add(platElder.getName()); param.add(platElder.getName());
......
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