|
@@ -9,6 +9,7 @@ import api.common.pojo.param.scene.SceneDeleteParam;
|
|
import api.common.pojo.param.scene.SceneImportParam;
|
|
import api.common.pojo.param.scene.SceneImportParam;
|
|
import api.common.pojo.po.scene.SceneAccidentPO;
|
|
import api.common.pojo.po.scene.SceneAccidentPO;
|
|
import api.common.pojo.po.system.SceneImportPO;
|
|
import api.common.pojo.po.system.SceneImportPO;
|
|
|
|
+import api.common.util.CollectionUtil;
|
|
import api.common.util.ObjectUtil;
|
|
import api.common.util.ObjectUtil;
|
|
import api.common.util.StringUtil;
|
|
import api.common.util.StringUtil;
|
|
import api.common.util.TimeUtil;
|
|
import api.common.util.TimeUtil;
|
|
@@ -654,12 +655,12 @@ public class SceneAccidentService {
|
|
/**
|
|
/**
|
|
* 获取交通事故场景数据:现在
|
|
* 获取交通事故场景数据:现在
|
|
*/
|
|
*/
|
|
- public SceneImportPO importMiNio(SceneImportParam parms) {
|
|
|
|
|
|
+ public SceneImportPO importMiNio(SceneImportParam params) {
|
|
SceneImportPO sceneImportPO = new SceneImportPO();
|
|
SceneImportPO sceneImportPO = new SceneImportPO();
|
|
- sceneImportPO.setId(parms.getId());
|
|
|
|
|
|
+ sceneImportPO.setId(params.getId());
|
|
try {
|
|
try {
|
|
MinioParameter MI = new MinioParameter();
|
|
MinioParameter MI = new MinioParameter();
|
|
- MI.setObjectName(parms.getMinioDirectory());
|
|
|
|
|
|
+ MI.setObjectName(params.getMinioDirectory());
|
|
List<String> list = fileDownService.listDeepOne(MI).getInfo();
|
|
List<String> list = fileDownService.listDeepOne(MI).getInfo();
|
|
String OsgbPath = null;
|
|
String OsgbPath = null;
|
|
String XodrPath = null;
|
|
String XodrPath = null;
|
|
@@ -673,6 +674,7 @@ public class SceneAccidentService {
|
|
XodrPath = filePath;
|
|
XodrPath = filePath;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ List<String> sceneNames = new ArrayList<>();
|
|
for (String filePath : list) {
|
|
for (String filePath : list) {
|
|
if (filePath.contains("/Scenarios")) {
|
|
if (filePath.contains("/Scenarios")) {
|
|
MI.setObjectName(filePath);
|
|
MI.setObjectName(filePath);
|
|
@@ -684,6 +686,7 @@ public class SceneAccidentService {
|
|
List<String> listAderss = fileDownService.listDeepOne(MI).getInfo();
|
|
List<String> listAderss = fileDownService.listDeepOne(MI).getInfo();
|
|
SceneAccidentPO sceneAccidentPO = new SceneAccidentPO();
|
|
SceneAccidentPO sceneAccidentPO = new SceneAccidentPO();
|
|
String isupdate = null;
|
|
String isupdate = null;
|
|
|
|
+ String sceneName = null;
|
|
for (String adress : listAderss) {
|
|
for (String adress : listAderss) {
|
|
if (adress.contains(".json")) {
|
|
if (adress.contains(".json")) {
|
|
MI.setObjectName(adress);
|
|
MI.setObjectName(adress);
|
|
@@ -693,7 +696,7 @@ public class SceneAccidentService {
|
|
ObjectMapper objMap = new ObjectMapper();
|
|
ObjectMapper objMap = new ObjectMapper();
|
|
JsonNode root = objMap.readTree(json);
|
|
JsonNode root = objMap.readTree(json);
|
|
// 判断场景名称唯一
|
|
// 判断场景名称唯一
|
|
- String sceneName = root.path("场景名称").asText();
|
|
|
|
|
|
+ sceneName = root.path("场景名称").asText();
|
|
String selfDriving = root.path("自车驾驶行为").asText();
|
|
String selfDriving = root.path("自车驾驶行为").asText();
|
|
String conflictBehavior = root.path("冲突行为").asText();
|
|
String conflictBehavior = root.path("冲突行为").asText();
|
|
String conflictType = root.path("冲突类型").asText();
|
|
String conflictType = root.path("冲突类型").asText();
|
|
@@ -756,19 +759,17 @@ public class SceneAccidentService {
|
|
sceneAccidentPO.setCreateUserId(AuthUtil.getCurrentUserId());
|
|
sceneAccidentPO.setCreateUserId(AuthUtil.getCurrentUserId());
|
|
sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
|
|
sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
|
|
sceneAccidentMapper.saveSceneAccident(sceneAccidentPO);
|
|
sceneAccidentMapper.saveSceneAccident(sceneAccidentPO);
|
|
|
|
+ sceneNames.add(sceneName);
|
|
} else if (isupdate.equals("1")) {
|
|
} else if (isupdate.equals("1")) {
|
|
// -------------------------------- 修改数据到 mysql --------------------------------
|
|
// -------------------------------- 修改数据到 mysql --------------------------------
|
|
sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
|
|
sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
|
|
sceneAccidentPO.setModifyUserId(AuthUtil.getCurrentUserId());
|
|
sceneAccidentPO.setModifyUserId(AuthUtil.getCurrentUserId());
|
|
sceneAccidentMapper.updateSceneAccident(sceneAccidentPO);
|
|
sceneAccidentMapper.updateSceneAccident(sceneAccidentPO);
|
|
|
|
+ sceneNames.add(sceneName);
|
|
}
|
|
}
|
|
|
|
+
|
|
successNum = successNum + 1;
|
|
successNum = successNum + 1;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
-// if (ObjectUtil.isNull(errorMessage)) {
|
|
|
|
-// errorMessage = scenePath;
|
|
|
|
-// } else {
|
|
|
|
-// errorMessage = errorMessage + ";" + scenePath;
|
|
|
|
-// }
|
|
|
|
errorMessage = e.getMessage();
|
|
errorMessage = e.getMessage();
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
falseNum = falseNum + 1;
|
|
falseNum = falseNum + 1;
|
|
@@ -780,13 +781,11 @@ public class SceneAccidentService {
|
|
sceneImportPO.setSuccessNum(successNum);
|
|
sceneImportPO.setSuccessNum(successNum);
|
|
sceneImportPO.setFalseNum(falseNum);
|
|
sceneImportPO.setFalseNum(falseNum);
|
|
sceneImportPO.setErrorMessage(errorMessage);
|
|
sceneImportPO.setErrorMessage(errorMessage);
|
|
- // sceneImportTaskService.updateSceneImportTask(sceneImportTaskPO);
|
|
|
|
-
|
|
|
|
|
|
+ sceneImportPO.setSceneNames(CollectionUtil.listToSequence(sceneNames));
|
|
return sceneImportPO;
|
|
return sceneImportPO;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- sceneImportPO.setErrorMessage("该文件地址:" + parms.getMinioDirectory() + "解析失败,请检查");
|
|
|
|
|
|
+ sceneImportPO.setErrorMessage("该文件地址:" + params.getMinioDirectory() + "解析失败,请检查");
|
|
sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);
|
|
sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);
|
|
- // sceneImportTaskService.updateSceneImportTask(sceneImportTaskPO);
|
|
|
|
return sceneImportPO;
|
|
return sceneImportPO;
|
|
}
|
|
}
|
|
}
|
|
}
|