增加事件处理详情
This commit is contained in:
parent
73e47e5127
commit
49401d42ba
@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【请填写功能名称】
|
* 事件附件
|
||||||
* 前端访问路由地址为:/system/alarmEventAttachments
|
* 前端访问路由地址为:/system/alarmEventAttachments
|
||||||
*
|
*
|
||||||
* @author mocheng
|
* @author mocheng
|
||||||
@ -39,41 +39,37 @@ public class SisAlarmEventAttachmentsController extends BaseController {
|
|||||||
private final ISisAlarmEventAttachmentsService sisAlarmEventAttachmentsService;
|
private final ISisAlarmEventAttachmentsService sisAlarmEventAttachmentsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询【请填写功能名称】列表
|
* 查询事件附件列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:list")
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<SisAlarmEventAttachmentsVo> list(SisAlarmEventAttachmentsBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SisAlarmEventAttachmentsVo> list(SisAlarmEventAttachmentsBo bo, PageQuery pageQuery) {
|
||||||
return sisAlarmEventAttachmentsService.queryPageList(bo, pageQuery);
|
return sisAlarmEventAttachmentsService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询【请填写功能名称】列表
|
* 查询事件附件列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:list")
|
|
||||||
@GetMapping("/query/{alarmId}")
|
@GetMapping("/query/{alarmId}")
|
||||||
public R<List<SisAlarmEventAttachmentsVo>> queryListByAlarmId(@PathVariable("alarmId") String alarmId) {
|
public R<List<SisAlarmEventAttachmentsVo>> queryListByAlarmId(@PathVariable("alarmId") Long alarmId) {
|
||||||
return R.ok(sisAlarmEventAttachmentsService.queryListByAlarmId(alarmId));
|
return R.ok(sisAlarmEventAttachmentsService.queryListByAlarmId(alarmId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出【请填写功能名称】列表
|
* 导出事件附件列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:export")
|
@Log(title = "事件附件", businessType = BusinessType.EXPORT)
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SisAlarmEventAttachmentsBo bo, HttpServletResponse response) {
|
public void export(SisAlarmEventAttachmentsBo bo, HttpServletResponse response) {
|
||||||
List<SisAlarmEventAttachmentsVo> list = sisAlarmEventAttachmentsService.queryList(bo);
|
List<SisAlarmEventAttachmentsVo> list = sisAlarmEventAttachmentsService.queryList(bo);
|
||||||
ExcelUtil.exportExcel(list, "【请填写功能名称】", SisAlarmEventAttachmentsVo.class, response);
|
ExcelUtil.exportExcel(list, "事件附件", SisAlarmEventAttachmentsVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取【请填写功能名称】详细信息
|
* 获取事件附件详细信息
|
||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:query")
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<SisAlarmEventAttachmentsVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<SisAlarmEventAttachmentsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable("id") Long id) {
|
@PathVariable("id") Long id) {
|
||||||
@ -81,10 +77,9 @@ public class SisAlarmEventAttachmentsController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增【请填写功能名称】
|
* 新增事件附件
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:add")
|
@Log(title = "事件附件", businessType = BusinessType.INSERT)
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SisAlarmEventAttachmentsBo bo) {
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SisAlarmEventAttachmentsBo bo) {
|
||||||
@ -92,10 +87,9 @@ public class SisAlarmEventAttachmentsController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改【请填写功能名称】
|
* 修改事件附件
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:edit")
|
@Log(title = "事件附件", businessType = BusinessType.UPDATE)
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SisAlarmEventAttachmentsBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SisAlarmEventAttachmentsBo bo) {
|
||||||
@ -103,12 +97,11 @@ public class SisAlarmEventAttachmentsController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除【请填写功能名称】
|
* 删除事件附件
|
||||||
*
|
*
|
||||||
* @param ids 主键串
|
* @param ids 主键串
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:alarmEventAttachments:remove")
|
@Log(title = "事件附件", businessType = BusinessType.DELETE)
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable("ids") Long[] ids) {
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
@ -103,4 +103,13 @@ public class SisAlarmEventProcessController extends BaseController {
|
|||||||
@PathVariable("ids") Long[] ids) {
|
@PathVariable("ids") Long[] ids) {
|
||||||
return toAjax(sisAlarmEventProcessService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(sisAlarmEventProcessService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询处理结果信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/query/result/{alarmId}")
|
||||||
|
public R<SisAlarmEventProcessVo> queryResult(@PathVariable("alarmId") Long alarmId) {
|
||||||
|
return R.ok(sisAlarmEventProcessService.queryResult(alarmId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ public class AlarmCompleteBo {
|
|||||||
/**
|
/**
|
||||||
* 附件信息(任务完成上传的图片或者文件)
|
* 附件信息(任务完成上传的图片或者文件)
|
||||||
*/
|
*/
|
||||||
private List<String> attachments;
|
private List<Long> attachments;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
package org.dromara.sis.domain.vo;
|
package org.dromara.sis.domain.vo;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.dromara.sis.domain.SisAlarmEventProcess;
|
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.sis.domain.SisAlarmEventProcess;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,4 +73,8 @@ public class SisAlarmEventProcessVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件列表
|
||||||
|
*/
|
||||||
|
private List<SisAlarmEventAttachmentsVo> attachments;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ public class HikApiService {
|
|||||||
@Resource
|
@Resource
|
||||||
private HikEqpConfig hikEqpConfig;
|
private HikEqpConfig hikEqpConfig;
|
||||||
|
|
||||||
private static final String URL_PREFIX = "http://127.0.0.1/eqp/hik/";
|
|
||||||
private static final String LOGIN_URI = "login";
|
private static final String LOGIN_URI = "login";
|
||||||
private static final String LOGOUT_URI = "logout";
|
private static final String LOGOUT_URI = "logout";
|
||||||
private static final String CHANNEL_LIST = "channel/list";
|
private static final String CHANNEL_LIST = "channel/list";
|
||||||
|
@ -80,6 +80,6 @@ public interface ISisAlarmEventAttachmentsService {
|
|||||||
* @param alarmId 告警id
|
* @param alarmId 告警id
|
||||||
* @return 返回附件列表
|
* @return 返回附件列表
|
||||||
*/
|
*/
|
||||||
List<SisAlarmEventAttachmentsVo> queryListByAlarmId(String alarmId);
|
List<SisAlarmEventAttachmentsVo> queryListByAlarmId(Long alarmId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,11 @@ public interface ISisAlarmEventProcessService {
|
|||||||
* @return 返回是否写入成功
|
* @return 返回是否写入成功
|
||||||
*/
|
*/
|
||||||
Boolean insert(SisAlarmEventProcess process);
|
Boolean insert(SisAlarmEventProcess process);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询事件处理结果
|
||||||
|
* @param alarmId 处理结果信息
|
||||||
|
* @return 返回处理结果
|
||||||
|
*/
|
||||||
|
SisAlarmEventProcessVo queryResult(Long alarmId);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ public class SisAlarmEventAttachmentsServiceImpl implements ISisAlarmEventAttach
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SisAlarmEventAttachmentsVo> queryListByAlarmId(String alarmId) {
|
public List<SisAlarmEventAttachmentsVo> queryListByAlarmId(Long alarmId) {
|
||||||
LambdaQueryWrapper<SisAlarmEventAttachments> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SisAlarmEventAttachments> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(SisAlarmEventAttachments::getEventId, alarmId);
|
lqw.eq(SisAlarmEventAttachments::getEventId, alarmId);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
|
@ -11,8 +11,10 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
|||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.sis.domain.SisAlarmEventProcess;
|
import org.dromara.sis.domain.SisAlarmEventProcess;
|
||||||
import org.dromara.sis.domain.bo.SisAlarmEventProcessBo;
|
import org.dromara.sis.domain.bo.SisAlarmEventProcessBo;
|
||||||
|
import org.dromara.sis.domain.vo.SisAlarmEventAttachmentsVo;
|
||||||
import org.dromara.sis.domain.vo.SisAlarmEventProcessVo;
|
import org.dromara.sis.domain.vo.SisAlarmEventProcessVo;
|
||||||
import org.dromara.sis.mapper.SisAlarmEventProcessMapper;
|
import org.dromara.sis.mapper.SisAlarmEventProcessMapper;
|
||||||
|
import org.dromara.sis.service.ISisAlarmEventAttachmentsService;
|
||||||
import org.dromara.sis.service.ISisAlarmEventProcessService;
|
import org.dromara.sis.service.ISisAlarmEventProcessService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -32,6 +34,7 @@ import java.util.Map;
|
|||||||
public class SisAlarmEventProcessServiceImpl implements ISisAlarmEventProcessService {
|
public class SisAlarmEventProcessServiceImpl implements ISisAlarmEventProcessService {
|
||||||
|
|
||||||
private final SisAlarmEventProcessMapper baseMapper;
|
private final SisAlarmEventProcessMapper baseMapper;
|
||||||
|
private final ISisAlarmEventAttachmentsService sisAlarmEventAttachmentsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询告警信息处理流程记录
|
* 查询告警信息处理流程记录
|
||||||
@ -139,4 +142,19 @@ public class SisAlarmEventProcessServiceImpl implements ISisAlarmEventProcessSer
|
|||||||
public Boolean insert(SisAlarmEventProcess process) {
|
public Boolean insert(SisAlarmEventProcess process) {
|
||||||
return baseMapper.insert(process) > 0;
|
return baseMapper.insert(process) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SisAlarmEventProcessVo queryResult(Long alarmId) {
|
||||||
|
LambdaQueryWrapper<SisAlarmEventProcess> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(SisAlarmEventProcess::getAlarmId, alarmId);
|
||||||
|
lqw.eq(SisAlarmEventProcess::getState, 40);
|
||||||
|
SisAlarmEventProcessVo sisAlarmEventProcessVo = baseMapper.selectVoById(alarmId);
|
||||||
|
if (sisAlarmEventProcessVo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 加载附件列表
|
||||||
|
List<SisAlarmEventAttachmentsVo> sisAlarmEventAttachmentsVos = sisAlarmEventAttachmentsService.queryListByAlarmId(alarmId);
|
||||||
|
sisAlarmEventProcessVo.setAttachments(sisAlarmEventAttachmentsVos);
|
||||||
|
return sisAlarmEventProcessVo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,11 +208,23 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
|||||||
alarmEvents.setServBeginTime(now);
|
alarmEvents.setServBeginTime(now);
|
||||||
alarmEvents.setServEndTime(DateUtil.offset(now, DateField.HOUR, 2));
|
alarmEvents.setServEndTime(DateUtil.offset(now, DateField.HOUR, 2));
|
||||||
alarmEvents.setDescription(EventSmallTypeEnum.SMART_REPORT_ZJCR.getDesc());
|
alarmEvents.setDescription(EventSmallTypeEnum.SMART_REPORT_ZJCR.getDesc());
|
||||||
|
|
||||||
int insert = this.baseMapper.insert(alarmEvents);
|
int insert = this.baseMapper.insert(alarmEvents);
|
||||||
log.info("写入报警事件表完成,num={}", insert);
|
log.info("写入报警事件表完成,num={}", insert);
|
||||||
|
|
||||||
|
// 写入事件处理表
|
||||||
|
SisAlarmEventProcess alarmEventProcess = new SisAlarmEventProcess();
|
||||||
|
alarmEventProcess.setId(0L);
|
||||||
|
alarmEventProcess.setAlarmId(0L);
|
||||||
|
alarmEventProcess.setSolveId(0L);
|
||||||
|
alarmEventProcess.setSolveName("");
|
||||||
|
alarmEventProcess.setState(0);
|
||||||
|
alarmEventProcess.setWorkReply("");
|
||||||
|
alarmEventProcess.setWorkReplyTime(new Date());
|
||||||
|
alarmEventProcess.setReceiveTaskTag(0L);
|
||||||
|
alarmEventProcess.setTenantId("");
|
||||||
|
|
||||||
|
|
||||||
// 写入附件表
|
// 写入附件表
|
||||||
// 上传图片
|
|
||||||
List<SisAlarmEventAttachments> ls = new ArrayList<>();
|
List<SisAlarmEventAttachments> ls = new ArrayList<>();
|
||||||
if (smallImg != null && smallImg.length > 0) {
|
if (smallImg != null && smallImg.length > 0) {
|
||||||
ls.add(createEventAttachments(smallImg, alarmEvents, sisDeviceManage));
|
ls.add(createEventAttachments(smallImg, alarmEvents, sisDeviceManage));
|
||||||
@ -303,13 +315,13 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
|||||||
@Override
|
@Override
|
||||||
public Boolean complete(AlarmCompleteBo bo) {
|
public Boolean complete(AlarmCompleteBo bo) {
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
// 验证工单状态
|
// 验证状态
|
||||||
SisAlarmEventsVo sisAlarmEventsVo = this.baseMapper.selectVoById(bo.getAlarmId());
|
SisAlarmEventsVo sisAlarmEventsVo = this.baseMapper.selectVoById(bo.getAlarmId());
|
||||||
if (sisAlarmEventsVo == null) {
|
if (sisAlarmEventsVo == null) {
|
||||||
throw new RuntimeException("工单信息不存在!");
|
throw new RuntimeException("告警信息不存在!");
|
||||||
}
|
}
|
||||||
if (sisAlarmEventsVo.getState().equals(AlarmStatus.REPORTED.getCode())) {
|
if (sisAlarmEventsVo.getState().equals(AlarmStatus.REPORTED.getCode())) {
|
||||||
throw new RuntimeException("当前工单已指派,请刷新后重新指派!");
|
throw new RuntimeException("当前告警已指派,请刷新后重新指派!");
|
||||||
}
|
}
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
SisAlarmEvents events = new SisAlarmEvents();
|
SisAlarmEvents events = new SisAlarmEvents();
|
||||||
@ -332,6 +344,16 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
|||||||
process.setReceiveTaskTag(0L);
|
process.setReceiveTaskTag(0L);
|
||||||
Boolean insert = alarmEventProcessService.insert(process);
|
Boolean insert = alarmEventProcessService.insert(process);
|
||||||
log.info("事件处理信息写入完成,result= {}", insert);
|
log.info("事件处理信息写入完成,result= {}", insert);
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(bo.getAttachments())) {
|
||||||
|
bo.getAttachments().forEach(item -> {
|
||||||
|
SisAlarmEventAttachments eventAttachments = new SisAlarmEventAttachments();
|
||||||
|
eventAttachments.setEventId(process.getId());
|
||||||
|
eventAttachments.setOssId(item);
|
||||||
|
eventAttachments.setType(1L);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user