fix(测试计划): 修复重复关联问题
This commit is contained in:
parent
3652b3db10
commit
a8910b8370
|
@ -575,8 +575,17 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
|||
//处理数据
|
||||
handleApiData(collectionAssociates.get(AssociateCaseType.API), user, testPlanApiCaseList, testPlan, isRepeat);
|
||||
handleApiCaseData(collectionAssociates.get(AssociateCaseType.API_CASE), user, testPlanApiCaseList, testPlan, isRepeat);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(testPlanApiCaseList)) {
|
||||
testPlanApiCaseMapper.batchInsert(testPlanApiCaseList);
|
||||
List<TestPlanApiCase> distinctList = testPlanApiCaseList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
TestPlanApiCase::getApiCaseId,
|
||||
Function.identity(),
|
||||
(existing, replacement) -> existing
|
||||
))
|
||||
.values().stream()
|
||||
.toList();
|
||||
testPlanApiCaseMapper.batchInsert(distinctList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue