Commit b2f6f7d7 by 李小龙

fix: 告警记录 已读状态

parent 46a41d97
......@@ -36,5 +36,12 @@ public class PlatAlarmRecordChildrenController {
public ApiResponseEntity<PlatAlarmRecordVO> view(@RequestBody BaseIdDTO dto) {
return ApiResponseUtils.success(platAlarmRecordService.view(dto.getId()));
}
@ApiOperation("已读")
@PostMapping("read")
public ApiResponseEntity<Void> read(@RequestBody BaseIdDTO dto) {
platAlarmRecordService.read(dto.getId());
return ApiResponseUtils.success();
}
}
......@@ -86,6 +86,9 @@ public class PlatAlarmRecord extends BaseBusEntity {
@ApiModelProperty("区域名称")
private String regionName;
@ApiModelProperty(value = "0-未读 1-已读")
private String readFlag;
}
......
......@@ -61,4 +61,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
void getElderListByDeviceId(PlatAlarmCheckDTO platAlarmCheckDTO);
void dealAlarm(BaseIdDTO dto);
void read(String id);
}
package com.makeit.service.platform.alarm.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.dto.BaseIdDTO;
......@@ -352,6 +354,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
platAlarmRecord.setRemark(platAlarmCheckDTO.getRemark());
platAlarmRecord.setAbnormalValue(platAlarmCheckDTO.getAbnormalValue());
platAlarmRecord.setRegionName(platElder.getRegionName());
platAlarmRecord.setReadFlag(CommonEnum.NO.getValue());
return platAlarmRecord;
}
......@@ -459,4 +463,13 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
platAlarmRecord.setDealDate(LocalDateTime.now());
updateById(platAlarmRecord);
}
@Override
@Transactional
public void read(String id) {
LambdaUpdateWrapper<PlatAlarmRecord> recordLambdaUpdateWrapper = Wrappers.lambdaUpdate(PlatAlarmRecord.class)
.eq(BaseEntity::getId, id)
.set(PlatAlarmRecord::getReadFlag, CommonEnum.YES.getValue());
update(recordLambdaUpdateWrapper);
}
}
......@@ -59,5 +59,8 @@ public class PlatAlarmRecordVO extends BaseTenantDTO {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createDate;
@ApiModelProperty(value = "0-未读 1-已读")
private String readFlag;
}
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