fix(测试跟踪): 修复功能用例导入时责任人未在导入项目中继续上传可导入成功的缺陷

--bug=1010201 --user=宋天阳
【测试跟踪】-【功能用例】-更多操作-导入excel格式用例-用例中责任人未在导入项目中-继续上传可导入成功
https://www.tapd.cn/55049933/s/1107573
This commit is contained in:
song-tianyang 2022-02-22 15:31:43 +08:00 committed by xiaomeinvG
parent ad1a45e433
commit bd6e3cb475
1 changed files with 7 additions and 20 deletions

View File

@ -866,25 +866,12 @@ public class TestCaseService {
testCaseNames.add(testCase.getName()); testCaseNames.add(testCase.getName());
} }
if (!request.isIgnore()) { QueryMemberRequest queryMemberRequest = new QueryMemberRequest();
QueryMemberRequest queryMemberRequest = new QueryMemberRequest(); queryMemberRequest.setProjectId(projectId);
queryMemberRequest.setProjectId(projectId); userIds = userService.getProjectMemberList(queryMemberRequest)
userIds = userService.getProjectMemberList(queryMemberRequest) .stream()
.stream() .map(User::getId)
.map(User::getId) .collect(Collectors.toSet());
.collect(Collectors.toSet());
} else {
GroupExample groupExample = new GroupExample();
groupExample.createCriteria().andTypeIn(Arrays.asList(UserGroupType.WORKSPACE, UserGroupType.PROJECT));
List<Group> groups = groupMapper.selectByExample(groupExample);
List<String> 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());
}
try { try {
//根据本地语言环境选择用哪种数据对象进行存放读取的数据 //根据本地语言环境选择用哪种数据对象进行存放读取的数据
@ -930,7 +917,7 @@ public class TestCaseService {
Integer num = importCreateNum.get(); Integer num = importCreateNum.get();
Integer beforeInsertId = beforeImportCreateNum.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); TestCaseWithBLOBs testCase = testCases.get(i);
testCase.setId(UUID.randomUUID().toString()); testCase.setId(UUID.randomUUID().toString());
testCase.setCreateUser(SessionUtils.getUserId()); testCase.setCreateUser(SessionUtils.getUserId());