Commit ad18f3cb by huangjy

fix:告警新增误报

parent 9f3670c0
ALTER TABLE `plat_device_other`
ALTER TABLE `plat_device_other`
ALTER TABLE `plat_device_other`
ADD COLUMN `secure_id` varchar(255) COMMENT '密钥id' AFTER `protocol_password`,
ADD COLUMN `secure_key` varchar(255) COMMENT '密钥key' AFTER `secure_id`;
ALTER TABLE `plat_alarm_record`
ADD COLUMN `misinformation_flag` char(1) DEFAULT 0 COMMENT '是否误报 1 误报 0 没有误报' AFTER `read_flag`;
\ No newline at end of file
......@@ -48,6 +48,13 @@ public class PlatAlarmRecordController {
return ApiResponseUtils.success();
}
@ApiOperation("误报")
@PostMapping("misinformation")
public ApiResponseEntity<Void> misinformation(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.misinformation(dto.getId());
return ApiResponseUtils.success();
}
@ApiOperation("未读条数")
@PostMapping("unreadCount")
public ApiResponseEntity<Integer> unreadCount(@RequestBody PlatAlarmRecordQueryDTO dto) {
......
......@@ -50,5 +50,12 @@ public class PlatAlarmRecordChildrenController {
Integer count = platAlarmRecordService.unreadCount(dto);
return ApiResponseUtils.success(count);
}
@ApiOperation("误报")
@PostMapping("misinformation")
public ApiResponseEntity<Void> misinformation(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.misinformation(dto.getId());
return ApiResponseUtils.success();
}
}
......@@ -70,5 +70,12 @@ public class PlatAlarmRecordWechatController {
platAlarmRecordService.noticeRelation(dto.getId());
return ApiResponseUtils.success();
}
@ApiOperation("误报")
@PostMapping("misinformation")
public ApiResponseEntity<Void> misinformation(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.misinformation(dto.getId());
return ApiResponseUtils.success();
}
}
......@@ -88,6 +88,8 @@ public class PlatAlarmRecord extends BaseBusEntity {
@ApiModelProperty(value = "0-未读 1-已读")
private String readFlag;
@ApiModelProperty(value = "是否误报 1 误报 0 没有误报")
private String misinformationFlag;
}
......
......@@ -65,4 +65,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
void read(String id);
Integer unreadCount(PlatAlarmRecordQueryDTO dto);
void misinformation(String id);
}
......@@ -124,9 +124,6 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
public PageVO<PlatAlarmRecordVO> childrenPage(PageReqDTO<PlatAlarmRecordQueryDTO> dto) {
PlatElderChildrenInfo platElderChildrenInfo = platElderChildrenInfoService.getById(WechatUserUtil.getUserId());
log.info("子女端账号:"+platElderChildrenInfo.toString());
if (platElderChildrenInfo == null) {
return new PageVO<>();
}
String elderId = platElderChildrenInfo.getElderId();
if(StringUtils.isBlank(elderId)){
return new PageVO<>();
......@@ -558,4 +555,17 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
LambdaQueryWrapper<PlatAlarmRecord> lambdaQueryWrapper = getLambdaQueryWrapper(dto);
return Math.toIntExact(count(lambdaQueryWrapper));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void misinformation(String id) {
PlatAlarmRecord platAlarmRecord = getById(id);
platAlarmRecord.setMisinformationFlag(CommonEnum.YES.getValue());
platAlarmRecord.setStatus(CommonEnum.YES.getValue());
updateById(platAlarmRecord);
// todo 误报结果写入设备
}
}
......@@ -245,6 +245,7 @@ public class DataScreenServiceImpl implements DataScreenService {
List<PlatAlarmRecord> alarmRecords = platAlarmRecordService.list(new QueryWrapper<PlatAlarmRecord>().lambda()
.between(PlatAlarmRecord::getAlarmDate,dto.getStartTime(),dto.getEndTime())
.isNotNull(PlatAlarmRecord::getElderIds)
.in(PlatAlarmRecord::getMisinformationFlag, CommonEnum.NO.getValue())
.in(PlatAlarmRecord::getOrgId, dto.getOrgIds()));
long total = alarmRecords.size();
long handledNumber = alarmRecords.stream()
......@@ -448,6 +449,7 @@ public class DataScreenServiceImpl implements DataScreenService {
Page<PlatAlarmRecord> pages = platAlarmRecordService.page(p, new QueryWrapper<PlatAlarmRecord>().lambda()
.between(dto.getStartTime()!=null && dto.getEndTime()!=null, PlatAlarmRecord::getAlarmDate,dto.getStartTime(),dto.getEndTime())
.in(PlatAlarmRecord::getOrgId, dto.getOrgIds())
.in(PlatAlarmRecord::getMisinformationFlag, CommonEnum.NO.getValue())
.isNotNull(PlatAlarmRecord::getElderIds)
.orderByDesc(PlatAlarmRecord::getAlarmDate));
List<PlatAlarmRecord> alarmRecords = pages.getRecords();
......
......@@ -61,6 +61,10 @@ public class PlatAlarmRecordVO extends BaseTenantDTO {
@ApiModelProperty(value = "0-未读 1-已读")
private String readFlag;
@ApiModelProperty(value = "是否误报 1 误报 0 没有误报")
private String misinformationFlag;
private String deviceId;
}
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