fix(测试跟踪): 不覆盖模式导入已存在缺陷有误

--bug=1021892 --user=宋昌昌 【测试跟踪】缺陷管理-导入-不覆盖-导入失败,提示不合法的缺陷 https://www.tapd.cn/55049933/s/1326303
This commit is contained in:
song-cc-rock 2023-01-11 18:01:25 +08:00 committed by jianxing
parent 94915609e8
commit e9a10bfc07
2 changed files with 9 additions and 1 deletions

View File

@ -48,6 +48,8 @@ public class IssueExcelData implements Serializable {
@ExcelIgnore @ExcelIgnore
private Boolean addFlag; private Boolean addFlag;
@ExcelIgnore @ExcelIgnore
private Boolean updateFlag = true;
@ExcelIgnore
private String title; private String title;
@ExcelIgnore @ExcelIgnore
private String description; private String description;

View File

@ -121,6 +121,12 @@ public class IssueExcelListener extends AnalysisEventListener<Map<Integer, Strin
issueExcelData.setId(issues.getId()); issueExcelData.setId(issues.getId());
issueExcelData.setAddFlag(Boolean.FALSE); issueExcelData.setAddFlag(Boolean.FALSE);
updateList.add(issueExcelData); updateList.add(issueExcelData);
} else {
// 不覆盖模式
issueExcelData.setId(issues.getId());
issueExcelData.setAddFlag(Boolean.FALSE);
issueExcelData.setUpdateFlag(Boolean.FALSE);
updateList.add(issueExcelData);
} }
} }
} }
@ -148,7 +154,7 @@ public class IssueExcelListener extends AnalysisEventListener<Map<Integer, Strin
} }
if (CollectionUtils.isNotEmpty(updateList)) { if (CollectionUtils.isNotEmpty(updateList)) {
List<IssuesUpdateRequest> issues = updateList.stream().map(this::convertToIssue).collect(Collectors.toList()); List<IssuesUpdateRequest> issues = updateList.stream().filter(IssueExcelData::getUpdateFlag).map(this::convertToIssue).collect(Collectors.toList());
issuesService.updateImportData(issues); issuesService.updateImportData(issues);
} }
} }