|
@@ -195,27 +195,27 @@ public class SceneAccidentService {
|
|
|
|
|
|
List<SceneAccidentPO> list = new ArrayList<>();
|
|
List<SceneAccidentPO> list = new ArrayList<>();
|
|
String roleCode = AuthUtil.getCurrentUserRoleCode();
|
|
String roleCode = AuthUtil.getCurrentUserRoleCode();
|
|
- log.info("交通事故查询------" +roleCode);
|
|
|
|
|
|
+ log.info("交通事故查询------" + roleCode);
|
|
String userId = AuthUtil.getCurrentUserId();
|
|
String userId = AuthUtil.getCurrentUserId();
|
|
if (DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)) { //管理员账户
|
|
if (DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)) { //管理员账户
|
|
list = SceneAccidentMapper.querySceneAccidentList(params);
|
|
list = SceneAccidentMapper.querySceneAccidentList(params);
|
|
- log.info("泛华----list--" +list.size()+"----------"+params);
|
|
|
|
|
|
+ log.info("泛华----list--" + list.size() + "----------" + params);
|
|
} else if (DictConstants.ROLE_CODE_SUBUESR.equals(roleCode)) {
|
|
} else if (DictConstants.ROLE_CODE_SUBUESR.equals(roleCode)) {
|
|
//查询父账户
|
|
//查询父账户
|
|
userId = AuthUtil.getCreateUserId();
|
|
userId = AuthUtil.getCreateUserId();
|
|
params.setUserId(userId);
|
|
params.setUserId(userId);
|
|
- if(params.getShare().equals("0")){
|
|
|
|
|
|
+ if (params.getShare().equals("0")) {
|
|
list = SceneAccidentMapper.querySceneAccidentList(params);
|
|
list = SceneAccidentMapper.querySceneAccidentList(params);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
list = SceneAccidentMapper.querySceneAccidentListByQx(params);
|
|
list = SceneAccidentMapper.querySceneAccidentListByQx(params);
|
|
}
|
|
}
|
|
|
|
|
|
} else if (DictConstants.ROLE_CODE_UESR.equals(roleCode)) {
|
|
} else if (DictConstants.ROLE_CODE_UESR.equals(roleCode)) {
|
|
//查询普通账户
|
|
//查询普通账户
|
|
params.setUserId(userId);
|
|
params.setUserId(userId);
|
|
- if(params.getShare().equals("0")){
|
|
|
|
|
|
+ if (params.getShare().equals("0")) {
|
|
list = SceneAccidentMapper.querySceneAccidentList(params);
|
|
list = SceneAccidentMapper.querySceneAccidentList(params);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
list = SceneAccidentMapper.querySceneAccidentListByQx(params);
|
|
list = SceneAccidentMapper.querySceneAccidentListByQx(params);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -675,22 +675,24 @@ public class SceneAccidentService {
|
|
// 判断场景名称唯一
|
|
// 判断场景名称唯一
|
|
String sceneName = root.path("场景名称").asText();
|
|
String sceneName = root.path("场景名称").asText();
|
|
String selfDriving = root.path("自车驾驶行为").asText();
|
|
String selfDriving = root.path("自车驾驶行为").asText();
|
|
- String conflictType = root.path("冲突类型").asText();
|
|
|
|
String conflictBehavior = root.path("冲突行为").asText();
|
|
String conflictBehavior = root.path("冲突行为").asText();
|
|
|
|
+ String conflictType = root.path("冲突类型").asText();
|
|
String selfReaction = root.path("自车反应行为").asText();
|
|
String selfReaction = root.path("自车反应行为").asText();
|
|
- if (ObjectUtil.isNull(selfDriving)
|
|
|
|
- && ObjectUtil.isNull(conflictType)
|
|
|
|
- && ObjectUtil.isNull(conflictBehavior)
|
|
|
|
- && ObjectUtil.isNull(selfReaction)) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(sceneName) || ObjectUtil.isNull(selfDriving) || ObjectUtil.isNull(conflictType) || ObjectUtil.isNull(conflictBehavior)) {
|
|
sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);
|
|
sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);
|
|
- sceneImportPO.setErrorMessage("文件 " + adress + " 内容不符合标准格式,解析失败。");
|
|
|
|
-// sceneImportPO.setErrorMessage("文件 " + adress + " 与交通事故场景类型不匹配,解析失败,请检查");
|
|
|
|
|
|
+ sceneImportPO.setErrorMessage("文件 " + adress + " 内容不符合标准格式(场景名称、自车驾驶行为、冲突行为、冲突类型不能为空)。");
|
|
return sceneImportPO;
|
|
return sceneImportPO;
|
|
}
|
|
}
|
|
|
|
|
|
sceneAccidentPO.setSceneName(sceneName);
|
|
sceneAccidentPO.setSceneName(sceneName);
|
|
sceneAccidentPO.setShare("0");
|
|
sceneAccidentPO.setShare("0");
|
|
SceneAccidentPO sceneAccidentPOByName = SceneAccidentMapper.querySceneAccidentByNmae(sceneAccidentPO);
|
|
SceneAccidentPO sceneAccidentPOByName = SceneAccidentMapper.querySceneAccidentByNmae(sceneAccidentPO);
|
|
|
|
+ if (ObjectUtil.isNull(sceneAccidentPOByName)) { // 新增数据
|
|
|
|
+ isupdate = "0";
|
|
|
|
+ } else { // 覆盖(更新)数据
|
|
|
|
+ isupdate = "1";
|
|
|
|
+ sceneAccidentPO.setAccidentId(sceneAccidentPOByName.getAccidentId());
|
|
|
|
+ }
|
|
String osgbAdress = OsgbPath + "/" + root.path("osgb").asText();
|
|
String osgbAdress = OsgbPath + "/" + root.path("osgb").asText();
|
|
String xodrAdress = XodrPath + "/" + root.path("xodr").asText();
|
|
String xodrAdress = XodrPath + "/" + root.path("xodr").asText();
|
|
sceneAccidentPO.setAccidentId(StringUtil.getRandomUUID());
|
|
sceneAccidentPO.setAccidentId(StringUtil.getRandomUUID());
|
|
@@ -712,12 +714,7 @@ public class SceneAccidentService {
|
|
if (ObjectUtil.isNull(sceneAccidentPO.getXodrAddress())) {
|
|
if (ObjectUtil.isNull(sceneAccidentPO.getXodrAddress())) {
|
|
sceneAccidentPO.setXodrAddress(xodrAdress);
|
|
sceneAccidentPO.setXodrAddress(xodrAdress);
|
|
}
|
|
}
|
|
- if (ObjectUtil.isNull(sceneAccidentPOByName)) {
|
|
|
|
- isupdate = "0";
|
|
|
|
- } else {
|
|
|
|
- isupdate = "1";
|
|
|
|
- sceneAccidentPO.setAccidentId(sceneAccidentPOByName.getAccidentId());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
if (adress.contains(".json")) {
|
|
if (adress.contains(".json")) {
|
|
sceneAccidentPO.setJsonAddress(adress);
|
|
sceneAccidentPO.setJsonAddress(adress);
|