From 36661a6d53fce24d0d2c6664236e1bdc38a34169 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Fri, 16 Aug 2024 11:59:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zc/business/mapper/DcWarningMapper.java | 2 ++ .../com/zc/business/service/impl/DcWarningServiceImpl.java | 6 +++++- .../src/main/resources/mapper/business/DcWarningMapper.xml | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java index a480dbef..4018d62b 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java @@ -159,4 +159,6 @@ public interface DcWarningMapper public HashMap selectDispatchId(@Param("eventId")String eventId); Long selectWarningNum(); + //事件验证是否存在 + public String selectEventId(@Param("eventId")String eventId); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 510532fe..a47f7213 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -564,11 +564,15 @@ public class DcWarningServiceImpl implements IDcWarningService { if (UniversalEnum.SIX.getValue().equals(dcWarning.getWarningSource().toString())) { return AjaxResult.error("非机预警无需转换"); } + String selectEventId = dcWarningMapper.selectEventId(dcWarning.getId());//验证转换的对象是否已经在事件表中存在 + if (StringUtils.isNotBlank(selectEventId)){ + return AjaxResult.success(); + } ArrayList> hashMaps = new ArrayList<>(); dcWarning.setUserId(SecurityUtils.getUserId()); int updateState = dcWarningMapper.updateState(dcWarning);//感知事件状态改变为已完成 if (updateState == UniversalEnum.ZERO.getNumber()) { - return AjaxResult.error(UniversalEnum.OPERATION_FAILURE.getValue()); + return AjaxResult.success(); } String stakeMark = dcWarning.getStakeMark(); DcEvent dcEvent = new DcEvent(); diff --git a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml index 1071d033..9d3a84c2 100644 --- a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml @@ -444,5 +444,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +