浏览代码

多元融合

lyhzzz 3 周之前
父节点
当前提交
0c1efa549c
共有 42 个文件被更改,包括 499 次插入142 次删除
  1. 2 1
      README.md
  2. 3 0
      src/main/java/com/fdkankan/fusion/common/ResultCode.java
  3. 32 0
      src/main/java/com/fdkankan/fusion/common/util/NumTypeUtils.java
  4. 1 1
      src/main/java/com/fdkankan/fusion/config/SaTokenConfigure.java
  5. 6 3
      src/main/java/com/fdkankan/fusion/controller/CaseAnimationController.java
  6. 58 6
      src/main/java/com/fdkankan/fusion/controller/CaseFusionController.java
  7. 6 3
      src/main/java/com/fdkankan/fusion/controller/CasePathController.java
  8. 5 5
      src/main/java/com/fdkankan/fusion/controller/CaseSettingsController.java
  9. 2 2
      src/main/java/com/fdkankan/fusion/controller/CaseTagController.java
  10. 3 3
      src/main/java/com/fdkankan/fusion/controller/FusionGuideController.java
  11. 6 10
      src/main/java/com/fdkankan/fusion/controller/HotIconController.java
  12. 2 1
      src/main/java/com/fdkankan/fusion/controller/ModelController.java
  13. 3 0
      src/main/java/com/fdkankan/fusion/entity/CaseAnimation.java
  14. 3 0
      src/main/java/com/fdkankan/fusion/entity/CasePath.java
  15. 3 0
      src/main/java/com/fdkankan/fusion/entity/CaseSettings.java
  16. 3 0
      src/main/java/com/fdkankan/fusion/entity/CaseTag.java
  17. 3 0
      src/main/java/com/fdkankan/fusion/entity/FusionGuide.java
  18. 5 0
      src/main/java/com/fdkankan/fusion/entity/HotIcon.java
  19. 3 0
      src/main/java/com/fdkankan/fusion/entity/ScenePlus.java
  20. 1 0
      src/main/java/com/fdkankan/fusion/request/AddByMediaLibraryParam.java
  21. 2 0
      src/main/java/com/fdkankan/fusion/request/FusionParam.java
  22. 2 1
      src/main/java/com/fdkankan/fusion/response/CaseFusionVo.java
  23. 2 0
      src/main/java/com/fdkankan/fusion/service/ICaseAnimationService.java
  24. 0 1
      src/main/java/com/fdkankan/fusion/service/ICaseFusionService.java
  25. 2 0
      src/main/java/com/fdkankan/fusion/service/ICasePathService.java
  26. 2 0
      src/main/java/com/fdkankan/fusion/service/ICaseSettingsService.java
  27. 5 0
      src/main/java/com/fdkankan/fusion/service/ICaseTagService.java
  28. 2 0
      src/main/java/com/fdkankan/fusion/service/IFusionGuideService.java
  29. 4 1
      src/main/java/com/fdkankan/fusion/service/IFusionNumService.java
  30. 2 0
      src/main/java/com/fdkankan/fusion/service/IHotIconService.java
  31. 7 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseAnimationServiceImpl.java
  32. 13 5
      src/main/java/com/fdkankan/fusion/service/impl/CaseFusionServiceImpl.java
  33. 2 65
      src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java
  34. 7 0
      src/main/java/com/fdkankan/fusion/service/impl/CasePathServiceImpl.java
  35. 21 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseSettingsServiceImpl.java
  36. 25 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java
  37. 17 2
      src/main/java/com/fdkankan/fusion/service/impl/FusionGuideServiceImpl.java
  38. 19 25
      src/main/java/com/fdkankan/fusion/service/impl/FusionNumServiceImpl.java
  39. 24 0
      src/main/java/com/fdkankan/fusion/service/impl/HotIconServiceImpl.java
  40. 80 0
      src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java
  41. 110 6
      src/main/java/com/fdkankan/fusion/task/TaskService.java
  42. 1 1
      src/main/resources/bootstrap-dev.yml

+ 2 - 1
README.md

@@ -80,6 +80,7 @@ fusion:
     10.fusion/casePath 入参修改为fusionId  ,add入参一致修改
     11.fusion/caseAnimation 入参修改为fusionId ,add入参一致修改    
     12.场景列表修改为 /service/manage/scene/list  {"pageNum":1,"pageSize":10,"isObj":"1"} 与管理后台一直
-    
+    13.caseFusion/add 添加场景到多元融合
+   
 ~~~~
 

+ 3 - 0
src/main/java/com/fdkankan/fusion/common/ResultCode.java

@@ -81,6 +81,9 @@ public enum ResultCode {
 
     AI_ERROR(8031, "调用ai出错"),
 
+    RECORD_NOT_EXIST(8032, "数据不存在或已删除"),
+
+
     ;
 
 

+ 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, String three) {
+        switch (sceneSource){
+            case 3 : return  1;
+            case 4 : return  4;
+            case 5 : return  6;
+            default:
+                if(StringUtils.isNotBlank(three) && "yzl".equals(three)){
+                    return 7;
+                }
+                return 0;
+        }
+    }
 }

+ 1 - 1
src/main/java/com/fdkankan/fusion/config/SaTokenConfigure.java

@@ -162,7 +162,7 @@ public class SaTokenConfigure {
 
     private void checkCaseAuth(String caseId,String pageType) {
 
-        fdService.checkCaseAuth(caseId,pageType,StpUtil.getTokenValue());
+        //fdService.checkCaseAuth(caseId,pageType,StpUtil.getTokenValue());
     }
 
 

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

@@ -28,16 +28,19 @@ 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")
     @PushJm(event_content = "添加动画模型")
     public ResultData addOrUpdate(@RequestBody CaseAnimation caseAnimation){
+        if(caseAnimation.getFusionId() == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
         caseAnimationService.saveOrUpdate(caseAnimation);
         return ResultData.ok(caseAnimation);
     }

+ 58 - 6
src/main/java/com/fdkankan/fusion/controller/CaseFusionController.java

@@ -6,19 +6,23 @@ 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.entity.Model;
+import com.fdkankan.fusion.entity.ScenePlus;
 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.response.CaseFusionVo;
+import com.fdkankan.fusion.response.SceneVo;
+import com.fdkankan.fusion.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -40,6 +44,10 @@ public class CaseFusionController extends BaseController{
     IFusionMeterService fusionMeterService;
     @Autowired
     ICaseTagPointService caseTagPointService;
+    @Autowired
+    IModelService modelService;
+    @Autowired
+    IScenePlusService scenePlusService;
 
     @GetMapping("/list")
     public ResultData allList(@RequestParam(required = false) Integer caseId){
@@ -48,13 +56,57 @@ public class CaseFusionController extends BaseController{
 
     @GetMapping("/info")
     public ResultData info(@RequestParam(required = false) Integer fusionId){
-        return ResultData.ok(caseFusionService.getInfo(fusionId));
+        CaseFusion caseFusion = caseFusionService.getById(fusionId);
+        if(caseFusion == null){
+            throw new BusinessException(ResultCode.RECORD_NOT_EXIST);
+        }
+        CaseFusionVo vo = new CaseFusionVo();
+        BeanUtils.copyProperties(caseFusion,vo);
+        List<SceneVo> 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);
+
+        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));
+
+        for (Model model : listByModelIds) {
+            SceneVo sceneVo = new SceneVo();
+            BeanUtils.copyProperties(model,sceneVo);
+            ScenePlus scenePlus = map.get(model.getNum());
+            if(model.getNum() != null && scenePlus != null){
+                BeanUtils.copyProperties(scenePlus,sceneVo);
+                sceneVo.setStatus(scenePlus.getSceneStatus() == -2 ? 2:scenePlus.getSceneStatus());
+                sceneVo.setName(scenePlus.getTitle());
+                sceneVo.setSceneName(scenePlus.getTitle());
+            }
+            if(model.getNum() == null){
+                sceneVo.setStatus(2);
+            }
+            sceneVos.add(sceneVo);
+        }
+
+        vo.setSceneVoList(sceneVos);
+
+        return ResultData.ok(vo);
     }
 
     @PostMapping("/add")
     @PushJm(event_content = "添加模型")
     public ResultData add(@RequestBody FusionParam param){
-        return ResultData.ok(fusionNumService.add(param));
+        if( param.getFusionId() == null || StringUtils.isNotBlank(param.getNum())){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        ScenePlus scenePlus = scenePlusService.getByNum(param.getNum());
+        if(scenePlus == null){
+            throw new BusinessException(ResultCode.RECORD_NOT_EXIST);
+        }
+
+        return ResultData.ok(fusionNumService.add(param,scenePlus));
     }
 
     /**

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

@@ -28,16 +28,19 @@ 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")
     @PushJm(event_content = "新增修改案件路线")
     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

@@ -30,22 +30,22 @@ 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")
     @PushJm(event_content = "新增修改案件设置")
     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);
             }

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

@@ -49,9 +49,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")

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

@@ -28,11 +28,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")

+ 6 - 10
src/main/java/com/fdkankan/fusion/controller/HotIconController.java

@@ -41,9 +41,9 @@ 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()));
     }
@@ -52,24 +52,20 @@ public class HotIconController extends BaseController{
     @PushJm(event_content = "添加标注图片")
     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) throws IOException {
+        if(file==null || StringUtils.isEmpty(iconTitle) || fusionId == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
 
         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);
         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;

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

@@ -67,7 +67,7 @@ public class ModelController extends BaseController{
     @PostMapping("/addByMediaLibrary")
     @PushJm(event_content = "关联媒体库模型")
     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());
@@ -88,6 +88,7 @@ public class ModelController extends BaseController{
         modelService.save(model);
 
         //caseNumService.addModeByCaseId(param.getCaseId(),model.getModelId());
+        fusionNumService.addModel(param.getFusionId(),model.getModelId());
         return ResultData.ok(model);
     }
 

+ 3 - 0
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;
 

+ 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
      */

+ 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;
     /**
      * 放置数量
      */

+ 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;
+
     /**
      * 封面图
      */

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

@@ -55,8 +55,13 @@ 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;
 

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

@@ -122,4 +122,7 @@ public class ScenePlus implements Serializable {
     @TableField("has_floorplan_ai")
     private Integer hasFloorplanAi;
 
+    @TableField("three_cam_type")
+    private String threeCamType;
+
 }

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

@@ -8,6 +8,7 @@ import java.util.List;
 @Data
 public class AddByMediaLibraryParam {
     private Integer caseId;
+    private Integer fusionId;
     private Integer uploadId;
     private Integer filesTypeId;
 

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

@@ -44,4 +44,6 @@ public class FusionParam {
 
     private String token;
 
+
+    private String num;
 }

+ 2 - 1
src/main/java/com/fdkankan/fusion/response/CaseFusionVo.java

@@ -6,5 +6,6 @@ import lombok.Data;
 import java.util.List;
 
 @Data
-public class CaseFusionVo extends CaseFusion {
+public class CaseFusionVo  extends CaseFusion {
+    private  List<SceneVo> sceneVoList;
 }

+ 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);
 }

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

@@ -19,5 +19,4 @@ public interface ICaseFusionService extends IService<CaseFusion> {
 
     void updateCaseId(List<Integer> fusionIds, Integer caseId);
 
-    Object getInfo(Integer fusionId);
 }

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

@@ -14,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 public interface ICasePathService extends IService<CasePath> {
 
     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);
 }

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

@@ -16,10 +16,15 @@ 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);
+
+    Object getByFusionId(Integer fusionId);
 }

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

@@ -2,6 +2,7 @@ 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;
 
@@ -25,7 +26,7 @@ public interface IFusionNumService extends IService<FusionNum> {
 
     List<FusionNumVo> getListByCaseId(Integer caseId,Integer fusionNumId);
 
-    FusionNumVo add(FusionParam param);
+    FusionNum add(FusionParam param, ScenePlus scenePlus);
 
     void updateModel(FusionParam param);
 
@@ -42,4 +43,6 @@ public interface IFusionNumService extends IService<FusionNum> {
     List<FusionNum> getByFusionId(Integer oldFusionId);
 
     HashMap<Integer, FusionNum> getByCaseId(Integer caseId);
+
+    void addModel(Integer fusionId, Integer modelId);
 }

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

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

+ 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);
+    }
 }

+ 13 - 5
src/main/java/com/fdkankan/fusion/service/impl/CaseFusionServiceImpl.java

@@ -2,14 +2,27 @@ package com.fdkankan.fusion.service.impl;
 
 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.entity.ScenePlus;
+import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.ICaseFusionMapper;
 import com.fdkankan.fusion.response.CaseFusionVo;
+import com.fdkankan.fusion.response.SceneVo;
 import com.fdkankan.fusion.service.ICaseFusionService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.fusion.service.IFusionNumService;
+import com.fdkankan.fusion.service.IModelService;
+import com.fdkankan.fusion.service.IScenePlusService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -45,9 +58,4 @@ public class CaseFusionServiceImpl extends ServiceImpl<ICaseFusionMapper, CaseFu
 
     }
 
-    @Override
-    public CaseFusionVo getInfo(Integer fusionId) {
-
-        return null;
-    }
 }

+ 2 - 65
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -115,29 +115,7 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                     continue;
                 }
                 Model model = modelService.getIsNullNewByNum(num,type);
-                if(model.getModelId() != null && StringUtils.isNotBlank(model.getModelGlbUrl()) && StringUtils.isNotBlank(model.getModelSize())){
-                    continue;
-                }
-                model.setModelDateType("obj");
-                model.setType(type);
-                model.setModelType("pointcloud");    //深时点云类型
-                model.setCreateStatus(1);
-                if(type == 0 || type == 1 || type == 4 || type == 6 || type == 7){           //看看,看见
-                    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);
                 modelList.add(model);
             }
         }
@@ -152,50 +130,9 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
 
 
 
-    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);
-            }
-        }
-    }
+
+
 
     private List<String> updateByNumList(Integer caseId, List<SceneNumParam> sceneNumParam) {
         List<String> addList = new ArrayList<>();

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

@@ -24,4 +24,11 @@ public class CasePathServiceImpl extends ServiceImpl<ICasePathMapper, CasePath>
         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);
+    }
 }

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

@@ -47,4 +47,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;
+    }
 }

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

@@ -55,6 +55,24 @@ 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) {
         HotIcon defaultIcon = hotIconService.getById(18);
         LambdaUpdateWrapper<CaseTag> wrapper = new LambdaUpdateWrapper<>();
@@ -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());

+ 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;

+ 19 - 25
src/main/java/com/fdkankan/fusion/service/impl/FusionNumServiceImpl.java

@@ -4,9 +4,11 @@ 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.common.util.NumTypeUtils;
 import com.fdkankan.fusion.entity.CaseFusion;
 import com.fdkankan.fusion.entity.FusionNum;
 import com.fdkankan.fusion.entity.Model;
+import com.fdkankan.fusion.entity.ScenePlus;
 import com.fdkankan.fusion.entity.jsonEntity.Transform;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IFusionNumMapper;
@@ -132,41 +134,33 @@ 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 FusionNum add(FusionParam param, ScenePlus scenePlus) {
+
+        Integer meshTypeBySceneSource = NumTypeUtils.getMeshTypeBySceneSource(scenePlus.getSceneSource(), scenePlus.getThreeCamType());
+        Model model = modelService.getIsNullNewByNum(param.getNum(),meshTypeBySceneSource);
         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);
-        }
+        CaseFusion caseFusion = caseFusionService.getById(param.getFusionId());
 
-        List<FusionNum> fusionNums = this.getByFusionIdAndModelId(caseFusion.getFusionId(),param.getModelId());
-        if(fusionNums.size()>0){
-           this.removeByIds(fusionNums);
-        }
         FusionNum fusionNum = new FusionNum();
         BeanUtils.copyProperties(param,fusionNum);
         fusionNum.setFusionId(caseFusion.getFusionId());
+        fusionNum.setModelId(model.getModelId());
         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);
-        }
-        return numVoList.get(0);
+        return fusionNum;
+    }
+
+    @Override
+    public void addModel(Integer fusionId, Integer modelId) {
+        FusionNum fusionNum = new FusionNum();
+        fusionNum.setFusionId(fusionId);
+        fusionNum.setModelId(modelId);
+        this.save(fusionNum);
     }
 
     private List<FusionNum> getByFusionIdAndModelId(Integer fusionId, Integer modelId) {

+ 24 - 0
src/main/java/com/fdkankan/fusion/service/impl/HotIconServiceImpl.java

@@ -109,6 +109,30 @@ public class HotIconServiceImpl extends ServiceImpl<IHotIconMapper, HotIcon> imp
     }
 
     @Override
+    public Object 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);

+ 80 - 0
src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java

@@ -209,6 +209,9 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
 
     @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);
@@ -246,6 +249,31 @@ 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);
+        if(type == 0 || type == 1 || type == 4 || type == 6 || type == 7){           //看看,看见
+            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);
+
+
         return model;
     }
 
@@ -326,4 +354,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);
+            }
+        }
+    }
 }

+ 110 - 6
src/main/java/com/fdkankan/fusion/task/TaskService.java

@@ -1,15 +1,13 @@
 package com.fdkankan.fusion.task;
 
 import cn.hutool.core.io.FileUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.fusion.common.util.DateUtils;
 import com.fdkankan.fusion.common.util.UploadToOssUtil;
-import com.fdkankan.fusion.entity.CaseLive;
-import com.fdkankan.fusion.entity.CommonUpload;
-import com.fdkankan.fusion.service.ICaseLiveService;
-import com.fdkankan.fusion.service.ICommonUploadService;
-import com.fdkankan.fusion.service.IDictFileService;
-import com.fdkankan.fusion.service.IDictService;
+import com.fdkankan.fusion.entity.*;
+import com.fdkankan.fusion.service.*;
 import com.fdkankan.redis.util.RedisUtil;
+import io.netty.util.internal.UnstableApi;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -31,6 +29,10 @@ public class TaskService {
 
     @Autowired
     ICaseLiveService caseLiveService;
+    @Autowired
+    ICaseSettingsService caseSettingsService;
+    @Autowired
+    ICaseFusionService caseFusionService;
 
 
     @Autowired
@@ -46,8 +48,15 @@ public class TaskService {
         }
 
         checkSystemModel();
+        updateCaseSetting();
+        updateHotIcon();
+        updateCaseTag();
+        updateGuide();
+        updatePath();
+        updateAnimation();
     }
 
+
     @Autowired
     ICommonUploadService commonUploadService;
     @Autowired
@@ -86,4 +95,99 @@ public class TaskService {
 
     }
 
+
+    private void updateCaseSetting() {
+        List<CaseSettings> list = caseSettingsService.list();
+        List<CaseSettings> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
+        for (CaseSettings caseSettings : collect) {
+            List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(caseSettings.getCaseId());
+            if(!listByCaseId.isEmpty()){
+                LambdaUpdateWrapper<CaseSettings> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(CaseSettings::getSettingsId,caseSettings.getSettingsId());
+                wrapper.set(CaseSettings::getFusionId,listByCaseId.get(0).getFusionId());
+                caseSettingsService.update(wrapper);
+            }
+        }
+    }
+    @Autowired
+    IHotIconService hotIconService;
+
+    private void updateHotIcon() {
+        List<HotIcon> list = hotIconService.list();
+        List<HotIcon> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
+        for (HotIcon entity : collect) {
+            List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
+            if(!listByCaseId.isEmpty()){
+                LambdaUpdateWrapper<HotIcon> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(HotIcon::getIconId,entity.getIconId());
+                wrapper.set(HotIcon::getFusionId,listByCaseId.get(0).getFusionId());
+                hotIconService.update(wrapper);
+            }
+        }
+    }
+    @Autowired
+    ICaseTagService caseTagService;
+    private void updateCaseTag() {
+        List<CaseTag> list = caseTagService.list();
+        List<CaseTag> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
+        for (CaseTag entity : collect) {
+            List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
+            if(!listByCaseId.isEmpty()){
+                LambdaUpdateWrapper<CaseTag> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(CaseTag::getTagId,entity.getTagId());
+                wrapper.set(CaseTag::getFusionId,listByCaseId.get(0).getFusionId());
+                caseTagService.update(wrapper);
+            }
+        }
+    }
+
+    @Autowired
+    IFusionGuideService fusionGuideService;
+    private void updateGuide() {
+        List<FusionGuide> list = fusionGuideService.list();
+        List<FusionGuide> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
+        for (FusionGuide entity : collect) {
+            List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
+            if(!listByCaseId.isEmpty()){
+                LambdaUpdateWrapper<FusionGuide> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(FusionGuide::getFusionGuideId,entity.getFusionGuideId());
+                wrapper.set(FusionGuide::getFusionId,listByCaseId.get(0).getFusionId());
+                fusionGuideService.update(wrapper);
+            }
+        }
+    }
+
+
+    @Autowired
+    ICasePathService casePathService;
+    private void updatePath() {
+        List<CasePath> list = casePathService.list();
+        List<CasePath> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
+        for (CasePath entity : collect) {
+            List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
+            if(!listByCaseId.isEmpty()){
+                LambdaUpdateWrapper<CasePath> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(CasePath::getId,entity.getId());
+                wrapper.set(CasePath::getFusionId,listByCaseId.get(0).getFusionId());
+                casePathService.update(wrapper);
+            }
+        }
+    }
+
+    @Autowired
+    ICaseAnimationService caseAnimationService;
+    private void updateAnimation() {
+        List<CaseAnimation> list = caseAnimationService.list();
+        List<CaseAnimation> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
+        for (CaseAnimation entity : collect) {
+            List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
+            if(!listByCaseId.isEmpty()){
+                LambdaUpdateWrapper<CaseAnimation> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(CaseAnimation::getId,entity.getId());
+                wrapper.set(CaseAnimation::getFusionId,listByCaseId.get(0).getFusionId());
+                caseAnimationService.update(wrapper);
+            }
+        }
+    }
+
 }

+ 1 - 1
src/main/resources/bootstrap-dev.yml

@@ -4,7 +4,7 @@ spring:
   cloud:
     nacos:
       config:
-        server-addr: 192.168.0.25:8848
+        server-addr: 119.23.182.50:8848
         file-extension: yaml
         namespace: dev
         extension-configs: