From bd6e3cb47542d86d10653d9dca9c8c29a431b789 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 22 Feb 2022 15:31:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E8=B4=A3=E4=BB=BB=E4=BA=BA=E6=9C=AA=E5=9C=A8?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=A1=B9=E7=9B=AE=E4=B8=AD=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=8F=AF=E5=AF=BC=E5=85=A5=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010201 --user=宋天阳 【测试跟踪】-【功能用例】-更多操作-导入excel格式用例-用例中责任人未在导入项目中-继续上传可导入成功 https://www.tapd.cn/55049933/s/1107573 --- .../track/service/TestCaseService.java | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 087e58be30..e908560786 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -866,25 +866,12 @@ public class TestCaseService { testCaseNames.add(testCase.getName()); } - if (!request.isIgnore()) { - QueryMemberRequest queryMemberRequest = new QueryMemberRequest(); - queryMemberRequest.setProjectId(projectId); - userIds = userService.getProjectMemberList(queryMemberRequest) - .stream() - .map(User::getId) - .collect(Collectors.toSet()); - } else { - GroupExample groupExample = new GroupExample(); - groupExample.createCriteria().andTypeIn(Arrays.asList(UserGroupType.WORKSPACE, UserGroupType.PROJECT)); - List groups = groupMapper.selectByExample(groupExample); - List groupIds = groups.stream().map(Group::getId).collect(Collectors.toList()); - - UserGroupExample userGroupExample = new UserGroupExample(); - userGroupExample.createCriteria() - .andGroupIdIn(groupIds) - .andSourceIdEqualTo(project.getWorkspaceId()); - userIds = userGroupMapper.selectByExample(userGroupExample).stream().map(UserGroup::getUserId).collect(Collectors.toSet()); - } + QueryMemberRequest queryMemberRequest = new QueryMemberRequest(); + queryMemberRequest.setProjectId(projectId); + userIds = userService.getProjectMemberList(queryMemberRequest) + .stream() + .map(User::getId) + .collect(Collectors.toSet()); try { //根据本地语言环境选择用哪种数据对象进行存放读取的数据 @@ -930,7 +917,7 @@ public class TestCaseService { Integer num = importCreateNum.get(); Integer beforeInsertId = beforeImportCreateNum.get(); - for (int i = testCases.size() - 1; i > - 1; i--) { // 反向遍历,保持和文件顺序一致 + for (int i = testCases.size() - 1; i > -1; i--) { // 反向遍历,保持和文件顺序一致 TestCaseWithBLOBs testCase = testCases.get(i); testCase.setId(UUID.randomUUID().toString()); testCase.setCreateUser(SessionUtils.getUserId());