feat(用例管理): 脑图新增批量删除和拖拽接口

This commit is contained in:
guoyuqi 2024-05-08 19:35:33 +08:00 committed by Craftsman
parent f1411f87ca
commit d4bd63ca04
1 changed files with 5 additions and 5 deletions

View File

@ -8,6 +8,7 @@ import io.metersphere.functional.constants.MinderLabel;
import io.metersphere.functional.domain.*; import io.metersphere.functional.domain.*;
import io.metersphere.functional.dto.BaseFunctionalCaseBatchDTO; import io.metersphere.functional.dto.BaseFunctionalCaseBatchDTO;
import io.metersphere.functional.dto.FunctionalCaseHistoryLogDTO; import io.metersphere.functional.dto.FunctionalCaseHistoryLogDTO;
import io.metersphere.functional.dto.MinderOptionDTO;
import io.metersphere.functional.mapper.*; import io.metersphere.functional.mapper.*;
import io.metersphere.functional.request.*; import io.metersphere.functional.request.*;
import io.metersphere.project.domain.FileAssociation; import io.metersphere.project.domain.FileAssociation;
@ -18,7 +19,6 @@ import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.JSON;
import io.metersphere.system.domain.CustomField; import io.metersphere.system.domain.CustomField;
import io.metersphere.system.domain.CustomFieldExample; import io.metersphere.system.domain.CustomFieldExample;
import io.metersphere.system.dto.sdk.OptionDTO;
import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogType; import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.log.dto.LogDTO; import io.metersphere.system.log.dto.LogDTO;
@ -192,16 +192,16 @@ public class FunctionalCaseLogService {
return dtoList; return dtoList;
} }
public List<LogDTO> deleteBatchMinderFunctionalCaseLog(List<OptionDTO> resourceList) { public List<LogDTO> deleteBatchMinderFunctionalCaseLog(List<MinderOptionDTO> resourceList) {
if (CollectionUtils.isEmpty(resourceList)) { if (CollectionUtils.isEmpty(resourceList)) {
return new ArrayList<>(); return new ArrayList<>();
} }
Map<String, List<OptionDTO>> resourceMap = resourceList.stream().collect(Collectors.groupingBy(OptionDTO::getName)); Map<String, List<MinderOptionDTO>> resourceMap = resourceList.stream().collect(Collectors.groupingBy(MinderOptionDTO::getType));
List<OptionDTO> caseOptionDTOS = resourceMap.get(MinderLabel.CASE.toString()); List<MinderOptionDTO> caseOptionDTOS = resourceMap.get(MinderLabel.CASE.toString());
if (CollectionUtils.isEmpty(caseOptionDTOS)) { if (CollectionUtils.isEmpty(caseOptionDTOS)) {
return new ArrayList<>(); return new ArrayList<>();
} }
List<String> caseIds = caseOptionDTOS.stream().map(OptionDTO::getId).toList(); List<String> caseIds = caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList();
return batchDeleteFunctionalCaseLogByIds(caseIds); return batchDeleteFunctionalCaseLogByIds(caseIds);
} }