mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 04:59:48 +08:00
fix(测试跟踪): 不覆盖模式导入已存在缺陷有误
--bug=1021892 --user=宋昌昌 【测试跟踪】缺陷管理-导入-不覆盖-导入失败,提示不合法的缺陷 https://www.tapd.cn/55049933/s/1326303
This commit is contained in:
parent
94915609e8
commit
e9a10bfc07
@ -48,6 +48,8 @@ public class IssueExcelData implements Serializable {
|
||||
@ExcelIgnore
|
||||
private Boolean addFlag;
|
||||
@ExcelIgnore
|
||||
private Boolean updateFlag = true;
|
||||
@ExcelIgnore
|
||||
private String title;
|
||||
@ExcelIgnore
|
||||
private String description;
|
||||
|
@ -121,6 +121,12 @@ public class IssueExcelListener extends AnalysisEventListener<Map<Integer, Strin
|
||||
issueExcelData.setId(issues.getId());
|
||||
issueExcelData.setAddFlag(Boolean.FALSE);
|
||||
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)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user