lyhzzz 4 месяцев назад
Родитель
Сommit
031b0b1e54
87 измененных файлов с 1820 добавлено и 433 удалено
  1. 4 2
      src/main/java/com/fdkankan/fusion/common/FilePath.java
  2. 21 0
      src/main/java/com/fdkankan/fusion/common/util/CameraUtil.java
  3. 32 0
      src/main/java/com/fdkankan/fusion/common/util/NumTypeUtils.java
  4. 6 3
      src/main/java/com/fdkankan/fusion/controller/CaseAnimationController.java
  5. 36 8
      src/main/java/com/fdkankan/fusion/controller/CaseController.java
  6. 12 0
      src/main/java/com/fdkankan/fusion/controller/CaseFilesTypeController.java
  7. 69 9
      src/main/java/com/fdkankan/fusion/controller/CaseFusionController.java
  8. 21 0
      src/main/java/com/fdkankan/fusion/controller/CaseFusionRelationController.java
  9. 6 3
      src/main/java/com/fdkankan/fusion/controller/CasePathController.java
  10. 5 5
      src/main/java/com/fdkankan/fusion/controller/CaseSettingsController.java
  11. 3 3
      src/main/java/com/fdkankan/fusion/controller/CaseTagController.java
  12. 5 15
      src/main/java/com/fdkankan/fusion/controller/FusionGuideController.java
  13. 29 16
      src/main/java/com/fdkankan/fusion/controller/HotIconController.java
  14. 49 4
      src/main/java/com/fdkankan/fusion/controller/MapConfigController.java
  15. 1 1
      src/main/java/com/fdkankan/fusion/controller/ModelController.java
  16. 4 3
      src/main/java/com/fdkankan/fusion/controller/TmDepartmentController.java
  17. 1 3
      src/main/java/com/fdkankan/fusion/down/CaseDownService.java
  18. 428 0
      src/main/java/com/fdkankan/fusion/down/FusionDownService.java
  19. 4 1
      src/main/java/com/fdkankan/fusion/entity/CaseAnimation.java
  20. 1 1
      src/main/java/com/fdkankan/fusion/entity/CaseEntity.java
  21. 5 1
      src/main/java/com/fdkankan/fusion/entity/CaseFiles.java
  22. 6 0
      src/main/java/com/fdkankan/fusion/entity/CaseFilesType.java
  23. 9 5
      src/main/java/com/fdkankan/fusion/entity/CaseFusion.java
  24. 48 0
      src/main/java/com/fdkankan/fusion/entity/CaseFusionRelation.java
  25. 12 0
      src/main/java/com/fdkankan/fusion/entity/CaseOverview.java
  26. 3 0
      src/main/java/com/fdkankan/fusion/entity/CasePath.java
  27. 3 0
      src/main/java/com/fdkankan/fusion/entity/CaseSettings.java
  28. 5 0
      src/main/java/com/fdkankan/fusion/entity/CaseTabulation.java
  29. 3 0
      src/main/java/com/fdkankan/fusion/entity/CaseTag.java
  30. 1 1
      src/main/java/com/fdkankan/fusion/entity/CaseTagPoint.java
  31. 3 0
      src/main/java/com/fdkankan/fusion/entity/FusionGuide.java
  32. 14 0
      src/main/java/com/fdkankan/fusion/entity/HotIcon.java
  33. 14 0
      src/main/java/com/fdkankan/fusion/entity/MapConfig.java
  34. 7 0
      src/main/java/com/fdkankan/fusion/entity/Model.java
  35. 3 0
      src/main/java/com/fdkankan/fusion/entity/SceneDeptShare.java
  36. 4 1
      src/main/java/com/fdkankan/fusion/entity/ScenePlus.java
  37. 1 1
      src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java
  38. 18 0
      src/main/java/com/fdkankan/fusion/httpClient/request/ManageSceneParam.java
  39. 18 0
      src/main/java/com/fdkankan/fusion/mapper/ICaseFusionRelationMapper.java
  40. 3 1
      src/main/java/com/fdkankan/fusion/mapper/IScenePlusMapper.java
  41. 6 0
      src/main/java/com/fdkankan/fusion/request/AddByMediaLibraryParam.java
  42. 5 0
      src/main/java/com/fdkankan/fusion/request/FusionParam.java
  43. 9 0
      src/main/java/com/fdkankan/fusion/request/MapParam.java
  44. 3 2
      src/main/java/com/fdkankan/fusion/request/ScenePram.java
  45. 11 0
      src/main/java/com/fdkankan/fusion/response/CaseFusionVo.java
  46. 10 0
      src/main/java/com/fdkankan/fusion/response/MapVo.java
  47. 1 0
      src/main/java/com/fdkankan/fusion/response/SceneVo.java
  48. 2 0
      src/main/java/com/fdkankan/fusion/service/ICaseAnimationService.java
  49. 8 0
      src/main/java/com/fdkankan/fusion/service/ICaseFilesTypeService.java
  50. 20 0
      src/main/java/com/fdkankan/fusion/service/ICaseFusionRelationService.java
  51. 5 0
      src/main/java/com/fdkankan/fusion/service/ICaseFusionService.java
  52. 4 0
      src/main/java/com/fdkankan/fusion/service/ICaseNumService.java
  53. 3 1
      src/main/java/com/fdkankan/fusion/service/ICasePathService.java
  54. 2 0
      src/main/java/com/fdkankan/fusion/service/ICaseSettingsService.java
  55. 4 0
      src/main/java/com/fdkankan/fusion/service/ICaseTagService.java
  56. 2 0
      src/main/java/com/fdkankan/fusion/service/IFusionGuideService.java
  57. 1 1
      src/main/java/com/fdkankan/fusion/service/IFusionMeterService.java
  58. 10 1
      src/main/java/com/fdkankan/fusion/service/IFusionNumService.java
  59. 6 0
      src/main/java/com/fdkankan/fusion/service/IHotIconService.java
  60. 4 4
      src/main/java/com/fdkankan/fusion/service/IModelService.java
  61. 4 0
      src/main/java/com/fdkankan/fusion/service/ISceneDeptShareService.java
  62. 6 0
      src/main/java/com/fdkankan/fusion/service/IScenePlusExtService.java
  63. 6 0
      src/main/java/com/fdkankan/fusion/service/IScenePlusService.java
  64. 0 2
      src/main/java/com/fdkankan/fusion/service/ISceneService.java
  65. 2 0
      src/main/java/com/fdkankan/fusion/service/ITmDepartmentService.java
  66. 7 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseAnimationServiceImpl.java
  67. 68 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseFilesTypeServiceImpl.java
  68. 56 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseFusionRelationServiceImpl.java
  69. 99 3
      src/main/java/com/fdkankan/fusion/service/impl/CaseFusionServiceImpl.java
  70. 49 118
      src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java
  71. 8 1
      src/main/java/com/fdkankan/fusion/service/impl/CasePathServiceImpl.java
  72. 20 111
      src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java
  73. 21 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseSettingsServiceImpl.java
  74. 28 3
      src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java
  75. 0 1
      src/main/java/com/fdkankan/fusion/service/impl/CopyCaseService.java
  76. 17 2
      src/main/java/com/fdkankan/fusion/service/impl/FusionGuideServiceImpl.java
  77. 1 13
      src/main/java/com/fdkankan/fusion/service/impl/FusionMeterServiceImpl.java
  78. 81 28
      src/main/java/com/fdkankan/fusion/service/impl/FusionNumServiceImpl.java
  79. 75 7
      src/main/java/com/fdkankan/fusion/service/impl/HotIconServiceImpl.java
  80. 101 5
      src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java
  81. 11 0
      src/main/java/com/fdkankan/fusion/service/impl/SceneDeptShareServiceImpl.java
  82. 25 0
      src/main/java/com/fdkankan/fusion/service/impl/ScenePlusExtServiceImpl.java
  83. 28 1
      src/main/java/com/fdkankan/fusion/service/impl/ScenePlusServiceImpl.java
  84. 17 34
      src/main/java/com/fdkankan/fusion/service/impl/SceneService.java
  85. 32 0
      src/main/java/com/fdkankan/fusion/service/impl/TmDepartmentServiceImpl.java
  86. 5 0
      src/main/resources/mapper/fusion/CaseFusionRelationMapper.xml
  87. 20 8
      src/main/resources/mapper/fusion/ScenePlusMapper.xml

+ 4 - 2
src/main/java/com/fdkankan/fusion/common/FilePath.java

@@ -14,8 +14,10 @@ public class FilePath {
 
     public final static String FFMPEG_IMG_PATH  = "/mnt/fusion/ffmpeg_imgs";
 
-    public final static String OFFLINE_PACKAGE_PATH = "/mnt/fusion/offline/offline_";
-    public final static String OFFLINE_TEMPLATE_PATH = "/mnt/fusion/offline/template";
+    public final static String OFFLINE_PACKAGE_PATH = "/mnt/fusion/offline/fusionOffline_";
+    public final static String OFFLINE_PACKAGE_PATH_CASE = "/mnt/fusion/offline/caseOffline_";
+    public final static String OFFLINE_TEMPLATE_PATH_Fusion = "/mnt/fusion/offline/template/fusion";
+    public final static String OFFLINE_TEMPLATE_PATH_CASE = "/mnt/fusion/offline/template/case";
     public final static String OFFLINE_RESOURCE_PACKAGE_PATH = OFFLINE_PACKAGE_PATH + "%s/www/package/resource/";
     public final static String OFFLINE_OSS_PATH = OFFLINE_PACKAGE_PATH + "%s/www";
     public final static String OFFLINE_LASER_OSS_PATH =  "/swss/%s/www/%s/";

+ 21 - 0
src/main/java/com/fdkankan/fusion/common/util/CameraUtil.java

@@ -10,4 +10,25 @@ public class CameraUtil {
             default: return "八目";
         }
     }
+
+
+    /**
+     * 现勘一号             SS
+     * 现勘二号             SG
+     * 现勘三号             KJ
+     * 现勘补拍仪           YZL
+     * 四维看看
+     */
+    public static String getSourceName(Integer type) {
+        switch (type){
+            case 1: return "现勘三号/Mesh";
+            case 2: return "现勘一号/点云";
+            case 4: return "现勘一号/Mesh";
+            case 5: return "现勘二号/点云";
+            case 6: return "现勘二号/Mesh";
+            case 7: return "现勘补拍仪";
+            case 3: return "媒体库";
+            default: return "四维看看/Mesh";
+        }
+    }
 }

+ 32 - 0
src/main/java/com/fdkankan/fusion/common/util/NumTypeUtils.java

@@ -1,5 +1,10 @@
 package com.fdkankan.fusion.common.util;
 
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Arrays;
+import java.util.List;
+
 public class NumTypeUtils {
 
     public static Boolean isLaser(Integer type){
@@ -16,4 +21,31 @@ public class NumTypeUtils {
         }
         return false;
     }
+
+
+    public static List<Integer> getTypeBySceneSource(Integer sceneSource, String three) {
+        switch (sceneSource){
+            case 3 : return  Arrays.asList(1);
+            case 4 : return  Arrays.asList(2,4);
+            case 5 : return  Arrays.asList(5,6);
+            default:
+                if(StringUtils.isNotBlank(three) && "yzl".equals(three)){
+                    return Arrays.asList(7);
+                }
+                return Arrays.asList(0);
+        }
+    }
+
+    public static Integer getMeshTypeBySceneSource(Integer sceneSource,Integer isObj, String three) {
+        switch (sceneSource){
+            case 3 : return  1;
+            case 4 : return  isObj ==1 ? 4 :2;
+            case 5 : return   isObj ==1 ? 6 :5;
+            default:
+                if(StringUtils.isNotBlank(three) && "yzl".equals(three)){
+                    return 7;
+                }
+                return 0;
+        }
+    }
 }

+ 6 - 3
src/main/java/com/fdkankan/fusion/controller/CaseAnimationController.java

@@ -27,15 +27,18 @@ public class CaseAnimationController {
 
 
     @GetMapping("/list")
-    public ResultData allList(@RequestParam(required = false) Integer caseId){
-        if(caseId == null){
+    public ResultData allList(@RequestParam(required = false) Integer fusionId){
+        if(fusionId == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        return ResultData.ok(caseAnimationService.getListByCaseId(caseId));
+        return ResultData.ok(caseAnimationService.getListByFusionId(fusionId));
     }
 
     @PostMapping("/addOrUpdate")
     public ResultData addOrUpdate(@RequestBody CaseAnimation caseAnimation){
+        if(caseAnimation.getFusionId() == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
         caseAnimationService.saveOrUpdate(caseAnimation);
         return ResultData.ok(caseAnimation);
     }

+ 36 - 8
src/main/java/com/fdkankan/fusion/controller/CaseController.java

@@ -3,22 +3,28 @@ package com.fdkankan.fusion.controller;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dtflys.forest.annotation.Post;
+import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.common.ResultCode;
-import com.fdkankan.fusion.entity.TmProject;
+import com.fdkankan.fusion.entity.*;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.common.ResultData;
-import com.fdkankan.fusion.entity.CaseEntity;
+import com.fdkankan.fusion.httpClient.request.ManageSceneParam;
 import com.fdkankan.fusion.request.CaseParam;
+import com.fdkankan.fusion.request.ScenePram;
 import com.fdkankan.fusion.response.CaseVo;
-import com.fdkankan.fusion.service.ICaseNumService;
-import com.fdkankan.fusion.service.ICaseService;
-import com.fdkankan.fusion.service.ITmProjectService;
+import com.fdkankan.fusion.response.SceneVo;
+import com.fdkankan.fusion.service.*;
 import com.fdkankan.fusion.service.impl.CopyCaseService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * 案件管理
  */
@@ -32,6 +38,12 @@ public class CaseController extends BaseController{
     ITmProjectService tmProjectService;
     @Autowired
     CopyCaseService copyCaseService;
+    @Autowired
+    ICaseOverviewService caseOverviewService;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    ICaseNumService caseNumService;
 
     @PostMapping("/list")
     public ResultData list(@RequestBody CaseParam param ){
@@ -49,9 +61,25 @@ public class CaseController extends BaseController{
     }
 
     @PostMapping("/sceneListPost")
-    public ResultData sceneListPost(@RequestBody CaseParam param ){
-        param.setSceneStatus(2);
-        return ResultData.ok(caseService.sceneList(param));
+    public ResultData sceneListPost(@RequestBody ManageSceneParam param ) {
+        if (param.getOverviewId() != null) {
+            CaseOverview caseOverview = caseOverviewService.getById(param.getOverviewId());
+            if (caseOverview != null && StringUtils.isNotBlank(caseOverview.getNum())) {
+                ScenePram scenePram = new ScenePram();
+                scenePram.setNumList(Arrays.asList(caseOverview.getNum()));
+                Page<SceneVo> page = scenePlusService.sceneList(scenePram);
+                return ResultData.ok(PageInfo.PageInfo(page));
+            }
+        }
+        if (param.getCaseId() != null) {
+            List<CaseNumEntity> byCaseId = caseNumService.getByCaseId(param.getCaseId());
+            List<String> numList = byCaseId.stream().map(CaseNumEntity::getNum).collect(Collectors.toList());
+            ScenePram scenePram = new ScenePram();
+            scenePram.setNumList(numList);
+            Page<SceneVo> page = scenePlusService.sceneList(scenePram);
+            return ResultData.ok(PageInfo.PageInfo(page));
+        }
+        return ResultData.ok(PageInfo.PageInfoEmpty());
     }
 
     @PostMapping("/addOrUpdate")

+ 12 - 0
src/main/java/com/fdkankan/fusion/controller/CaseFilesTypeController.java

@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -28,5 +29,16 @@ public class CaseFilesTypeController {
     public ResultData allList(){
         return ResultData.ok(caseFilesTypeService.list());
     }
+
+    @GetMapping("/getByParentId")
+    public ResultData getByParentId(@RequestParam(required = false) Integer parentId){
+        return ResultData.ok(caseFilesTypeService.getByParentId(parentId));
+    }
+
+
+    @GetMapping("/getByTree")
+    public ResultData getByTree(@RequestParam(required = false) Integer caseId){
+        return ResultData.ok(caseFilesTypeService.getByTree(caseId));
+    }
 }
 

+ 69 - 9
src/main/java/com/fdkankan/fusion/controller/CaseFusionController.java

@@ -1,16 +1,14 @@
 package com.fdkankan.fusion.controller;
 
 
+import com.alibaba.fastjson.JSONArray;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;
-import com.fdkankan.fusion.entity.CaseFusion;
-import com.fdkankan.fusion.entity.FusionNum;
+import com.fdkankan.fusion.common.util.FileWriterUtil;
+import com.fdkankan.fusion.entity.*;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.request.FusionParam;
-import com.fdkankan.fusion.service.ICaseFusionService;
-import com.fdkankan.fusion.service.ICaseTagPointService;
-import com.fdkankan.fusion.service.IFusionMeterService;
-import com.fdkankan.fusion.service.IFusionNumService;
+import com.fdkankan.fusion.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,15 +37,77 @@ public class CaseFusionController extends BaseController{
     IFusionMeterService fusionMeterService;
     @Autowired
     ICaseTagPointService caseTagPointService;
+    @Autowired
+    IModelService modelService;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    IScenePlusExtService scenePlusExtService;
+    @Autowired
+    ICommonUploadService commonUploadService;
 
     @GetMapping("/list")
-    public ResultData allList(@RequestParam(required = false) Integer caseId){
-        return ResultData.ok(fusionNumService.getListByCaseId(caseId,null));
+    public ResultData allList(@RequestParam(required = false) Integer fusionId){
+        return ResultData.ok(caseFusionService.getSceneListVo(fusionId));
+    }
+
+
+    @GetMapping("/info")
+    public ResultData info(@RequestParam(required = false) Integer fusionId){
+        CaseFusion caseFusion = caseFusionService.getById(fusionId);
+        if(caseFusion == null){
+            throw new BusinessException(ResultCode.RECORD_NOT_EXITS);
+        }
+        return ResultData.ok(caseFusion);
     }
 
     @PostMapping("/add")
     public ResultData add(@RequestBody FusionParam param){
-        return ResultData.ok(fusionNumService.add(param));
+        if( param.getFusionId() == null ){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        if((param.getIsObj() == null || StringUtils.isBlank(param.getNum())) && param.getUploadId() == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        if(param.getUploadId() != null){
+            CommonUpload commonUpload = commonUploadService.getById(param.getUploadId());
+            if(commonUpload == null || StringUtils.isBlank(commonUpload.getFileUrl())){
+                throw new BusinessException(ResultCode.MEDIO_NOT_EXIT);
+            }
+            Model model = modelService.getByUploadId(commonUpload.getId());
+            if(model == null){
+                model = new Model();
+                model.setModelTitle(commonUpload.getFileName());
+                model.setModelSize(FileWriterUtil.setFileSize(Long.valueOf(commonUpload.getFileSize())));
+                model.setModelDateType(commonUpload.getFileFormat());
+                model.setModelType(commonUpload.getResultFileFormat());
+                model.setWgs84(commonUpload.getWgs84());
+                model.setGcj02(commonUpload.getGcj02());
+                model.setConvertType(commonUpload.getConvertType());
+                JSONArray jsonArray = new JSONArray();
+                jsonArray.add(commonUpload.getFileUrl());
+                model.setModelGlbUrl(jsonArray.toJSONString());
+                model.setType(3);
+                model.setCreateStatus(1);
+                model.setUploadId(commonUpload.getId());
+                modelService.save(model);
+            }
+            return ResultData.ok(fusionNumService.addModel(param,model.getModelId(),model.getModelTitle()));
+        }
+        ScenePlus scenePlus = scenePlusService.getByNum(param.getNum());
+        ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
+        scenePlus.setScenePlusExt(scenePlusExt);
+        return ResultData.ok(fusionNumService.add(param,scenePlus,param.getIsObj()));
+    }
+
+    @PostMapping("/updateInfo")
+    public ResultData updateInfo(@RequestBody CaseFusion caseFusion){
+        if(caseFusion.getFusionId() == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        caseFusion.setUpdateTime(null);
+        caseFusionService.updateById(caseFusion);
+        return ResultData.ok();
     }
 
     /**

+ 21 - 0
src/main/java/com/fdkankan/fusion/controller/CaseFusionRelationController.java

@@ -0,0 +1,21 @@
+package com.fdkankan.fusion.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-12
+ */
+@RestController
+@RequestMapping("/fusion/caseFusionRelation")
+public class CaseFusionRelationController {
+
+}
+

+ 6 - 3
src/main/java/com/fdkankan/fusion/controller/CasePathController.java

@@ -27,15 +27,18 @@ public class CasePathController {
 
 
     @GetMapping("/info")
-    public ResultData info(@RequestParam(required = false) Integer caseId){
-        if(caseId == null){
+    public ResultData info(@RequestParam(required = false) Integer fusionId){
+        if(fusionId == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        return ResultData.ok(casePathService.getByCaseId(caseId));
+        return ResultData.ok(casePathService.getByFusionId(fusionId));
     }
 
     @PostMapping("/saveOrUpdate")
     public ResultData saveOrUpdate(@RequestBody CasePath casePath){
+        if(casePath.getFusionId() == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
         casePathService.saveOrUpdate(casePath);
         return ResultData.ok(casePath);
     }

+ 5 - 5
src/main/java/com/fdkankan/fusion/controller/CaseSettingsController.java

@@ -29,21 +29,21 @@ public class CaseSettingsController {
     ICaseSettingsService caseSettingsService;
 
     @GetMapping("/info")
-    public ResultData info(@RequestParam(required = false) Integer caseId){
-        if(caseId == null){
+    public ResultData info(@RequestParam(required = false) Integer fusionId){
+        if(fusionId == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        return ResultData.ok(caseSettingsService.getByCaseId(caseId));
+        return ResultData.ok(caseSettingsService.getByFusionId(fusionId));
     }
 
 
     @PostMapping("/saveOrUpdate")
     public ResultData saveOrUpdate(@RequestBody CaseSettings caseSettings){
-        if(caseSettings.getCaseId() == null){
+        if(caseSettings.getFusionId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(caseSettings.getSettingsId() == null ){
-            List<CaseSettings> list = caseSettingsService.getByCaseId(caseSettings.getCaseId());
+            List<CaseSettings> list = caseSettingsService.getByFusionId(caseSettings.getFusionId());
             if(list.size() >0){
                 throw new BusinessException(ResultCode.CASE_HAVE_SETTINGS);
             }

+ 3 - 3
src/main/java/com/fdkankan/fusion/controller/CaseTagController.java

@@ -35,7 +35,7 @@ public class CaseTagController {
     @PostMapping("/add")
     public ResultData add(@RequestBody CaseTag caseTag){
         if(caseTag.getHotIconId()==null ||  StringUtils.isEmpty(caseTag.getHotIconUrl())
-              ||caseTag.getCaseId() == null  || StringUtils.isEmpty(caseTag.getTagTitle())){
+              ||caseTag.getFusionId() == null  || StringUtils.isEmpty(caseTag.getTagTitle())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         //新增时取消icon上次使用标识,增加使用次数,设置新的上次使用标识
@@ -47,9 +47,9 @@ public class CaseTagController {
     }
 
     @GetMapping("/allList")
-    public ResultData allList(@RequestParam(required = false) Integer caseId,
+    public ResultData allList(@RequestParam(required = false) Integer fusionId,
                               @RequestParam(required = false)String tagTitle){
-        return ResultData.ok(caseTagService.allList(caseId,tagTitle));
+        return ResultData.ok(caseTagService.allListFusionId(fusionId,tagTitle));
     }
 
     @PostMapping("/delete")

+ 5 - 15
src/main/java/com/fdkankan/fusion/controller/FusionGuideController.java

@@ -27,11 +27,11 @@ public class FusionGuideController {
     IFusionGuideService fusionGuideService;
 
     @GetMapping("/allList")
-    public ResultData allList(@RequestParam(required = false) Integer caseId){
-        if(caseId == null){
+    public ResultData allList(@RequestParam(required = false) Integer fusionId){
+        if(fusionId == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        return ResultData.ok(fusionGuideService.getAllList(caseId));
+        return ResultData.ok(fusionGuideService.getByFusionId(fusionId));
     }
 
     @PostMapping("/add")
@@ -44,18 +44,8 @@ public class FusionGuideController {
                 (fusionGuide.getSort() == null && StringUtils.isEmpty(fusionGuide.getTitle()) && StringUtils.isEmpty(fusionGuide.getCover())  )){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        LambdaUpdateWrapper<FusionGuide> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(FusionGuide::getFusionGuideId,fusionGuide.getFusionGuideId());
-        if(fusionGuide.getSort()!=null){
-            wrapper.set(FusionGuide::getSort,fusionGuide.getSort());
-        }
-        if(StringUtils.isNotBlank(fusionGuide.getTitle())){
-            wrapper.set(FusionGuide::getTitle,fusionGuide.getTitle());
-        }
-        if(StringUtils.isNotBlank(fusionGuide.getCover())){
-            wrapper.set(FusionGuide::getCover,fusionGuide.getCover());
-        }
-        fusionGuideService.update(wrapper);
+        fusionGuide.setUpdateTime(null);
+        fusionGuideService.updateById(fusionGuide);
         return ResultData.ok();
     }
 

+ 29 - 16
src/main/java/com/fdkankan/fusion/controller/HotIconController.java

@@ -40,40 +40,46 @@ public class HotIconController extends BaseController{
     private String environment;
 
     @GetMapping("/list")
-    public ResultData list(@RequestParam(required = false) Integer caseId){
-        if(caseId!=null){
-            return ResultData.ok(hotIconService.getListByCaseId(caseId));
+    public ResultData list(@RequestParam(required = false) Integer fusionId){
+        if(fusionId!=null){
+            return ResultData.ok(hotIconService.getListByFusionId(fusionId));
         }
         return ResultData.ok(hotIconService.getListByUserName(getUserName()));
     }
 
+    @GetMapping("/treeList")
+    public ResultData listTree(@RequestParam(required = false) Integer fusionId){
+        List<HotIcon> iconList ;
+        if(fusionId!=null){
+            iconList = hotIconService.getListByFusionId(fusionId);
+        }else {
+            iconList = hotIconService.getListByUserName(getUserName());
+        }
+        List<HotIcon> treeList = hotIconService.treeList(iconList);
+
+        return ResultData.ok(treeList);
+    }
+
     @PostMapping("/add")
     public ResultData add(@RequestParam(required = false) MultipartFile file,
                           @RequestParam(required = false) String iconTitle,
-                          @RequestParam(required = false) Integer caseId) throws IOException {
-        if(file==null || StringUtils.isEmpty(iconTitle)){
+                          @RequestParam(required = false) Integer fusionId,
+                          @RequestParam(required = false,defaultValue = "279") Integer parentId) throws IOException {
+
+        if(file==null || StringUtils.isEmpty(iconTitle) || fusionId == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        if(caseId != null){
-            List<HotIcon> hotIconList = hotIconService.getListByCaseId(caseId);
-            if(!hotIconList.isEmpty() && hotIconList.size() >=19){
-                throw new BusinessException(ResultCode.HOST_ICON_LIMIT);
-            }
-        }
 
         String iconUrl = uploadService.uploadFile(file, true, String.format(FilePath.ICON_OSS_PATH,environment,""));
 
-        String username = getUserName();
         HotIcon hotIcon = new HotIcon();
         hotIcon.setIconTitle(iconTitle);
         hotIcon.setIconUrl(iconUrl);
-        hotIcon.setCaseId(caseId);
-        hotIcon.setUserName(username);
+        hotIcon.setFusionId(fusionId);
+        hotIcon.setParentId(parentId);
         if(StringUtils.isEmpty(hotIcon.getIconUrl())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        //取消用户之前新增标记
-        hotIconService.cancelIsNew(username);
         if(StringUtils.isEmpty(hotIcon.getIconTitle())){
             String fileName = file.getOriginalFilename();
             assert fileName != null;
@@ -91,6 +97,13 @@ public class HotIconController extends BaseController{
         if(hotIcon.getIconId() == 1){
             return ResultData.ok();
         }
+        HotIcon byId = hotIconService.getById(hotIcon.getIconId());
+        if(byId == null){
+            return ResultData.ok();
+        }
+        if(byId .getIsSystem() == 1){
+            throw new BusinessException(ResultCode.SYSTEM_HOT_ICON_NOT_DELETE);
+        }
         caseTagService.updateDFHotIcon(hotIcon.getIconId());
         hotIconService.removeById(hotIcon.getIconId());
         return ResultData.ok();

+ 49 - 4
src/main/java/com/fdkankan/fusion/controller/MapConfigController.java

@@ -1,16 +1,25 @@
 package com.fdkankan.fusion.controller;
 
 
+import cn.hutool.core.util.URLUtil;
+import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;
+import com.fdkankan.fusion.entity.MapConfig;
 import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.request.MapParam;
+import com.fdkankan.fusion.response.MapVo;
+import com.fdkankan.fusion.service.IMapConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * <p>
@@ -26,5 +35,41 @@ import org.springframework.web.bind.annotation.RestController;
 public class MapConfigController {
 
 
+    @Autowired
+    IMapConfigService mapConfigService;
+
+    @PostMapping("/geocode")
+    public ResultData geocode(@RequestBody MapParam param){
+        try {
+            if(param.getMapId() == null || StringUtils.isBlank(param.getAddress())){
+                throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+            }
+            MapConfig mapConfig = mapConfigService.getById(param.getMapId());
+            if(mapConfig == null || mapConfig.getGeocodeUrl() == null){
+                throw new BusinessException(ResultCode.RECORD_NOT_EXITS);
+            }
+
+            String url = mapConfig.getGeocodeUrl().replace("{address}",param.getAddress());
+            String s = HttpUtil.get(url);
+            log.info("map-resp:{}",s);
+            JSONObject jsonObject = JSON.parseObject(s);
+            JSONArray jsonArray = jsonObject.getJSONArray(mapConfig.getRespListKey());
+            List<MapVo> mapVos = new ArrayList<>();
+            for (Object object : jsonArray) {
+                JSONObject jsonObject1 = (JSONObject) object;
+                MapVo vo = new MapVo();
+                vo.setLocation(jsonObject1.getString(mapConfig.getRespLocationKey()));
+                vo.setAddress(jsonObject1.getString(mapConfig.getRespAddressKey()));
+                vo.setName(jsonObject1.getString(mapConfig.getRespNameKey()));
+                mapVos.add(vo);
+            }
+            return ResultData.ok(mapVos);
+        }catch ( Exception e){
+            log.info("map-error:{}",e);
+        }
+
+        return ResultData.ok();
+    }
+
 }
 

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/ModelController.java

@@ -64,7 +64,7 @@ public class ModelController extends BaseController{
 
     @PostMapping("/addByMediaLibrary")
     public ResultData addByMediaLibrary(@RequestBody AddByMediaLibraryParam param)  {
-        if(param.getCaseId() == null || param.getUploadId() == null ){
+        if(param.getFusionId() == null || param.getUploadId() == null ){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CommonUpload commonUpload = commonUploadService.getById(param.getUploadId());

+ 4 - 3
src/main/java/com/fdkankan/fusion/controller/TmDepartmentController.java

@@ -90,9 +90,10 @@ public class TmDepartmentController {
         return ResultData.ok();
     }
 
-    @PostMapping("/higherLevel")
-    public ResultData higherLevel(@RequestBody SceneDeptShare param){
-        return ResultData.ok();
+    @GetMapping("/higherLevel")
+    public ResultData higherLevel(@RequestParam(required = false) String deptId){
+
+        return ResultData.ok(departmentService.higherLevel(deptId));
     }
 }
 

+ 1 - 3
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -417,7 +417,7 @@ public class CaseDownService {
        log.info("down-offline-cpIndexHtml:{}",caseId);
 
        String caseOfflinePath = FilePath.OFFLINE_PACKAGE_PATH+caseId;
-       FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH),new File(caseOfflinePath),true);
+       FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH_CASE),new File(caseOfflinePath),true);
 
        String s = FileUtil.readString(caseOfflinePath + File.separator + batName, StandardCharsets.UTF_8);
        String s1 = s.replaceAll("@caseId", String.valueOf(caseId));
@@ -484,8 +484,6 @@ public class CaseDownService {
                ShellUtil.unZip(kkzipPath,kknumPath);
 
            }else {
-               //        {"msg":"操作成功","code":200,"data":{"status":1,"
-               //        url":"https://laser-oss.4dkankan.com/testdata/SS-t-bY7NMQYlm6v/data/SS-t-bY7NMQYlm6v_offline18826401790
                ShellUtil.yunDownloadSs(uri.replace(ssQueryPath, ""), sszipPath);
                ShellUtil.unZip(sszipPath,ssNumPath);
            }

+ 428 - 0
src/main/java/com/fdkankan/fusion/down/FusionDownService.java

@@ -0,0 +1,428 @@
+package com.fdkankan.fusion.down;
+
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.deepoove.poi.XWPFTemplate;
+import com.fdkankan.fusion.common.FilePath;
+import com.fdkankan.fusion.common.ResultData;
+import com.fdkankan.fusion.common.util.DateUtils;
+import com.fdkankan.fusion.common.util.ShellUtil;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.entity.*;
+import com.fdkankan.fusion.httpClient.LaserService;
+import com.fdkankan.fusion.httpClient.response.FdkkResponse;
+import com.fdkankan.fusion.request.CaseParam;
+import com.fdkankan.fusion.response.DownVo;
+import com.fdkankan.fusion.response.DownloadProcessVo;
+import com.fdkankan.fusion.response.FusionNumVo;
+import com.fdkankan.fusion.response.SceneVo;
+import com.fdkankan.fusion.service.*;
+import com.fdkankan.fusion.service.impl.DownService;
+import com.fdkankan.redis.util.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+@Service
+@Slf4j
+public class FusionDownService {
+
+    @Value("${server.servlet.context-path}")
+    String basePath;
+
+    public static String jsonDataName = "data.json";
+    public static String caseFusionInfo =     "/caseFusion/info?fusionId=";
+    public static String caseFusionList=     "/caseFusion/list?fusionId=";
+    public static String mapConfig =     "/notAuth/getMapConfig";
+    public static String caseSettingsInfo =     "/caseSettings/info?fusionId=";
+    public static String hostIconTreeList =     "/edit/hotIcon/treeList?fusionId=";
+    public static String caseTag =      "/caseTag/allList?fusionId=";
+    public static String caseTagPoint =      "/caseTagPoint/allList?tagId=";
+    public static String fusionGuide =      "/fusionGuide/allList?fusionId=";
+    public static String fusionGuidePath =     "/fusionGuidePath/allList?guideId=";
+    public static String fusionMeter =      "/fusionMeter/allList?fusionId=";
+    public static String casePathInfoUrl =      "/casePath/info?fusionId=";
+    public static String caseAnimationUrl =      "/caseAnimation/list?fusionId=";
+    public static String laserData = "/laser/dataset/%s/getDataSet";
+    public static String laserDataSetAndControlPoint = "/laser/4dage/%s/getDataSetAndControlPoint";
+    public static String laserDataQuery = "/laser/filter/%s/query?datasetId=%s";
+
+
+    @Autowired
+    ICaseSettingsService caseSettingsService;
+    @Autowired
+    IFusionNumService fusionNumService;
+    @Autowired
+    ICaseViewService caseViewService;
+    @Autowired
+    ICaseVideoFolderService caseVideoFolderService;
+    @Autowired
+    ICaseVideoService caseVideoService;
+    @Autowired
+    ICaseFilesService caseFilesService;
+    @Autowired
+    ICaseFilesTypeService caseFilesTypeService;
+    @Autowired
+    IHotIconService hotIconService;
+    @Autowired
+    ICaseTagService caseTagService;
+    @Autowired
+    ICaseTagPointService caseTagPointService;
+    @Autowired
+    IFusionGuideService fusionGuideService;
+    @Autowired
+    IFusionGuidePathService fusionGuidePathService;
+    @Autowired
+    ICaseInquestService caseInquestService;
+    @Autowired
+    ICaseExtractDetailService caseExtractDetailService;
+    @Autowired
+    IFusionMeterService fusionMeterService;
+    @Autowired
+    IModelService modelService;
+    @Autowired
+    LaserService laserService;
+    @Autowired
+    ICaseOfflineService caseOfflineService;
+    @Autowired
+    ICaseImgService caseImgService;
+    @Autowired
+    ICasePathService casePathService;
+    @Autowired
+    ICaseFusionService caseFusionService;
+    @Autowired
+    ICaseAnimationService caseAnimationService;
+    @Autowired
+    IMapConfigService mapConfigService;
+
+    @Autowired
+    RedisUtil redisUtil;
+    public static String downProcessKey = "fusion:down:offline:process:fusionId:%s";
+
+    @Async
+    public void downOffline(Integer fusionId){
+        String caseOffPath = null;
+        String zipName = null;
+        try {
+            String redisKey = String.format(downProcessKey, fusionId);
+            if(redisUtil.hasKey(redisKey)){
+                String res = redisUtil.get(redisKey);
+                DownloadProcessVo downloadProcessVo = JSONObject.parseObject(res, DownloadProcessVo.class);
+                if(downloadProcessVo.getStatus() != 1003 && (downloadProcessVo.getPercent()== null || downloadProcessVo.getPercent() != 100)){
+                    return;
+                }
+            }
+
+            String timeKey = DateUtils.dateStr();
+            caseOffPath =FilePath.OFFLINE_PACKAGE_PATH+timeKey+fusionId ;
+
+            setRedisProcess(fusionId,0);
+            //复制前端资源
+            cpIndexHtml(fusionId,caseOffPath);
+            setRedisProcess(fusionId,10);
+            //创建data.json并下载资源
+            createDataJson(fusionId,caseOffPath+"/env/www");
+            //打包zip
+            zipName = caseOffPath+".zip";
+            ShellUtil.zip(zipName,caseOffPath);
+            setRedisProcess(fusionId,70);
+            //上传oss
+            String ossUrl = zipName.replace("/mnt/", "");
+            ShellUtil.yunUpload(zipName,ossUrl);
+            ossUrl = queryPath + ossUrl;
+            setRedisProcess(fusionId,100,ossUrl);
+        }catch (Exception e){
+            log.info("down-offline-error:{}",fusionId,e);
+            setRedisProcess(fusionId,0,null,1003);
+        }finally {
+            delFile(caseOffPath);
+            delFile(zipName);
+        }
+
+    }
+    private void delFile(String path){
+        if(StringUtils.isNotBlank(path)){
+            try {
+                FileUtil.del(path);
+            }catch (Exception e){
+                log.info("删除文件失败:{}",path);
+            }
+        }
+    }
+
+    public void setRedisProcess(Integer caseId,Integer num){
+        setRedisProcess(caseId,num,null,1000);
+    }
+
+    public void setRedisProcess(Integer caseId,Integer num,String url){
+       setRedisProcess(caseId,num,url,1000);
+    }
+
+    public void setRedisProcess(Integer caseId,Integer num,String url,Integer status){
+        String redisKey = String.format(downProcessKey, caseId);
+        log.info("down-offline-process:{},{},{}",caseId,num,url);
+        DownloadProcessVo processVo = new DownloadProcessVo();
+        processVo.setStatus(status);
+        processVo.setPercent(num);
+        processVo.setUrl( url);
+        redisUtil.set(redisKey,JSONObject.toJSONString(processVo));
+    }
+
+    public DownloadProcessVo process(Integer caseId) {
+        DownloadProcessVo downVo = new DownloadProcessVo();
+        String redisKey = String.format(downProcessKey, caseId);
+        if(redisUtil.hasKey(redisKey)){
+            return JSONObject.parseObject(redisUtil.get(redisKey),DownloadProcessVo.class);
+        }
+        return downVo;
+    }
+
+    public void createDataJson(Integer fusionId,String caseOffPath){
+        log.info("down-offline-createDataJson:{}",fusionId);
+        JSONObject jsonObject = new JSONObject();
+        CaseFusion caseFusion = caseFusionService.getById(fusionId);
+        jsonObject.put(basePath+caseFusionInfo+fusionId, ResultData.ok(caseFusion));
+
+        List<FusionNumVo> sceneListVo = caseFusionService.getSceneListVo(fusionId);
+        jsonObject.put(basePath+caseFusionList+fusionId, ResultData.ok(sceneListVo));
+
+        List<MapConfig> list = mapConfigService.list();
+        jsonObject.put(basePath+mapConfig, ResultData.ok(list));
+
+        List<CaseSettings> caseSettings = caseSettingsService.getByFusionId(fusionId);
+        jsonObject.put(basePath+caseSettingsInfo+fusionId, ResultData.ok(caseSettings));
+        for (CaseSettings caseSetting : caseSettings) {
+            downResource(caseSetting.getBack(),caseOffPath);
+            downResource(caseSetting.getCover(),caseOffPath);
+        }
+
+        jsonObject.put(basePath+fusionMeter+fusionId, ResultData.ok(fusionMeterService.getListByFusionId(fusionId,null)));
+
+        List<FusionNumVo> fusionNumVos = caseFusionService.getSceneListVo(fusionId);
+        for (FusionNumVo fusionNumVo : fusionNumVos) {
+            SceneVo sceneData = fusionNumVo.getSceneData();
+            //下载模型
+            sceneData.setCutModelPath(sceneData.getCutModelPath().replace("/oss/","/swkk/"+sceneData.getNum() +"/wwwroot/"));
+            sceneData.setSceneJsonPath(sceneData.getSceneJsonPath().replace("/oss/","/swkk/"+sceneData.getNum() +"/wwwroot/"));
+            sceneData.setSurveillancePath(sceneData.getSurveillancePath().replace("/oss/","/swkk/"+sceneData.getNum() +"/wwwroot/"));
+
+            if(StringUtils.isNotBlank(sceneData.getModelGlbUrl())){
+                downModel(sceneData.getModelGlbUrl(),caseOffPath);
+            }
+            if(sceneData.getType() != 3){
+                //下载场景离线包
+                downSwkk(caseOffPath,sceneData.getNum(),sceneData.getType());
+            }
+            if(sceneData.getType() == 2 || sceneData.getType() == 5){
+                FdkkResponse sceneInfo = laserService.getSceneInfo(sceneData.getNum());
+                HashSet<String> dataSetIds = new HashSet<>();
+                if(sceneInfo != null){
+                    JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(sceneInfo.getData()));
+                    JSONArray newJsonArray = new JSONArray();
+                    for (Object object : jsonArray) {
+                        JSONObject sceneInfoObj = (JSONObject) object;
+                        String newPath = String.format(FilePath.OFFLINE_LASER_OSS_PATH, sceneData.getNum(), sceneData.getNum());
+                        String oldPath = sceneInfoObj.getString("webBin");
+                        sceneInfoObj.put("oldWebBin",oldPath);
+                        sceneInfoObj.put("webBin",newPath + oldPath);
+                        newJsonArray.add(sceneInfoObj);
+                        dataSetIds.add( sceneInfoObj.getString("id"));
+                    }
+                    sceneInfo.setData(newJsonArray);
+                    jsonObject.put(String.format(laserData,sceneData.getNum()),sceneInfo);
+                    if(!dataSetIds.isEmpty()){
+                        for (String dataSetId : dataSetIds) {
+                            FdkkResponse sceneInfo2 = laserService.getSceneInfoQuery(sceneData.getNum(),dataSetId);
+                            jsonObject.put(String.format(laserDataQuery,sceneData.getNum(),dataSetId),sceneInfo2);
+                        }
+                    }
+                }
+                FdkkResponse dataSetAndControlPoint = laserService.getDataSetAndControlPoint(sceneData.getNum());
+                if(dataSetAndControlPoint !=null){
+                    jsonObject.put(String.format(laserDataSetAndControlPoint,sceneData.getNum()),dataSetAndControlPoint);
+                }
+            }
+        }
+        jsonObject.put(basePath+caseFusionInfo+fusionId, ResultData.ok(fusionNumVos));
+
+        List<HotIcon> hotIconList = hotIconService.getListByFusionId(fusionId);
+        for (HotIcon hotIcon : hotIconList) {
+            downResource(hotIcon.getIconUrl(),caseOffPath);
+        }
+       // jsonObject.put(basePath+hostIcon+fusionId, ResultData.ok(hotIconList));
+        List<HotIcon> treeList = hotIconService.treeList(hotIconList);
+        jsonObject.put(basePath+hostIconTreeList+fusionId, ResultData.ok(treeList));
+
+        List<CaseTag> caseTagList = caseTagService.getListByFusionId(fusionId);
+        jsonObject.put(basePath+caseTag+fusionId, ResultData.ok(caseTagList));
+        for (CaseTag tag : caseTagList) {
+            jsonObject.put(basePath+caseTagPoint+tag.getTagId(), ResultData.ok(caseTagPointService.allList(tag.getTagId())));
+            downResources(tag.getTagImgUrl(),caseOffPath);
+            downResource(tag.getHotIconUrl(),caseOffPath);
+            downResource(tag.getAudio(),caseOffPath);
+        }
+
+        jsonObject.put(basePath+casePathInfoUrl+fusionId, ResultData.ok(casePathService.getByFusionId(fusionId)));
+        List<FusionGuide> fusionGuides = fusionGuideService.getByFusionId(fusionId);
+        jsonObject.put(basePath+fusionGuide+fusionId, ResultData.ok(fusionGuides));
+
+        for (FusionGuide guide : fusionGuides) {
+            downResource(guide.getCover(),caseOffPath);
+            List<FusionGuidePath> listByGuideId = fusionGuidePathService.getListByGuideId(guide.getFusionGuideId());
+            for (FusionGuidePath guidePath : listByGuideId) {
+                downResource(guidePath.getCover(),caseOffPath);
+            }
+            jsonObject.put(basePath+fusionGuidePath+guide.getFusionGuideId(), ResultData.ok(listByGuideId));
+        }
+
+        List<CaseAnimation> listByFusionId = caseAnimationService.getListByFusionId(fusionId);
+        jsonObject.put(basePath+caseAnimationUrl+fusionId, ResultData.ok(listByFusionId));
+
+
+        FileUtil.writeString(jsonObject.toJSONString(), caseOffPath+"/package/"+jsonDataName,"UTF-8");
+
+    }
+
+
+
+    //http://127.0.0.1:8080/offline.html?caseId=362&app=1&share=1#/show/summary
+
+    static String batName = "start-browser.bat";
+    static String batName2 = "信创环境启动(打开后选在终端运行).sh";
+   public void cpIndexHtml(Integer caseId,String caseOfflinePath){
+       log.info("down-offline-cpIndexHtml:{}",caseId);
+
+       FileUtil.copyContent(new File(FilePath.OFFLINE_TEMPLATE_PATH_Fusion),new File(caseOfflinePath),true);
+
+       String s = FileUtil.readString(caseOfflinePath + File.separator + batName, StandardCharsets.UTF_8);
+       s = s.replaceAll("@caseId", String.valueOf(caseId));
+       FileUtil.writeString(s, caseOfflinePath + File.separator + batName,"UTF-8");
+
+       String s1 = FileUtil.readString(caseOfflinePath + File.separator + batName2, StandardCharsets.UTF_8);
+       s1 = s1.replaceAll("@caseId", String.valueOf(caseId));
+       FileUtil.writeString(s1, caseOfflinePath + File.separator + batName2,"UTF-8");
+
+   }
+
+
+   @Autowired
+    DownService downService;
+   @Autowired
+    UploadToOssUtil uploadToOssUtil;
+
+   public void downSwkk(String path,String num,Integer type){
+
+       String swkkPath = path + "/swkk/"+num;
+       String swkkZipPath = swkkPath +".zip";
+       String swssPath = path + "/swss/"+num;
+       String swssZipPath = swssPath +".zip";
+
+       Integer isObj = 0;
+       if(type == 4 || type == 6){
+           isObj =1;
+       }
+       try {
+
+           DownVo downVo = downService.checkDownLoad(num, isObj,"offline");
+           log.info("down:{}",downVo);
+           if(downVo.getDownloadStatus() == 3 && StringUtils.isNotBlank(downVo.getDownloadUrl())){
+               downZip(type,downVo.getDownloadUrl(),swkkZipPath,swkkPath,swssZipPath,swssPath);
+           }else {
+               DownVo down = downService.down(num, isObj,"offline");
+               if(down.getDownloadStatus() == 1){
+                   DownloadProcessVo downloadProcessVo = downService.downloadProcess(num, isObj);
+                   while (downloadProcessVo.getStatus() != 1002 ){
+                       downloadProcessVo =  downService.downloadProcess(num, isObj);
+                       Thread.sleep(2000L);
+                   }
+                   downZip(type,downloadProcessVo.getUrl(),swkkZipPath,swkkPath,swssZipPath,swssPath);
+               }
+           }
+       }catch (Exception e){
+           log.info("下载场景离线包失败:{}",num,e);
+       }
+
+   }
+    @Value("${upload.query-path}")
+    private String queryPath;
+   public void downZip(Integer type ,String uri,String kkzipPath,String kknumPath,String sszipPath,String ssNumPath){
+       try {
+           if(type != 2 && type != 5){ //深时点云
+               if(uri.contains("?")){
+                   uri = uri.split("[?]")[0];
+               }
+               ShellUtil.yunDownload(uri.replace(queryPath, ""), kkzipPath);
+
+               ShellUtil.unZip(kkzipPath,kknumPath);
+               FileUtil.del(kkzipPath);
+           }else {
+               ShellUtil.yunDownloadSs(uri.replace(queryPath, ""), sszipPath);
+               ShellUtil.unZip(sszipPath,ssNumPath);
+               FileUtil.del(sszipPath);
+           }
+       }catch (Exception e){
+            log.info("下载场景离线包失败:{}",uri,e);
+       }
+
+   }
+    public void downModel( String modelGlbUrl,String path) {
+
+        JSONArray jsonArray = JSONArray.parseArray(modelGlbUrl);
+        for (Object object : jsonArray) {
+            String res = (String) object;
+            log.info("下载模型:{}",res);
+            res = res.replace(queryPath, "");
+            if(res.contains(".json") ){
+                res = new File(res).getParentFile().getPath();
+            }
+            ShellUtil.yunDownload(res, path +queryPath + res);
+        }
+    }
+    public void downResources(String urls,String offPath) {
+        JSONArray jsonArray = JSONArray.parseArray(urls);
+        for (Object object : jsonArray) {
+            String res = (String) object;
+            downResource(res,offPath);
+        }
+    }
+
+    public void downResource(String url,String path) {
+        if(StringUtils.isBlank(url) ){
+            return;
+        }
+        url = url.replace(queryPath, "");
+        if( !uploadToOssUtil.existKey(url)){
+            log.info("downResource文件不存在:{},{}",url,path);
+            return;
+        }
+        ShellUtil.yunDownload(url,path+queryPath+url);
+    }
+
+    public void downWordByTemplate(Integer caseId,XWPFTemplate template,String name){
+        // 指定输出文件的路径
+        String outputPath = String.format(FilePath.OFFLINE_RESOURCE_PACKAGE_PATH,caseId) + name;
+        try {
+            FileOutputStream out = new FileOutputStream(outputPath);
+            template.write(out);
+            out.close();
+            log.info("文档已成功写入到: " + outputPath);
+        } catch (Exception e) {
+           log.info("写出文档失败:{},{}",caseId,name,e);
+        }
+    }
+
+
+
+}

+ 4 - 1
src/main/java/com/fdkankan/fusion/entity/CaseAnimation.java

@@ -31,6 +31,9 @@ public class CaseAnimation implements Serializable {
     @TableField("case_id")
     private Integer caseId;
 
+    @TableField("fusion_id")
+    private Integer fusionId;
+
     @TableField("title")
     private String title;
 
@@ -44,7 +47,7 @@ public class CaseAnimation implements Serializable {
     private Boolean showTitle;
 
     @TableField("font_size")
-    private Double fontSize;
+    private Integer fontSize;
 
     /**
      * 0否,1是

+ 1 - 1
src/main/java/com/fdkankan/fusion/entity/CaseEntity.java

@@ -118,7 +118,7 @@ public class CaseEntity implements Serializable {
     /**
      * 案发时间
      */
-    @TableField("crime_time")
+    @TableField(value = "crime_time",updateStrategy = FieldStrategy.IGNORED)
     private String crimeTime;
 
     /**

+ 5 - 1
src/main/java/com/fdkankan/fusion/entity/CaseFiles.java

@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
+
 import lombok.Getter;
 import lombok.Setter;
 
@@ -94,5 +97,6 @@ public class CaseFiles implements Serializable {
     @TableField("tabulation_id")
     private Integer tabulationId;
 
-
+    @TableField(exist = false)
+    private List<Integer> filesIds = new ArrayList<>();
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/entity/CaseFilesType.java

@@ -55,4 +55,10 @@ public class CaseFilesType implements Serializable {
 
     @TableField("flat_show")
     private Integer flatShow;
+
+    @TableField("sort")
+    private Integer sort;
+
+    @TableField("dict_id")
+    private Integer dictId;
 }

+ 9 - 5
src/main/java/com/fdkankan/fusion/entity/CaseFusion.java

@@ -37,11 +37,15 @@ public class CaseFusion implements Serializable {
     @TableField("fusion_title")
     private String fusionTitle;
 
-    /**
-     * 案件id
-     */
-    @TableField("case_id")
-    private Integer caseId;
+    @TableField("platform_id")
+    private Integer platformId;
+
+    @TableField("sys_user_id")
+    private Integer sysUserId;
+
+    @TableField("lat_and_long")
+    private String latAndLong;
+
 
     @TableField("tb_status")
     @TableLogic

+ 48 - 0
src/main/java/com/fdkankan/fusion/entity/CaseFusionRelation.java

@@ -0,0 +1,48 @@
+package com.fdkankan.fusion.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-12
+ */
+@Getter
+@Setter
+@TableName("t_case_fusion_relation")
+public class CaseFusionRelation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("case_id")
+    private Integer caseId;
+
+    @TableField("fusion_id")
+    private Integer fusionId;
+
+    @TableField("tb_status")
+    @TableLogic
+    private Integer tbStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 12 - 0
src/main/java/com/fdkankan/fusion/entity/CaseOverview.java

@@ -73,6 +73,18 @@ public class CaseOverview implements Serializable {
     @TableField("kankan_cover")
     private String kankanCover;
 
+    @TableField("num")
+    private String num;
+
+    @TableField("sub_group")
+    private Integer subGroup;
+
+    @TableField("sys_user_id")
+    private Long sysUserId;
+
+    @TableField("platform_id")
+    private Integer platformId;
+
     @TableField(exist = false)
     private CaseTabulation caseTabulation;
 

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/CasePath.java

@@ -31,6 +31,9 @@ public class CasePath implements Serializable {
     @TableField("case_id")
     private Integer caseId;
 
+    @TableField("fusion_id")
+    private Integer fusionId;
+
     @TableField("path")
     private String path;
 

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/CaseSettings.java

@@ -34,6 +34,9 @@ public class CaseSettings implements Serializable {
     @TableField("case_id")
     private Integer caseId;
 
+    @TableField("fusion_id")
+    private Integer fusionId;
+
     /**
      * 初始画面json
      */

+ 5 - 0
src/main/java/com/fdkankan/fusion/entity/CaseTabulation.java

@@ -86,4 +86,9 @@ public class CaseTabulation implements Serializable {
     @TableField("list_cover")
     private String listCover;
 
+    @TableField("sys_user_id")
+    private Long sysUserId;
+
+    @TableField("platform_id")
+    private Integer platformId;
 }

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/CaseTag.java

@@ -83,6 +83,9 @@ public class CaseTag implements Serializable {
      */
     @TableField("case_id")
     private Integer caseId;
+
+    @TableField("fusion_id")
+    private Integer fusionId;
     /**
      * 放置数量
      */

+ 1 - 1
src/main/java/com/fdkankan/fusion/entity/CaseTagPoint.java

@@ -79,7 +79,7 @@ public class CaseTagPoint implements Serializable {
     private String mat;
 
     @TableField("font_size")
-    private Double fontSize;
+    private Integer fontSize;
 
     @TableField("line_height")
     private String lineHeight;

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/FusionGuide.java

@@ -37,6 +37,9 @@ public class FusionGuide implements Serializable {
     @TableField("case_id")
     private Integer caseId;
 
+    @TableField("fusion_id")
+    private Integer fusionId;
+
     /**
      * 封面图
      */

+ 14 - 0
src/main/java/com/fdkankan/fusion/entity/HotIcon.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.*;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
+
 import lombok.Getter;
 import lombok.Setter;
 
@@ -55,11 +57,19 @@ public class HotIcon implements Serializable {
      */
     @TableField("is_new")
     private Integer isNew;
+
     @TableField("case_id")
     private Integer caseId;
+
+    @TableField("fusion_id")
+    private Integer fusionId;
+
     @TableField("sort")
     private Integer sort;
 
+    @TableField("parent_id")
+    private Integer parentId;
+
     @TableField("tb_status")
     @TableLogic
     private Integer tbStatus;
@@ -70,5 +80,9 @@ public class HotIcon implements Serializable {
     @TableField("update_time")
     private String updateTime;
 
+    @TableField(exist = false)
+    private List<HotIcon> childrenList;
 
+    @TableField("dict_id")
+    private Integer dictId;
 }

+ 14 - 0
src/main/java/com/fdkankan/fusion/entity/MapConfig.java

@@ -34,6 +34,20 @@ public class MapConfig implements Serializable {
     @TableField("coord")
     private String coord;
 
+    @TableField("geocode_url")
+    private String geocodeUrl;
+
+    @TableField("resp_list_key")
+    private String respListKey;
+
+    @TableField("resp_location_key")
+    private String respLocationKey;
+
+    @TableField("resp_address_key")
+    private String respAddressKey;
+
+    @TableField("resp_name_key")
+    private String respNameKey;
 
     @TableField("tb_status")
     @TableLogic

+ 7 - 0
src/main/java/com/fdkankan/fusion/entity/Model.java

@@ -55,6 +55,9 @@ public class Model implements Serializable {
     @TableField("type")
     private Integer type;
 
+    @TableField("is_obj")
+    private Integer isObj;
+
     @TableField("model_obj_url")
     private String modelObjUrl;
 
@@ -104,4 +107,8 @@ public class Model implements Serializable {
 
     @TableField("convert_type")
     private Integer convertType;
+
+    @TableField("upload_id")
+    private Integer uploadId;
+
 }

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/SceneDeptShare.java

@@ -34,6 +34,9 @@ public class SceneDeptShare implements Serializable {
     @TableField("is_obj")
     private Integer isObj;
 
+    /**
+     * 0不共享,1查看,2编辑
+     */
     @TableField("is_auth")
     private Integer isAuth;
 

+ 4 - 1
src/main/java/com/fdkankan/fusion/entity/ScenePlus.java

@@ -101,7 +101,7 @@ public class ScenePlus implements Serializable {
      * 创建时间
      */
     @TableField("create_time")
-    private Date createTime;
+    private String createTime;
 
     /**
      * 更新时间
@@ -121,4 +121,7 @@ public class ScenePlus implements Serializable {
 
     @TableField("has_floorplan_ai")
     private Integer hasFloorplanAi;
+
+    @TableField(exist = false)
+    private ScenePlusExt scenePlusExt;
 }

+ 1 - 1
src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir") ;
 
         generate(path,"fusion", getTables(new String[]{
-               "t_scene_dept_share"
+               "t_case_fusion_relation"
         }));
 
 //        generate(path,"goods", getTables(new String[]{

+ 18 - 0
src/main/java/com/fdkankan/fusion/httpClient/request/ManageSceneParam.java

@@ -0,0 +1,18 @@
+package com.fdkankan.fusion.httpClient.request;
+
+import com.fdkankan.fusion.common.RequestBase;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ManageSceneParam extends RequestBase {
+    private Integer isObj =1;
+    private String sceneName;
+    private Integer sceneStatus = -2;
+    private String num;
+    private Integer caseId;
+    private List<String> numList;
+    private Long userId;
+    private Integer overviewId;
+}

+ 18 - 0
src/main/java/com/fdkankan/fusion/mapper/ICaseFusionRelationMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.fusion.mapper;
+
+import com.fdkankan.fusion.entity.CaseFusionRelation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-12
+ */
+@Mapper
+public interface ICaseFusionRelationMapper extends BaseMapper<CaseFusionRelation> {
+
+}

+ 3 - 1
src/main/java/com/fdkankan/fusion/mapper/IScenePlusMapper.java

@@ -27,5 +27,7 @@ public interface IScenePlusMapper extends BaseMapper<ScenePlus> {
 
     List<DataGroupVo> groupByType(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("cameraIds") List<Long> cameraIds);
 
-    Page<SceneVo> sceneList(Page<Object> objectPage, ScenePram param);
+    Page<SceneVo> sceneListPage(Page<Object> objectPage, ScenePram param);
+
+    List<SceneVo> sceneList(ScenePram param);
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/request/AddByMediaLibraryParam.java

@@ -3,15 +3,18 @@ package com.fdkankan.fusion.request;
 import lombok.Data;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Data
 public class AddByMediaLibraryParam {
     private Integer caseId;
+    private Integer fusionId;
     private Integer uploadId;
     private Integer filesTypeId;
 
     private Integer filesId;
+    private List<Integer> filesIds = new ArrayList<>();
 
     private Integer imgType ;
     private String content;
@@ -19,4 +22,7 @@ public class AddByMediaLibraryParam {
 
     private List<Integer> uploadIds;
 
+    private Integer type = 0; //0原图,1裁剪图
+
+    private String ognFileUrl;
 }

+ 5 - 0
src/main/java/com/fdkankan/fusion/request/FusionParam.java

@@ -44,4 +44,9 @@ public class FusionParam {
 
     private String token;
 
+
+    private String num;
+
+    private Integer isObj;
+    private Integer uploadId;
 }

+ 9 - 0
src/main/java/com/fdkankan/fusion/request/MapParam.java

@@ -0,0 +1,9 @@
+package com.fdkankan.fusion.request;
+
+import lombok.Data;
+
+@Data
+public class MapParam {
+    private String address;
+    private Integer mapId;
+}

+ 3 - 2
src/main/java/com/fdkankan/fusion/request/ScenePram.java

@@ -3,17 +3,18 @@ package com.fdkankan.fusion.request;
 import com.fdkankan.fusion.common.RequestBase;
 import lombok.Data;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Data
 public class ScenePram extends RequestBase {
     private Integer type; //0 看看,1看见 ;2深时
     private String sceneName;
-    private List<String> numList;
+    private List<String> numList = new ArrayList<>();
     private Integer status; //
     private Integer caseId;
 
-    private List<String> snCodes;
+    private List<String> snCodes = new ArrayList<>();
 
     private String deptId;
     private String snCode;

+ 11 - 0
src/main/java/com/fdkankan/fusion/response/CaseFusionVo.java

@@ -0,0 +1,11 @@
+package com.fdkankan.fusion.response;
+
+import com.fdkankan.fusion.entity.CaseFusion;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CaseFusionVo  extends CaseFusion {
+    private  List<FusionNumVo> sceneVoList;
+}

+ 10 - 0
src/main/java/com/fdkankan/fusion/response/MapVo.java

@@ -0,0 +1,10 @@
+package com.fdkankan.fusion.response;
+
+import lombok.Data;
+
+@Data
+public class MapVo {
+    private String location;
+    private String address;
+    private String name;
+}

+ 1 - 0
src/main/java/com/fdkankan/fusion/response/SceneVo.java

@@ -49,6 +49,7 @@ public class SceneVo extends Model {
     private String cutModelPath;
     private String surveillancePath;
     private String sceneJsonPath;
+    private String sourceName;
 
 
     public String getCutModelPath() {

+ 2 - 0
src/main/java/com/fdkankan/fusion/service/ICaseAnimationService.java

@@ -16,4 +16,6 @@ import java.util.List;
 public interface ICaseAnimationService extends IService<CaseAnimation> {
 
     List<CaseAnimation> getListByCaseId(Integer caseId);
+
+    List<CaseAnimation> getListByFusionId(Integer fusionId);
 }

+ 8 - 0
src/main/java/com/fdkankan/fusion/service/ICaseFilesTypeService.java

@@ -2,6 +2,9 @@ package com.fdkankan.fusion.service;
 
 import com.fdkankan.fusion.entity.CaseFilesType;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.fusion.response.CaseFilesTypeTreeVo;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +16,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICaseFilesTypeService extends IService<CaseFilesType> {
 
+    List<CaseFilesType> getByParentId(Integer parentId);
+
+    List<CaseFilesTypeTreeVo> getByTree(Integer caseId);
+
+    CaseFilesType getByName(String name);
 }

+ 20 - 0
src/main/java/com/fdkankan/fusion/service/ICaseFusionRelationService.java

@@ -0,0 +1,20 @@
+package com.fdkankan.fusion.service;
+
+import com.fdkankan.fusion.entity.CaseFusionRelation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-12
+ */
+public interface ICaseFusionRelationService extends IService<CaseFusionRelation> {
+    List<CaseFusionRelation> getByCaseId(Integer caseId);
+
+    void addFusionIds(List<Integer> fusionIds, Integer caseId);
+}

+ 5 - 0
src/main/java/com/fdkankan/fusion/service/ICaseFusionService.java

@@ -2,6 +2,7 @@ package com.fdkankan.fusion.service;
 
 import com.fdkankan.fusion.entity.CaseFusion;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.fusion.response.FusionNumVo;
 
 import java.util.List;
 
@@ -16,4 +17,8 @@ import java.util.List;
 public interface ICaseFusionService extends IService<CaseFusion> {
 
     List<CaseFusion> getListByCaseId(Integer caseId);
+
+    void addFusionIds(List<Integer> fusionIds, Integer caseId);
+
+    List<FusionNumVo> getSceneListVo(Integer fusionId);
 }

+ 4 - 0
src/main/java/com/fdkankan/fusion/service/ICaseNumService.java

@@ -29,4 +29,8 @@ public interface ICaseNumService extends IService<CaseNumEntity> {
     List<CaseNumEntity> getByNum(String num);
 
     void deleteByNum(Integer caseId,List<String> num,Integer type);
+
+    void addModeByCaseId(Integer caseId, Integer modelId);
+
+    void deleteByModel(Integer modelId);
 }

+ 3 - 1
src/main/java/com/fdkankan/fusion/service/ICasePathService.java

@@ -15,5 +15,7 @@ import java.util.List;
  */
 public interface ICasePathService extends IService<CasePath> {
 
-    List<CasePath> getByCaseId(Integer caseId);
+    Object getByCaseId(Integer caseId);
+
+    Object getByFusionId(Integer fusionId);
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/service/ICaseSettingsService.java

@@ -16,4 +16,6 @@ import java.util.List;
 public interface ICaseSettingsService extends IService<CaseSettings> {
 
     List<CaseSettings> getByCaseId(Integer caseId);
+
+    List<CaseSettings> getByFusionId(Integer fusionId);
 }

+ 4 - 0
src/main/java/com/fdkankan/fusion/service/ICaseTagService.java

@@ -16,10 +16,14 @@ import java.util.List;
 public interface ICaseTagService extends IService<CaseTag> {
 
     List<CaseTag> allList(Integer caseId, String tagTitle);
+    List<CaseTag> allListFusionId(Integer fusionId, String tagTitle);
 
     void updateDFHotIcon(Integer iconId);
 
     List<CaseTag> getListByCaseId(Integer caseId);
 
     void deletePointByCaseId(Integer caseId);
+
+    List<CaseTag> getListByFusionId(Integer fusionId);
+
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/service/IFusionGuideService.java

@@ -20,4 +20,6 @@ public interface IFusionGuideService extends IService<FusionGuide> {
     FusionGuide add(FusionGuide fusionGuide);
 
     Long getCountByCaseId(Integer caseId);
+
+    List<FusionGuide>  getByFusionId(Integer fusionId);
 }

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/IFusionMeterService.java

@@ -29,5 +29,5 @@ public interface IFusionMeterService extends IService<FusionMeter> {
 
     List<FusionMeter> getByFusionId(Integer oldFusionId);
 
-    List<FusionMeter> getByFusionNumId(Integer oldFusionId,Integer oldFusionNumId);
+    List<FusionMeter> getByFusionNumId(Integer oldFusionNumId);
 }

+ 10 - 1
src/main/java/com/fdkankan/fusion/service/IFusionNumService.java

@@ -2,10 +2,13 @@ package com.fdkankan.fusion.service;
 
 import com.fdkankan.fusion.entity.FusionNum;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.fusion.entity.ScenePlus;
 import com.fdkankan.fusion.request.FusionParam;
 import com.fdkankan.fusion.response.FusionNumVo;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -23,7 +26,7 @@ public interface IFusionNumService extends IService<FusionNum> {
 
     List<FusionNumVo> getListByCaseId(Integer caseId,Integer fusionNumId);
 
-    FusionNumVo add(FusionParam param);
+    FusionNumVo add(FusionParam param, ScenePlus scenePlus, Integer isObj );
 
     void updateModel(FusionParam param);
 
@@ -38,4 +41,10 @@ public interface IFusionNumService extends IService<FusionNum> {
     void hideOrShow(Integer modelId, String num,Integer hide);
 
     List<FusionNum> getByFusionId(Integer oldFusionId);
+
+    HashMap<Integer, FusionNum> getByCaseId(Integer caseId);
+
+    FusionNumVo addModel(FusionParam param, Integer modelId,String title);
+    FusionNumVo addModel(FusionParam param, Integer modelId,ScenePlus scenePlus);
+
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/service/IHotIconService.java

@@ -27,4 +27,10 @@ public interface IHotIconService extends IService<HotIcon> {
     List<HotIcon> getListByCaseId(Integer caseId);
 
     List<HotIcon> getByIds( HashSet<Integer> hotIconId);
+
+    List<HotIcon> getListByFusionId(Integer fusionId);
+
+    List<HotIcon> treeList(List<HotIcon> iconList);
+
+    Integer getDictId(Integer hotIconId);
 }

+ 4 - 4
src/main/java/com/fdkankan/fusion/service/IModelService.java

@@ -26,8 +26,6 @@ public interface IModelService extends IService<Model> {
 
     void delete(Integer modelId);
 
-    List<Model> getListByNum(List<String> numList);
-
     void deleteByNum(List<String> numList);
 
     List<Model> getByUserName(String username);
@@ -36,7 +34,7 @@ public interface IModelService extends IService<Model> {
 
     List<Model> getListByModelIdStrs(List<String> numList);
 
-    Model getIsNullNewByNum(String num,Integer type);
+    Model getIsNullNewByNum(String num,Integer type ,Integer isObj);
 
     SceneVo getInfo(Integer modelId);
 
@@ -44,7 +42,9 @@ public interface IModelService extends IService<Model> {
 
     void cancelUpload(Integer modelId);
 
-    HashMap<String, Model> getMapByNum(List<String> numList);
+    HashMap<String, Model> getMapByNum(List<String> numList,Integer isObj);
 
     void copyModel(Integer modelId);
+
+    Model getByUploadId(Integer uploadId);
 }

+ 4 - 0
src/main/java/com/fdkankan/fusion/service/ISceneDeptShareService.java

@@ -3,6 +3,8 @@ package com.fdkankan.fusion.service;
 import com.fdkankan.fusion.entity.SceneDeptShare;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -14,4 +16,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 public interface ISceneDeptShareService extends IService<SceneDeptShare> {
 
     void share(SceneDeptShare param);
+
+    List<String> getNumListByDeptId(String deptId, Integer isObj);
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/service/IScenePlusExtService.java

@@ -1,8 +1,11 @@
 package com.fdkankan.fusion.service;
 
+import com.fdkankan.fusion.entity.ScenePlus;
 import com.fdkankan.fusion.entity.ScenePlusExt;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IScenePlusExtService extends IService<ScenePlusExt> {
 
+    List<ScenePlusExt> getByPlusIds(List<Long> plusIds);
+
+    ScenePlusExt getByPlusId(Long id);
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/service/IScenePlusService.java

@@ -26,5 +26,11 @@ public interface IScenePlusService extends IService<ScenePlus> {
 
     List<DataGroupVo> groupByType(DataParam param, List<Long> cameraIds);
 
+    List<ScenePlus> getByNumList(List<String> numList);
+
     Page<SceneVo> sceneList(ScenePram param);
+
+    List<SceneVo> getMeshList(List<String> meshNumList);
+
+    List<SceneVo> getLaserList(List<String> laserNumList);
 }

+ 0 - 2
src/main/java/com/fdkankan/fusion/service/ISceneService.java

@@ -12,8 +12,6 @@ public interface ISceneService {
 
     PageInfo pageList(ScenePram param);
 
-    List<SceneVo> getSceneListAndModel(ScenePram param);
-
     Object getFdTokenByNum(String num);
 
     void deleteNum(String num);

+ 2 - 0
src/main/java/com/fdkankan/fusion/service/ITmDepartmentService.java

@@ -41,4 +41,6 @@ public interface ITmDepartmentService extends IService<TmDepartment> {
 
     List<String> getSonByDeptIdAndDeptIds(List<String> deptIds, String deptId);
     List<String> getSonByDeptIdAndDeptIds(List<String> deptIds, String deptId,Integer type);
+
+    List<TmDepartment> higherLevel(String deptId);
 }

+ 7 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseAnimationServiceImpl.java

@@ -27,4 +27,11 @@ public class CaseAnimationServiceImpl extends ServiceImpl<ICaseAnimationMapper,
         return this.list(wrapper);
 
     }
+
+    @Override
+    public List<CaseAnimation> getListByFusionId(Integer fusionId) {
+        LambdaQueryWrapper<CaseAnimation> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseAnimation::getFusionId,fusionId);
+        return this.list(wrapper);
+    }
 }

+ 68 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseFilesTypeServiceImpl.java

@@ -1,11 +1,23 @@
 package com.fdkankan.fusion.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.fusion.entity.CaseFiles;
 import com.fdkankan.fusion.entity.CaseFilesType;
 import com.fdkankan.fusion.mapper.ICaseFilesTypeMapper;
+import com.fdkankan.fusion.response.CaseFilesTypeTreeVo;
+import com.fdkankan.fusion.service.ICaseFilesService;
 import com.fdkankan.fusion.service.ICaseFilesTypeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.WeakHashMap;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +29,60 @@ import org.springframework.stereotype.Service;
 @Service
 public class CaseFilesTypeServiceImpl extends ServiceImpl<ICaseFilesTypeMapper, CaseFilesType> implements ICaseFilesTypeService {
 
+    @Autowired
+    ICaseFilesService caseFilesService;
+    @Override
+    public List<CaseFilesType> getByParentId(Integer parentId) {
+        LambdaQueryWrapper<CaseFilesType> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseFilesType::getParentId,parentId);
+        wrapper.orderByAsc(CaseFilesType::getSort);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public List<CaseFilesTypeTreeVo> getByTree(Integer caseId) {
+        LambdaQueryWrapper<CaseFilesType> wrapper = new LambdaQueryWrapper<>();
+        wrapper.orderByAsc(CaseFilesType::getSort);
+        List<CaseFilesType> list = this.list(wrapper);
+
+
+        List<CaseFiles> caseFilesList = caseFilesService.getByCaseId(caseId);
+        HashMap<Integer,List<CaseFiles>> map = new HashMap<>();
+
+        for (CaseFiles caseFiles : caseFilesList) {
+            if(caseFiles.getFilesTypeId() == null){
+                continue;
+            }
+            List<CaseFiles> files = map.computeIfAbsent(caseFiles.getFilesTypeId(), k -> new ArrayList<>());
+            files.add(caseFiles);
+        }
+
+        List<CaseFilesType> oneList = list.stream().filter(e -> e.getParentId() == null).collect(Collectors.toList());
+        return getVoList(oneList,list,map);
+    }
+
+    private List<CaseFilesTypeTreeVo> getVoList (List<CaseFilesType> oneList,List<CaseFilesType> allList, HashMap<Integer,List<CaseFiles>> map){
+        List<CaseFilesTypeTreeVo> voList = new ArrayList<>();
+        for (CaseFilesType caseFilesType : oneList) {
+            CaseFilesTypeTreeVo vo = new CaseFilesTypeTreeVo();
+            BeanUtils.copyProperties(caseFilesType,vo);
+            List<CaseFiles> files = map.get(caseFilesType.getFilesTypeId());
+            vo.setCaseFilesList(files);
+            List<CaseFilesType> twoList = allList.stream().filter(e -> e.getParentId() !=null && e.getParentId().equals(caseFilesType.getFilesTypeId())).collect(Collectors.toList());
+            vo.setChildrenList(getVoList(twoList,allList,map));
+            voList.add(vo);
+        }
+        return voList;
+    }
+
+    @Override
+    public CaseFilesType getByName(String name) {
+        LambdaQueryWrapper<CaseFilesType> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseFilesType::getFilesTypeName,name);
+        List<CaseFilesType> list = this.list(wrapper);
+        if(!list.isEmpty()){
+            return list.get(0);
+        }
+        return null;
+    }
 }

+ 56 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseFusionRelationServiceImpl.java

@@ -0,0 +1,56 @@
+package com.fdkankan.fusion.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.fusion.entity.CaseFusionRelation;
+import com.fdkankan.fusion.mapper.ICaseFusionRelationMapper;
+import com.fdkankan.fusion.service.ICaseFusionRelationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-12
+ */
+@Service
+public class CaseFusionRelationServiceImpl extends ServiceImpl<ICaseFusionRelationMapper, CaseFusionRelation> implements ICaseFusionRelationService {
+    @Override
+    public List<CaseFusionRelation> getByCaseId(Integer caseId) {
+        LambdaQueryWrapper<CaseFusionRelation> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseFusionRelation::getCaseId,caseId);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public void addFusionIds(List<Integer> fusionIds, Integer caseId) {
+        List<CaseFusionRelation> caseFusionRelations = this.getByCaseId(caseId);
+        List<Integer> dbFusionIds = caseFusionRelations.stream().map(CaseFusionRelation::getFusionId).collect(Collectors.toList());
+
+        List<Integer> delFusionIds = new ArrayList<>();
+        for (CaseFusionRelation dbFusionId : caseFusionRelations) {
+            if(!fusionIds.contains(dbFusionId.getFusionId())){
+                delFusionIds.add(dbFusionId.getId());
+            }
+        }
+
+        for (Integer fusionId : fusionIds) {
+            if(dbFusionIds.contains(fusionId)){
+                continue;
+            }
+            CaseFusionRelation caseFusionRelation = new CaseFusionRelation();
+            caseFusionRelation.setCaseId(caseId);
+            caseFusionRelation.setFusionId(fusionId);
+            this.save(caseFusionRelation);
+        }
+        if(!delFusionIds.isEmpty()){
+            this.removeByIds(delFusionIds);
+        }
+    }
+}

+ 99 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseFusionServiceImpl.java

@@ -1,13 +1,27 @@
 package com.fdkankan.fusion.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.fusion.entity.CaseFusion;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.util.CameraUtil;
+import com.fdkankan.fusion.entity.*;
+import com.fdkankan.fusion.entity.jsonEntity.Transform;
+import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.ICaseFusionMapper;
-import com.fdkankan.fusion.service.ICaseFusionService;
+import com.fdkankan.fusion.response.CaseFusionVo;
+import com.fdkankan.fusion.response.FusionNumVo;
+import com.fdkankan.fusion.response.SceneVo;
+import com.fdkankan.fusion.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -20,10 +34,92 @@ import java.util.List;
 @Service
 public class CaseFusionServiceImpl extends ServiceImpl<ICaseFusionMapper, CaseFusion> implements ICaseFusionService {
 
+    @Autowired
+    ICaseFusionRelationService caseFusionRelationService;
+
     @Override
     public List<CaseFusion> getListByCaseId(Integer caseId) {
+        List<CaseFusionRelation> caseFusionRelations = caseFusionRelationService.getByCaseId(caseId);
+        if(caseFusionRelations.isEmpty()){
+            return new ArrayList<>();
+        }
+        List<Integer> fusionIds = caseFusionRelations.stream().map(CaseFusionRelation::getFusionId).collect(Collectors.toList());
+        if(fusionIds.isEmpty()){
+            return new ArrayList<>();
+        }
         LambdaQueryWrapper<CaseFusion> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(CaseFusion::getCaseId,caseId);
+        wrapper.in(CaseFusion::getFusionId,fusionIds);
         return this.list(wrapper);
     }
+
+    @Override
+    public synchronized void addFusionIds(List<Integer> fusionIds, Integer caseId) {
+        caseFusionRelationService.addFusionIds(fusionIds,caseId);
+    }
+
+    @Autowired
+    IFusionNumService fusionNumService;
+    @Autowired
+    IModelService modelService;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    IScenePlusExtService scenePlusExtService;
+
+    @Override
+    public List<FusionNumVo> getSceneListVo(Integer fusionId) {
+        List<FusionNumVo> sceneVos = new ArrayList<>();
+        List<FusionNum> fusionNumList = fusionNumService.getByFusionId(fusionId);
+
+        List<Integer> modelIds = fusionNumList.stream().map(FusionNum::getModelId).collect(Collectors.toList());
+        List<Model> listByModelIds = modelService.getListByModelIds(modelIds);
+        HashMap<Integer,Model> modelMap = new HashMap<>();
+        listByModelIds.stream().forEach(e -> modelMap.put(e.getModelId(),e));
+
+
+        List<String> numList = listByModelIds.stream().filter(e -> e.getNum() != null).map(Model::getNum).collect(Collectors.toList());
+        List<ScenePlus> scenePlusList = scenePlusService.getByNumList(numList);
+        HashMap<String,ScenePlus> map = new HashMap<>();
+        scenePlusList.stream().forEach(e -> map.put(e.getNum(),e));
+
+        List<Long> plusIds = scenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
+        List<ScenePlusExt> extList = scenePlusExtService.getByPlusIds(plusIds);
+        HashMap<Long,ScenePlusExt> mapext = new HashMap<>();
+        extList.stream().forEach(e -> mapext.put(e.getPlusId(),e));
+
+
+        for (FusionNum fusionNum : fusionNumList) {
+            Transform transform = JSONObject.parseObject(fusionNum.getTransform(),Transform.class);
+            FusionNumVo vo = new FusionNumVo();
+            vo.setTransform(transform);
+            BeanUtils.copyProperties(fusionNum,vo);
+            SceneVo sceneVo = new SceneVo();
+            Model model = modelMap.get(fusionNum.getModelId());
+            if(model != null){
+                BeanUtils.copyProperties(model,sceneVo);
+                if(model.getNum() != null ){
+                    ScenePlus scenePlus = map.get(model.getNum());
+                    if(scenePlus != null){
+                        BeanUtils.copyProperties(scenePlus,sceneVo);
+                        sceneVo.setStatus(scenePlus.getSceneStatus() == -2 ? 2:scenePlus.getSceneStatus());
+                        sceneVo.setName(scenePlus.getTitle());
+                        sceneVo.setSceneName(scenePlus.getTitle());
+                        sceneVo.setCreateTime(scenePlus.getCreateTime());
+                        ScenePlusExt scenePlusExt = mapext.get(scenePlus.getId());
+                        if(scenePlusExt != null){
+                            sceneVo.setRtkLocation(scenePlusExt.getRtkLocation());
+                            sceneVo.setOrientation(scenePlusExt.getOrientation());
+                        }
+                    }
+                }else {
+                    sceneVo.setStatus(2);
+                }
+                sceneVo.setSourceName(CameraUtil.getSourceName(model.getType()));
+            }
+            vo.setSceneData(sceneVo);
+            sceneVos.add(vo);
+        }
+
+        return sceneVos;
+    }
 }

+ 49 - 118
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -85,9 +85,20 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
         }
 
         List<CaseNumEntity> newCaseNums = new ArrayList<>();
-        List<Model> modelList = new ArrayList<>();
-        for (SceneNumParam param : sceneNumParam) {
-            List<String> numList = param.getNumList();
+
+        HashMap<Integer,HashSet<String>> map = new HashMap<>();
+        for (SceneNumParam numParam : sceneNumParam) {
+            if(map.get(numParam.getType()) == null){
+                HashSet<String> set = new HashSet<>(numParam.getNumList());
+                map.put(numParam.getType(),set);
+            }else {
+                map.get(numParam.getType()).addAll(numParam.getNumList());
+            }
+        }
+
+        for (Integer type : map.keySet()) {
+            HashSet<String> nulList = map.get(type);
+            List<String> numList = new ArrayList<>(nulList);
             HashSet<String> setNum = new HashSet<>(numList);
             for (String num : setNum) {
                 if(!addNumList.contains(num)){
@@ -95,128 +106,26 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                 }
                 CaseNumEntity caseNumEntity = new CaseNumEntity();
                 caseNumEntity.setCaseId(caseId);
-                caseNumEntity.setNumType(param.getType());
+                caseNumEntity.setNumType(type);
                 caseNumEntity.setNum(num);
                 newCaseNums.add(caseNumEntity);
-                if(param.getType() == 3){                   //用户上传三维模型跳过
-                    continue;
-                }
-                Model model = modelService.getIsNullNewByNum(num,param.getType());
-                if(model.getModelId() != null && StringUtils.isNotBlank(model.getModelGlbUrl()) && StringUtils.isNotBlank(model.getModelSize())){
-                    continue;
-                }
-                model.setModelDateType("obj");
-                model.setType(param.getType());
-                model.setModelType("pointcloud");    //深时点云类型
-                model.setCreateStatus(1);
-                if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4 || param.getType() == 6){           //看看,看见
-                    String mesh3DtilesPath  = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles/tileset.json";
-                    String sizePath = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles";
-                    if(uploadToOssUtil.existKey(mesh3DtilesPath)){
-                        model.setModelDateType("b3dm");
-                        model.setModelType("b3dm");
-                        model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath +mesh3DtilesPath)));
-                        model.setModelSize(FileWriterUtil.setFileSize(uploadToOssUtil.getSize( sizePath)));
-                    }else {
-                        //model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
-                        //model.setModelGlbUrl(getGlbUrl(param.getType(),num,model));
-                        String meshPath = String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh";
-                        if(uploadToOssUtil.existKey(meshPath +"/mesh.obj")){
-                            Long size = uploadToOssUtil.getSize(meshPath);
-                            model.setModelSize(FileWriterUtil.setFileSize(size));
-                            model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + meshPath+"/mesh.obj")));
-                        }else {
-                            List<String> objPaths = new ArrayList<>();
-                            String meshPathjs = String.format(FilePath.OBJ_OSS_PATH, num)+"/data/";
-
-                            String jsonPath = meshPath + "/floors.json";
-                            if(!uploadToOssUtil.existKey(jsonPath)){
-                               jsonPath = meshPath +"mesh.json";
-                            }
-                            if(uploadToOssUtil.existKey(jsonPath)){
-                                String objectContent = uploadToOssUtil.getObjectContent(meshPath + "/floors.json");
-                                JSONObject jsonObject = JSONObject.parseObject(objectContent);
-                                JSONArray floors1 = jsonObject.getJSONArray("floors");
-                                for (Object object : floors1) {
-                                    JSONObject jb = (JSONObject) object;
-                                    String string = jb.getString("objPath");
-                                    objPaths.add(queryPath +meshPathjs + string);
-                                }
-                                model.setModelGlbUrl(JSONArray.toJSONString(objPaths));
-                                Long size = uploadToOssUtil.getSize(meshPath);
-                                model.setModelSize(FileWriterUtil.setFileSize(size));
-                            }
-                        }
-                        model.setModelType("obj");
-                    }
-
-                }
-                model.setNum(num);
-                modelList.add(model);
             }
         }
 
         if(newCaseNums.size() >0){
             this.saveBatch(newCaseNums);
         }
-        if(modelList.size() >0){
-            modelService.saveOrUpdateBatch(modelList);
-        }
     }
 
 
 
-    private String getGlbUrl(Integer type, String num,Model model) {
-        if(type == 0 || type == 1 || type == 4 || type == 6){ //看看,看见
-            String objPath = String.format(FilePath.OBJ_LOCAL_PATH ,environment,num);
-//            if(uploadToOssUtil.existKey(glbOssPath)){
-//                return queryPath + "/"+glbOssPath;
-//            }
-            ShellUtil.yunDownload(String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh" ,objPath);
-            List<String> localGlbPaths = new ArrayList<>();
-            List<String> ossGlbPaths = new ArrayList<>();
-            File localFile = new File(objPath);
-            this.toGlB(localFile,localGlbPaths);
-            Long modelSize = 0L;
-            if(localGlbPaths.size() >0){
-                for (String localGlbPath : localGlbPaths) {
-                    String ossGlbPath = localGlbPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/");
-                    uploadToOssUtil.uploadOss(localGlbPath,ossGlbPath);
-                    if(ossGlbPath.contains("lod_")){
-                        if(ossGlbPath.contains("lod_0")){
-                            ossGlbPaths.add(queryPath  +ossGlbPath);
-                            modelSize +=  uploadToOssUtil.getSize(ossGlbPath);
-                        }
-                        continue;
-                    }
-                    modelSize +=  uploadToOssUtil.getSize(ossGlbPath);
-                    ossGlbPaths.add(queryPath +ossGlbPath);
-                }
-                model.setModelSize(FileWriterUtil.setFileSize(modelSize));
-                FileUtil.del(objPath);
-                return JSONArray.toJSONString(ossGlbPaths);
-            }
-            FileUtil.del(objPath);
-        }
-        return null;
-    }
 
-    private void toGlB(File localFile, List<String> localGlbPath) {
-        File[] files = localFile.listFiles();
-        for (File file : files) {
-            if(file.isDirectory()){
-                toGlB(file,localGlbPath);
-            }
-            if(file.getName().contains(".obj")){
-               String glbPath =  OBJToGLBUtil.objToGlb(file.getPath(),file.getPath().replace(".obj",".glb") );
-               localGlbPath.add(glbPath);
-            }
-        }
-    }
+
+
 
     private List<String> updateByNumList(Integer caseId, List<SceneNumParam> sceneNumParam) {
         List<String> addList = new ArrayList<>();
-        List<String> delMsgList = new ArrayList<>();
+        HashMap<Integer,List<String>> delMap = new HashMap<>();
         for (SceneNumParam param : sceneNumParam) {
             Integer type = param.getType();
             List<String> numList = param.getNumList();
@@ -224,12 +133,12 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
             wrapper.eq(CaseNumEntity::getCaseId,caseId);
             wrapper.eq(CaseNumEntity::getNumType,type);
             List<CaseNumEntity> list = this.list(wrapper);
+
             List<String> hanNumList = list.parallelStream().map(CaseNumEntity::getNum).collect(Collectors.toList());
             List<String> delList = new ArrayList<>();
             for (String num : hanNumList) {
                 if(!numList.contains(num)){
                     delList.add(num);
-                    delMsgList.add(num);
                 }
             }
             for (String num : numList) {
@@ -237,10 +146,14 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                     addList.add(num);
                 }
             }
-            this.deleteByNum(caseId,delList,param.getType());
+            if(!delList.isEmpty()){
+                delMap.put(param.getType(),delList);
+            }
         }
-        if(!delMsgList.isEmpty()){
-            sessionService.sendSingleByCaseId(caseId, WsMessage.okResult(CommonEnum.NOTICE, ResultData.error(ResultCode.CASE_REMOVE_SCENE)));
+        if(!delMap.isEmpty()){
+            for (Integer type : delMap.keySet()) {
+                this.deleteByNum(caseId,delMap.get(type),type);
+            }
         }
 
         return addList;
@@ -263,11 +176,6 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
         LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CaseNumEntity::getCaseId,caseId);
         this.remove(wrapper);
-        fusionNumService.deleteByCaseId(caseId);
-        caseViewService.deleteByCaseId(caseId);
-        fusionGuidePathService.deleteByCaseId(caseId);
-        fusionMeterService.deleteByCaseId(caseId);
-        caseTagService.deletePointByCaseId(caseId);
     }
 
     @Override
@@ -294,4 +202,27 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
         return this.list(wrapper);
     }
 
+    @Override
+    public void addModeByCaseId(Integer caseId, Integer modelId) {
+        LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseNumEntity::getCaseId,caseId);
+        wrapper.eq(CaseNumEntity::getNum,modelId);
+        List<CaseNumEntity> list = this.list(wrapper);
+        if(list.isEmpty()){
+            CaseNumEntity caseNumEntity = new CaseNumEntity();
+            caseNumEntity.setCaseId(caseId);
+            caseNumEntity.setNumType(3);
+            caseNumEntity.setNum(modelId.toString());
+            this.save(caseNumEntity);
+        }
+    }
+
+    @Override
+    public void deleteByModel(Integer modelId) {
+        LambdaQueryWrapper<CaseNumEntity> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseNumEntity::getNum,modelId.toString());
+        this.remove(wrapper);
+        modelService.removeById(modelId);
+
+    }
 }

+ 8 - 1
src/main/java/com/fdkankan/fusion/service/impl/CasePathServiceImpl.java

@@ -21,9 +21,16 @@ import java.util.List;
 public class CasePathServiceImpl extends ServiceImpl<ICasePathMapper, CasePath> implements ICasePathService {
 
     @Override
-    public List<CasePath> getByCaseId(Integer caseId) {
+    public Object getByCaseId(Integer caseId) {
         LambdaQueryWrapper<CasePath> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CasePath::getCaseId,caseId);
         return this.list(wrapper);
     }
+
+    @Override
+    public Object getByFusionId(Integer fusionId) {
+        LambdaQueryWrapper<CasePath> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CasePath::getFusionId,fusionId);
+        return this.list(wrapper);
+    }
 }

+ 20 - 111
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -59,9 +59,10 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     ITmCameraService tmCameraService;
     @Autowired
     ICaseSettingsService caseSettingsService;
-
     @Autowired
     IMapConfigService mapConfigService;
+    @Autowired
+    IScenePlusService scenePlusService;
 
     @Override
     public PageInfo pageList(CaseParam param,String userName) {
@@ -140,126 +141,34 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
         if(param.getCaseId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        if(param.getTypeMap() == null){
-            HashMap<Integer, List<String>> typeMap = caseNumService.getTypeMap(param.getCaseId());
-            param.setTypeMap(typeMap);
-        }
-        List<SceneVo> listAll = new ArrayList<>();
-        for (Integer type : param.getTypeMap().keySet()) {
-            List<String> numList = param.getTypeMap().get(type);
-            if(numList ==null || numList.size() <=0 || type ==3){
-                continue;
-            }
-            if(param.getIsMesh()!=null && param.getIsMesh() == 1 && NumTypeUtils.isLaser(type)){
-                continue;
-            }
-            ScenePram scenePram = new ScenePram();
-            scenePram.setType(type);
-            scenePram.setPageNum(1);
-            scenePram.setPageSize(99999);
-            scenePram.setNumList(param.getTypeMap().get(type));
-            scenePram.setShare("1");
-            scenePram.setSceneName(param.getSceneName());
-            scenePram.setStatus(param.getSceneStatus());
-            PageInfo pageInfo = sceneService.pageList(scenePram);
-            List<SceneVo> list1 = (List<SceneVo>) pageInfo.getList();
-            listAll.addAll(list1);
+        List<CaseNumEntity> numListByCase = caseNumService.getByCaseId(param.getCaseId());
+        List<String> laserNumList =  numListByCase.stream().filter(e -> NumTypeUtils.isLaser(e.getNumType())).map(CaseNumEntity::getNum).collect(Collectors.toList());
+        List<String> meshNumList =  numListByCase.stream().filter(e ->! NumTypeUtils.isLaser(e.getNumType())).map(CaseNumEntity::getNum).collect(Collectors.toList());
 
-        }
-        if(listAll.size() >0){
-            List<String> numList = listAll.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
-            //设置模型
-            HashMap<String,Model> map = modelService.getMapByNum(numList);
-            for (SceneVo sceneVo : listAll) {
-                String createTime = sceneVo.getCreateTime();
-                Model model = map.get(sceneVo.getNum() + sceneVo.getType());
-                if(model == null){
-                    continue;
-                }
-                BeanUtils.copyProperties(model,sceneVo);
-                sceneVo.setCreateTime(createTime);
-            }
-        }
-        //官网删除的场景,删除对应资源
-        if(param.getIsMesh() == null  ){
-            for (Integer type : param.getTypeMap().keySet()) {
-                List<String> dbNumList = listAll.stream().filter(entity -> entity.getType().equals(type)).map(SceneVo::getNum).collect(Collectors.toList());
-                this.deleteNotInScene(param.getTypeMap().get(type), dbNumList,type,param.getCaseId(),listAll);
-            }
-        }
+        List<SceneVo> meshSceneList = scenePlusService.getMeshList(meshNumList);
+        List<SceneVo> laserSceneList = scenePlusService.getLaserList(laserNumList);
 
-        //相机解绑,标注,测量隐藏,视图
-        for (SceneVo sceneVo : listAll) {
-            if(!sceneVo.getBind() || (sceneVo.getStatus()!=null && sceneVo.getStatus() == 3)){
-                fusionNumService.hideOrShow(sceneVo.getModelId(),sceneVo.getNum(),1);
-            }else {
-                fusionNumService.hideOrShow(sceneVo.getModelId(),sceneVo.getNum(),0);
-            }
-        }
-        listAll.removeIf(sceneVo -> !sceneVo.getBind());
-
-        //关联的三维模型
-        if(param.getIsMesh() == null ){
-            List<String> numList = param.getTypeMap().get(3);
-            if(numList!=null && numList.size() >0){
-                List<Model> models = modelService.getListByModelIdStrs(numList);
-                for (Model model : models) {
-                    SceneVo sceneVo = new SceneVo();
-                    sceneVo.setStatus(2);
-                    BeanUtils.copyProperties(model,sceneVo);
-                    listAll.add(sceneVo);
-                }
+        HashMap<String, Model> laserModelMap = modelService.getMapByNum(laserNumList,0);
+        HashMap<String, Model> meshModelMap = modelService.getMapByNum(meshNumList,1);
+        for (SceneVo sceneVo : laserSceneList) {
+            Model model = laserModelMap.get(sceneVo.getNum());
+            if(model != null){
+                BeanUtils.copyProperties(model,sceneVo);
             }
         }
-        Set<String> snList = listAll.stream().filter(entity ->StringUtils.isNotBlank(entity.getSnCode()))
-                .map(SceneVo::getSnCode).collect(Collectors.toSet());
-        HashMap<String, TmDepartment> mapBySnCodes = tmCameraService.getMapBySnCodes(snList);
-        for (SceneVo sceneVo : listAll) {
-            if(StringUtils.isNotBlank(sceneVo.getSnCode())){
-                TmDepartment tmDepartment = mapBySnCodes.get(sceneVo.getSnCode().toUpperCase());
-                if(tmDepartment != null){
-                    sceneVo.setDeptId(tmDepartment.getId());
-                    sceneVo.setDeptName(tmDepartment.getName());
-                }
+        for (SceneVo sceneVo : meshSceneList) {
+            Model model = meshModelMap.get(sceneVo.getNum());
+            if(model != null){
+                BeanUtils.copyProperties(model,sceneVo);
             }
         }
+        List<SceneVo> listAll = new ArrayList<>();
+        listAll.addAll(meshSceneList);
+        listAll.addAll(laserSceneList);
 
-        Set<String> deptIdset = listAll.stream().filter(entity ->StringUtils.isNotBlank(entity.getDeptId())&& StringUtils.isBlank(entity.getDeptName()))
-                .map(SceneVo::getDeptId).collect(Collectors.toSet());
-        HashMap<String, TmDepartment> mapByDept = tmDepartmentService.getMapByDeptIds(deptIdset);
-        for (SceneVo sceneVo : listAll) {
-            if(StringUtils.isNotBlank(sceneVo.getDeptId())){
-                TmDepartment tmDepartment = mapByDept.get(sceneVo.getDeptId());
-                if(tmDepartment != null){
-                    sceneVo.setDeptName(tmDepartment.getName());
-                }
-            }
-
-        }
         return listAll;
     }
 
-    private void deleteNotInScene(List<String> numList,List<String> obNumList,Integer type,Integer caseId,List<SceneVo> sceneVos) {
-        if(type == 3){  //上传的三维模型,无需处理
-            return;
-        }
-        if(numList.size() >0){
-            List<String> delNumList = new ArrayList<>();
-            for (String num : numList) {
-                if(!obNumList.contains(num)){
-                    delNumList.add(num);
-                }
-            }
-            List<String> delNumList2 = new ArrayList<>();
-            for (SceneVo sceneVo : sceneVos) {
-                if(sceneVo.getStatus() !=2 && sceneVo.getStatus() !=3 && sceneVo.getType().equals(type)){
-                    delNumList2.add(sceneVo.getNum());
-                }
-            }
-            caseNumService.deleteByNum(caseId,delNumList,type);
-            fusionNumService.deleteByNumList(caseId,delNumList2,false,type);
-        }
-    }
 
     @Override
     public void addOrUpdate(CaseParam param, String userName) {

+ 21 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseSettingsServiceImpl.java

@@ -46,4 +46,25 @@ public class CaseSettingsServiceImpl extends ServiceImpl<ICaseSettingsMapper, Ca
 
         return list;
     }
+
+
+    @Override
+    public List<CaseSettings> getByFusionId(Integer fusionId) {
+        LambdaQueryWrapper<CaseSettings> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseSettings::getFusionId,fusionId);
+        List<CaseSettings> list = this.list(wrapper);
+        List<Integer> mapIds = list.stream().map(CaseSettings::getMapId).collect(Collectors.toList());
+        if(!mapIds.isEmpty()){
+            HashMap<Integer,MapConfig> map = mapConfigService.getMapByIds(mapIds);
+            for (CaseSettings caseSettings : list) {
+                if(caseSettings.getMapId() != null && map.get(caseSettings.getMapId()) != null){
+                    MapConfig mapConfig = map.get(caseSettings.getMapId());
+                    caseSettings.setMapConfig(mapConfig);
+                }
+
+            }
+        }
+
+        return list;
+    }
 }

+ 28 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java

@@ -55,12 +55,30 @@ public class CaseTagServiceImpl extends ServiceImpl<ICaseTagMapper, CaseTag> imp
     }
 
     @Override
+    public List<CaseTag> allListFusionId(Integer fusionId, String tagTitle) {
+        if(fusionId == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        LambdaQueryWrapper<CaseTag> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseTag::getFusionId,fusionId);
+        if(StringUtils.isNotBlank(tagTitle)){
+            wrapper.like(CaseTag::getTagTitle,tagTitle);
+        }
+        wrapper.orderByAsc(CaseTag::getSort);
+        wrapper.orderByAsc(CaseTag::getCreateTime);
+        List<CaseTag> list = this.list(wrapper);
+        HashMap<Integer,Long> countMap = caseTagPointService.getGroupByTagId();
+        list.forEach(entity -> entity.setPlaceNum(countMap.get(entity.getTagId())));
+        return list;
+    }
+
+    @Override
     public void updateDFHotIcon(Integer iconId) {
-        List<HotIcon> defaultIcons = hotIconService.getDefaultIcon();
+        HotIcon defaultIcon = hotIconService.getById(18);
         LambdaUpdateWrapper<CaseTag> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(CaseTag::getHotIconId,iconId)
-                .set(CaseTag::getHotIconId,defaultIcons.get(0).getIconId())
-                .set(CaseTag::getHotIconUrl,defaultIcons.get(0).getIconUrl());
+                .set(CaseTag::getHotIconId,defaultIcon.getIconId())
+                .set(CaseTag::getHotIconUrl,defaultIcon.getIconUrl());
         this.update(wrapper);
     }
 
@@ -72,6 +90,13 @@ public class CaseTagServiceImpl extends ServiceImpl<ICaseTagMapper, CaseTag> imp
     }
 
     @Override
+    public List<CaseTag> getListByFusionId(Integer fusionId) {
+        LambdaQueryWrapper<CaseTag> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseTag::getFusionId,fusionId);
+        return list(wrapper);
+    }
+
+    @Override
     public void deletePointByCaseId(Integer caseId) {
         List<CaseTag> list = this.getListByCaseId(caseId);
         List<Integer> tagIds = list.parallelStream().map(CaseTag::getTagId).collect(Collectors.toList());

+ 0 - 1
src/main/java/com/fdkankan/fusion/service/impl/CopyCaseService.java

@@ -206,7 +206,6 @@ public class CopyCaseService {
         for (CaseFusion entity : listByCaseId) {
             Integer oldFusionId = entity.getFusionId();
             entity.setFusionId(null);
-            entity.setCaseId(newCaseId);
             caseFusionService.save(entity);
 
             cpCaseViewByFusionId(oldFusionId,entity.getFusionId(),newCaseId);

+ 17 - 2
src/main/java/com/fdkankan/fusion/service/impl/FusionGuideServiceImpl.java

@@ -33,19 +33,34 @@ public class FusionGuideServiceImpl extends ServiceImpl<IFusionGuideMapper, Fusi
     }
 
     @Override
+    public List<FusionGuide> getByFusionId(Integer fusionId) {
+        LambdaQueryWrapper<FusionGuide> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(FusionGuide::getFusionId,fusionId);
+        wrapper.orderByAsc(FusionGuide::getSort);
+        wrapper.orderByAsc(FusionGuide::getCreateTime);
+        return this.list(wrapper);
+    }
+
+    @Override
     public Long getCountByCaseId(Integer caseId) {
         LambdaQueryWrapper<FusionGuide> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(FusionGuide::getCaseId,caseId);
         return this.count(wrapper);
     }
 
+    public Long getCountByFusionId(Integer fusionId) {
+        LambdaQueryWrapper<FusionGuide> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(FusionGuide::getFusionId,fusionId);
+        return this.count(wrapper);
+    }
+
     @Override
     public FusionGuide add(FusionGuide fusionGuide) {
-        if(fusionGuide.getCaseId() == null || StringUtils.isEmpty(fusionGuide.getTitle())
+        if(fusionGuide.getFusionId() == null || StringUtils.isEmpty(fusionGuide.getTitle())
             || StringUtils.isEmpty(fusionGuide.getCover())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        Long count = this.getCountByCaseId(fusionGuide.getCaseId());
+        Long count = this.getCountByFusionId(fusionGuide.getFusionId());
         fusionGuide.setSort(count + 1);
         this.save(fusionGuide);
         return fusionGuide;

+ 1 - 13
src/main/java/com/fdkankan/fusion/service/impl/FusionMeterServiceImpl.java

@@ -78,17 +78,6 @@ public class FusionMeterServiceImpl extends ServiceImpl<IFusionMeterMapper, Fusi
 
     @Override
     public void deleteByCaseId(Integer caseId) {
-        LambdaQueryWrapper<CaseFusion> fnwr = new LambdaQueryWrapper<>();
-        fnwr.eq(CaseFusion::getCaseId,caseId);
-        List<CaseFusion> list = caseFusionService.list(fnwr);
-        if(list.size() >0){
-            List<Integer> fusionIds = list.parallelStream().map(CaseFusion::getFusionId).collect(Collectors.toList());
-            if(fusionIds.size() >0){
-                LambdaQueryWrapper<FusionMeter> wrapper = new LambdaQueryWrapper<>();
-                wrapper.in(FusionMeter::getFusionId,fusionIds);
-                this.remove(wrapper);
-            }
-        }
     }
 
     @Override
@@ -109,9 +98,8 @@ public class FusionMeterServiceImpl extends ServiceImpl<IFusionMeterMapper, Fusi
     }
 
     @Override
-    public List<FusionMeter> getByFusionNumId(Integer oldFusionId,Integer oldFusionNumId) {
+    public List<FusionMeter> getByFusionNumId(Integer oldFusionNumId) {
         LambdaQueryWrapper<FusionMeter> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(FusionMeter::getFusionId,oldFusionId);
         wrapper.like(FusionMeter::getPosition,"\"fusionNumId\":\""+oldFusionNumId+"\"");
         return list(wrapper);
     }

+ 81 - 28
src/main/java/com/fdkankan/fusion/service/impl/FusionNumServiceImpl.java

@@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.fusion.common.ResultCode;
-import com.fdkankan.fusion.entity.CaseFusion;
-import com.fdkankan.fusion.entity.FusionNum;
-import com.fdkankan.fusion.entity.Model;
+import com.fdkankan.fusion.common.util.CameraUtil;
+import com.fdkankan.fusion.common.util.NumTypeUtils;
+import com.fdkankan.fusion.entity.*;
 import com.fdkankan.fusion.entity.jsonEntity.Transform;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IFusionNumMapper;
@@ -47,6 +47,8 @@ public class FusionNumServiceImpl extends ServiceImpl<IFusionNumMapper, FusionNu
     ICaseTagPointService caseTagPointService;
     @Autowired
     ICaseViewService caseViewService;
+    @Autowired
+    ICaseNumService caseNumService;
 
     @Override
     public List<FusionNum> getByNum(String num) {
@@ -57,6 +59,9 @@ public class FusionNumServiceImpl extends ServiceImpl<IFusionNumMapper, FusionNu
 
     @Override
     public List<FusionNum> getListByFusionIdList(List<Integer> fusionIdList) {
+        if(fusionIdList.isEmpty()){
+            return new ArrayList<>();
+        }
         LambdaQueryWrapper<FusionNum> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(FusionNum::getFusionId,fusionIdList);
         wrapper.orderByDesc(FusionNum::getCreateTime);
@@ -127,41 +132,68 @@ public class FusionNumServiceImpl extends ServiceImpl<IFusionNumMapper, FusionNu
         return typeMap;
     }
 
+
+
     @Override
-    public FusionNumVo add(FusionParam param) {
-        if(param.getModelId()==null || param.getCaseId() == null){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        Model model = modelService.getById(param.getModelId());
+    public FusionNumVo add(FusionParam param, ScenePlus scenePlus, Integer isObj ) {
+        Integer type = NumTypeUtils.getMeshTypeBySceneSource(scenePlus.getSceneSource(), isObj, null);
+        Model model = modelService.getIsNullNewByNum(scenePlus.getNum(),type, isObj);
         if(model == null){
             throw new BusinessException(ResultCode.MODEL_NOT_EXIST);
         }
-        CaseFusion caseFusion = null;
-        synchronized (this){
-            List<CaseFusion> list = caseFusionService.getListByCaseId(param.getCaseId());
-            if(list.size() <=0){
-                caseFusion = new CaseFusion();
-                caseFusion.setCaseId(param.getCaseId());
-                caseFusionService.save(caseFusion);
-                list.add(caseFusion);
-            }
-            caseFusion = list.get(0);
-        }
 
-        List<FusionNum> fusionNums = this.getByFusionIdAndModelId(caseFusion.getFusionId(),param.getModelId());
-        if(fusionNums.size()>0){
-           this.removeByIds(fusionNums);
-        }
+        return addModel(param,model.getModelId(),scenePlus);
+    }
+
+    @Override
+    public FusionNumVo addModel(FusionParam param, Integer modelId,ScenePlus scenePlus) {
         FusionNum fusionNum = new FusionNum();
         BeanUtils.copyProperties(param,fusionNum);
-        fusionNum.setFusionId(caseFusion.getFusionId());
+        fusionNum.setFusionId(param.getFusionId());
+        fusionNum.setModelId(modelId);
         fusionNum.setTransform(JSONObject.toJSONString(param.getTransform()));
         this.save(fusionNum);
-        List<FusionNumVo> numVoList = this.getListByCaseId(param.getCaseId(), fusionNum.getFusionNumId());
-        if(numVoList.size()<=0){
-            throw new BusinessException(ResultCode.ERROR);
+
+        FusionNumVo vo = new FusionNumVo();
+        SceneVo sceneVo = new SceneVo();
+        BeanUtils.copyProperties(fusionNum,vo);
+        Model model = modelService.getById(modelId);
+        BeanUtils.copyProperties(model,sceneVo);
+        sceneVo.setStatus(2);
+        sceneVo.setSceneName(scenePlus.getTitle());
+        sceneVo.setSourceName(CameraUtil.getSourceName(model.getType()));
+        sceneVo.setName(scenePlus.getTitle());
+        sceneVo.setCreateTime(scenePlus.getCreateTime());
+        ScenePlusExt scenePlusExt = scenePlus.getScenePlusExt();
+        if(scenePlusExt != null){
+            sceneVo.setRtkLocation(scenePlusExt.getRtkLocation());
+            sceneVo.setOrientation(scenePlusExt.getOrientation());
         }
-        return numVoList.get(0);
+
+        vo.setSceneData(sceneVo);
+        return vo;
+    }
+
+    @Override
+    public FusionNumVo addModel(FusionParam param, Integer modelId,String title) {
+        FusionNum fusionNum = new FusionNum();
+        BeanUtils.copyProperties(param,fusionNum);
+        fusionNum.setFusionId(param.getFusionId());
+        fusionNum.setModelId(modelId);
+        fusionNum.setTransform(JSONObject.toJSONString(param.getTransform()));
+        this.save(fusionNum);
+
+        FusionNumVo vo = new FusionNumVo();
+        SceneVo sceneVo = new SceneVo();
+        BeanUtils.copyProperties(fusionNum,vo);
+        Model model = modelService.getById(modelId);
+        BeanUtils.copyProperties(model,sceneVo);
+        sceneVo.setStatus(2);
+        sceneVo.setSceneName(title);
+        sceneVo.setSourceName(CameraUtil.getSourceName(model.getType()));
+
+        vo.setSceneData(sceneVo);
+        return vo;
     }
 
     private List<FusionNum> getByFusionIdAndModelId(Integer fusionId, Integer modelId) {
@@ -286,4 +318,25 @@ public class FusionNumServiceImpl extends ServiceImpl<IFusionNumMapper, FusionNu
         wrapper.eq(FusionNum::getFusionId,oldFusionId);
         return this.list(wrapper);
     }
+
+    @Override
+    public HashMap<Integer, FusionNum> getByCaseId( Integer caseId) {
+        HashMap<Integer, FusionNum> map = new HashMap<>();
+        List<CaseFusion> caseFusions = caseFusionService.getListByCaseId(caseId);
+        if(caseFusions.isEmpty()){
+            return map;
+        }
+        List<Integer> ids = caseFusions.stream().map(CaseFusion::getFusionId).collect(Collectors.toList());
+        if(ids.isEmpty()){
+            return map;
+        }
+        List<FusionNum> fusionNums = this.getListByFusionIdList(ids);
+        if(fusionNums.isEmpty()){
+            return map;
+        }
+        for (FusionNum fusionNum : fusionNums) {
+            map.put(fusionNum.getModelId(),fusionNum);
+        }
+        return map;
+    }
 }

+ 75 - 7
src/main/java/com/fdkankan/fusion/service/impl/HotIconServiceImpl.java

@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -43,6 +44,7 @@ public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> imp
                 .orderByDesc(HotIcon::getIsNew)           // 新增
                 .orderByDesc(HotIcon::getLastUse)         // 上次使用
                 .orderByDesc(HotIcon::getUseNum)          // 使用次数
+                .orderByAsc(HotIcon::getSort)
                 .orderByDesc(HotIcon::getCreateTime);
         return this.list(wrapper);
     }
@@ -51,7 +53,7 @@ public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> imp
     public List<HotIcon> getDefaultIcon() {
         LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(HotIcon::getIsSystem,1);
-        wrapper.orderByAsc(HotIcon::getIconId);
+        wrapper.orderByDesc(HotIcon::getCreateTime);
         List<HotIcon> list = this.list(wrapper);
         return list;
     }
@@ -93,8 +95,7 @@ public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> imp
                 hotIconIds.addAll(ids);
             }
         }
-        List<Integer> collect = getDefaultIcon().stream().map(HotIcon::getIconId).collect(Collectors.toList());
-        hotIconIds.addAll(collect);
+        hotIconIds.addAll(getDefaultIcon().stream().map(HotIcon::getIconId).collect(Collectors.toList()));
         LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(HotIcon::getCaseId,caseId);
         List<HotIcon> list1 = this.list(wrapper);
@@ -109,14 +110,81 @@ public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> imp
     }
 
     @Override
+    public List<HotIcon> getListByFusionId(Integer fusionId) {
+        HashSet<Integer> hotIconIds = new HashSet<>();
+        List<CaseTag> list = caseTagService.getListByFusionId(fusionId);
+        if(list.size() >0){
+            List<Integer> ids  = list.parallelStream().map(CaseTag::getHotIconId).collect(Collectors.toList());
+            if(!ids.isEmpty()){
+                hotIconIds.addAll(ids);
+            }
+        }
+        hotIconIds.addAll(getDefaultIcon().stream().map(HotIcon::getIconId).collect(Collectors.toList()));
+        LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(HotIcon::getFusionId,fusionId);
+        List<HotIcon> list1 = this.list(wrapper);
+        List<Integer> ids = list1.stream().map(HotIcon::getIconId).collect(Collectors.toList());
+        if(!ids.isEmpty()){
+            hotIconIds.addAll(ids);
+        }
+        if(hotIconIds.isEmpty()){
+            return new ArrayList<>();
+        }
+        return this.getByIds(hotIconIds);
+    }
+
+    @Override
     public List<HotIcon> getByIds( HashSet<Integer> hotIconIds) {
         LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(HotIcon::getIconId,hotIconIds);
         wrapper.orderByDesc(HotIcon::getIsSystem)           // 官方默认
-                .orderByDesc(HotIcon::getIsNew)           // 新增
-                .orderByDesc(HotIcon::getLastUse)         // 上次使用
-                .orderByDesc(HotIcon::getUseNum)          // 使用次数
-                .orderByDesc(HotIcon::getCreateTime);
+                .orderByAsc(HotIcon::getSort);
         return this.list(wrapper);
     }
+
+    @Override
+    public List<HotIcon> treeList(List<HotIcon> iconList) {
+        HashMap<Integer,HotIcon> map = new HashMap<>();
+
+        List<HotIcon> list = new ArrayList<>();
+        List<HotIcon> result = new ArrayList<>();
+
+        for (HotIcon hotIcon : iconList) {
+            if(hotIcon.getParentId() == null){
+                list.add(hotIcon);
+            }
+            map.put(hotIcon.getIconId(),hotIcon);
+        }
+        for (HotIcon hotIcon : iconList) {
+            if(hotIcon.getParentId() == null){
+                continue;
+            }
+            HotIcon parent = map.get(hotIcon.getParentId());
+            if(parent.getChildrenList() == null){
+                parent.setChildrenList(new ArrayList<>());
+            }
+            parent.getChildrenList().add(hotIcon);
+        }
+        for (HotIcon hotIcon : list) {
+            result.add( map.get(hotIcon.getIconId()));
+        }
+
+        return result;
+    }
+
+    @Override
+    public Integer getDictId(Integer hotIconId) {
+        HotIcon hotIcon = this.getById(hotIconId);
+        if(hotIcon == null){
+            return null;
+        }
+        if(hotIcon.getDictId() != null || hotIcon.getParentId() == null){
+            return hotIcon.getDictId();
+        }
+        HotIcon hotIcon1 = this.getById(hotIcon.getParentId());
+        if(hotIcon1 !=null){
+            return hotIcon1.getDictId();
+        }
+        return null;
+    }
 }

+ 101 - 5
src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java

@@ -200,15 +200,21 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
         }
     }
 
-    @Override
-    public List<Model> getListByNum(List<String> numList) {
+    public List<Model> getListByNum(List<String> numList,Integer isObj) {
+        if(numList.isEmpty()){
+            return new ArrayList<>();
+        }
         LambdaQueryWrapper<Model> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(Model::getNum,numList);
+        wrapper.eq(Model::getIsObj,isObj);
         return this.list(wrapper);
     }
 
     @Override
     public List<Model> getListByModelIds(List<Integer> modelIds) {
+        if(modelIds == null || modelIds.isEmpty()){
+            return new ArrayList<>();
+        }
         LambdaQueryWrapper<Model> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(Model::getModelId,modelIds);
         return this.list(wrapper);
@@ -238,7 +244,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
     }
 
     @Override
-    public Model getIsNullNewByNum(String num,Integer type) {
+    public Model getIsNullNewByNum(String num,Integer type, Integer isObj) {
         LambdaQueryWrapper<Model> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Model::getNum,num);
         wrapper.eq(Model::getType,type);
@@ -246,6 +252,32 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
         if(model == null){
             model = new Model();
         }
+        if(model.getModelId() != null && StringUtils.isNotBlank(model.getModelGlbUrl()) && StringUtils.isNotBlank(model.getModelSize())){
+            return model;
+        }
+        model.setModelDateType("obj");
+        model.setType(type);
+        model.setModelType("pointcloud");    //深时点云类型
+        model.setCreateStatus(1);
+        model.setIsObj(isObj);
+        if(isObj == 1){           //看看,看见
+            String mesh3DtilesPath  = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles/tileset.json";
+            String sizePath = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles";
+            if(uploadToOssUtil.existKey(mesh3DtilesPath)){
+                model.setModelDateType("b3dm");
+                model.setModelType("b3dm");
+                model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath +mesh3DtilesPath)));
+                model.setModelSize(FileWriterUtil.setFileSize(uploadToOssUtil.getSize( sizePath)));
+            }else {
+                model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
+                model.setModelGlbUrl(getGlbUrl(type,num,model));
+                model.setModelType("glb");
+            }
+
+        }
+        model.setNum(num);
+
+        this.saveOrUpdate(model);
         return model;
     }
 
@@ -289,13 +321,25 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
     }
 
     @Override
-    public HashMap<String, Model> getMapByNum(List<String> numList) {
+    public HashMap<String, Model> getMapByNum(List<String> numList,Integer isObj) {
         HashMap<String,Model> map = new HashMap<>();
-        List<Model> modelList = this.getListByNum(numList);
+        List<Model> modelList = this.getListByNum(numList,isObj);
         modelList.forEach(entity-> map.put(entity.getNum() + entity.getType(),entity));
         return map;
     }
 
+
+    @Override
+    public Model getByUploadId(Integer uploadId) {
+        LambdaQueryWrapper<Model> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Model::getUploadId,uploadId);
+        List<Model> list = this.list(wrapper);
+        if(list.isEmpty()){
+            return null;
+        }
+        return list.get(0);
+    }
+
     @Override
     public void copyModel(Integer modelId) {
         Model modelEntity = this.getById(modelId);
@@ -326,4 +370,56 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
             uploadToOssUtil.copyFile(oldOssPath,newOssPath);
         }
     }
+
+
+
+
+
+
+
+
+    private String getGlbUrl(Integer type, String num,Model model) {
+        if(type == 0 || type == 1 || type == 4 || type == 6 || type == 7){ //看看,看见
+            String objPath = String.format(FilePath.OBJ_LOCAL_PATH ,environment,num);
+            ShellUtil.yunDownload(String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh" ,objPath);
+            List<String> localGlbPaths = new ArrayList<>();
+            List<String> ossGlbPaths = new ArrayList<>();
+            File localFile = new File(objPath);
+            this.toGlB(localFile,localGlbPaths);
+            Long modelSize = 0L;
+            if(localGlbPaths.size() >0){
+                for (String localGlbPath : localGlbPaths) {
+                    String ossGlbPath = localGlbPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/");
+                    uploadToOssUtil.uploadOss(localGlbPath,ossGlbPath);
+                    if(ossGlbPath.contains("lod_")){
+                        if(ossGlbPath.contains("lod_0")){
+                            ossGlbPaths.add(queryPath  +ossGlbPath);
+                            modelSize +=  uploadToOssUtil.getSize(ossGlbPath);
+                        }
+                        continue;
+                    }
+                    modelSize +=  uploadToOssUtil.getSize(ossGlbPath);
+                    ossGlbPaths.add(queryPath +ossGlbPath);
+                }
+                model.setModelSize(FileWriterUtil.setFileSize(modelSize));
+                FileUtil.del(objPath);
+                return JSONArray.toJSONString(ossGlbPaths);
+            }
+            FileUtil.del(objPath);
+        }
+        return null;
+    }
+
+    private void toGlB(File localFile, List<String> localGlbPath) {
+        File[] files = localFile.listFiles();
+        for (File file : files) {
+            if(file.isDirectory()){
+                toGlB(file,localGlbPath);
+            }
+            if(file.getName().contains(".obj")){
+                String glbPath =  OBJToGLBUtil.objToGlb(file.getPath(),file.getPath().replace(".obj",".glb") );
+                localGlbPath.add(glbPath);
+            }
+        }
+    }
 }

+ 11 - 0
src/main/java/com/fdkankan/fusion/service/impl/SceneDeptShareServiceImpl.java

@@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -45,4 +46,14 @@ public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper
 
 
     }
+
+    @Override
+    public List<String> getNumListByDeptId(String deptId, Integer isObj) {
+        LambdaQueryWrapper<SceneDeptShare> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneDeptShare::getDeptId,deptId);
+        wrapper.eq(SceneDeptShare::getIsObj,isObj);
+        wrapper.ne(SceneDeptShare::getIsAuth,0);
+        List<SceneDeptShare> list = this.list(wrapper);
+        return list.stream().map(SceneDeptShare::getNum).collect(Collectors.toList());
+    }
 }

+ 25 - 0
src/main/java/com/fdkankan/fusion/service/impl/ScenePlusExtServiceImpl.java

@@ -1,12 +1,17 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.fusion.entity.ScenePlus;
 import com.fdkankan.fusion.entity.ScenePlusExt;
 import com.fdkankan.fusion.mapper.IScenePlusExtMapper;
 import com.fdkankan.fusion.service.IScenePlusExtService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -19,4 +24,24 @@ import org.springframework.stereotype.Service;
 @DS("db2")
 public class ScenePlusExtServiceImpl extends ServiceImpl<IScenePlusExtMapper, ScenePlusExt> implements IScenePlusExtService {
 
+    @Override
+    public List<ScenePlusExt> getByPlusIds(List<Long> plusIds) {
+        if(plusIds == null || plusIds.isEmpty()){
+            return new ArrayList<>();
+        }
+        LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(ScenePlusExt::getPlusId,plusIds);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public ScenePlusExt getByPlusId(Long id) {
+        LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ScenePlusExt::getPlusId,id);
+        List<ScenePlusExt> list = this.list(wrapper);
+        if(list == null || list.isEmpty()){
+            return null;
+        }
+        return list.get(0);
+    }
 }

+ 28 - 1
src/main/java/com/fdkankan/fusion/service/impl/ScenePlusServiceImpl.java

@@ -13,6 +13,7 @@ import com.fdkankan.fusion.service.IScenePlusService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -46,7 +47,33 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
     }
 
     @Override
+    public List<ScenePlus> getByNumList(List<String> numList) {
+        if(numList == null || numList.isEmpty()){
+            return new ArrayList<>();
+        }
+        LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(ScenePlus::getNum,numList);
+        return this.list(wrapper);
+    }
+
+    @Override
     public Page<SceneVo> sceneList(ScenePram param) {
-        return this.getBaseMapper().sceneList(new Page<>(param.getPageNum(),param.getPageSize()),param);
+        return this.getBaseMapper().sceneListPage(new Page<>(param.getPageNum(),param.getPageSize()),param);
+    }
+
+    @Override
+    public List<SceneVo> getMeshList(List<String> meshNumList) {
+        ScenePram param = new ScenePram();
+        param.setIsObj(1);
+        param.setNumList(meshNumList);
+        return this.getBaseMapper().sceneList(param);
+    }
+
+    @Override
+    public List<SceneVo> getLaserList(List<String> laserNumList) {
+        ScenePram param = new ScenePram();
+        param.setIsObj(0);
+        param.setNumList(laserNumList);
+        return this.getBaseMapper().sceneList(param);
     }
 }

+ 17 - 34
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -40,10 +40,6 @@ import java.util.stream.Collectors;
 @Slf4j
 public class SceneService implements ISceneService {
 
-    @Resource
-    FdKKClient fdKKClient;
-    @Resource
-    LaserClient laserClient;
     @Autowired
     IModelService modelService;
     @Autowired
@@ -62,48 +58,35 @@ public class SceneService implements ISceneService {
     IMqSendLogService mqSendLogService;
     @Autowired
     IScenePlusService scenePlusService;
+    @Autowired
+    ISceneDeptShareService sceneDeptShareService;
 
-    @Override
-    public List<SceneVo> getSceneListAndModel(ScenePram param) {
-        PageInfo pageInfo = this.pageList(param);
-        List<SceneVo> listAll = (List<SceneVo>) pageInfo.getList();
-        if(listAll.size() >0){
-            List<String> numList = listAll.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
-            //设置模型
-            HashMap<String,Model> map = modelService.getMapByNum(numList);
-            for (SceneVo sceneVo : listAll) {
-                String createTime = sceneVo.getCreateTime();
-                Model model = map.get(sceneVo.getNum() + sceneVo.getType());
-                if(model == null){
-                    continue;
-                }
-                BeanUtils.copyProperties(model,sceneVo);
-                sceneVo.setCreateTime(createTime);
-            }
-        }
-        return listAll;
-    }
 
     @Override
     public PageInfo pageList(ScenePram param) {
 
+        String deptId = tmDepartmentService.getDeptId();
+
         if(param.getSearchType() == 0){  //当前组织下场景
-            String deptId = tmDepartmentService.getDeptId();
+            List<TmCamera> tmCameraList = tmCameraService.getByDeptIds(Arrays.asList(deptId));
+            List<String> collect = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
+            param.setSnCodes(collect);
+        }
+        if(param.getSearchType() == 1){  //下级共享给上级场景
+           List<String> numList =  sceneDeptShareService.getNumListByDeptId(deptId,param.getIsObj());
+           param.setNumList(numList);
+        }
+        if(param.getSearchType() == 2){  //当前组织及下级组织的数据
+            List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(deptId);
             List<String> deptIds = new ArrayList<>();
             deptIds.add(deptId);
-            if(StpUtil.hasRole("admin-super")){
-                List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(deptId);
-                deptIds.addAll(sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList()));
-            }
+            deptIds.addAll(sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList()));
             List<TmCamera> tmCameraList = tmCameraService.getByDeptIds(deptIds);
             List<String> collect = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
             param.setSnCodes(collect);
         }
-        if(param.getSearchType() == 1){  //下级共享给上级场景
-
-        }
-        if(param.getSearchType() == 2){  //下级组织共享的场景数据
-
+        if(param.getSnCodes().isEmpty() || param.getNumList().isEmpty()){
+            return PageInfo.PageInfoEmpty();
         }
         Page<SceneVo> sceneVoPage = scenePlusService.sceneList(param);
 

+ 32 - 0
src/main/java/com/fdkankan/fusion/service/impl/TmDepartmentServiceImpl.java

@@ -318,4 +318,36 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
         }
         return deptIds;
     }
+
+    @Override
+    public List<TmDepartment> higherLevel(String deptId) {
+        if(StringUtils.isBlank(deptId)){
+            deptId = this.getDeptId();
+        }
+        if(deptId==null){
+            return new ArrayList<>();
+        }
+        TmDepartment tmDepartment = this.getById(deptId);
+        if(tmDepartment==null){
+            return new ArrayList<>();
+        }
+        if(tmDepartment.getParentId() == null || tmDepartment.getDeptType() == 0){
+            return new ArrayList<>();
+        }
+        List<TmDepartment> departments = new ArrayList<>();
+        setParentList(tmDepartment,departments);
+        return departments;
+    }
+
+    private void setParentList(TmDepartment tmDepartment, List<TmDepartment> departments) {
+        if(tmDepartment.getParentId() != null){
+            TmDepartment prentDept = this.getById(tmDepartment.getParentId());
+            if(prentDept != null && prentDept.getDeptType()!= 0 ){
+                departments.add(prentDept);
+                if(prentDept.getParentId() != null ){
+                    setParentList(prentDept,departments);
+                }
+            }
+        }
+    }
 }

+ 5 - 0
src/main/resources/mapper/fusion/CaseFusionRelationMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.fusion.mapper.ICaseFusionRelationMapper">
+
+</mapper>

+ 20 - 8
src/main/resources/mapper/fusion/ScenePlusMapper.xml

@@ -2,12 +2,11 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fdkankan.fusion.mapper.IScenePlusMapper">
 
-
     <select id="groupByCameraId" resultType="com.fdkankan.fusion.response.DataGroupVo">
         select camera_id as groupKey ,count(1) as dataCount from t_scene_plus where rec_status = 'A'
         and  camera_id in
         <foreach item="cameraId" collection="cameraIds" open="(" separator="," close=")">
-         #{cameraId}
+            #{cameraId}
         </foreach>
         <if test="startTime !=null and startTime !='' ">
             and create_time &gt;= #{startTime}
@@ -34,8 +33,18 @@
         group by scene_source
     </select>
 
-
     <select id="sceneList" resultType="com.fdkankan.fusion.response.SceneVo">
+        <include refid="commonSelect"></include>
+    </select>
+
+
+
+    <select id="sceneListPage" resultType="com.fdkankan.fusion.response.SceneVo">
+        <include refid="commonSelect"></include>
+    </select>
+
+
+    <sql id="commonSelect">
         select s.id,s.title as title,s.title as name ,s.title as sceneName, s.num,s.create_time,c.sn_code,e.space as sceneSize
         ,u.user_name,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site , e.thumb
         ,e.algorithm_time,s.user_id,s.scene_source,e.is_obj,d.type as cameraType,e.rtk_location,e.orientation
@@ -44,7 +53,7 @@
         left join t_user u on s.user_id = u.id
         left join t_camera c on s.camera_id = c.id
         left join t_camera_detail d on s.camera_id = d.camera_id
-        WHERE s.rec_status = 'A'
+        WHERE s.rec_status = 'A' and s.camera_id is not null
         <if test="param.isObj != null and param.isObj==0">
             and  s.scene_source in (4,5)
         </if>
@@ -76,9 +85,12 @@
                 #{snCode}
             </foreach>
         </if>
-
+        <if test="param.numList!= null and param.numList.size >0">
+            and s.num in
+            <foreach item="num" collection="param.numList" open="(" separator="," close=")">
+                #{num}
+            </foreach>
+        </if>
         ORDER BY create_time desc,id asc
-
-
-    </select>
+    </sql>
 </mapper>