From 297a760f9eeaf39398194905a59bb9e284936776 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 23 Jul 2021 15:05:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=97=A0=E8=B4=A3=E4=BB=BB=E4=BA=BA=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=97=B6=E6=8A=A5=E9=94=99#1005374?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1005374 --user=lyh【github#4960】导入的用例无责任人时无法在计划中进行关联 https://www.tapd.cn/55049933/s/1028453 --- .../java/io/metersphere/track/service/TestPlanService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 08e7e473cb..a70331263a 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -461,7 +461,8 @@ public class TestPlanService { TestCaseExample testCaseExample = new TestCaseExample(); testCaseExample.createCriteria().andIdIn(testCaseIds); List testCaseList = testCaseMapper.selectByExample(testCaseExample); - Map userMap = testCaseList.stream().collect(Collectors.toMap(TestCase::getId, TestCase::getMaintainer)); + Map userMap = testCaseList.stream() + .collect(HashMap::new, (m,v)-> m.put(v.getId(), v.getMaintainer()), HashMap::putAll); SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); TestPlanTestCaseMapper batchMapper = sqlSession.getMapper(TestPlanTestCaseMapper.class);