Skip to content

Commit

Permalink
Merge pull request #128 from JayWenStar/fix_delete_bug
Browse files Browse the repository at this point in the history
🐛: 修复存在多个公共步骤时删除失败的问题
  • Loading branch information
ZhouYixun authored Feb 9, 2022
2 parents d34a4b6 + 90d8d04 commit 66ad083
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<PublicStepsSteps>()
.eq(PublicStepsSteps::getPublicStepsId, publicSteps.getId()));
delete(publicSteps.getId());
return true;
List<PublicSteps> publicSteps = lambdaQuery().eq(PublicSteps::getProjectId, projectId).list();
for (PublicSteps publicStep : publicSteps) {
if (!ObjectUtils.isEmpty(publicSteps)) {
publicStepsStepsMapper.delete(new LambdaQueryWrapper<PublicStepsSteps>()
.eq(PublicStepsSteps::getPublicStepsId, publicStep.getId()));
delete(publicStep.getId());
}
}
return false;
return true;
}
}

0 comments on commit 66ad083

Please sign in to comment.