diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java index 26d1661084..d77640ddea 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java @@ -210,8 +210,9 @@ public class FunctionalCaseDemandService { * @param id 需求关系ID */ public void deleteDemand(String id) { + FunctionalCaseDemand functionalCaseDemandInDb= functionalCaseDemandMapper.selectByPrimaryKey(id); FunctionalCaseDemandExample functionalCaseDemandExample = new FunctionalCaseDemandExample(); - functionalCaseDemandExample.createCriteria().andParentEqualTo(id); + functionalCaseDemandExample.createCriteria().andParentEqualTo(functionalCaseDemandInDb.getDemandId()); List functionalCaseDemands = functionalCaseDemandMapper.selectByExample(functionalCaseDemandExample); if (CollectionUtils.isNotEmpty(functionalCaseDemands)) { SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);