|
@@ -1289,11 +1289,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseBodyVO analysisVehicleCoord() throws Exception {
|
|
|
-
|
|
|
+ @SneakyThrows
|
|
|
+ public ResponseBodyVO<String> analysisVehicleCoord(){
|
|
|
analysisCsvFile("E:\\仿真云平台\\三维还原视频说明\\360ogt.csv", new int[]{6, 7, 9});
|
|
|
-
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, null);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1324,7 +1323,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
private void analysisCsvFile(String filePath, int[] analysisFields) throws Exception {
|
|
|
|
|
|
File file = new File(filePath);
|
|
|
- InputStream fileInputStream = new FileInputStream(file);
|
|
|
+ InputStream fileInputStream = Files.newInputStream(file.toPath());
|
|
|
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
|
|
|
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
|
|
String line;
|
|
@@ -2592,48 +2591,62 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//任务运行状态统计-饼图
|
|
|
@Override
|
|
|
public ResponseBodyVO<List<Map<String, Object>>> selectRunTaskByState() {
|
|
|
+ String key1 = "num";
|
|
|
+ String key2 = "runState";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("createUserId", AuthUtil.getCurrentUserId());
|
|
|
List<Map<String, Object>> list = simulationProjectTaskMapper.selectRunTaskByState(params);
|
|
|
+ // 汉化
|
|
|
list.forEach(map -> {
|
|
|
- if (StateConstant.Aborted.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Aborted.getChinese());
|
|
|
+ if (StateConstant.Aborted.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Aborted.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.PendingAnalysis.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.PendingAnalysis.getChinese());
|
|
|
+ if (StateConstant.PendingAnalysis.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.PendingAnalysis.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.Running.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Running.getChinese());
|
|
|
+ if (StateConstant.Running.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Running.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.Analysing.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Analysing.getChinese());
|
|
|
+ if (StateConstant.Analysing.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Analysing.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.Completed.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Completed.getChinese());
|
|
|
+ if (StateConstant.Completed.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Completed.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.Terminated.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Terminated.getChinese());
|
|
|
+ if (StateConstant.Terminated.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Terminated.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.Terminating.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Terminating.getChinese());
|
|
|
+ if (StateConstant.Terminating.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Terminating.getChinese());
|
|
|
}
|
|
|
- if (StateConstant.Pending.getEnglish().equals(map.get("runState"))) {
|
|
|
- map.put("runState", StateConstant.Pending.getChinese());
|
|
|
+ if (StateConstant.Pending.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.Pending.getChinese());
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ // 合并手动终止
|
|
|
+ Map<String, Object> newMap = new HashMap<>();
|
|
|
+ int numSum = 0;
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
+ if (StateConstant.Terminated.getChinese().equals(map.get(key2))) {
|
|
|
+ numSum += Integer.parseInt(map.get(key2) + "");
|
|
|
+ list.remove(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newMap.put(key1, numSum + "");
|
|
|
+ newMap.put(key2, StateConstant.Terminated.getChinese());
|
|
|
+ list.add(newMap);
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, list);
|
|
|
}
|
|
|
|
|
|
//项目运行状态统计-饼图
|
|
|
@Override
|
|
|
- public ResponseBodyVO selectRunProjectByState() {
|
|
|
+ public ResponseBodyVO<List<Map<String, Object>>> selectRunProjectByState() {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("createUserId", AuthUtil.getCurrentUserId());
|
|
|
//10:未执行,20:执行中,30:执行完成,40:已中止
|
|
|
- List<Map> list = simulationProjectMapper.selectRunProjectByState(params);
|
|
|
+ List<Map<String, Object>> list = simulationProjectMapper.selectRunProjectByState(params);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
- for (Map map : list) {
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
String nowRunState = map.get("nowRunState").toString();
|
|
|
map.put("nowRunState", getDictName(DictConstants.PROJECT_RUN_STATE, nowRunState));
|
|
|
}
|
|
@@ -2643,10 +2656,26 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//评测等级分布-饼图
|
|
|
@Override
|
|
|
- public ResponseBodyVO selectEvaluationLevel() {
|
|
|
+ public ResponseBodyVO<List<Map<String, Object>>> selectEvaluationLevel() {
|
|
|
+ String key2 = "evaluationLevel";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("createUserId", AuthUtil.getCurrentUserId());
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, simulationProjectMapper.selectEvaluationLevel(params));
|
|
|
+ final List<Map<String, Object>> maps = simulationProjectMapper.selectEvaluationLevel(params);
|
|
|
+ maps.forEach(map -> {
|
|
|
+ if (StateConstant.G.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.G.getChinese());
|
|
|
+ }
|
|
|
+ if (StateConstant.A.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.A.getChinese());
|
|
|
+ }
|
|
|
+ if (StateConstant.M.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.M.getChinese());
|
|
|
+ }
|
|
|
+ if (StateConstant.P.getEnglish().equals(map.get(key2))) {
|
|
|
+ map.put(key2, StateConstant.P.getChinese());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, maps);
|
|
|
}
|
|
|
|
|
|
@Override
|