修改app接口
parent
a99f9dbcab
commit
730657c0ef
|
|
@ -2,7 +2,7 @@ spring:
|
|||
config:
|
||||
import:
|
||||
- classpath:nacos.yml
|
||||
# - classpath:prodnacos.yml
|
||||
- classpath:sdk.yml
|
||||
# - classpath:prodnacos.yml
|
||||
# - classpath:prodsdk.yml
|
||||
- classpath:swagger.yml
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.zcloud.api.AlarmDisposeServiceI;
|
|||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -23,33 +25,25 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AppAlarmDisposeController {
|
||||
|
||||
|
||||
private final AlarmDisposeServiceI alarmDisposeService;
|
||||
|
||||
@ApiOperation("手机端待处置列表")
|
||||
@PostMapping("/todoList")
|
||||
public PageResponse<AlarmDisposeCO> todoList(@RequestBody AppAlarmDisposePageQry qry) {
|
||||
// 自动填充当前用户ID
|
||||
qry.setCurrentUserId(AuthContext.getUserId());
|
||||
public PageResponse<AlarmRecordCO> todoList(@RequestBody AppAlarmDisposePageQry qry) {
|
||||
qry.setStatus(20);
|
||||
return alarmDisposeService.appTodoList(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("手机端报警详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<AlarmDisposeCO> info(@PathVariable("id") Long id) {
|
||||
public SingleResponse<AlarmRecordCO> info(@PathVariable("id") Long id) {
|
||||
return alarmDisposeService.appInfo(id);
|
||||
}
|
||||
|
||||
@ApiOperation("手机端提交处置结果")
|
||||
@PostMapping("/submit")
|
||||
public SingleResponse submit(@Validated @RequestBody AppAlarmDisposeSubmitCmd cmd) {
|
||||
// 自动填充租户ID和组织ID
|
||||
if (cmd.getTenantId() == null) {
|
||||
cmd.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
if (cmd.getOrgId() == null) {
|
||||
cmd.setOrgId(AuthContext.getOrgId());
|
||||
}
|
||||
return alarmDisposeService.appSubmit(cmd);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.web;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.AlarmRecordServiceI;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -20,12 +21,13 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AppAlarmRecordController {
|
||||
|
||||
|
||||
private final AlarmRecordServiceI alarmRecordService;
|
||||
|
||||
@ApiOperation("处置记录列表(按当前用户过滤)")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<AlarmRecordCO> list(@RequestBody AppAlarmRecordPageQry qry) {
|
||||
public PageResponse<AlarmRecordCO> list(@RequestBody AppAlarmDisposePageQry qry) {
|
||||
qry.setStatus(30);
|
||||
return alarmRecordService.appList(qry);
|
||||
}
|
||||
|
||||
|
|
@ -34,4 +36,4 @@ public class AppAlarmRecordController {
|
|||
public SingleResponse<AlarmRecordCO> info(@PathVariable("id") Long id) {
|
||||
return alarmRecordService.appInfo(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,21 +28,21 @@ public class SensorTypeController {
|
|||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-add')")
|
||||
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-add')")
|
||||
public SingleResponse<String> save(@Validated @RequestBody SensorTypeAddCmd cmd) {
|
||||
return sensorTypeService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页列表")
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-list')")
|
||||
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-list')")
|
||||
public PageResponse<SensorTypeCO> list(@RequestBody SensorTypePageQry qry) {
|
||||
return sensorTypeService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-edit')")
|
||||
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-edit')")
|
||||
public SingleResponse edit(@Validated @RequestBody SensorTypeUpdateCmd cmd) {
|
||||
sensorTypeService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
|
|
@ -50,7 +50,7 @@ public class SensorTypeController {
|
|||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-delete')")
|
||||
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-delete')")
|
||||
public SingleResponse remove(@PathVariable("id") Long id) {
|
||||
sensorTypeService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.zcloud.domain.gateway.AlarmDisposeLogGateway;
|
|||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.domain.model.AlarmDisposeLogE;
|
||||
import com.zcloud.dto.AlarmDisposeAssignCmd;
|
||||
import com.zcloud.gbscommon.utils.DateUtil;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.service.AlarmMessageService;
|
||||
|
|
@ -42,12 +43,12 @@ public class AlarmDisposeAssignExe {
|
|||
if (Tools.isEmpty(alarmRecord)) {
|
||||
throw new BizException("报警记录不存在");
|
||||
}
|
||||
|
||||
|
||||
// 检查状态:只有待研判(10)状态可以分配
|
||||
if (alarmRecord.getStatus() != 10) {
|
||||
throw new BizException("该报警已分配或已处置,无法再次分配");
|
||||
}
|
||||
|
||||
|
||||
// 更新报警记录状态和处置人
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
BeanUtils.copyProperties(cmd, updateEntity);
|
||||
|
|
@ -55,19 +56,19 @@ public class AlarmDisposeAssignExe {
|
|||
updateEntity.setStatus(20); // 待处置
|
||||
updateEntity.setManagerId(cmd.getDisposeUserId());
|
||||
updateEntity.setDisposeUserId(cmd.getDisposeUserId());
|
||||
updateEntity.setAssignTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
updateEntity.setAssignTime(LocalDateTime.now());
|
||||
if (StrUtil.isNotBlank(cmd.getAlarmLevel())) {
|
||||
updateEntity.setAlarmLevel(cmd.getAlarmLevel());
|
||||
}
|
||||
if (StrUtil.isNotBlank(cmd.getAlarmType())) {
|
||||
updateEntity.setAlarmType(cmd.getAlarmType());
|
||||
}
|
||||
|
||||
|
||||
Boolean res = alarmRecordGateway.update(updateEntity);
|
||||
if (!res) {
|
||||
throw new BizException("分配失败");
|
||||
}
|
||||
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
|
|
@ -78,20 +79,20 @@ public class AlarmDisposeAssignExe {
|
|||
log.setAfterStatus(20);
|
||||
log.setOperatorId(cmd.getDisposeUserId());
|
||||
log.setActionDesc("手动分配处置");
|
||||
log.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
log.setActionTime(LocalDateTime.now());
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
|
||||
// 发送报警处置推送消息给处置人
|
||||
// 更新后的报警记录包含分配时间和处置说明
|
||||
alarmMessageService.sendDisposePushMessage(updateEntity, cmd.getDisposeUserId());
|
||||
|
||||
|
||||
// 新增处置人待办
|
||||
alarmTodoService.addDisposeTodo(updateEntity, cmd.getDisposeUserId());
|
||||
|
||||
|
||||
// 完成负责人待办(原来负责人是 alarmRecord.getManagerId())
|
||||
alarmTodoService.completeTodo(cmd.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,33 +40,33 @@ public class AlarmDisposeBatchAssignExe {
|
|||
if (Tools.isEmpty(ids)) {
|
||||
throw new BizException("请选择要分配的报警记录");
|
||||
}
|
||||
|
||||
|
||||
String assignTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
|
||||
for (Long id : ids) {
|
||||
// 查询报警记录
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(id);
|
||||
if (Tools.isEmpty(alarmRecord)) {
|
||||
continue; // 跳过不存在的记录
|
||||
}
|
||||
|
||||
|
||||
// 检查状态:只有待研判(10)状态可以分配
|
||||
if (alarmRecord.getStatus() != 10) {
|
||||
continue; // 跳过非待研判状态的记录
|
||||
}
|
||||
|
||||
|
||||
// 更新报警记录状态和处置人
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
updateEntity.setId(id);
|
||||
updateEntity.setStatus(20); // 待处置
|
||||
updateEntity.setManagerId(cmd.getDisposeUserId());
|
||||
updateEntity.setDisposeUserId(cmd.getDisposeUserId());
|
||||
updateEntity.setAssignTime(assignTime);
|
||||
// updateEntity.setAssignTime(assignTime);
|
||||
updateEntity.setTenantId(cmd.getTenantId());
|
||||
updateEntity.setOrgId(cmd.getOrgId());
|
||||
|
||||
|
||||
alarmRecordGateway.update(updateEntity);
|
||||
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
|
|
@ -77,16 +77,16 @@ public class AlarmDisposeBatchAssignExe {
|
|||
log.setAfterStatus(20);
|
||||
log.setOperatorId(cmd.getDisposeUserId());
|
||||
log.setActionDesc("批量分配处置");
|
||||
log.setActionTime(assignTime);
|
||||
// log.setActionTime(assignTime);
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
|
||||
// 发送报警处置推送消息给处置人
|
||||
alarmMessageService.sendDisposePushMessage(updateEntity, cmd.getDisposeUserId());
|
||||
|
||||
|
||||
// 新增处置人待办
|
||||
alarmTodoService.addDisposeTodo(updateEntity, cmd.getDisposeUserId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,31 +39,31 @@ public class AlarmDisposeInvalidExe {
|
|||
if (Tools.isEmpty(alarmRecord)) {
|
||||
throw new BizException("报警记录不存在");
|
||||
}
|
||||
|
||||
|
||||
// 检查状态:只有待研判(10)或待处置(20)状态可以标记为无效
|
||||
if (alarmRecord.getStatus() != 10 && alarmRecord.getStatus() != 20) {
|
||||
throw new BizException("该报警已处置或已消警,无法标记为无效");
|
||||
}
|
||||
|
||||
|
||||
Integer beforeStatus = alarmRecord.getStatus();
|
||||
|
||||
|
||||
// 更新报警记录状态
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
updateEntity.setId(cmd.getId());
|
||||
updateEntity.setStatus(40); // 误报
|
||||
updateEntity.setDisposeTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
updateEntity.setDisposeTime(LocalDateTime.now());
|
||||
updateEntity.setDisposeResult("误报");
|
||||
if (StrUtil.isNotBlank(cmd.getInvalidReason())) {
|
||||
updateEntity.setDisposeRemark(cmd.getInvalidReason());
|
||||
}
|
||||
updateEntity.setTenantId(cmd.getTenantId());
|
||||
updateEntity.setOrgId(cmd.getOrgId());
|
||||
|
||||
|
||||
Boolean res = alarmRecordGateway.update(updateEntity);
|
||||
if (!res) {
|
||||
throw new BizException("标记无效失败");
|
||||
}
|
||||
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
|
|
@ -76,14 +76,14 @@ public class AlarmDisposeInvalidExe {
|
|||
if (StrUtil.isNotBlank(cmd.getInvalidReason())) {
|
||||
log.setResultText(cmd.getInvalidReason());
|
||||
}
|
||||
log.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
log.setActionTime(LocalDateTime.now());
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
|
||||
// 删除待办(误报时删除所有相关待办)
|
||||
alarmTodoService.deleteTodo(cmd.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.AlarmRecordGateway;
|
||||
|
|
@ -29,83 +30,29 @@ import java.time.format.DateTimeFormatter;
|
|||
public class AppAlarmDisposeSubmitExe {
|
||||
|
||||
private final AlarmRecordGateway alarmRecordGateway;
|
||||
private final AlarmDisposeLogGateway alarmDisposeLogGateway;
|
||||
private final AlarmTodoService alarmTodoService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(AppAlarmDisposeSubmitCmd cmd) {
|
||||
// 查询报警记录
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(cmd.getAlarmId());
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(cmd.getId());
|
||||
if (Tools.isEmpty(alarmRecord)) {
|
||||
throw new BizException("报警记录不存在");
|
||||
}
|
||||
|
||||
|
||||
// 检查状态:只有待处置(20)状态可以提交处置
|
||||
if (alarmRecord.getStatus() != 20) {
|
||||
throw new BizException("该报警已处置或状态异常,无法提交处置结果");
|
||||
}
|
||||
|
||||
// 确定目标状态
|
||||
Integer afterStatus;
|
||||
String actionDesc;
|
||||
if ("误报".equals(cmd.getDisposeResult())) {
|
||||
afterStatus = 40; // 误报
|
||||
actionDesc = "手机端处置:误报判定";
|
||||
} else {
|
||||
afterStatus = 30; // 已消警
|
||||
actionDesc = "手机端处置:已消警";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 更新报警记录
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
updateEntity.setId(cmd.getAlarmId());
|
||||
updateEntity.setStatus(afterStatus);
|
||||
updateEntity.setDisposeTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
updateEntity.setDisposeResult(cmd.getDisposeResult());
|
||||
if (StrUtil.isNotBlank(cmd.getDisposeRemark())) {
|
||||
updateEntity.setDisposeRemark(cmd.getDisposeRemark());
|
||||
}
|
||||
if (StrUtil.isNotBlank(cmd.getPictureUrls())) {
|
||||
updateEntity.setPictureUrls(cmd.getPictureUrls());
|
||||
}
|
||||
updateEntity.setTenantId(cmd.getTenantId());
|
||||
updateEntity.setOrgId(cmd.getOrgId());
|
||||
|
||||
BeanUtil.copyProperties(cmd, updateEntity);
|
||||
updateEntity.init();
|
||||
|
||||
Boolean res = alarmRecordGateway.update(updateEntity);
|
||||
if (!res) {
|
||||
throw new BizException("处置提交失败");
|
||||
}
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
log.setAlarmId(cmd.getAlarmId());
|
||||
log.setAlarmNo(alarmRecord.getAlarmNo());
|
||||
log.setActionType("DISPOSE");
|
||||
log.setBeforeStatus(20);
|
||||
log.setAfterStatus(afterStatus);
|
||||
log.setActionDesc(actionDesc);
|
||||
log.setResultText(cmd.getDisposeResult());
|
||||
if (StrUtil.isNotBlank(cmd.getDisposeRemark())) {
|
||||
log.setResultText(cmd.getDisposeRemark());
|
||||
}
|
||||
if (StrUtil.isNotBlank(cmd.getPictureUrls())) {
|
||||
log.setPictureUrls(cmd.getPictureUrls());
|
||||
}
|
||||
log.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
// 根据处置结果处理待办
|
||||
if ("误报".equals(cmd.getDisposeResult())) {
|
||||
// 误报时删除待办
|
||||
alarmTodoService.deleteTodo(cmd.getAlarmId());
|
||||
} else {
|
||||
// 已消警时完成待办
|
||||
alarmTodoService.completeTodo(cmd.getAlarmId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,24 +30,26 @@ public class BindSensorExe {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(BindSensorCmd cmd) {
|
||||
// 检查传感器是否已绑定到其他区域
|
||||
Boolean isBound = regionSensorRelGateway.isSensorBound(cmd.getSensorId());
|
||||
Boolean isBound = regionSensorRelGateway.isSensorBound(cmd.getSensorDeviceId());
|
||||
if (isBound) {
|
||||
throw new BizException("该传感器已绑定到其他区域,请先解绑");
|
||||
}
|
||||
|
||||
|
||||
// 检查区域配置是否存在
|
||||
DeviceRegionE region = deviceRegionGateway.getById(cmd.getRegionConfigId());
|
||||
if (Tools.isEmpty(region)) {
|
||||
throw new BizException("区域配置不存在");
|
||||
}
|
||||
|
||||
|
||||
RegionSensorRelE entity = new RegionSensorRelE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
entity.setRegionConfigId(String.valueOf(cmd.getRegionConfigId()));
|
||||
entity.setSensorDeviceId(cmd.getSensorDeviceId());
|
||||
entity.setSensorCode(cmd.getSensorCode());
|
||||
entity.setRegionSensorRelId(UuidUtil.get32UUID());
|
||||
entity.setFireRegionId(region.getFireRegionId());
|
||||
entity.setFireRegionId(cmd.getFireRegionId());
|
||||
// 设置默认值
|
||||
entity.setDeleteEnum("FALSE");
|
||||
|
||||
|
||||
Long res = regionSensorRelGateway.add(entity);
|
||||
if (Tools.isEmpty(res)) {
|
||||
throw new BizException("绑定失败");
|
||||
|
|
|
|||
|
|
@ -28,21 +28,22 @@ public class DeviceRegionAddExe {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public SingleResponse<String> execute(DeviceRegionAddCmd cmd) {
|
||||
// 检查消防区域是否已存在配置
|
||||
DeviceRegionE existingRegion = deviceRegionGateway.getByFireRegionId(cmd.getFireRegionId());
|
||||
DeviceRegionE existingRegion = deviceRegionGateway.getByFireRegionId(String.valueOf(cmd.getFireRegionId()));
|
||||
if (existingRegion != null) {
|
||||
throw new BizException("该消防区域已存在配置,请直接修改");
|
||||
}
|
||||
|
||||
|
||||
DeviceRegionE entity = new DeviceRegionE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
entity.setRegionConfigId(UuidUtil.get32UUID());
|
||||
entity.setFireRegionId(String.valueOf(cmd.getFireRegionId()));
|
||||
// 设置默认值
|
||||
entity.setDeleteEnum("FALSE");
|
||||
// 设置状态默认值
|
||||
if (entity.getStatus() == null) {
|
||||
entity.setStatus(1);
|
||||
}
|
||||
|
||||
|
||||
Long res = deviceRegionGateway.add(entity);
|
||||
if (Tools.isEmpty(res)) {
|
||||
throw new BizException("保存失败");
|
||||
|
|
|
|||
|
|
@ -22,26 +22,26 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorDeviceRemoveExe {
|
||||
|
||||
|
||||
private final SensorDeviceGateway sensorDeviceGateway;
|
||||
private final RegionSensorRelRepository regionSensorRelRepository;
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
LambdaQueryWrapper<RegionSensorRelDO> relWrapper = new LambdaQueryWrapper<>();
|
||||
relWrapper.eq(RegionSensorRelDO::getSensorId, id)
|
||||
.eq(RegionSensorRelDO::getDeleteEnum, "FALSE");
|
||||
if (regionSensorRelRepository.count(relWrapper) > 0) {
|
||||
throw new BizException("该传感器已被使用,不可删除");
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<AlarmRecordDO> alarmWrapper = new LambdaQueryWrapper<>();
|
||||
alarmWrapper.eq(AlarmRecordDO::getSensorId, id)
|
||||
.eq(AlarmRecordDO::getDeleteEnum, "FALSE");
|
||||
if (alarmRecordRepository.count(alarmWrapper) > 0) {
|
||||
throw new BizException("该传感器已被使用,不可删除");
|
||||
}
|
||||
// LambdaQueryWrapper<RegionSensorRelDO> relWrapper = new LambdaQueryWrapper<>();
|
||||
// relWrapper.eq(RegionSensorRelDO::getSensorId, id)
|
||||
// .eq(RegionSensorRelDO::getDeleteEnum, "FALSE");
|
||||
// if (regionSensorRelRepository.count(relWrapper) > 0) {
|
||||
// throw new BizException("该传感器已被使用,不可删除");
|
||||
// }
|
||||
//
|
||||
// LambdaQueryWrapper<AlarmRecordDO> alarmWrapper = new LambdaQueryWrapper<>();
|
||||
// alarmWrapper.eq(AlarmRecordDO::getSensorId, id)
|
||||
// .eq(AlarmRecordDO::getDeleteEnum, "FALSE");
|
||||
// if (alarmRecordRepository.count(alarmWrapper) > 0) {
|
||||
// throw new BizException("该传感器已被使用,不可删除");
|
||||
// }
|
||||
|
||||
boolean res = sensorDeviceGateway.deleteById(id);
|
||||
if (!res) {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ public class UnbindSensorExe {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(UnbindSensorCmd cmd) {
|
||||
// 检查传感器是否已绑定
|
||||
RegionSensorRelE rel = regionSensorRelGateway.getBySensorId(cmd.getSensorId());
|
||||
RegionSensorRelE rel = regionSensorRelGateway.getBySensorId(cmd.getSensorDeviceId());
|
||||
if (Tools.isEmpty(rel)) {
|
||||
throw new BizException("该传感器未绑定到任何区域");
|
||||
}
|
||||
|
||||
Boolean res = regionSensorRelGateway.deleteBySensorId(cmd.getSensorId());
|
||||
|
||||
Boolean res = regionSensorRelGateway.deleteBySensorId(cmd.getSensorDeviceId());
|
||||
if (!res) {
|
||||
throw new BizException("解绑失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.command.convertor.alarmRecord;
|
||||
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2026-03-20 16:16:04
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface AlarmRecordCoConvertor {
|
||||
/**
|
||||
* @param alarmRecordDOs
|
||||
* @return
|
||||
*/
|
||||
List<AlarmRecordCO> converDOsToCOs(List<AlarmRecordDO> alarmRecordDOs);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AlarmDisposeQueryExe {
|
||||
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
private final SensorDeviceRepository sensorDeviceRepository;
|
||||
private final UserRepository userRepository;
|
||||
|
|
@ -46,7 +46,7 @@ public class AlarmDisposeQueryExe {
|
|||
List<AlarmDisposeCO> alarmDisposeCOs = BeanUtil.copyToList(pageResponse.getData(), AlarmDisposeCO.class);
|
||||
return PageResponse.of(alarmDisposeCOs, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
public SingleResponse<AlarmDisposeCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.detailView(id);
|
||||
if (d == null) {
|
||||
|
|
@ -63,8 +63,8 @@ public class AlarmDisposeQueryExe {
|
|||
return;
|
||||
}
|
||||
|
||||
Set<Long> sensorIds = alarmDisposeCOs.stream()
|
||||
.map(AlarmDisposeCO::getSensorId)
|
||||
Set<String> sensorIds = alarmDisposeCOs.stream()
|
||||
.map(AlarmDisposeCO::getSensorDeviceId)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
Set<Long> disposeUserIds = alarmDisposeCOs.stream()
|
||||
|
|
@ -90,7 +90,7 @@ public class AlarmDisposeQueryExe {
|
|||
}
|
||||
|
||||
for (AlarmDisposeCO alarmDisposeCO : alarmDisposeCOs) {
|
||||
alarmDisposeCO.setSensorName(sensorNameMap.get(alarmDisposeCO.getSensorId()));
|
||||
alarmDisposeCO.setSensorName(sensorNameMap.get(alarmDisposeCO.getSensorDeviceId()));
|
||||
alarmDisposeCO.setDisposeUserName(userNameMap.get(alarmDisposeCO.getDisposeUserId()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AlarmRecordQueryExe {
|
||||
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
private final SensorDeviceRepository sensorDeviceRepository;
|
||||
private final UserRepository userRepository;
|
||||
|
|
@ -46,7 +46,7 @@ public class AlarmRecordQueryExe {
|
|||
List<AlarmRecordCO> alarmRecordCOs = BeanUtil.copyToList(pageResponse.getData(), AlarmRecordCO.class);
|
||||
return PageResponse.of(alarmRecordCOs, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
public SingleResponse<AlarmRecordCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.detailView(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
|
|
@ -63,8 +63,8 @@ public class AlarmRecordQueryExe {
|
|||
return;
|
||||
}
|
||||
|
||||
Set<Long> sensorIds = alarmRecordCOs.stream()
|
||||
.map(AlarmRecordCO::getSensorId)
|
||||
Set<String> sensorIds = alarmRecordCOs.stream()
|
||||
.map(AlarmRecordCO::getSensorDeviceId)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
Set<Long> disposeUserIds = alarmRecordCOs.stream()
|
||||
|
|
@ -90,7 +90,7 @@ public class AlarmRecordQueryExe {
|
|||
}
|
||||
|
||||
for (AlarmRecordCO alarmRecordCO : alarmRecordCOs) {
|
||||
alarmRecordCO.setSensorName(sensorNameMap.get(alarmRecordCO.getSensorId()));
|
||||
alarmRecordCO.setSensorName(sensorNameMap.get(alarmRecordCO.getSensorDeviceId()));
|
||||
alarmRecordCO.setDisposeUserName(userNameMap.get(alarmRecordCO.getDisposeUserId()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ import com.alibaba.cola.dto.PageResponse;
|
|||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.command.convertor.alarmRecord.AlarmRecordCoConvertor;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import com.zcloud.persistence.dataobject.SensorDeviceDO;
|
||||
|
|
@ -34,32 +36,34 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AppAlarmDisposeQueryExe {
|
||||
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
private final SensorDeviceRepository sensorDeviceRepository;
|
||||
private final UserRepository userRepository;
|
||||
private final AlarmRecordCoConvertor alarmRecordCoConvertor;
|
||||
|
||||
/**
|
||||
* 手机端待处置列表(按当前用户过滤)
|
||||
*/
|
||||
public PageResponse<AlarmDisposeCO> execute(AppAlarmDisposePageQry qry) {
|
||||
public PageResponse<AlarmRecordCO> execute(AppAlarmDisposePageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
params.put("tenantId", AuthContext.getTenantId());
|
||||
params.put("disposeUserId", AuthContext.getUserId());
|
||||
PageResponse<AlarmRecordDO> pageResponse = alarmRecordRepository.appDisposeListPage(params);
|
||||
List<AlarmDisposeCO> alarmDisposeCOs = BeanUtil.copyToList(pageResponse.getData(), AlarmDisposeCO.class);
|
||||
return PageResponse.of(alarmDisposeCOs, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
List<AlarmRecordCO> alarmRecordCOS = alarmRecordCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(alarmRecordCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手机端报警详情
|
||||
*/
|
||||
public SingleResponse<AlarmDisposeCO> getById(Long id) {
|
||||
public SingleResponse<AlarmRecordCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.detailView(id);
|
||||
if (d == null) {
|
||||
return SingleResponse.buildFailure("报警记录不存在");
|
||||
}
|
||||
|
||||
AlarmDisposeCO co = new AlarmDisposeCO();
|
||||
AlarmRecordCO co = new AlarmRecordCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
|
|
@ -69,8 +73,8 @@ public class AppAlarmDisposeQueryExe {
|
|||
return;
|
||||
}
|
||||
|
||||
Set<Long> sensorIds = alarmDisposeCOs.stream()
|
||||
.map(AlarmDisposeCO::getSensorId)
|
||||
Set<String> sensorIds = alarmDisposeCOs.stream()
|
||||
.map(AlarmDisposeCO::getSensorDeviceId)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
Set<Long> disposeUserIds = alarmDisposeCOs.stream()
|
||||
|
|
@ -96,7 +100,7 @@ public class AppAlarmDisposeQueryExe {
|
|||
}
|
||||
|
||||
for (AlarmDisposeCO alarmDisposeCO : alarmDisposeCOs) {
|
||||
alarmDisposeCO.setSensorName(sensorNameMap.get(alarmDisposeCO.getSensorId()));
|
||||
alarmDisposeCO.setSensorName(sensorNameMap.get(alarmDisposeCO.getSensorDeviceId()));
|
||||
alarmDisposeCO.setDisposeUserName(userNameMap.get(alarmDisposeCO.getDisposeUserId()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AppAlarmRecordQueryExe {
|
||||
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
private final SensorDeviceRepository sensorDeviceRepository;
|
||||
private final UserRepository userRepository;
|
||||
|
|
@ -46,7 +46,7 @@ public class AppAlarmRecordQueryExe {
|
|||
List<AlarmRecordCO> alarmRecordCOs = BeanUtil.copyToList(pageResponse.getData(), AlarmRecordCO.class);
|
||||
return PageResponse.of(alarmRecordCOs, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
public SingleResponse<AlarmRecordCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.detailView(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
|
|
@ -69,8 +69,8 @@ public class AppAlarmRecordQueryExe {
|
|||
return;
|
||||
}
|
||||
|
||||
Set<Long> sensorIds = alarmRecordCOs.stream()
|
||||
.map(AlarmRecordCO::getSensorId)
|
||||
Set<String> sensorIds = alarmRecordCOs.stream()
|
||||
.map(AlarmRecordCO::getSensorDeviceId)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
Set<Long> disposeUserIds = alarmRecordCOs.stream()
|
||||
|
|
@ -96,7 +96,7 @@ public class AppAlarmRecordQueryExe {
|
|||
}
|
||||
|
||||
for (AlarmRecordCO alarmRecordCO : alarmRecordCOs) {
|
||||
alarmRecordCO.setSensorName(sensorNameMap.get(alarmRecordCO.getSensorId()));
|
||||
alarmRecordCO.setSensorName(sensorNameMap.get(alarmRecordCO.getSensorDeviceId()));
|
||||
alarmRecordCO.setDisposeUserName(userNameMap.get(alarmRecordCO.getDisposeUserId()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceRegionQueryExe {
|
||||
|
||||
|
||||
private final DeviceRegionRepository deviceRegionRepository;
|
||||
private final RegionSensorRelRepository regionSensorRelRepository;
|
||||
private final SensorDeviceRepository sensorDeviceRepository;
|
||||
|
|
@ -52,7 +52,7 @@ public class DeviceRegionQueryExe {
|
|||
List<DeviceRegionCO> deviceRegionCOs = BeanUtil.copyToList(pageResponse.getData(), DeviceRegionCO.class);
|
||||
return PageResponse.of(deviceRegionCOs, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
public SingleResponse<DeviceRegionCO> getById(Long id) {
|
||||
DeviceRegionDO d = deviceRegionRepository.getById(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
|
|
@ -84,13 +84,13 @@ public class DeviceRegionQueryExe {
|
|||
.eq(RegionSensorRelDO::getDeleteEnum, "FALSE");
|
||||
List<RegionSensorRelDO> relList = regionSensorRelRepository.list(relWrapper);
|
||||
|
||||
Map<Long, List<RegionSensorRelDO>> relMap = relList.stream()
|
||||
Map<String, List<RegionSensorRelDO>> relMap = relList.stream()
|
||||
.collect(Collectors.groupingBy(RegionSensorRelDO::getRegionConfigId));
|
||||
|
||||
Map<Long, SensorDeviceCO> sensorMap = Collections.emptyMap();
|
||||
if (includeBoundSensors && !relList.isEmpty()) {
|
||||
Set<Long> sensorIds = relList.stream()
|
||||
.map(RegionSensorRelDO::getSensorId)
|
||||
Set<String> sensorIds = relList.stream()
|
||||
.map(RegionSensorRelDO::getSensorDeviceId)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toSet());
|
||||
if (!sensorIds.isEmpty()) {
|
||||
|
|
@ -111,7 +111,7 @@ public class DeviceRegionQueryExe {
|
|||
}
|
||||
|
||||
List<SensorDeviceCO> boundSensors = currentRelList.stream()
|
||||
.map(RegionSensorRelDO::getSensorId)
|
||||
.map(RegionSensorRelDO::getSensorDeviceId)
|
||||
.map(sensorMap::get)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -55,15 +55,15 @@ public class DcsAlarmEventConsumer {
|
|||
}
|
||||
|
||||
// 2. 查找传感器绑定的区域
|
||||
RegionSensorRelE regionSensorRel = regionSensorRelGateway.getBySensorId(sensorDevice.getId());
|
||||
RegionSensorRelE regionSensorRel = regionSensorRelGateway.getBySensorId(sensorDevice.getSensorDeviceId());
|
||||
DeviceRegionE deviceRegion = null;
|
||||
if (regionSensorRel != null && regionSensorRel.getFireRegionId() != null) {
|
||||
deviceRegion = deviceRegionGateway.getByFireRegionId(regionSensorRel.getFireRegionId());
|
||||
}
|
||||
|
||||
if (deviceRegion == null) {
|
||||
log.warn("未找到传感器绑定的区域配置: sensorCode={}, sensorId={}",
|
||||
event.getSensorCode(), sensorDevice.getId());
|
||||
log.warn("未找到传感器绑定的区域配置: sensorCode={}, sensorDeviceId={}",
|
||||
event.getSensorCode(), sensorDevice.getSensorDeviceId());
|
||||
}
|
||||
|
||||
// 3. 生成报警记录
|
||||
|
|
@ -110,13 +110,13 @@ public class DcsAlarmEventConsumer {
|
|||
alarmRecord.setDeviceSourceDesc(event.getDeviceSourceDesc());
|
||||
|
||||
// 传感器信息
|
||||
alarmRecord.setSensorId(sensorDevice.getId());
|
||||
alarmRecord.setSensorDeviceId(sensorDevice.getSensorDeviceId());
|
||||
alarmRecord.setSensorCode(event.getSensorCode());
|
||||
alarmRecord.setUnitName(sensorDevice.getUnitName());
|
||||
|
||||
// 区域信息(从传感器绑定关系获取)
|
||||
if (regionSensorRel != null && regionSensorRel.getFireRegionId() != null) {
|
||||
alarmRecord.setFireRegionId(regionSensorRel.getFireRegionId());
|
||||
alarmRecord.setFireRegionId(String.valueOf(regionSensorRel.getFireRegionId()));
|
||||
}
|
||||
|
||||
// 负责人信息(自动分配)
|
||||
|
|
@ -133,8 +133,10 @@ public class DcsAlarmEventConsumer {
|
|||
alarmRecord.setAlarmDesc(event.getAlarmDesc());
|
||||
|
||||
// 报警时间
|
||||
alarmRecord.setAlarmTime(event.getAlarmTime());
|
||||
alarmRecord.setAssignTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
if (event.getAlarmTime() != null) {
|
||||
alarmRecord.setAlarmTime(LocalDateTime.parse(event.getAlarmTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
}
|
||||
alarmRecord.setAssignTime(LocalDateTime.now());
|
||||
|
||||
// 状态:10(报警中-待研判)
|
||||
alarmRecord.setStatus(10);
|
||||
|
|
@ -179,7 +181,7 @@ public class DcsAlarmEventConsumer {
|
|||
disposeLog.setActionDesc("系统自动分配区域负责人");
|
||||
|
||||
// 操作时间
|
||||
disposeLog.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
disposeLog.setActionTime(LocalDateTime.now());
|
||||
|
||||
// 租户和组织
|
||||
disposeLog.setTenantId(tenantId);
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ public class ThresholdAlarmEventConsumer {
|
|||
// 2. 查找区域配置
|
||||
DeviceRegionE deviceRegion = null;
|
||||
if (event.getFireRegionId() != null) {
|
||||
deviceRegion = deviceRegionGateway.getByFireRegionId(event.getFireRegionId());
|
||||
deviceRegion = deviceRegionGateway.getByFireRegionId(String.valueOf(event.getFireRegionId()));
|
||||
}
|
||||
|
||||
|
||||
if (deviceRegion == null) {
|
||||
log.warn("未找到区域配置: fireRegionId={}", event.getFireRegionId());
|
||||
}
|
||||
|
|
@ -111,13 +111,13 @@ public class ThresholdAlarmEventConsumer {
|
|||
alarmRecord.setDeviceSourceDesc(event.getDeviceSourceDesc());
|
||||
|
||||
// 传感器信息
|
||||
alarmRecord.setSensorId(sensorDevice.getId());
|
||||
alarmRecord.setSensorDeviceId(sensorDevice.getSensorDeviceId());
|
||||
alarmRecord.setSensorCode(event.getSensorCode());
|
||||
alarmRecord.setUnitName(sensorDevice.getUnitName());
|
||||
|
||||
|
||||
// 区域信息
|
||||
if (event.getFireRegionId() != null) {
|
||||
alarmRecord.setFireRegionId(event.getFireRegionId());
|
||||
alarmRecord.setFireRegionId(String.valueOf(event.getFireRegionId()));
|
||||
}
|
||||
|
||||
// 负责人信息(自动分配)
|
||||
|
|
@ -136,8 +136,10 @@ public class ThresholdAlarmEventConsumer {
|
|||
alarmRecord.setCompareFlag(mapThresholdTypeToCompareFlag(event.getThresholdType()));
|
||||
|
||||
// 报警时间
|
||||
alarmRecord.setAlarmTime(event.getAlarmTime());
|
||||
alarmRecord.setAssignTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
if (event.getAlarmTime() != null) {
|
||||
alarmRecord.setAlarmTime(LocalDateTime.parse(event.getAlarmTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
}
|
||||
alarmRecord.setAssignTime(LocalDateTime.now());
|
||||
|
||||
// 状态:10(报警中-待研判)
|
||||
alarmRecord.setStatus(10);
|
||||
|
|
@ -179,7 +181,7 @@ public class ThresholdAlarmEventConsumer {
|
|||
disposeLog.setActionDesc("系统自动分配区域负责人");
|
||||
|
||||
// 操作时间
|
||||
disposeLog.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
disposeLog.setActionTime(LocalDateTime.now());
|
||||
|
||||
// 租户和组织
|
||||
disposeLog.setTenantId(tenantId);
|
||||
|
|
|
|||
|
|
@ -16,13 +16,15 @@ import com.zcloud.dto.AlarmDisposePageQry;
|
|||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AlarmDisposeServiceImpl implements AlarmDisposeServiceI {
|
||||
|
||||
|
||||
private final AlarmDisposeAssignExe alarmDisposeAssignExe;
|
||||
private final AlarmDisposeBatchAssignExe alarmDisposeBatchAssignExe;
|
||||
private final AlarmDisposeInvalidExe alarmDisposeInvalidExe;
|
||||
|
|
@ -59,20 +61,20 @@ public class AlarmDisposeServiceImpl implements AlarmDisposeServiceI {
|
|||
}
|
||||
|
||||
// ==================== 手机端接口实现 ====================
|
||||
|
||||
|
||||
@Override
|
||||
public PageResponse<AlarmDisposeCO> appTodoList(AppAlarmDisposePageQry qry) {
|
||||
public PageResponse<AlarmRecordCO> appTodoList(AppAlarmDisposePageQry qry) {
|
||||
return appAlarmDisposeQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SingleResponse<AlarmDisposeCO> appInfo(Long id) {
|
||||
public SingleResponse<AlarmRecordCO> appInfo(Long id) {
|
||||
return appAlarmDisposeQueryExe.getById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SingleResponse appSubmit(AppAlarmDisposeSubmitCmd cmd) {
|
||||
appAlarmDisposeSubmitExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package com.zcloud.service;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.druid.sql.visitor.functions.If;
|
||||
import com.zcloud.api.AlarmRecordServiceI;
|
||||
import com.zcloud.command.query.AlarmRecordQueryExe;
|
||||
import com.zcloud.command.query.AppAlarmDisposeQueryExe;
|
||||
import com.zcloud.command.query.AppAlarmRecordQueryExe;
|
||||
import com.zcloud.dto.AlarmRecordPageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -14,8 +17,9 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AlarmRecordServiceImpl implements AlarmRecordServiceI {
|
||||
|
||||
|
||||
private final AlarmRecordQueryExe alarmRecordQueryExe;
|
||||
private final AppAlarmDisposeQueryExe appAlarmDisposeQueryExe;
|
||||
private final AppAlarmRecordQueryExe appAlarmRecordQueryExe;
|
||||
|
||||
@Override
|
||||
|
|
@ -29,12 +33,12 @@ public class AlarmRecordServiceImpl implements AlarmRecordServiceI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<AlarmRecordCO> appList(AppAlarmRecordPageQry qry) {
|
||||
return appAlarmRecordQueryExe.execute(qry);
|
||||
public PageResponse<AlarmRecordCO> appList(AppAlarmDisposePageQry qry) {
|
||||
return appAlarmDisposeQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<AlarmRecordCO> appInfo(Long id) {
|
||||
return appAlarmRecordQueryExe.getById(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.zcloud.dto.AlarmDisposePageQry;
|
|||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
|
||||
/**
|
||||
* AlarmDisposeServiceI - 报警处置服务接口
|
||||
|
|
@ -53,25 +54,25 @@ public interface AlarmDisposeServiceI {
|
|||
SingleResponse<AlarmDisposeCO> info(Long id);
|
||||
|
||||
// ==================== 手机端接口 ====================
|
||||
|
||||
|
||||
/**
|
||||
* 手机端待处置列表(按当前用户过滤)
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<AlarmDisposeCO> appTodoList(AppAlarmDisposePageQry qry);
|
||||
|
||||
PageResponse<AlarmRecordCO> appTodoList(AppAlarmDisposePageQry qry);
|
||||
|
||||
/**
|
||||
* 手机端报警详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<AlarmDisposeCO> appInfo(Long id);
|
||||
|
||||
SingleResponse<AlarmRecordCO> appInfo(Long id);
|
||||
|
||||
/**
|
||||
* 手机端提交处置结果
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse appSubmit(AppAlarmDisposeSubmitCmd cmd);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.api;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.AlarmRecordPageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ public interface AlarmRecordServiceI {
|
|||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<AlarmRecordCO> appList(AppAlarmRecordPageQry qry);
|
||||
PageResponse<AlarmRecordCO> appList(AppAlarmDisposePageQry qry);
|
||||
|
||||
/**
|
||||
* 手机端报警详情
|
||||
|
|
@ -40,4 +41,4 @@ public interface AlarmRecordServiceI {
|
|||
* @return
|
||||
*/
|
||||
SingleResponse<AlarmRecordCO> appInfo(Long id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,31 +11,36 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
public class AppAlarmDisposePageQry extends PageQuery {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警编号")
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警来源")
|
||||
private String alarmSource;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警时间开始")
|
||||
private String alarmTimeStart;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警时间结束")
|
||||
private String alarmTimeEnd;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前用户ID(手机端自动填充)")
|
||||
private Long currentUserId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* AppAlarmDisposeSubmitCmd - APP报警处置命令
|
||||
* @Author wangyan
|
||||
|
|
@ -17,22 +19,14 @@ import lombok.AllArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppAlarmDisposeSubmitCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "报警ID", name = "alarmId", required = true)
|
||||
private Long alarmId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "处置结果(已消警/误报)", name = "disposeResult", required = true)
|
||||
@NotEmpty(message = "处置结果不能为空")
|
||||
private String disposeResult;
|
||||
|
||||
@ApiModelProperty(value = "处置说明", name = "disposeRemark")
|
||||
private String disposeRemark;
|
||||
|
||||
@ApiModelProperty(value = "图片地址(多个URL用逗号分隔)", name = "pictureUrls")
|
||||
private String pictureUrls;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "处置视频地址", name = "videoUrl")
|
||||
private String videoUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@ import lombok.AllArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BindSensorCmd extends Command {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "区域配置主键ID", name = "regionConfigId", required = true)
|
||||
private Long regionConfigId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域ID", name = "fireRegionId")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID", name = "sensorId", required = true)
|
||||
private Long sensorId;
|
||||
private String fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "传感器设备ID", name = "sensorDeviceId", required = true)
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码快照", name = "sensorCode")
|
||||
private String sensorCode;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class SensorDeviceAddCmd extends Command {
|
|||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID", name = "sensorTypeId", required = true)
|
||||
private Long sensorTypeId;
|
||||
private String sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性快照(NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||
private String sensorAttr;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class SensorDevicePageQry extends PageQuery {
|
|||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型ID")
|
||||
private Long sensorTypeId;
|
||||
private String sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器状态")
|
||||
private String sensorStatus;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class SensorDeviceUpdateCmd extends Command {
|
|||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID", name = "sensorTypeId")
|
||||
private Long sensorTypeId;
|
||||
private String sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性快照(NUMBER/SWITCH)", name = "sensorAttr")
|
||||
private String sensorAttr;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* SensorTypeAddCmd - 传感器类型命令
|
||||
|
|
@ -24,15 +25,24 @@ public class SensorTypeAddCmd extends Command {
|
|||
@ApiModelProperty(value = "类型名称", name = "typeName", required = true)
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序", name = "sortNo")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)", name = "status", required = true)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "环境", name = "env")
|
||||
private String env;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
||||
private BigDecimal thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
||||
private BigDecimal thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
||||
private BigDecimal thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
||||
private BigDecimal thresholdHighHigh;
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* SensorTypeUpdateCmd - 传感器类型命令
|
||||
|
|
@ -27,15 +28,24 @@ public class SensorTypeUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "类型名称", name = "typeName", required = false)
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)", name = "sensorAttr", required = false)
|
||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)", name = "sensorAttr", required = false)
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序", name = "sortNo")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)", name = "status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "环境", name = "env")
|
||||
private String env;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
||||
private BigDecimal thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
||||
private BigDecimal thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
||||
private BigDecimal thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
||||
private BigDecimal thresholdHighHigh;
|
||||
}
|
||||
|
|
@ -17,9 +17,9 @@ import lombok.AllArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UnbindSensorCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "传感器ID", name = "sensorId", required = true)
|
||||
private Long sensorId;
|
||||
|
||||
@ApiModelProperty(value = "传感器设备ID", name = "sensorDeviceId", required = true)
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
|
|
|||
|
|
@ -15,126 +15,126 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
public class AlarmDisposeCO extends ClientObject {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String alarmRecordId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警编号(32位)")
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警来源 THRESHOLD/DCS")
|
||||
private String alarmSource;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "设备来源描述快照")
|
||||
private String deviceSourceDesc;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID")
|
||||
private Long sensorId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器设备ID")
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
private String fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "消防区域名称")
|
||||
private String fireRegionName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责部门名称")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "当前负责人姓名")
|
||||
private String managerName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW")
|
||||
private String thresholdType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "告警值")
|
||||
private BigDecimal currentValue;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "比较方向 UP/DOWN")
|
||||
private String compareFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警描述")
|
||||
private String alarmDesc;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前状态 10待研判/20待处置/30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "分配时间")
|
||||
private String assignTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置时间")
|
||||
private String disposeTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置人ID")
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "处置人姓名")
|
||||
private String disposeUserName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前处置结果快照")
|
||||
private String disposeResult;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前处置说明快照")
|
||||
private String disposeRemark;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "图片地址")
|
||||
private String pictureUrls;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否活跃告警")
|
||||
private Integer activeFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -15,129 +16,151 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
public class AlarmRecordCO extends ClientObject {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String alarmRecordId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警编号(32位)")
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警来源 THRESHOLD/DCS")
|
||||
private String alarmSource;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "设备来源描述快照")
|
||||
private String deviceSourceDesc;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID")
|
||||
private Long sensorId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器设备ID")
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
private String fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "消防区域名称")
|
||||
private String fireRegionName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责部门名称")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "当前负责人姓名")
|
||||
private String managerName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警级别名称")
|
||||
private String alarmLevelName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
@ApiModelProperty(value = "阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW")
|
||||
private String thresholdType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "告警值")
|
||||
private BigDecimal currentValue;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "比较方向 UP/DOWN")
|
||||
private String compareFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警描述")
|
||||
private String alarmDesc;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前状态 10待研判/20待处置/30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "分配时间")
|
||||
private String assignTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置时间")
|
||||
private String disposeTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置人ID")
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "处置人姓名")
|
||||
private String disposeUserName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前处置结果快照")
|
||||
private String disposeResult;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前处置说明快照")
|
||||
private String disposeRemark;
|
||||
|
||||
@ApiModelProperty(value = "图片地址")
|
||||
private String pictureUrls;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置视频地址")
|
||||
private String videoUrl;
|
||||
|
||||
@ApiModelProperty(value = "外部记录唯一键")
|
||||
private String sourceRecordKey;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否活跃告警")
|
||||
private Integer activeFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "量程下限")
|
||||
private BigDecimal rangeMin;
|
||||
@ApiModelProperty(value = "量程上限")
|
||||
private BigDecimal rangeMax;
|
||||
@ApiModelProperty(value = "低低报阈值")
|
||||
private BigDecimal thresholdLowLow;
|
||||
@ApiModelProperty(value = "低报阈值")
|
||||
private BigDecimal thresholdLow;
|
||||
@ApiModelProperty(value = "高报阈值")
|
||||
private BigDecimal thresholdHigh;
|
||||
@ApiModelProperty(value = "高高报阈值")
|
||||
private BigDecimal thresholdHighHigh;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class SensorDeviceCO extends ClientObject {
|
|||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID")
|
||||
private Long sensorTypeId;
|
||||
private String sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型名称")
|
||||
private String sensorTypeName;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -27,15 +28,9 @@ public class SensorTypeCO extends ClientObject {
|
|||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)")
|
||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
|
|
@ -64,4 +59,19 @@ public class SensorTypeCO extends ClientObject {
|
|||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值")
|
||||
private BigDecimal thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值")
|
||||
private BigDecimal thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值")
|
||||
private BigDecimal thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值")
|
||||
private BigDecimal thresholdHighHigh;
|
||||
}
|
||||
|
|
@ -30,10 +30,10 @@ public interface DeviceRegionGateway {
|
|||
*/
|
||||
DeviceRegionE getById(Long id);
|
||||
|
||||
/**
|
||||
* 根据消防区域ID获取
|
||||
*/
|
||||
DeviceRegionE getByFireRegionId(Long fireRegionId);
|
||||
/**
|
||||
* 根据消防区域ID获取
|
||||
*/
|
||||
DeviceRegionE getByFireRegionId(String fireRegionId);
|
||||
|
||||
/**
|
||||
* 根据租户ID获取所有区域配置
|
||||
|
|
|
|||
|
|
@ -14,18 +14,18 @@ public interface RegionSensorRelGateway {
|
|||
*/
|
||||
Long add(RegionSensorRelE regionSensorRelE);
|
||||
|
||||
/**
|
||||
* 根据传感器ID删除(软删除)
|
||||
/**
|
||||
* 根据传感器设备ID删除(软删除)
|
||||
*/
|
||||
Boolean deleteBySensorId(Long sensorId);
|
||||
Boolean deleteBySensorId(String sensorDeviceId);
|
||||
|
||||
/**
|
||||
* 根据传感器ID获取
|
||||
* 根据传感器设备ID获取
|
||||
*/
|
||||
RegionSensorRelE getBySensorId(Long sensorId);
|
||||
RegionSensorRelE getBySensorId(String sensorDeviceId);
|
||||
|
||||
/**
|
||||
* 检查传感器是否已绑定
|
||||
*/
|
||||
Boolean isSensorBound(Long sensorId);
|
||||
Boolean isSensorBound(String sensorDeviceId);
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ import com.jjb.saas.framework.domain.model.BaseE;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* AlarmDisposeLogE - 报警处置日志实体
|
||||
* @Author wangyan
|
||||
|
|
@ -12,61 +14,61 @@ import lombok.EqualsAndHashCode;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmDisposeLogE extends BaseE {
|
||||
|
||||
|
||||
/**
|
||||
* 业务ID(32位)
|
||||
*/
|
||||
private String alarmDisposalLogId;
|
||||
|
||||
|
||||
/**
|
||||
* 报警主键ID
|
||||
*/
|
||||
private Long alarmId;
|
||||
|
||||
|
||||
/**
|
||||
* 报警编号(32位)
|
||||
*/
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
/**
|
||||
* 操作类型 AUTO_ASSIGN/MANUAL_ASSIGN/DISPOSE/INVALID
|
||||
*/
|
||||
private String actionType;
|
||||
|
||||
|
||||
/**
|
||||
* 变更前状态
|
||||
*/
|
||||
private Integer beforeStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 变更后状态
|
||||
*/
|
||||
private Integer afterStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
|
||||
/**
|
||||
* 操作说明
|
||||
*/
|
||||
private String actionDesc;
|
||||
|
||||
|
||||
/**
|
||||
* 处置结果
|
||||
*/
|
||||
private String resultText;
|
||||
|
||||
|
||||
/**
|
||||
* 附件图片
|
||||
*/
|
||||
private String pictureUrls;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private String actionTime;
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private LocalDateTime actionTime;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* AlarmRecordE - 报警记录实体
|
||||
|
|
@ -14,154 +15,159 @@ import java.math.BigDecimal;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmRecordE extends BaseE {
|
||||
|
||||
|
||||
/**
|
||||
* 业务ID(32位)
|
||||
*/
|
||||
private String alarmRecordId;
|
||||
|
||||
|
||||
/**
|
||||
* 报警编号(32位)
|
||||
*/
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
/**
|
||||
* 报警来源 THRESHOLD/DCS
|
||||
*/
|
||||
private String alarmSource;
|
||||
|
||||
|
||||
/**
|
||||
* 设备来源描述快照
|
||||
*/
|
||||
private String deviceSourceDesc;
|
||||
|
||||
/**
|
||||
* 传感器ID
|
||||
*/
|
||||
private Long sensorId;
|
||||
|
||||
|
||||
/**
|
||||
* 传感器设备ID
|
||||
*/
|
||||
private String sensorDeviceId;
|
||||
|
||||
/**
|
||||
* 传感器编码
|
||||
*/
|
||||
private String sensorCode;
|
||||
|
||||
/**
|
||||
* 消防区域ID
|
||||
*/
|
||||
private Long fireRegionId;
|
||||
|
||||
|
||||
/**
|
||||
* 消防区域ID
|
||||
*/
|
||||
private String fireRegionId;
|
||||
|
||||
/**
|
||||
* 负责部门ID
|
||||
*/
|
||||
private Long departmentId;
|
||||
|
||||
|
||||
/**
|
||||
* 当前负责人ID
|
||||
*/
|
||||
private Long managerId;
|
||||
|
||||
|
||||
/**
|
||||
* 报警级别
|
||||
*/
|
||||
private String alarmLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 报警类型
|
||||
*/
|
||||
private String alarmType;
|
||||
|
||||
|
||||
/**
|
||||
* 阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW
|
||||
*/
|
||||
private String thresholdType;
|
||||
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
private BigDecimal currentValue;
|
||||
|
||||
|
||||
/**
|
||||
* 比较方向 UP/DOWN
|
||||
*/
|
||||
private String compareFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
|
||||
/**
|
||||
* 报警描述
|
||||
*/
|
||||
private String alarmDesc;
|
||||
|
||||
/**
|
||||
* 报警时间
|
||||
*/
|
||||
private String alarmTime;
|
||||
|
||||
|
||||
/**
|
||||
* 报警时间
|
||||
*/
|
||||
private LocalDateTime alarmTime;
|
||||
|
||||
/**
|
||||
* 当前状态 10待研判/20待处置/30已消警/40误报
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
private String assignTime;
|
||||
|
||||
/**
|
||||
* 处置时间
|
||||
*/
|
||||
private String disposeTime;
|
||||
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
private LocalDateTime assignTime;
|
||||
|
||||
/**
|
||||
* 处置时间
|
||||
*/
|
||||
private LocalDateTime disposeTime;
|
||||
|
||||
/**
|
||||
* 处置人ID
|
||||
*/
|
||||
private Long disposeUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 当前处置结果快照
|
||||
*/
|
||||
private String disposeResult;
|
||||
|
||||
|
||||
/**
|
||||
* 当前处置说明快照
|
||||
*/
|
||||
private String disposeRemark;
|
||||
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
* 处置视频地址
|
||||
*/
|
||||
private String pictureUrls;
|
||||
|
||||
private String videoUrl;
|
||||
|
||||
/**
|
||||
* 外部记录唯一键
|
||||
*/
|
||||
private String sourceRecordKey;
|
||||
|
||||
|
||||
/**
|
||||
* 是否活跃告警
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private String deleteEnum;
|
||||
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
/**
|
||||
* 组织ID
|
||||
*/
|
||||
private Long orgId;
|
||||
}
|
||||
|
||||
public void init(){
|
||||
this.setStatus(30);
|
||||
this.setDisposeTime(LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ public class DeviceRegionE extends BaseE {
|
|||
*/
|
||||
private String regionConfigId;
|
||||
|
||||
/**
|
||||
* 外部消防区域主键
|
||||
*/
|
||||
private Long fireRegionId;
|
||||
/**
|
||||
* 外部消防区域主键
|
||||
*/
|
||||
private String fireRegionId;
|
||||
|
||||
/**
|
||||
* 外部消防区域名称
|
||||
|
|
|
|||
|
|
@ -18,20 +18,20 @@ public class RegionSensorRelE extends BaseE {
|
|||
*/
|
||||
private String regionSensorRelId;
|
||||
|
||||
/**
|
||||
* 区域配置主键ID
|
||||
*/
|
||||
private Long regionConfigId;
|
||||
|
||||
/**
|
||||
* 外部消防区域ID
|
||||
*/
|
||||
private Long fireRegionId;
|
||||
|
||||
/**
|
||||
* 传感器ID
|
||||
*/
|
||||
private Long sensorId;
|
||||
/**
|
||||
* 区域配置主键ID
|
||||
*/
|
||||
private String regionConfigId;
|
||||
|
||||
/**
|
||||
* 外部消防区域ID
|
||||
*/
|
||||
private String fireRegionId;
|
||||
|
||||
/**
|
||||
* 传感器设备ID
|
||||
*/
|
||||
private String sensorDeviceId;
|
||||
|
||||
/**
|
||||
* 传感器编码快照
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ public class SensorDeviceE extends BaseE {
|
|||
*/
|
||||
private String sensorName;
|
||||
|
||||
/**
|
||||
* 传感器类型主键ID
|
||||
*/
|
||||
private Long sensorTypeId;
|
||||
/**
|
||||
* 传感器类型主键ID
|
||||
*/
|
||||
private String sensorTypeId;
|
||||
|
||||
/**
|
||||
* 传感器属性快照(NUMBER/SWITCH)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import com.jjb.saas.framework.domain.model.BaseE;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* SensorTypeE - 传感器类型实体
|
||||
* @Author wangyan
|
||||
|
|
@ -29,20 +31,10 @@ public class SensorTypeE extends BaseE {
|
|||
private String typeName;
|
||||
|
||||
/**
|
||||
* 传感器属性(STRING/NUMBER/SWITCH)
|
||||
* 传感器属性(NUMBER/SWITCH)
|
||||
*/
|
||||
private String sensorAttr;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortNo;
|
||||
|
||||
/**
|
||||
* 状态(1:启用 0:停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
|
@ -57,4 +49,29 @@ public class SensorTypeE extends BaseE {
|
|||
* 组织ID
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
private String env;
|
||||
|
||||
/**
|
||||
* 低低报阈值
|
||||
*/
|
||||
private BigDecimal thresholdLowLow;
|
||||
|
||||
/**
|
||||
* 低报阈值
|
||||
*/
|
||||
private BigDecimal thresholdLow;
|
||||
|
||||
/**
|
||||
* 高报阈值
|
||||
*/
|
||||
private BigDecimal thresholdHigh;
|
||||
|
||||
/**
|
||||
* 高高报阈值
|
||||
*/
|
||||
private BigDecimal thresholdHighHigh;
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AlarmRecordGatewayImpl implements AlarmRecordGateway {
|
||||
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
|
||||
@Override
|
||||
|
|
@ -55,7 +55,7 @@ public class AlarmRecordGatewayImpl implements AlarmRecordGateway {
|
|||
LambdaQueryWrapper<AlarmRecordDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(AlarmRecordDO::getAlarmNo, alarmNo)
|
||||
.eq(AlarmRecordDO::getDeleteEnum, "FALSE");
|
||||
|
||||
|
||||
AlarmRecordDO d = alarmRecordRepository.getOne(wrapper);
|
||||
if (d == null) {
|
||||
return null;
|
||||
|
|
@ -70,7 +70,7 @@ public class AlarmRecordGatewayImpl implements AlarmRecordGateway {
|
|||
LambdaQueryWrapper<AlarmRecordDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(AlarmRecordDO::getTenantId, tenantId)
|
||||
.eq(AlarmRecordDO::getDeleteEnum, "FALSE");
|
||||
|
||||
|
||||
List<AlarmRecordDO> list = alarmRecordRepository.list(wrapper);
|
||||
return list.stream().map(d -> {
|
||||
AlarmRecordE alarmRecordE = new AlarmRecordE();
|
||||
|
|
@ -84,8 +84,9 @@ public class AlarmRecordGatewayImpl implements AlarmRecordGateway {
|
|||
AlarmRecordDO d = new AlarmRecordDO();
|
||||
d.setId(id);
|
||||
d.setStatus(status);
|
||||
d.setAssignTime(assignTime);
|
||||
// TODO 待完善
|
||||
// d.setAssignTime(assignTime);
|
||||
alarmRecordRepository.updateById(d);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,11 +56,13 @@ public class DeviceRegionGatewayImpl implements DeviceRegionGateway {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DeviceRegionE getByFireRegionId(Long fireRegionId) {
|
||||
public DeviceRegionE getByFireRegionId(String fireRegionId) {
|
||||
LambdaQueryWrapper<DeviceRegionDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(DeviceRegionDO::getFireRegionId, fireRegionId)
|
||||
.eq(DeviceRegionDO::getDeleteEnum, "FALSE");
|
||||
|
||||
if (fireRegionId != null) {
|
||||
wrapper.eq(DeviceRegionDO::getFireRegionId, Long.parseLong(fireRegionId))
|
||||
.eq(DeviceRegionDO::getDeleteEnum, "FALSE");
|
||||
}
|
||||
|
||||
DeviceRegionDO d = deviceRegionRepository.getOne(wrapper);
|
||||
if (d == null) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -29,18 +29,18 @@ public class RegionSensorRelGatewayImpl implements RegionSensorRelGateway {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteBySensorId(Long sensorId) {
|
||||
public Boolean deleteBySensorId(String sensorDeviceId) {
|
||||
LambdaQueryWrapper<RegionSensorRelDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(RegionSensorRelDO::getSensorId, sensorId);
|
||||
wrapper.eq(RegionSensorRelDO::getSensorDeviceId, sensorDeviceId);
|
||||
return regionSensorRelRepository.remove(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionSensorRelE getBySensorId(Long sensorId) {
|
||||
public RegionSensorRelE getBySensorId(String sensorDeviceId) {
|
||||
LambdaQueryWrapper<RegionSensorRelDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(RegionSensorRelDO::getSensorId, sensorId)
|
||||
wrapper.eq(RegionSensorRelDO::getSensorDeviceId, sensorDeviceId)
|
||||
.eq(RegionSensorRelDO::getDeleteEnum, "FALSE");
|
||||
|
||||
|
||||
RegionSensorRelDO d = regionSensorRelRepository.getOne(wrapper);
|
||||
if (d == null) {
|
||||
return null;
|
||||
|
|
@ -51,11 +51,11 @@ public class RegionSensorRelGatewayImpl implements RegionSensorRelGateway {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Boolean isSensorBound(Long sensorId) {
|
||||
public Boolean isSensorBound(String sensorDeviceId) {
|
||||
LambdaQueryWrapper<RegionSensorRelDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(RegionSensorRelDO::getSensorId, sensorId)
|
||||
wrapper.eq(RegionSensorRelDO::getSensorDeviceId, sensorDeviceId)
|
||||
.eq(RegionSensorRelDO::getDeleteEnum, "FALSE");
|
||||
|
||||
|
||||
long count = regionSensorRelRepository.count(wrapper);
|
||||
return count > 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
package com.zcloud.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* AlarmDisposeLogDO - 报警处置日志数据对象
|
||||
* @Author wangyan
|
||||
|
|
@ -16,47 +17,38 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("iot_alarm_disposal_log")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmDisposeLogDO extends BaseDO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String alarmDisposalLogId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警主键ID")
|
||||
private Long alarmId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警编号(32位)")
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作类型 AUTO_ASSIGN/MANUAL_ASSIGN/DISPOSE/INVALID")
|
||||
private String actionType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "变更前状态")
|
||||
private Integer beforeStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "变更后状态")
|
||||
private Integer afterStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作人ID")
|
||||
private Long operatorId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作说明")
|
||||
private String actionDesc;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置结果")
|
||||
private String resultText;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "附件图片")
|
||||
private String pictureUrls;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
private String actionTime;
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
@TableLogic
|
||||
private String deleteEnum = "FALSE";
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
private LocalDateTime actionTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* AlarmRecordDO - 报警记录数据对象
|
||||
|
|
@ -19,115 +20,132 @@ import java.math.BigDecimal;
|
|||
@TableName("iot_alarm_record")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmRecordDO extends BaseDO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String alarmRecordId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警编号(32位)")
|
||||
private String alarmNo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警来源 THRESHOLD/DCS")
|
||||
private String alarmSource;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "设备来源描述快照")
|
||||
private String deviceSourceDesc;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID")
|
||||
private Long sensorId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器设备ID")
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
private String fireRegionId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "消防区域名称")
|
||||
private String fireRegionName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "负责部门名称")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "当前负责人姓名")
|
||||
private String managerName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警级别名称")
|
||||
private String alarmLevelName;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
@ApiModelProperty(value = "阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW")
|
||||
private String thresholdType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "告警值")
|
||||
private BigDecimal currentValue;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "比较方向 UP/DOWN")
|
||||
private String compareFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警描述")
|
||||
private String alarmDesc;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
private LocalDateTime alarmTime;
|
||||
|
||||
@ApiModelProperty(value = "当前状态 10待研判/20待处置/30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "分配时间")
|
||||
private String assignTime;
|
||||
|
||||
private LocalDateTime assignTime;
|
||||
|
||||
@ApiModelProperty(value = "处置时间")
|
||||
private String disposeTime;
|
||||
|
||||
private LocalDateTime disposeTime;
|
||||
|
||||
@ApiModelProperty(value = "处置人ID")
|
||||
private Long disposeUserId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "处置人姓名")
|
||||
private String disposeUserName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前处置结果快照")
|
||||
private String disposeResult;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前处置说明快照")
|
||||
private String disposeRemark;
|
||||
|
||||
@ApiModelProperty(value = "图片地址")
|
||||
private String pictureUrls;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "处置视频地址")
|
||||
private String videoUrl;
|
||||
|
||||
@ApiModelProperty(value = "外部记录唯一键")
|
||||
private String sourceRecordKey;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否活跃告警")
|
||||
private Integer activeFlag;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
@TableLogic
|
||||
private String deleteEnum = "FALSE";
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "量程下限")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal rangeMin;
|
||||
@ApiModelProperty(value = "量程上限")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal rangeMax;
|
||||
@ApiModelProperty(value = "低低报阈值")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal thresholdLowLow;
|
||||
@ApiModelProperty(value = "低报阈值")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal thresholdLow;
|
||||
@ApiModelProperty(value = "高报阈值")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal thresholdHigh;
|
||||
@ApiModelProperty(value = "高高报阈值")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal thresholdHighHigh;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.zcloud.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -17,51 +16,41 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("iot_alarm_region_config")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeviceRegionDO extends BaseDO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String regionConfigId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域主键")
|
||||
private Long fireRegionId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "外部消防区域名称")
|
||||
private String fireRegionName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域编码")
|
||||
private String fireRegionCode;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "负责部门名称")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "负责人姓名")
|
||||
private String managerName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "状态 1启用0停用")
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "已绑定传感器数量")
|
||||
private Integer bindSensorCount;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
@TableLogic
|
||||
private String deleteEnum = "FALSE";
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.zcloud.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -16,29 +15,20 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("iot_alarm_region_sensor_rel")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RegionSensorRelDO extends BaseDO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String regionSensorRelId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "区域配置主键ID")
|
||||
private Long regionConfigId;
|
||||
|
||||
private String regionConfigId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域ID")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID")
|
||||
private Long sensorId;
|
||||
|
||||
private String fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "传感器设备ID")
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码快照")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
@TableLogic
|
||||
private String deleteEnum = "FALSE";
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package com.zcloud.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* SensorDeviceDO - 传感器设备数据对象
|
||||
* @Author wangyan
|
||||
|
|
@ -17,26 +18,26 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("iot_alarm_sensor_device")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorDeviceDO extends BaseDO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器设备业务ID")
|
||||
private String sensorDeviceId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID")
|
||||
private Long sensorTypeId;
|
||||
private String sensorTypeId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "传感器类型名称")
|
||||
private String sensorTypeName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器属性快照(NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "安装位置")
|
||||
private String installPosition;
|
||||
|
||||
|
|
@ -45,59 +46,47 @@ public class SensorDeviceDO extends BaseDO {
|
|||
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private String latitude;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器状态")
|
||||
private String sensorStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否定位(0否1是)")
|
||||
private Integer positioningFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警开关(1开0关)")
|
||||
private Integer alarmSwitch;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否阈值设定(0否1是)")
|
||||
private Integer thresholdFlag;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "量程下限")
|
||||
private String rangeMin;
|
||||
|
||||
private BigDecimal rangeMin;
|
||||
|
||||
@ApiModelProperty(value = "量程上限")
|
||||
private String rangeMax;
|
||||
|
||||
private BigDecimal rangeMax;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值")
|
||||
private String thresholdLowLow;
|
||||
|
||||
private BigDecimal thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值")
|
||||
private String thresholdLow;
|
||||
|
||||
private BigDecimal thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值")
|
||||
private String thresholdHigh;
|
||||
|
||||
private BigDecimal thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值")
|
||||
private String thresholdHighHigh;
|
||||
|
||||
private BigDecimal thresholdHighHigh;
|
||||
|
||||
@ApiModelProperty(value = "连续报警确认次数")
|
||||
private Integer continuousAlarmCount;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "出厂日期")
|
||||
private String factoryDate;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "企业侧源编码")
|
||||
private String enterpriseSourceCode;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
@TableLogic
|
||||
private String deleteEnum = "FALSE";
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
package com.zcloud.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* SensorTypeDO - 传感器类型数据对象
|
||||
* @Author wangyan
|
||||
|
|
@ -16,35 +17,42 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("iot_alarm_sensor_type")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorTypeDO extends BaseDO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器类型业务ID")
|
||||
private String sensorTypeId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "类型编码")
|
||||
private String typeCode;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "量程上限")
|
||||
private BigDecimal rangeMax;
|
||||
|
||||
@ApiModelProperty(value = "量程下限")
|
||||
private BigDecimal rangeMin;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值")
|
||||
private BigDecimal thresholdHighHigh;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值")
|
||||
private BigDecimal thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值")
|
||||
private BigDecimal thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值")
|
||||
private BigDecimal thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
@TableLogic
|
||||
private String deleteEnum = "FALSE";
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
|
||||
<sql id="alarmRecordBaseJoins">
|
||||
FROM iot_alarm_record ar
|
||||
LEFT JOIN `jjb-saas-zcloud-fire-check`.fire_region fr ON ar.fire_region_id = fr.id AND fr.delete_enum = 'FALSE'
|
||||
LEFT JOIN fire_region fr ON ar.fire_region_id = fr.id AND fr.delete_enum = 'FALSE'
|
||||
LEFT JOIN department dep ON ar.department_id = dep.id AND dep.delete_enum = 'FALSE'
|
||||
LEFT JOIN user mgr ON ar.manager_id = mgr.id AND mgr.delete_enum = 'FALSE'
|
||||
LEFT JOIN iot_alarm_sensor_device sd ON ar.sensor_id = sd.id AND sd.delete_enum = 'FALSE'
|
||||
LEFT JOIN iot_alarm_sensor_device sd ON ar.sensor_device_id = sd.sensor_device_id AND sd.delete_enum = 'FALSE'
|
||||
LEFT JOIN user u ON ar.dispose_user_id = u.id
|
||||
</sql>
|
||||
|
||||
|
|
@ -152,8 +152,10 @@
|
|||
<include refid="alarmRecordBaseJoins"/>
|
||||
<where>
|
||||
ar.delete_enum = 'FALSE'
|
||||
AND ar.status = 20
|
||||
AND ar.active_flag = 1
|
||||
<if test="params.status != null">
|
||||
AND ar.status = #{params.status}
|
||||
</if>
|
||||
-- AND ar.active_flag = 1
|
||||
<if test="params.tenantId != null">
|
||||
AND ar.tenant_id = #{params.tenantId}
|
||||
</if>
|
||||
|
|
@ -169,9 +171,15 @@
|
|||
<if test="params.sensorCode != null and params.sensorCode != ''">
|
||||
AND ar.sensor_code LIKE CONCAT('%', #{params.sensorCode}, '%')
|
||||
</if>
|
||||
<if test="params.sensorName != null and params.sensorName != ''">
|
||||
AND sd.sensor_name LIKE CONCAT('%', #{params.sensorName}, '%')
|
||||
</if>
|
||||
<if test="params.fireRegionId != null">
|
||||
AND ar.fire_region_id = #{params.fireRegionId}
|
||||
</if>
|
||||
<if test="params.disposeUserId != null">
|
||||
AND ar.dispose_user_id = #{params.disposeUserId}
|
||||
</if>
|
||||
<if test="params.alarmLevel != null and params.alarmLevel != ''">
|
||||
AND ar.alarm_level = #{params.alarmLevel}
|
||||
</if>
|
||||
|
|
@ -193,7 +201,14 @@
|
|||
|
||||
<select id="detailView" resultType="com.zcloud.persistence.dataobject.AlarmRecordDO">
|
||||
SELECT
|
||||
<include refid="alarmRecordBaseColumns"/>
|
||||
<include refid="alarmRecordBaseColumns"/>,
|
||||
sd.unit_name,
|
||||
sd.range_min,
|
||||
sd.range_max,
|
||||
sd.threshold_low_low,
|
||||
sd.threshold_low,
|
||||
sd.threshold_high,
|
||||
sd.threshold_high_high
|
||||
<include refid="alarmRecordBaseJoins"/>
|
||||
<where>
|
||||
ar.id = #{id}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,10 @@
|
|||
rc.update_time AS updateTime,
|
||||
rc.tenant_id AS tenantId,
|
||||
rc.org_id AS orgId,
|
||||
rc.version AS version,
|
||||
rc.env AS env,
|
||||
IFNULL(bindRel.bindSensorCount, 0) AS bindSensorCount
|
||||
FROM `jjb-saas-zcloud-fire-check`.fire_region fr
|
||||
FROM fire_region fr
|
||||
LEFT JOIN iot_alarm_region_config rc ON rc.fire_region_id = fr.id AND rc.delete_enum = 'FALSE'
|
||||
LEFT JOIN department d ON fr.department_id = d.id AND d.delete_enum = 'FALSE'
|
||||
LEFT JOIN user u ON rc.manager_id = u.id AND u.delete_enum = 'FALSE'
|
||||
|
|
|
|||
Loading…
Reference in New Issue