mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 21:19:52 +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
|
@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;
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user