lyhzzz 4 月之前
父节点
当前提交
e3bc474e26

+ 21 - 5
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -260,10 +260,10 @@ public class CaseDownService {
                 sceneData.setCutModelPath(sceneData.getCutModelPath().replace("/oss/","/swkk/"+sceneData.getNum()+"/wwwroot/"));
             }
             if(StringUtils.isNotBlank(sceneData.getSurveillancePath())){
-                sceneData.setCutModelPath(sceneData.getSurveillancePath().replace("/oss/","/swkk/"+sceneData.getNum()+"/wwwroot/"));
+                sceneData.setSurveillancePath(sceneData.getSurveillancePath().replace("/oss/","/swkk/"+sceneData.getNum()+"/wwwroot/"));
             }
             if(StringUtils.isNotBlank(sceneData.getSceneJsonPath())){
-                sceneData.setCutModelPath(sceneData.getSceneJsonPath().replace("/oss/","/swkk/"+sceneData.getNum()+"/wwwroot/"));
+                sceneData.setSceneJsonPath(sceneData.getSceneJsonPath().replace("/oss/","/swkk/"+sceneData.getNum()+"/wwwroot/"));
             }
 
             //下载模型
@@ -306,7 +306,17 @@ public class CaseDownService {
 
             }
             if(sceneData.getModelId() != null){
-                jsonObject.put(basePath+model+sceneData.getModelId(), ResultData.ok(modelService.getInfo(sceneData.getModelId())));
+                SceneVo info = modelService.getInfo(sceneData.getModelId());
+                if(StringUtils.isNotBlank(info.getCutModelPath())){
+                    info.setCutModelPath(info.getCutModelPath().replace("/oss/","/swkk/"+info.getNum()+"/wwwroot/"));
+                }
+                if(StringUtils.isNotBlank(info.getSurveillancePath())){
+                    info.setSurveillancePath(info.getSurveillancePath().replace("/oss/","/swkk/"+info.getNum()+"/wwwroot/"));
+                }
+                if(StringUtils.isNotBlank(info.getSceneJsonPath())){
+                    info.setSceneJsonPath(info.getSceneJsonPath().replace("/oss/","/swkk/"+info.getNum()+"/wwwroot/"));
+                }
+                jsonObject.put(basePath+model+sceneData.getModelId(), ResultData.ok(info));
             }
         }
         jsonObject.put(basePath+caseScene+caseId, ResultData.ok(sceneVos));
@@ -353,6 +363,7 @@ public class CaseDownService {
             jsonObject.put(basePath+caseTagPoint+tag.getTagId(), ResultData.ok(caseTagPointService.allList(tag.getTagId())));
             downResources(caseId,tag.getTagImgUrl());
             downResource(caseId,tag.getHotIconUrl());
+            downResource(caseId,tag.getAudio());
         }
 
         jsonObject.put(basePath+casePathInfoUrl+caseId, ResultData.ok(casePathService.getByCaseId(caseId)));
@@ -387,8 +398,13 @@ public class CaseDownService {
         }
         jsonObject.put(basePath+caseImg+caseId, ResultData.ok(caseImgList));
 
-
-        jsonObject.put(basePath+caseAnimationUrl+caseId, ResultData.ok(animationService.getListByCaseId(caseId)));
+        List<CaseAnimation> list = animationService.getListByCaseId(caseId);
+        for (CaseAnimation caseAnimation : list) {
+            if(StringUtils.isNotBlank(caseAnimation.getUrl())){
+                downResource(caseId,caseAnimation.getUrl());
+            }
+        }
+        jsonObject.put(basePath+caseAnimationUrl+caseId, ResultData.ok(list));
         jsonObject.put(basePath+getMapConfig, ResultData.ok(mapConfigService.list()));
 
 

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

@@ -3,6 +3,8 @@ package com.fdkankan.fusion.service;
 import com.fdkankan.fusion.entity.CaseAnimation;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -13,5 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICaseAnimationService extends IService<CaseAnimation> {
 
-    Object getListByCaseId(Integer caseId);
+    List<CaseAnimation> getListByCaseId(Integer caseId);
 }

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

@@ -4,6 +4,7 @@ import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.entity.Model;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.fusion.request.ModelPram;
+import com.fdkankan.fusion.response.SceneVo;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.HashMap;
@@ -37,7 +38,7 @@ public interface IModelService extends IService<Model> {
 
     Model getIsNullNewByNum(String num,Integer type);
 
-    Object getInfo(Integer modelId);
+    SceneVo getInfo(Integer modelId);
 
     String uploadObjProgress(Integer modelId);
 

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

@@ -7,6 +7,8 @@ import com.fdkankan.fusion.service.ICaseAnimationService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -19,7 +21,7 @@ import org.springframework.stereotype.Service;
 public class CaseAnimationServiceImpl extends ServiceImpl<ICaseAnimationMapper, CaseAnimation> implements ICaseAnimationService {
 
     @Override
-    public Object getListByCaseId(Integer caseId) {
+    public List<CaseAnimation> getListByCaseId(Integer caseId) {
         LambdaQueryWrapper<CaseAnimation> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CaseAnimation::getCaseId,caseId);
         return this.list(wrapper);

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

@@ -250,7 +250,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
     }
 
     @Override
-    public Object getInfo(Integer modelId) {
+    public SceneVo getInfo(Integer modelId) {
         Model model = this.getById(modelId);
         if(model == null){
             throw new BusinessException(ResultCode.SCENE_NOT_EXIST);