diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index ee191c68..e21de6a3 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.io.IOException; @@ -718,6 +719,30 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { dcEmergencyPlans.getDcExecuteAction() .forEach(dcExecuteAction -> { List dcDevices = ruleFiltering(dcExecuteAction, markArray, direction); + + // 此代码 是为了防止事件没有匹配到预案,但是还执行了设备控制,并且执行操作中带有智能发布 + boolean isIdEmpty = ObjectUtils.isEmpty(dcEmergencyPlans.getId()); + Set targetDeviceTypes = new HashSet<>(Arrays.asList( + DeviceTypeEnum.ROAD_SECTION_VOICE_BROADCASTING.getCode(), + DeviceTypeEnum.VARIABLE_INFORMATION_FLAG.getCode() + )); + boolean isTargetDeviceType = targetDeviceTypes.contains(dcExecuteAction.getDeviceType()); + if (isIdEmpty && isTargetDeviceType) { + String configJson = operationType.equals(1) ? dcExecuteAction.getExecuteConfig() : dcExecuteAction.getRecoverConfig(); + JSONObject config = JSON.parseObject(configJson); + if (config.getString("operationType").equals("2")) { + DcEvent dcEvent = dcEventAnDcEmergencyPlans.getDcEvent(); + String content = intelligentPublishingOfInformation(dcEvent); + updateIntelligentPublishingContent( + dcExecuteAction, + markArray, + dcEvent, + content, + dcEvent.getDirection() + ); + } + } + JSONObject otherConfig = operationType.equals(1)? JSON.parseObject(dcExecuteAction.getExecuteConfig()): JSON.parseObject(dcExecuteAction.getRecoverConfig()); try {