1、生成自动化脚本修改performance.json

This commit is contained in:
2025-12-04 10:33:17 +08:00
parent 112417adb9
commit a4c128106c

View File

@@ -1121,10 +1121,10 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
}
// 生成performance.json
List<SimulationPerformance> performanceList = req.getPerformanceList();
List<JSONObject> exportPerformanceList = new ArrayList<>();
// List<JSONObject> exportPerformanceList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(performanceList)) {
JSONObject allPerformanceInfoJson = new JSONObject();
for (SimulationPerformance performance : performanceList) {
JSONObject performanceInfoJson = new JSONObject();
PerformanceInfoReq performanceInfoReq = new PerformanceInfoReq();
performanceInfoReq.setValue(StringUtils.isNotBlank(performance.getTargetValue()) ? performance.getTargetValue() : "");
performanceInfoReq.setEnglishName(StringUtils.isNotBlank(performance.getEnglishName()) ? performance.getEnglishName() : "");
@@ -1132,13 +1132,11 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
performanceInfoReq.setPerformanceName(StringUtils.isNotBlank(performance.getPerformanceName()) ? performance.getPerformanceName() : "");
performanceInfoReq.setMethod(StringUtils.isNotBlank(performance.getMethod()) ? performance.getMethod() : "");
performanceInfoReq.setUnit(StringUtils.isNotBlank(performance.getUnit()) ? performance.getUnit() : "");
performanceInfoJson.put(performanceInfoReq.getEnglishName(),performanceInfoReq);
exportPerformanceList.add(performanceInfoJson);
allPerformanceInfoJson.put(performanceInfoReq.getEnglishName(),performanceInfoReq);
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("type","insert");
exportPerformanceList.add(jsonObject);
String jsonString = JSON.toJSONString(exportPerformanceList);
allPerformanceInfoJson.put("type","insert");
// exportPerformanceList.add(jsonObject);
String jsonString = JSON.toJSONString(allPerformanceInfoJson);
FileOutputStream performanceOutputStream = null;
try {
performanceOutputStream = new FileOutputStream(TEMP_REPORT_PATH + randomId + File.separator + "performance.json");