|
@@ -419,11 +419,16 @@ public class SceneEvaluationComputeRunnable implements Runnable {
|
|
log.error("场景" + sceneEvaluationComputeSubParam.getSceneId() + " 的场景评价失败:", e);
|
|
log.error("场景" + sceneEvaluationComputeSubParam.getSceneId() + " 的场景评价失败:", e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ sceneEvaluationStatusPO.setEndEvaluationTime(TimeUtil.getNowForMysql());
|
|
|
|
+ sceneEvaluationStatusPO.setEvaluationStatus(DictConstants.SCENE_EVALUATION_STATUS_2);
|
|
|
|
+ sceneEvaluationStatusPO.setEvaluationErrorMsg("");
|
|
|
|
+ updateStatus(sceneEvaluationComputeParam, sceneEvaluationStatusMapper, sceneEvaluationStatusPO, numsKeysSceneResult, DictConstants.PROJECT_COMPLETED);
|
|
}
|
|
}
|
|
|
|
|
|
if (DictConstants.EXPOSURE_RATE.equals(sceneEvaluationComputeParam.getComputeType())
|
|
if (DictConstants.EXPOSURE_RATE.equals(sceneEvaluationComputeParam.getComputeType())
|
|
|| DictConstants.COVERAGE.equals(sceneEvaluationComputeParam.getComputeType())
|
|
|| DictConstants.COVERAGE.equals(sceneEvaluationComputeParam.getComputeType())
|
|
- || DictConstants.COVERAGE_PREFIX.equals(sceneEvaluationComputeParam.getComputeType())) { // 这3个是跑所有场景
|
|
|
|
|
|
+ || DictConstants.COVERAGE_PREFIX.equals(sceneEvaluationComputeParam.getComputeType())) {
|
|
|
|
+ // 这3个是跑所有场景
|
|
// 读文件
|
|
// 读文件
|
|
StringBuilder result = new StringBuilder();
|
|
StringBuilder result = new StringBuilder();
|
|
try {
|
|
try {
|
|
@@ -449,29 +454,34 @@ public class SceneEvaluationComputeRunnable implements Runnable {
|
|
result.append(line).append("\n");
|
|
result.append(line).append("\n");
|
|
}
|
|
}
|
|
bufferedReader.close();
|
|
bufferedReader.close();
|
|
- } catch (IOException e) {
|
|
|
|
- log.error("读取场景评价结果失败", e);
|
|
|
|
- }
|
|
|
|
- String resultStr = result.toString();
|
|
|
|
- String replace = StringUtil.replace(resultStr, "'", "\"");
|
|
|
|
- try {
|
|
|
|
- // 如果是覆盖率前置条件,需要修改覆盖率前置条件
|
|
|
|
- if (numsKeysSceneResult != null && DictConstants.COVERAGE_PREFIX.equals(sceneEvaluationComputeParam.getComputeType())) {
|
|
|
|
- sceneComputerRateMapper.updateResultByIdAndType(numsKeysSceneResult.getComputerRateId(), numsKeysSceneResult.getComputerType(), replace);
|
|
|
|
- } else {
|
|
|
|
- // 保存结果
|
|
|
|
- SceneComputerRateDTO sceneComputerRatePO = getSceneComputerRatePO(sceneEvaluationComputeParam, replace, ruleId, sceneIdList);
|
|
|
|
- sceneComputerRateMapper.saveSceneComputerRate(sceneComputerRatePO);
|
|
|
|
- }
|
|
|
|
|
|
+ String resultStr = result.toString();
|
|
|
|
+ String replace = StringUtil.replace(resultStr, "'", "\"");
|
|
|
|
+ try {
|
|
|
|
+ // 如果是覆盖率前置条件,需要修改覆盖率前置条件
|
|
|
|
+ if (numsKeysSceneResult != null && DictConstants.COVERAGE_PREFIX.equals(sceneEvaluationComputeParam.getComputeType())) {
|
|
|
|
+ sceneComputerRateMapper.updateResultByIdAndType(numsKeysSceneResult.getComputerRateId(), numsKeysSceneResult.getComputerType(), replace);
|
|
|
|
+ } else {
|
|
|
|
+ // 保存结果
|
|
|
|
+ SceneComputerRateDTO sceneComputerRatePO = getSceneComputerRatePO(sceneEvaluationComputeParam, replace, ruleId, sceneIdList);
|
|
|
|
+ sceneComputerRateMapper.saveSceneComputerRate(sceneComputerRatePO);
|
|
|
|
+ }
|
|
|
|
+ sceneEvaluationStatusPO.setEndEvaluationTime(TimeUtil.getNowForMysql());
|
|
|
|
+ sceneEvaluationStatusPO.setEvaluationStatus(DictConstants.SCENE_EVALUATION_STATUS_2);
|
|
|
|
+ sceneEvaluationStatusPO.setEvaluationErrorMsg("");
|
|
|
|
+ updateStatus(sceneEvaluationComputeParam, sceneEvaluationStatusMapper, sceneEvaluationStatusPO, numsKeysSceneResult, DictConstants.PROJECT_COMPLETED);
|
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("任务={} 的场景评价失败:", sceneEvaluationComputeParam.getTaskId(), e);
|
|
|
|
+ throw new Exception(e);
|
|
|
|
+ }
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("任务" + sceneEvaluationComputeParam.getTaskId() + " 的场景评价失败:", e);
|
|
|
|
|
|
+ log.error("读取场景评价结果失败", e);
|
|
|
|
+ sceneEvaluationStatusPO.setEndEvaluationTime(TimeUtil.getNowForMysql());
|
|
|
|
+ sceneEvaluationStatusPO.setEvaluationStatus(DictConstants.SCENE_EVALUATION_STATUS_3);
|
|
|
|
+ sceneEvaluationStatusPO.setEvaluationErrorMsg("");
|
|
|
|
+ updateStatus(sceneEvaluationComputeParam, sceneEvaluationStatusMapper, sceneEvaluationStatusPO, numsKeysSceneResult, DictConstants.PROJECT_COMPLETED);
|
|
}
|
|
}
|
|
|
|
|
|
- sceneEvaluationStatusPO.setEndEvaluationTime(TimeUtil.getNowForMysql());
|
|
|
|
- sceneEvaluationStatusPO.setEvaluationStatus(DictConstants.SCENE_EVALUATION_STATUS_2);
|
|
|
|
- sceneEvaluationStatusPO.setEvaluationErrorMsg("");
|
|
|
|
- updateStatus(sceneEvaluationComputeParam, sceneEvaluationStatusMapper, sceneEvaluationStatusPO, numsKeysSceneResult, DictConstants.PROJECT_COMPLETED);
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// 删除临时文件
|
|
// 删除临时文件
|
|
@@ -576,16 +586,6 @@ public class SceneEvaluationComputeRunnable implements Runnable {
|
|
SceneComputerRateMapper sceneComputerRateMapper = ApplicationContextAwareImpl.getApplicationContext().getBean(SceneComputerRateMapper.class);
|
|
SceneComputerRateMapper sceneComputerRateMapper = ApplicationContextAwareImpl.getApplicationContext().getBean(SceneComputerRateMapper.class);
|
|
sceneComputerRateMapper.updateProcessStatusByIdAndType(numsKeysSceneResult.getComputerRateId(), numsKeysSceneResult.getComputerType(), processStatus);
|
|
sceneComputerRateMapper.updateProcessStatusByIdAndType(numsKeysSceneResult.getComputerRateId(), numsKeysSceneResult.getComputerType(), processStatus);
|
|
}
|
|
}
|
|
- SimulationManualProjectMapper simulationManualProjectMapper = ApplicationContextAwareImpl.getApplicationContext().getBean(SimulationManualProjectMapper.class);
|
|
|
|
- ProjectEntity projectEntity = simulationManualProjectMapper.selectById(sceneEvaluationComputeParam.getTaskId());
|
|
|
|
- if (StringUtil.isNotEmpty(projectEntity.getEvaluationJsonMsg())) {
|
|
|
|
- JSONObject evaluationJsonObj = JSONObject.parseObject(projectEntity.getEvaluationJsonMsg());
|
|
|
|
- evaluationJsonObj.put("coveragePreEvaluationStatus", sceneEvaluationStatusPO.getEvaluationStatus());
|
|
|
|
- evaluationJsonObj.put("coveragePreEvaluationErrorMsg", sceneEvaluationStatusPO.getEvaluationErrorMsg());
|
|
|
|
- evaluationJsonObj.put("coveragePreStartEvaluationTime", sceneEvaluationStatusPO.getStartEvaluationTime() == null ? null : sdf.format(sceneEvaluationStatusPO.getStartEvaluationTime()));
|
|
|
|
- evaluationJsonObj.put("coveragePreEndEvaluationTime", sceneEvaluationStatusPO.getEndEvaluationTime() == null ? null : sdf.format(sceneEvaluationStatusPO.getEndEvaluationTime()));
|
|
|
|
- sceneEvaluationStatusMapper.updateManualProjectEvaluationStatus(sceneEvaluationStatusPO.getId(), evaluationJsonObj.toString());
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|