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