fix(功能用例): 脑图增删改无需在逻辑例再次校验

This commit is contained in:
guoyuqi 2024-06-21 09:35:35 +08:00 committed by Craftsman
parent 1771a64e42
commit 254cbfa019
1 changed files with 0 additions and 10 deletions

View File

@ -256,14 +256,6 @@ public class FunctionalCaseMinderService {
return functionalMinderTreeDTO; return functionalMinderTreeDTO;
} }
private void checkPermission(List<String> sourceIds, String tableName, String userId) {
if (CollectionUtils.isNotEmpty(sourceIds)) {
if (!extCheckOwnerMapper.checkoutOwner(tableName, userId, sourceIds)) {
throw new MSException(Translator.get(CHECK_OWNER_CASE));
}
}
}
public void editFunctionalCaseBatch(FunctionalCaseMinderEditRequest request, String userId) { public void editFunctionalCaseBatch(FunctionalCaseMinderEditRequest request, String userId) {
//处理删除的模块和用例和空白节点 //处理删除的模块和用例和空白节点
deleteResource(request, userId); deleteResource(request, userId);
@ -1127,7 +1119,6 @@ public class FunctionalCaseMinderService {
List<MinderOptionDTO> caseOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.case")); List<MinderOptionDTO> caseOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.case"));
if (CollectionUtils.isNotEmpty(caseOptionDTOS)) { if (CollectionUtils.isNotEmpty(caseOptionDTOS)) {
List<String> caseIds = caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); List<String> caseIds = caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList();
checkPermission(caseIds, FUNCTIONAL_CASE, userId);
functionalCaseService.handDeleteFunctionalCase(caseIds, false, userId, request.getProjectId()); functionalCaseService.handDeleteFunctionalCase(caseIds, false, userId, request.getProjectId());
functionalCaseLogService.batchDeleteFunctionalCaseLogByIds(caseIds, "/functional/mind/case/edit"); functionalCaseLogService.batchDeleteFunctionalCaseLogByIds(caseIds, "/functional/mind/case/edit");
functionalCaseNoticeService.batchSendNotice(request.getProjectId(), caseIds, user, NoticeConstants.Event.DELETE); functionalCaseNoticeService.batchSendNotice(request.getProjectId(), caseIds, user, NoticeConstants.Event.DELETE);
@ -1136,7 +1127,6 @@ public class FunctionalCaseMinderService {
List<MinderOptionDTO> caseModuleOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.module")); List<MinderOptionDTO> caseModuleOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.module"));
if (CollectionUtils.isNotEmpty(caseModuleOptionDTOS)) { if (CollectionUtils.isNotEmpty(caseModuleOptionDTOS)) {
List<String> moduleIds = caseModuleOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); List<String> moduleIds = caseModuleOptionDTOS.stream().map(MinderOptionDTO::getId).toList();
checkPermission(moduleIds, FUNCTIONAL_CASE_MODULE, userId);
List<FunctionalCase> functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), userId); List<FunctionalCase> functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), userId);
functionalCaseModuleService.batchDelLog(functionalCases, request.getProjectId()); functionalCaseModuleService.batchDelLog(functionalCases, request.getProjectId());
functionalCaseNoticeService.batchSendNotice(request.getProjectId(), functionalCases.stream().map(FunctionalCase::getId).toList(), user, NoticeConstants.Event.DELETE); functionalCaseNoticeService.batchSendNotice(request.getProjectId(), functionalCases.stream().map(FunctionalCase::getId).toList(), user, NoticeConstants.Event.DELETE);