fix(用例管理): 修改关联需求子集没有处理disable问题

This commit is contained in:
guoyuqi 2024-09-10 13:47:02 +08:00 committed by Craftsman
parent 5a0a301fec
commit 8e10e32ab3
1 changed files with 12 additions and 5 deletions

View File

@ -365,14 +365,21 @@ public class FunctionalCaseDemandService {
if (CollectionUtils.isNotEmpty(demandIds)) {
PlatformDemandDTO data = platformDemandDTOPluginPager.getData();
List<PlatformDemandDTO.Demand> list = data.getList();
for (PlatformDemandDTO.Demand demand : list) {
if (demandIds.contains(demand.getDemandId())) {
demand.setDisabled(true);
}
}
setDisabled(list, demandIds);
data.setList(list);
platformDemandDTOPluginPager.setData(data);
}
return platformDemandDTOPluginPager;
}
private static void setDisabled(List<PlatformDemandDTO.Demand> list, List<String> demandIds) {
for (PlatformDemandDTO.Demand demand : list) {
if (demandIds.contains(demand.getDemandId())) {
demand.setDisabled(true);
}
if (CollectionUtils.isNotEmpty(demand.getChildren())) {
setDisabled(demand.getChildren(), demandIds);
}
}
}
}