From f504ed6528c4fe8b97b29eccfc12218e0c91c5e9 Mon Sep 17 00:00:00 2001 From: songjun Date: Fri, 20 Oct 2023 17:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TesterExecutorServiceImpl.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tester/src/main/java/com/ruoyi/tester/service/impl/TesterExecutorServiceImpl.java b/tester/src/main/java/com/ruoyi/tester/service/impl/TesterExecutorServiceImpl.java index aed6952..3e7c432 100644 --- a/tester/src/main/java/com/ruoyi/tester/service/impl/TesterExecutorServiceImpl.java +++ b/tester/src/main/java/com/ruoyi/tester/service/impl/TesterExecutorServiceImpl.java @@ -48,18 +48,10 @@ public class TesterExecutorServiceImpl implements ITesterExecutorService { Set thisRelationIdSet = effectiveList.stream().map(x -> x.getRelationId()).collect(Collectors.toSet()); for (TaskInterfaceEffectiveInfo item : effectiveList){ - boolean missDependRelation = false; - for (Long dependRelationId : item.getDependRelationIdList()) { - if (!thisRelationIdSet.contains(dependRelationId)) { - missDependRelation = true; - } - } - if (missDependRelation) { - InterfaceCallLog interfaceCallLog = new InterfaceCallLog(item, null, null, null, "依赖接口缺失"); - interfaceCallLog.setStatus(InterfaceCallStatus.FAULT); - extraHandler.saveResult(interfaceCallLog, TaskCallProgres.FAULT); - } item.setTaskCallLogId(taskCallLog.getTaskCallLogId()); + + missDependRelation(item, thisRelationIdSet); + if(item.getDependRelationIdList().isEmpty()){ calledStatus.put(item.getRelationId(), IExtraHandler._PROCESSING_); InterfaceExecutorUtil.callInterface(item, extraHandler, effectiveList, calledStatus); @@ -67,6 +59,22 @@ public class TesterExecutorServiceImpl implements ITesterExecutorService { } } + //是否缺失要执行的依赖关系 + private boolean missDependRelation(TaskInterfaceEffectiveInfo item, Set thisRelationIdSet){ + boolean missDependRelation = false; + for (Long dependRelationId : item.getDependRelationIdList()) { + if (!thisRelationIdSet.contains(dependRelationId)) { + missDependRelation = true; + } + } + if (missDependRelation) { + InterfaceCallLog interfaceCallLog = new InterfaceCallLog(item, null, null, null, "依赖接口缺失"); + interfaceCallLog.setStatus(InterfaceCallStatus.FAULT); + extraHandler.saveResult(interfaceCallLog, TaskCallProgres.FAULT); + } + return missDependRelation; + } + @Override public List swaggerSearch(String swaggerResourcesUrl) { List ret = new ArrayList(); -- Gitee