Commit d0122b7d by 杨伟程
parents e87c2b82 e2bff2fd
...@@ -22,7 +22,7 @@ public class SaasRoleDTOVO extends BaseIdDTO implements Serializable { ...@@ -22,7 +22,7 @@ public class SaasRoleDTOVO extends BaseIdDTO implements Serializable {
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
private String name; private String name;
@NotBlank(message = "编码不能为空") // @NotBlank(message = "编码不能为空")
@Size(max = 64, message = "编码最长为64字符") @Size(max = 64, message = "编码最长为64字符")
@Pattern(regexp = "[a-zA-Z0-9]{0,64}", message = "编码只能为大小写英文字符和数字") @Pattern(regexp = "[a-zA-Z0-9]{0,64}", message = "编码只能为大小写英文字符和数字")
@ApiModelProperty(value = "编码") @ApiModelProperty(value = "编码")
......
...@@ -112,13 +112,12 @@ public class BehaviorAlarm implements IAlarm { ...@@ -112,13 +112,12 @@ public class BehaviorAlarm implements IAlarm {
if (duration!= 0 && count / 1000 >= duration && StringUtils.equals(alarmRedisDTO.getAlarm(), CommonEnum.NO.getValue())) { if (duration!= 0 && count / 1000 >= duration && StringUtils.equals(alarmRedisDTO.getAlarm(), CommonEnum.NO.getValue())) {
log.error("空间雷达发出告警,设备plat_id:" + platDevice.getId()); log.error("空间雷达发出告警,设备plat_id:" + platDevice.getId());
if(duration1 != 0) { if(duration1 != 0) {
alarmRedisDTO.setAlarm(CommonEnum.YES.getValue());
RedisUtil.set(RedisConst.ALARM_DEVICE_BEHAVIOR_ID + deviceId, alarmRedisDTO);
notice(platAlarmCheckDTO); notice(platAlarmCheckDTO);
}else { }else {
return; return;
} }
alarmRedisDTO.setAlarm(CommonEnum.YES.getValue());
RedisUtil.set(RedisConst.ALARM_DEVICE_BEHAVIOR_ID + deviceId, alarmRedisDTO);
} }
} else {//没人 } else {//没人
......
...@@ -121,11 +121,12 @@ public class BreathAlarm implements IAlarm { ...@@ -121,11 +121,12 @@ public class BreathAlarm implements IAlarm {
} }
fillRemark(platAlarmCheckDTO, br, start, end); fillRemark(platAlarmCheckDTO, br, start, end);
platAlarmCheckDTO.setAbnormalValue(Convert.toStr(br)); platAlarmCheckDTO.setAbnormalValue(Convert.toStr(br));
notice(platAlarmCheckDTO);
alarmRedisDTO.setStartLong(endLong); alarmRedisDTO.setStartLong(endLong);
alarmRedisDTO.setStart(now); alarmRedisDTO.setStart(now);
alarmRedisDTO.setAlarm(CommonEnum.YES.getValue()); alarmRedisDTO.setAlarm(CommonEnum.YES.getValue());
RedisUtil.set(RedisConst.ALARM_DEVICE_BR_ID + deviceId, alarmRedisDTO); RedisUtil.set(RedisConst.ALARM_DEVICE_BR_ID + deviceId, alarmRedisDTO);
notice(platAlarmCheckDTO);
} }
} else { } else {
RedisUtil.delete(RedisConst.ALARM_DEVICE_BR_ID + deviceId); RedisUtil.delete(RedisConst.ALARM_DEVICE_BR_ID + deviceId);
......
...@@ -57,9 +57,9 @@ public class FallAlarm implements IAlarm { ...@@ -57,9 +57,9 @@ public class FallAlarm implements IAlarm {
log.error("长者跌倒,已告警过,设备plat_id:"+deviceId); log.error("长者跌倒,已告警过,设备plat_id:"+deviceId);
return; return;
} }
notice(platAlarmCheckDTO);
alarmRedisDTO.setAlarm(CommonEnum.YES.getValue()); alarmRedisDTO.setAlarm(CommonEnum.YES.getValue());
RedisUtil.set(RedisConst.ALARM_DEVICE_FALL_ID+ deviceId, alarmRedisDTO); RedisUtil.set(RedisConst.ALARM_DEVICE_FALL_ID+ deviceId, alarmRedisDTO);
notice(platAlarmCheckDTO);
} else { } else {
if(StringUtils.equals(alarmRedisDTO.getAlarm(),CommonEnum.YES.getValue())) { if(StringUtils.equals(alarmRedisDTO.getAlarm(),CommonEnum.YES.getValue())) {
alarmRedisDTO.setAlarm(CommonEnum.NO.getValue()); alarmRedisDTO.setAlarm(CommonEnum.NO.getValue());
......
...@@ -110,11 +110,12 @@ public class HeartAlarm implements IAlarm { ...@@ -110,11 +110,12 @@ public class HeartAlarm implements IAlarm {
} }
fillRemark(platAlarmCheckDTO, hr, start, end); fillRemark(platAlarmCheckDTO, hr, start, end);
platAlarmCheckDTO.setAbnormalValue(Convert.toStr(hr)); platAlarmCheckDTO.setAbnormalValue(Convert.toStr(hr));
notice(platAlarmCheckDTO);
alarmRedisDTO.setStartLong(endLong); alarmRedisDTO.setStartLong(endLong);
alarmRedisDTO.setStart(now); alarmRedisDTO.setStart(now);
alarmRedisDTO.setAlarm(CommonEnum.YES.getValue()); alarmRedisDTO.setAlarm(CommonEnum.YES.getValue());
RedisUtil.set(RedisConst.ALARM_DEVICE_HR_ID + deviceId, alarmRedisDTO); RedisUtil.set(RedisConst.ALARM_DEVICE_HR_ID + deviceId, alarmRedisDTO);
notice(platAlarmCheckDTO);
} }
} else { } else {
......
...@@ -83,7 +83,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -83,7 +83,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
.eq(StringUtils.isNotBlank(dto.getStatus()), PlatDevice::getStatus, dto.getStatus()) .eq(StringUtils.isNotBlank(dto.getStatus()), PlatDevice::getStatus, dto.getStatus())
.like(StringUtils.isNotBlank(dto.getProductName()), PlatDevice::getProductName, dto.getProductName()) .like(StringUtils.isNotBlank(dto.getProductName()), PlatDevice::getProductName, dto.getProductName())
.eq(StringUtils.isNotBlank(dto.getProductId()), PlatDevice::getProductId, dto.getProductId()) .eq(StringUtils.isNotBlank(dto.getProductId()), PlatDevice::getProductId, dto.getProductId())
.apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)") .eq(StringUtils.isNotBlank(dto.getOrgId()),PlatDevice::getOrgId,dto.getOrgId())
// .apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)")
.orderByDesc(BaseEntity::getUpdateDate)
); );
List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(page.getRecords(), PlatDeviceListVO.class); List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(page.getRecords(), PlatDeviceListVO.class);
......
...@@ -95,13 +95,13 @@ implements SaasRoleService{ ...@@ -95,13 +95,13 @@ implements SaasRoleService{
} }
oldList = list(new QueryWrapper<SaasRole>().lambda() // oldList = list(new QueryWrapper<SaasRole>().lambda()
.eq(SaasRole::getCode, dto.getCode())); // .eq(SaasRole::getCode, dto.getCode()));
for (SaasRole old : oldList) { // for (SaasRole old : oldList) {
if (old != null && !old.getId().equals(dto.getId())) { // if (old != null && !old.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_CODE_DUPLICATE); // throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_CODE_DUPLICATE);
} // }
} // }
} }
......
...@@ -106,6 +106,9 @@ public class PushCallback implements MqttCallback { ...@@ -106,6 +106,9 @@ public class PushCallback implements MqttCallback {
for (PlatAlarmConfig config : deviceAlarmConfigList) { for (PlatAlarmConfig config : deviceAlarmConfigList) {
String alarmType = config.getAlarmType(); String alarmType = config.getAlarmType();
for (IAlarm alarm : alarmList) {
if (alarm.support(alarmType)) {
//防止呼吸心率的数据交叉
PlatAlarmCheckDTO platAlarmCheckDTO = new PlatAlarmCheckDTO(); PlatAlarmCheckDTO platAlarmCheckDTO = new PlatAlarmCheckDTO();
//告警配置 //告警配置
platAlarmCheckDTO.setPlatAlarmConfig(config); platAlarmCheckDTO.setPlatAlarmConfig(config);
...@@ -113,9 +116,6 @@ public class PushCallback implements MqttCallback { ...@@ -113,9 +116,6 @@ public class PushCallback implements MqttCallback {
platAlarmCheckDTO.setPlatDevice(platDevice); platAlarmCheckDTO.setPlatDevice(platDevice);
//iot上报数据 //iot上报数据
platAlarmCheckDTO.setProperties(properties); platAlarmCheckDTO.setProperties(properties);
for (IAlarm alarm : alarmList) {
if (alarm.support(alarmType)) {
alarm.checkConfig(platAlarmCheckDTO); alarm.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