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" +