Commit b2efd2ea authored by wdy's avatar wdy

获取所有测试用例编号

parent 1ff7a1c2
......@@ -438,16 +438,28 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
// 获取测试用例
if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) {
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class);
SerialNumberResponse numberResponse = new SerialNumberResponse();
for(StandardNewVO vo : list) {
Map<String, SerialNumberResponse> idToNumberResponse = new HashMap<>();
for (StandardNewVO vo : list) {
for (UseCaseNewVO useCaseNewVO : vo.getUseCases()) {
numberResponse.setId(useCaseNewVO.getId());
numberResponse.setSerialNumber(vo.getSerialNumber());
serialNumberList.add(numberResponse);
SerialNumberResponse numberResponse = idToNumberResponse.computeIfAbsent(
useCaseNewVO.getId(),
k -> {
SerialNumberResponse resp = new SerialNumberResponse();
resp.setId(useCaseNewVO.getId());
resp.setSerialNumber(useCaseNewVO.getCustomizedID());
return resp;
}
);
}
}
// 将 Map 中的值提取到 serialNumberList 中
serialNumberList.addAll(idToNumberResponse.values());
}
return serialNumberList;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment