fix(用例管理): 修复用例模块校验重复不区分项目问题

--bug=1036021 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036021
This commit is contained in:
guoyuqi 2024-02-21 17:06:03 +08:00 committed by 刘瑞斌
parent 8d1ff51766
commit 04feef117c
1 changed files with 2 additions and 4 deletions

View File

@ -7,9 +7,7 @@
package io.metersphere.functional.service;
import io.metersphere.functional.domain.CaseReview;
import io.metersphere.functional.domain.CaseReviewModule;
import io.metersphere.functional.domain.CaseReviewModuleExample;
import io.metersphere.functional.domain.*;
import io.metersphere.functional.mapper.CaseReviewModuleMapper;
import io.metersphere.functional.mapper.ExtCaseReviewMapper;
import io.metersphere.functional.mapper.ExtCaseReviewModuleMapper;
@ -215,7 +213,7 @@ public class CaseReviewModuleService extends ModuleTreeService {
}
example.clear();
}
example.createCriteria().andParentIdEqualTo(caseReviewModule.getParentId()).andNameEqualTo(caseReviewModule.getName()).andIdNotEqualTo(caseReviewModule.getId());
example.createCriteria().andParentIdEqualTo(caseReviewModule.getParentId()).andNameEqualTo(caseReviewModule.getName()).andIdNotEqualTo(caseReviewModule.getId()).andProjectIdEqualTo(caseReviewModule.getProjectId());
if (caseReviewModuleMapper.countByExample(example) > 0) {
throw new MSException(Translator.get("node.name.repeat"));
}