From 90d8d04632b23d023e454e8f7ca3f6d98f02a72f Mon Sep 17 00:00:00 2001 From: JayWenStar <1599603313@qq.com> Date: Wed, 9 Feb 2022 10:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=A4=9A=E4=B8=AA=E5=85=AC=E5=85=B1=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E6=97=B6=E5=88=A0=E9=99=A4=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/impl/PublicStepsServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/PublicStepsServiceImpl.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/PublicStepsServiceImpl.java index 4b4d96fc..7b719e97 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/PublicStepsServiceImpl.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/PublicStepsServiceImpl.java @@ -135,13 +135,14 @@ public PublicStepsDTO findById(int id) { @Override @Transactional(rollbackFor = Exception.class) public boolean deleteByProjectId(int projectId) { - PublicSteps publicSteps = lambdaQuery().eq(PublicSteps::getProjectId, projectId).one(); - if (!ObjectUtils.isEmpty(publicSteps)) { - publicStepsStepsMapper.delete(new LambdaQueryWrapper() - .eq(PublicStepsSteps::getPublicStepsId, publicSteps.getId())); - delete(publicSteps.getId()); - return true; + List publicSteps = lambdaQuery().eq(PublicSteps::getProjectId, projectId).list(); + for (PublicSteps publicStep : publicSteps) { + if (!ObjectUtils.isEmpty(publicSteps)) { + publicStepsStepsMapper.delete(new LambdaQueryWrapper() + .eq(PublicStepsSteps::getPublicStepsId, publicStep.getId())); + delete(publicStep.getId()); + } } - return false; + return true; } }