Commit beb1b944 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'master'

获取所有测试用例编号

See merge request !13
parents 1ff7a1c2 b2efd2ea
......@@ -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