|
@@ -3,6 +3,7 @@ package com.gis.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.lang.tree.Tree;
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
@@ -1676,6 +1677,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
|
|
|
for (int i = 0; i < catalogRootArray.size(); i++) {
|
|
|
JSONObject catalogRootJson = catalogRootArray.getJSONObject(i);
|
|
|
+
|
|
|
WorkNavigationEntity workNavigationEntity = new WorkNavigationEntity();
|
|
|
workNavigationEntity.setName(catalogRootJson.getString("name"));
|
|
|
workNavigationEntity.setParentId(0L);
|
|
@@ -1683,7 +1685,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
workNavigationEntity.setSort(i + 1);
|
|
|
workNavigationEntity.setType(NavigationTypeEnum.GROUP.code());
|
|
|
workNavigationService.save(workNavigationEntity);
|
|
|
-
|
|
|
+ Long workNavigationEntityId = workNavigationEntity.getId();
|
|
|
JSONArray childrenArray = catalogRootJson.getJSONArray("children");
|
|
|
for (int j = 0; j < childrenArray.size(); j++) {
|
|
|
String treeId = childrenArray.getString(j);
|
|
@@ -1691,13 +1693,33 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
JSONObject catalogJson = catalogsArray.getJSONObject(j1);
|
|
|
if (catalogJson.getString("name").equalsIgnoreCase("默认二级分组")&&treeId.equalsIgnoreCase(catalogJson.getString("id"))){
|
|
|
JSONArray scenesArray = res.getJSONArray("scenes");
|
|
|
+ //第一次判断
|
|
|
+ boolean panoFlag=false;
|
|
|
+ for (int j2 = 0; j2 < scenesArray.size(); j2++) {
|
|
|
+ JSONObject sceneJson = scenesArray.getJSONObject(j2);
|
|
|
+ if (treeId.equalsIgnoreCase(sceneJson.getString("category"))) {
|
|
|
+ panoFlag=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //第二次处理
|
|
|
+ if (panoFlag&&childrenArray.size()>1){
|
|
|
+ WorkNavigationEntity workNavigationEntityChild = new WorkNavigationEntity();
|
|
|
+ workNavigationEntityChild.setName(catalogJson.getString("name"));
|
|
|
+ workNavigationEntityChild.setParentId(workNavigationEntity.getId());
|
|
|
+ workNavigationEntityChild.setWorkId(workId);
|
|
|
+ workNavigationEntityChild.setSort(j1 + 1);
|
|
|
+ workNavigationEntityChild.setType(NavigationTypeEnum.GROUP.code());
|
|
|
+ workNavigationService.save(workNavigationEntityChild);
|
|
|
+ workNavigationEntityId=workNavigationEntityChild.getId();
|
|
|
+ }
|
|
|
for (int j2 = 0; j2 < scenesArray.size(); j2++) {
|
|
|
JSONObject sceneJson = scenesArray.getJSONObject(j2);
|
|
|
if (treeId.equalsIgnoreCase(sceneJson.getString("category"))) {
|
|
|
WorkNavigationEntity workNavigationEntityScene = new WorkNavigationEntity();
|
|
|
workNavigationEntityScene.setWorkId(workId);
|
|
|
workNavigationEntityScene.setName(sceneJson.getString("name"));
|
|
|
- workNavigationEntityScene.setParentId(workNavigationEntity.getId());
|
|
|
+ workNavigationEntityScene.setParentId(workNavigationEntityId);
|
|
|
workNavigationEntityScene.setType(sceneJson.getString("type"));
|
|
|
workNavigationEntityScene.setSceneCode(sceneJson.getString("sceneCode"));
|
|
|
workNavigationEntityScene.setIcon(sceneJson.getString("icon"));
|
|
@@ -1762,7 +1784,10 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}else if (treeId.equalsIgnoreCase(catalogJson.getString("id"))) {
|
|
|
WorkNavigationEntity workNavigationEntityChild = new WorkNavigationEntity();
|
|
|
workNavigationEntityChild.setName(catalogJson.getString("name"));
|
|
@@ -1868,6 +1893,17 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ List<Tree<Long>> navigationTrees = workNavigationSettingService.queryNavigation(workId, null);
|
|
|
+ //子目录下面有全景图和文件夹的时候,新建一个把所有全景图放在默认的二级目录
|
|
|
+ if (navigationTrees.size() > 0) {
|
|
|
+ for (Tree<Long> tree : navigationTrees) {
|
|
|
+ if (tree.getChildren() != null && tree.getChildren().size() > 0) {
|
|
|
+ for (Tree<Long> child : tree.getChildren()) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|