瀏覽代碼

代码合并

dsx 2 年之前
父節點
當前提交
6cff2ab765

+ 5 - 5
pom.xml

@@ -84,11 +84,11 @@
             <version>3.0.0-SNAPSHOT</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.fdkankan</groupId>
-            <artifactId>4dkankan-utils-rabbitmq</artifactId>
-            <version>3.0.0-SNAPSHOT</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.fdkankan</groupId>-->
+<!--            <artifactId>4dkankan-utils-rabbitmq</artifactId>-->
+<!--            <version>3.0.0-SNAPSHOT</version>-->
+<!--        </dependency>-->
 
         <dependency>
             <groupId>com.fdkankan</groupId>

+ 77 - 77
src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java

@@ -1,77 +1,77 @@
-package com.fdkankan.scene.listener;
-
-import com.alibaba.fastjson.JSON;
-import com.fdkankan.scene.entity.DownloadTourVideo;
-import com.fdkankan.scene.service.IDownloadTourVideoService;
-import com.rabbitmq.client.Channel;
-import java.nio.charset.StandardCharsets;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.core.Message;
-import org.springframework.amqp.rabbit.annotation.Queue;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-/**
- * <p>
- * TODO
- * </p>
- *
- * @author dengsixing
- * @since 2022/4/19
- **/
-@Slf4j
-@Component
-public class RabbitMqListener {
-
-    @Value("${queue.scene.transfer-tour-video}")
-    private String downloadTourVideoQueue;
-
-    @Autowired
-    private IDownloadTourVideoService downloadTourVideoService;
-
-
-
-
-    /**
-     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
-     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
-     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
-     */
-    @RabbitListener(
-        queuesToDeclare = @Queue("${queue.scene.transfer-tour-video}")
-    )
-    public void transferTourVideo(Channel channel, Message message) throws Exception {
-        String messageId = message.getMessageProperties().getMessageId();
-        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, downloadTourVideoQueue, msg);
-        DownloadTourVideo downloadTourVideo = JSON.parseObject(msg, DownloadTourVideo.class);
-        downloadTourVideoService.transferTourVideo(downloadTourVideo);
-        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
-        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-        log.info("结束消费消息,id:{}", messageId);
-    }
-
-    /**
-     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
-     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
-     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
-     */
-    @RabbitListener(
-        queuesToDeclare = @Queue("test_dsx")
-    )
-    public void test(Channel channel, Message message) throws Exception {
-        String messageId = message.getMessageProperties().getMessageId();
-        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "test_dsx", msg);
-        Thread.sleep(10000L);
-        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
-        log.info("结束消费消息,id:{}", messageId);
-    }
-
-
-
-
-}
+//package com.fdkankan.scene.listener;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.fdkankan.scene.entity.DownloadTourVideo;
+//import com.fdkankan.scene.service.IDownloadTourVideoService;
+//import com.rabbitmq.client.Channel;
+//import java.nio.charset.StandardCharsets;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.amqp.core.Message;
+//import org.springframework.amqp.rabbit.annotation.Queue;
+//import org.springframework.amqp.rabbit.annotation.RabbitListener;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * <p>
+// * TODO
+// * </p>
+// *
+// * @author dengsixing
+// * @since 2022/4/19
+// **/
+//@Slf4j
+//@Component
+//public class RabbitMqListener {
+//
+//    @Value("${queue.scene.transfer-tour-video}")
+//    private String downloadTourVideoQueue;
+//
+//    @Autowired
+//    private IDownloadTourVideoService downloadTourVideoService;
+//
+//
+//
+//
+//    /**
+//     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
+//     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
+//     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
+//     */
+//    @RabbitListener(
+//        queuesToDeclare = @Queue("${queue.scene.transfer-tour-video}")
+//    )
+//    public void transferTourVideo(Channel channel, Message message) throws Exception {
+//        String messageId = message.getMessageProperties().getMessageId();
+//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+//        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, downloadTourVideoQueue, msg);
+//        DownloadTourVideo downloadTourVideo = JSON.parseObject(msg, DownloadTourVideo.class);
+//        downloadTourVideoService.transferTourVideo(downloadTourVideo);
+//        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
+//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+//        log.info("结束消费消息,id:{}", messageId);
+//    }
+//
+//    /**
+//     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
+//     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
+//     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
+//     */
+//    @RabbitListener(
+//        queuesToDeclare = @Queue("test_dsx")
+//    )
+//    public void test(Channel channel, Message message) throws Exception {
+//        String messageId = message.getMessageProperties().getMessageId();
+//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+//        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "test_dsx", msg);
+//        Thread.sleep(10000L);
+//        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
+//        log.info("结束消费消息,id:{}", messageId);
+//    }
+//
+//
+//
+//
+//}

+ 0 - 2
src/main/java/com/fdkankan/scene/schedule/ScheduleJob.java

@@ -3,11 +3,9 @@ package com.fdkankan.scene.schedule;
 import com.fdkankan.scene.service.ISceneAsynOperLogService;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
-@RefreshScope
 @Log4j2
 @Component
 public class ScheduleJob {

+ 9 - 18
src/main/java/com/fdkankan/scene/service/impl/BoxModelServiceImpl.java

@@ -13,7 +13,6 @@ import com.fdkankan.common.constant.ServerCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.common.util.OBJToGLBUtil;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.model.utils.ComputerUtil;
@@ -21,6 +20,7 @@ import com.fdkankan.scene.bean.BoxModelBean;
 import com.fdkankan.scene.entity.SceneEditInfo;
 import com.fdkankan.scene.entity.ScenePlus;
 import com.fdkankan.scene.entity.ScenePlusExt;
+import com.fdkankan.scene.oss.OssUtil;
 import com.fdkankan.scene.service.IBoxModelService;
 import com.fdkankan.scene.service.ISceneEditInfoService;
 import com.fdkankan.scene.service.IScenePlusExtService;
@@ -29,20 +29,15 @@ import com.fdkankan.scene.vo.BaseJsonDataParamVO;
 import com.fdkankan.scene.vo.DeleteSidParamVO;
 import com.fdkankan.web.response.ResultData;
 import com.google.common.collect.Lists;
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
 /**
  * <p>
  * TODO
@@ -56,13 +51,13 @@ import org.springframework.web.multipart.MultipartFile;
 public class BoxModelServiceImpl implements IBoxModelService {
 
     @Autowired
-    private FYunFileServiceInterface fYunFileService;
-    @Autowired
     private IScenePlusService scenePlusService;
     @Autowired
     private ISceneEditInfoService sceneEditInfoService;
     @Autowired
     private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private OssUtil ossUtil;
 
     @Override
     public ResultData uploadBoxModel(String num, String sid, MultipartFile file) throws Exception {
@@ -109,7 +104,7 @@ public class BoxModelServiceImpl implements IBoxModelService {
         }
 
         //上传glb
-        fYunFileService.uploadFile(bucket, glbPath, String.format(UploadFilePath.USER_EDIT_PATH, num) + "boxModels/" + sid + ".glb");
+        ossUtil.uploadFile(String.format(UploadFilePath.USER_EDIT_PATH, num) + "boxModels/" + sid + ".glb", glbPath, false);
 
         return ResultData.ok(sid + ".glb");
     }
@@ -197,11 +192,7 @@ public class BoxModelServiceImpl implements IBoxModelService {
             //删除资源文件
             if(CollUtil.isNotEmpty(deleteFile))
                 deleteFile.stream().forEach(key -> {
-                    try {
-                        fYunFileService.deleteFile(bucket, key);
-                    } catch (IOException e) {
-                        log.warn("oss删除文件失败,key:{}", key);
-                    }
+                    ossUtil.deleteObject(key);
                 });
         }else{
             //更新

+ 9 - 13
src/main/java/com/fdkankan/scene/service/impl/DownloadTourVideoServiceImpl.java

@@ -6,27 +6,26 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.model.utils.CreateObjUtil;
-import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.scene.entity.DownloadTourVideo;
 import com.fdkankan.scene.mapper.IDownloadTourVideoMapper;
+import com.fdkankan.scene.oss.OssUtil;
 import com.fdkankan.scene.service.IDownloadTourVideoService;
 import com.fdkankan.scene.vo.DownloadTourVideoVO;
 import com.fdkankan.web.response.ResultData;
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import lombok.SneakyThrows;
 import org.apache.http.HttpHeaders;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
 /**
  * <p>
  * 导览视频转换记录表 服务实现类
@@ -46,10 +45,7 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
     private String bucket;
 
     @Autowired
-    private RabbitMqProducer rabbitMqProducer;
-    @Autowired
-    private FYunFileServiceInterface fYunFileService;
-
+    private OssUtil ossUtil;
 
     @Override
     public DownloadTourVideo getWaitingByNum(String num) {
@@ -94,7 +90,7 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
         this.save(downloadTourVideo);
 
         //发送mq
-        rabbitMqProducer.sendByWorkQueue(downloadTourVideoQueue, downloadTourVideo);
+//        rabbitMqProducer.sendByWorkQueue(downloadTourVideoQueue, downloadTourVideo);
 
         return ResultData.ok();
     }
@@ -116,7 +112,7 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
             String ossPath = String.format(UploadFilePath.DOWNLOADS_TOUR_VIDEO, downloadTourVideo.getNum()) + downloadTourVideo.getFileName();
             Map<String, String> headers = new HashMap<>();
             headers.put(HttpHeaders.CONTENT_TYPE, "application/octet-stream");
-            fYunFileService.uploadFile(bucket, destPath, ossPath, headers);
+            ossUtil.uploadFile(ossPath, destPath, false);
             downloadTourVideo.setDownloadPath(ossPath);
             downloadTourVideo.setState(1);
             this.updateById(downloadTourVideo);

+ 3 - 8
src/main/java/com/fdkankan/scene/service/impl/SceneAsynOperLogServiceImpl.java

@@ -11,9 +11,9 @@ import com.fdkankan.common.constant.CommonStatus;
 import com.fdkankan.common.constant.SceneAsynFuncType;
 import com.fdkankan.common.constant.SceneAsynModuleType;
 import com.fdkankan.common.constant.SceneAsynOperType;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.scene.entity.SceneAsynOperLog;
 import com.fdkankan.scene.mapper.ISceneAsynOperLogMapper;
+import com.fdkankan.scene.oss.OssUtil;
 import com.fdkankan.scene.service.ISceneAsynOperLogService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.scene.vo.SceneAsynOperLogParamVO;
@@ -39,8 +39,7 @@ import org.springframework.stereotype.Service;
 public class SceneAsynOperLogServiceImpl extends ServiceImpl<ISceneAsynOperLogMapper, SceneAsynOperLog> implements ISceneAsynOperLogService {
 
     @Autowired
-    private FYunFileServiceInterface fYunFileService;
-
+    private OssUtil ossUtil;
 
     @Override
     public ResultData getAsynOperLog(SceneAsynOperLogParamVO param) {
@@ -106,11 +105,7 @@ public class SceneAsynOperLogServiceImpl extends ServiceImpl<ISceneAsynOperLogMa
 
         deleteList.parallelStream().forEach(item -> {
             if(StrUtil.isNotEmpty(item.getUrl())){
-                try {
-                    fYunFileService.deleteFile(item.getUrl());
-                } catch (IOException e) {
-                    log.warn("删除oss全景图下载压缩包失败,key:{}", item.getUrl());
-                }
+                ossUtil.deleteObject(item.getUrl());
             }
         });
 

+ 46 - 139
src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -1,14 +1,4 @@
 package com.fdkankan.scene.service.impl;
-import cn.hutool.core.net.multipart.UploadFile;
-import cn.hutool.core.util.CharsetUtil;
-import com.fdkankan.common.constant.CommonOperStatus;
-import com.fdkankan.common.constant.SceneAsynFuncType;
-import com.fdkankan.common.constant.SceneAsynModuleType;
-import com.fdkankan.common.constant.SceneAsynOperType;
-import com.fdkankan.common.util.MD5;
-import com.fdkankan.scene.vo.SaveFiltersParamVO;
-import io.opencensus.metrics.LongGauge;
-import java.util.Date;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
@@ -21,114 +11,39 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.CommonStatus;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.constant.FileBizType;
-import com.fdkankan.common.constant.OperationType;
-import com.fdkankan.common.constant.SceneInfoReqType;
-import com.fdkankan.common.constant.ServerCode;
+import com.fdkankan.common.constant.*;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.model.utils.CreateHouseJsonUtil;
 import com.fdkankan.model.utils.CreateObjUtil;
-import com.fdkankan.common.util.FileMd5Util;
-import com.fdkankan.common.util.FileUtils;
-import com.fdkankan.fyun.constant.FYunTypeEnum;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
-import com.fdkankan.model.constants.ConstantFilePath;
-import com.fdkankan.model.constants.UploadFilePath;
-import com.fdkankan.model.utils.ComputerUtil;
-import com.fdkankan.model.utils.CreateHouseJsonUtil;
-import com.fdkankan.model.utils.CreateObjUtil;
-import com.fdkankan.model.utils.SceneUtil;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.constant.RedisLockKey;
 import com.fdkankan.redis.util.RedisLockUtil;
 import com.fdkankan.redis.util.RedisUtil;
-import com.fdkankan.scene.bean.BoxPhotoBean;
-import com.fdkankan.scene.bean.LaserSceneBean;
-import com.fdkankan.scene.bean.PointBean;
-import com.fdkankan.scene.bean.SceneJsonBean;
-import com.fdkankan.scene.bean.SegmentBean;
-import com.fdkankan.scene.bean.StyleBean;
-import com.fdkankan.scene.bean.TagBean;
-import com.fdkankan.scene.bean.VertexBean;
-import com.fdkankan.scene.bean.WallBean;
-import com.fdkankan.scene.entity.CameraDetail;
-import com.fdkankan.scene.entity.Company;
-import com.fdkankan.scene.entity.SceneAsynOperLog;
-import com.fdkankan.scene.entity.SceneDataDownload;
-import com.fdkankan.scene.entity.SceneEditControls;
-import com.fdkankan.scene.entity.SceneEditInfo;
-import com.fdkankan.scene.entity.SceneEditInfoExt;
-import com.fdkankan.scene.entity.ScenePlus;
-import com.fdkankan.scene.entity.ScenePlusExt;
+import com.fdkankan.scene.bean.*;
+import com.fdkankan.scene.entity.*;
 import com.fdkankan.scene.mapper.ISceneEditInfoMapper;
 import com.fdkankan.scene.oss.OssUtil;
-import com.fdkankan.scene.service.ILaserService;
-import com.fdkankan.scene.service.ICameraDetailService;
-import com.fdkankan.scene.service.ICompanyService;
-import com.fdkankan.scene.service.ISceneAsynOperLogService;
-import com.fdkankan.scene.service.ISceneDataDownloadService;
-import com.fdkankan.scene.service.ISceneEditControlsService;
-import com.fdkankan.scene.service.ISceneEditInfoExtService;
-import com.fdkankan.scene.service.ISceneEditInfoService;
-import com.fdkankan.scene.service.IScenePlusExtService;
-import com.fdkankan.scene.service.IScenePlusService;
-import com.fdkankan.scene.service.ISceneProService;
-import com.fdkankan.scene.service.ISceneUploadService;
-import com.fdkankan.scene.service.ISurveillanceService;
-import com.fdkankan.scene.vo.BallScreenVideoParamVO;
-import com.fdkankan.scene.vo.BaseDataParamVO;
-import com.fdkankan.scene.vo.BaseFileParamVO;
-import com.fdkankan.scene.vo.BaseSceneParamVO;
-import com.fdkankan.scene.vo.DeleteFileParamVO;
-import com.fdkankan.scene.vo.DeleteLinkPanParamVO;
-import com.fdkankan.scene.vo.DeleteLinkSceneStylesParamVO;
-import com.fdkankan.scene.vo.DeleteMosaicParamVO;
-import com.fdkankan.scene.vo.DeleteSidParamVO;
-import com.fdkankan.scene.vo.DownloadVO;
-import com.fdkankan.scene.vo.FileNameAndDataParamVO;
-import com.fdkankan.scene.vo.RenameCadParamVO;
-import com.fdkankan.scene.vo.SaveLinkPanParamVO;
-import com.fdkankan.scene.vo.SceneCheckKeyParamVO;
-import com.fdkankan.scene.vo.SceneEditControlsVO;
-import com.fdkankan.scene.vo.SceneEditInfoParamVO;
-import com.fdkankan.scene.vo.SceneEditInfoVO;
-import com.fdkankan.scene.vo.SceneInfoParamVO;
-import com.fdkankan.scene.vo.SceneInfoVO;
-import com.fdkankan.web.response.ResultData;
-import com.fdkankan.scene.vo.SurveillanceVO;
-import com.fdkankan.scene.vo.UploadPanoramaVO;
+import com.fdkankan.scene.service.*;
+import com.fdkankan.scene.vo.*;
 import com.fdkankan.web.response.ResultData;
 import com.google.common.collect.Lists;
 import com.google.errorprone.annotations.Var;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
 
 /**
  * <p>
@@ -142,7 +57,6 @@ import org.springframework.web.multipart.MultipartFile;
 @Service
 public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper, SceneEditInfo> implements ISceneEditInfoService {
 
-    @Value("${ecs.checkFile.maxTimes:5}")
     @Value("${fyun.host}")
     private String ossUrlPrefix;
     @Value("${fyun.type}")
@@ -175,7 +89,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
     @Autowired
     private ILaserService laserService;
 
-    private ICompanyService companyService;
     @Autowired
     private ISurveillanceService surveillanceService;
     @Autowired
@@ -345,40 +258,34 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
 
         scenePlus.setTitle(sceneEditInfo.getTitle());
         scenePlus.setDescription(sceneEditInfo.getDescription());
-        scenePlus.setHouseType(this.existsHouseType(bucket, num));
+//        scenePlus.setHouseType(this.existsHouseType(bucket, num));
         scenePlusService.updateById(scenePlus);
 
         return ResultData.ok();
     }
 
-    private int existsHouseType(String bucket, String num){
-        String houseTypePath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
-        boolean exist = fYunFileService.fileExist(bucket, houseTypePath);
-        return exist ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue();
-    }
-
     private void publicSurveillance(String num, Integer surveillances, String bucket) throws IOException {
         String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
         if(surveillances == CommonStatus.NO.code().intValue()){
-            fYunFileService.deleteFile(bucket, surveillanceJsonPath);
+            ossUtil.deleteObject(surveillanceJsonPath);
             return;
         }
         List<SurveillanceVO> surveillanceList = surveillanceService.listSurveillance(num);
-        fYunFileService.uploadFile(bucket, JSON.toJSONString(surveillanceList).getBytes(StandardCharsets.UTF_8), surveillanceJsonPath);
+        ossUtil.uploadFileBytes(surveillanceJsonPath, JSON.toJSONString(surveillanceList).getBytes(StandardCharsets.UTF_8));
     }
 
     private void publicFilterData(String num, int filters, String bucket) throws IOException {
 
         String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
         if(filters == CommonStatus.NO.code()){
-            fYunFileService.deleteFile(bucket, userEditPath + "filter.json");
+            ossUtil.deleteObject(userEditPath + "filter.json");
             return;
         }
         String key = String.format(RedisKey.SCENE_filter_DATA, num);
         List<String> list = redisUtil.lGet(key, 0, -1);
         JSONArray jsonArray = new JSONArray();
         list.stream().forEach(str->jsonArray.add(JSON.parseObject(str)));
-        fYunFileService.uploadFile(bucket, JSON.toJSONBytes(jsonArray), userEditPath + "filter.json");
+        ossUtil.uploadFileBytes(userEditPath + "filter.json", JSON.toJSONBytes(jsonArray));
     }
 
     public void publicLinkSceneData(String num, String bucket) throws IOException {
@@ -388,8 +295,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
 
         //清除发布目录中的场景关联图片
-        if(fYunFileService.fileExist(bucket,imgViewPath + "panorama")){
-            fYunFileService.deleteFolder(bucket,imgViewPath + "panorama");
+        if(ossUtil.doesObjectExist(imgViewPath + "panorama")){
+            ossUtil.deleteObject(imgViewPath + "panorama");
         }
 
         //生成links.json并上传到发布目录
@@ -433,7 +340,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         }
 
         String hotJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, sceneNum) + "hot.json";
-        ossUtil.uploadFileBytes(hotJsonPath, jsonhots.toString().getBytes(StandardCharsets.UTF_8));
+        ossUtil.uploadFileBytes(hotJsonPath, tags.toString().getBytes(StandardCharsets.UTF_8));
 //        this.saveTagsToSceneEditInfo(sceneNum, sceneEditInfo);
 
     }
@@ -532,32 +439,32 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         sceneInfoVO.setBoxVideos(JSON.toJSONString(boxVideoList));
     }
 
-    /**
-     * <p>
-            getInfo接口返回字段扩展
-     * </p>
-     * @author dengsixing
-     * @date 2022/3/9
-     **/
-    private void setExtData(SceneInfoVO sceneInfoVO, Long cameraId) throws Exception{
-
-        if(Objects.isNull(cameraId)){
-            return;
-        }
-
-        CameraDetail cameraDetail = cameraDetailService.findByCameraId(cameraId);
-        if(Objects.isNull(cameraDetail)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
-        }
-        if(Objects.isNull(cameraDetail.getCompanyId())){
-            return;
-        }
-        Company company = companyService.getById(cameraDetail.getCompanyId());
-        if(Objects.isNull(company)){
-            return;
-        }
-        sceneInfoVO.setDataSync(company.getDataSync());
-    }
+//    /**
+//     * <p>
+//            getInfo接口返回字段扩展
+//     * </p>
+//     * @author dengsixing
+//     * @date 2022/3/9
+//     **/
+//    private void setExtData(SceneInfoVO sceneInfoVO, Long cameraId) throws Exception{
+//
+//        if(Objects.isNull(cameraId)){
+//            return;
+//        }
+//
+//        CameraDetail cameraDetail = cameraDetailService.findByCameraId(cameraId);
+//        if(Objects.isNull(cameraDetail)){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
+//        }
+//        if(Objects.isNull(cameraDetail.getCompanyId())){
+//            return;
+//        }
+//        Company company = companyService.getById(cameraDetail.getCompanyId());
+//        if(Objects.isNull(company)){
+//            return;
+//        }
+//        sceneInfoVO.setDataSync(company.getDataSync());
+//    }
 
     /**
      * <p>

+ 1 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneEditServiceImpl.java

@@ -34,6 +34,7 @@ import java.util.List;
 import java.util.Objects;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 

+ 18 - 46
src/main/java/com/fdkankan/scene/service/impl/ScenePlusServiceImpl.java

@@ -3,67 +3,43 @@ package com.fdkankan.scene.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
 import cn.hutool.extra.qrcode.QrCodeUtil;
 import cn.hutool.extra.qrcode.QrConfig;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.constant.PayStatus;
-import com.fdkankan.common.constant.SceneKind;
-import com.fdkankan.common.constant.SceneSource;
-import com.fdkankan.common.constant.SceneStatus;
-import com.fdkankan.common.constant.SceneType;
+import com.fdkankan.common.constant.*;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
-import com.fdkankan.scene.bean.LaserSceneBean;
-import com.fdkankan.scene.bean.SceneJsonBean;
-import com.fdkankan.scene.config.FdkkLaserConfig;
-import com.fdkankan.scene.entity.SceneEditControls;
-import com.fdkankan.scene.entity.SceneEditInfoExt;
-import com.fdkankan.scene.oss.OssUtil;
-import com.fdkankan.scene.service.ISceneEditControlsService;
-import com.fdkankan.scene.service.ISceneEditInfoExtService;
-import com.fdkankan.scene.vo.SceneEditControlsVO;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
-import com.fdkankan.model.constants.ConstantFilePath;
-import com.fdkankan.model.constants.UploadFilePath;
-import com.fdkankan.scene.entity.SceneEditInfoExt;
-import com.fdkankan.scene.entity.ScenePro;
-import com.fdkankan.scene.service.ISceneEditInfoExtService;
-import com.fdkankan.scene.service.ISceneProService;
-import com.fdkankan.web.response.ResultData;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.constant.RedisLockKey;
 import com.fdkankan.redis.util.RedisLockUtil;
 import com.fdkankan.redis.util.RedisUtil;
-import com.fdkankan.scene.entity.SceneDataDownload;
-import com.fdkankan.scene.entity.SceneEditInfo;
-import com.fdkankan.scene.entity.ScenePlus;
-import com.fdkankan.scene.entity.ScenePlusExt;
+import com.fdkankan.scene.bean.LaserSceneBean;
+import com.fdkankan.scene.bean.SceneJsonBean;
+import com.fdkankan.scene.config.FdkkLaserConfig;
+import com.fdkankan.scene.entity.*;
 import com.fdkankan.scene.mapper.IScenePlusMapper;
-import com.fdkankan.scene.service.ISceneDataDownloadService;
-import com.fdkankan.scene.service.ISceneEditInfoService;
-import com.fdkankan.scene.service.IScenePlusExtService;
-import com.fdkankan.scene.service.IScenePlusService;
-import com.fdkankan.scene.vo.BaseSceneParamVO;
+import com.fdkankan.scene.oss.OssUtil;
+import com.fdkankan.scene.service.*;
 import com.fdkankan.scene.vo.SceneCheckKeyParamVO;
 import com.fdkankan.scene.vo.SceneDataDownloadVO;
+import com.fdkankan.scene.vo.SceneEditControlsVO;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
 import java.nio.charset.StandardCharsets;
-import java.io.File;
 import java.util.List;
 import java.util.Objects;
 import java.util.UUID;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
 
 /**
  * <p>
@@ -105,10 +81,6 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
 
     @Autowired
     private ISceneProService sceneProService;
-    @Autowired
-    private FYunFileServiceInterface fYunFileService;
-    @Autowired
-    private ISceneEditInfoExtService sceneEditInfoExtService;
 
     @Override
     public ScenePlus getScenePlusByNum(String num) {
@@ -254,11 +226,11 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
         QrCodeUtil.generate(webSize + "&lang=en", QrConfig.create().setImg(logoPath).setWidth(512).setHeight(512), FileUtil.file(outPathEn));
         //上传logo图片
         String ossLogoPath = String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + "shareLogo" + extName;
-        fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), logoPath, ossLogoPath);
+        ossUtil.uploadFile(ossLogoPath, logoPath, false);
 
         //上传二维码
-        fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + ".png");
-        fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + "_en.png");
+        ossUtil.uploadFile(String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + ".png", outPathZh, false);
+        ossUtil.uploadFile(String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + "_en.png", outPathEn, false);
 
         sceneEditInfoExt.setShareLogoImg(ossLogoPath);
         sceneEditInfoExtService.updateById(sceneEditInfoExt);

+ 108 - 121
src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -2,8 +2,8 @@ package com.fdkankan.scene.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.util.RuntimeUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ZipUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -14,7 +14,6 @@ import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.FileBizType;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.FileUtils;
-import com.fdkankan.common.constant.*;
 import com.fdkankan.model.constants.ConstantFileName;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
@@ -28,48 +27,31 @@ import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.scene.bean.IconBean;
 import com.fdkankan.scene.bean.LaserSceneBean;
 import com.fdkankan.scene.bean.TagBean;
-import com.fdkankan.scene.constant.LaserApiConstant;
 import com.fdkankan.scene.entity.SceneEditInfo;
 import com.fdkankan.scene.entity.ScenePlus;
 import com.fdkankan.scene.entity.ScenePlusExt;
 import com.fdkankan.scene.entity.ScenePro;
 import com.fdkankan.scene.mapper.ISceneProMapper;
 import com.fdkankan.scene.oss.OssUtil;
-import com.fdkankan.scene.service.ILaserService;
-import com.fdkankan.scene.service.ISceneDataDownloadService;
-import com.fdkankan.scene.service.ISceneEditControlsService;
-import com.fdkankan.scene.service.ISceneEditInfoService;
-import com.fdkankan.scene.service.IScenePlusExtService;
-import com.fdkankan.scene.service.IScenePlusService;
-import com.fdkankan.scene.service.ISceneProService;
-import com.fdkankan.scene.service.ISceneUploadService;
-import com.fdkankan.scene.util.forest.HttpClient;
-import com.fdkankan.scene.vo.BaseDataParamVO;
-import com.fdkankan.scene.vo.DeleteFileParamVO;
-import com.fdkankan.scene.vo.DeleteHotIconParamVO;
-import com.fdkankan.scene.vo.DeleteHotParamVO;
-import com.fdkankan.scene.vo.FileNameAndDataParamVO;
-import com.fdkankan.scene.vo.HotParamVO;
-import com.fdkankan.scene.vo.SaveTagsParamVO;
-import com.fdkankan.scene.vo.SaveTagsVisibleParamVO;
+import com.fdkankan.scene.service.*;
+import com.fdkankan.scene.vo.*;
 import com.fdkankan.web.response.ResultData;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
 import lombok.extern.slf4j.Slf4j;
-import org.redisson.Redisson;
-import org.redisson.RedissonLock;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  * pro场景表 服务实现类
@@ -235,7 +217,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
     private void deleteHotDataFromTourJson(String num, List<String> sidList, String bucket){
         String key = String.format(UploadFilePath.USER_EDIT_PATH, num) + "tour.json";
-        String tourJson = fYunFileService.getFileContent(bucket, key);
+        String tourJson = ossUtil.getFileContent(key);
         if(StrUtil.isEmpty(tourJson)){
             return;
         }
@@ -254,7 +236,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                 }
             });
         });
-        fYunFileService.uploadFile(bucket, jsonArray.toJSONString().getBytes(StandardCharsets.UTF_8), key);
+        ossUtil.uploadFileBytes(key, jsonArray.toJSONString().getBytes(StandardCharsets.UTF_8));
 
     }
 
@@ -747,39 +729,44 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 //        return ResultData.ok();
 //    }
 
-    /**
-     * 老算法(dam)上传模型逻辑
-     * @param num
-     * @param bucket
-     * @param dataSource
-     * @param buildType
-     * @throws Exception
-     */
-    private void buildModel4Dam(String num, String bucket, String dataSource, String buildType, MultipartFile file) throws Exception {
-        //文件上传的位置可以自定义
-        String path = dataSource + "_obj2txt";
-        String zipPath = path + "/zip/";
-        String filePath =  path + "/extras/";
-        String resultPath = path + "/results/";
-
-        //压缩文件处理:解压缩,解压缩后复制等操作
-        this.objAndImgFileHandler(resultPath, filePath, zipPath, file);
-
-        //创建data.json
-        this.writeDataJson(path);
-
-        //调用算法,不同的类型调用不同的算法
-        if("V2".equals(buildType)){
-            CreateObjUtil.objToTxt(path , "1");
-        }
-        if("V3".equals(buildType)){
-            CreateObjUtil.build3dModel(path , "1");
-        }
-
-        //算法计算完后,生成压缩文件,上传到oss
-        this.uploadFileofterRebuildPanoram(path, filePath, num, bucket);
+    @Override
+    public ScenePro getByNum(String num) {
+        return this.getOne(new LambdaQueryWrapper<ScenePro>().eq(ScenePro::getNum, num));
     }
 
+//    /**
+//     * 老算法(dam)上传模型逻辑
+//     * @param num
+//     * @param bucket
+//     * @param dataSource
+//     * @param buildType
+//     * @throws Exception
+//     */
+//    private void buildModel4Dam(String num, String bucket, String dataSource, String buildType, MultipartFile file) throws Exception {
+//        //文件上传的位置可以自定义
+//        String path = dataSource + "_obj2txt";
+//        String zipPath = path + "/zip/";
+//        String filePath =  path + "/extras/";
+//        String resultPath = path + "/results/";
+//
+//        //压缩文件处理:解压缩,解压缩后复制等操作
+//        this.objAndImgFileHandler(resultPath, filePath, zipPath, file);
+//
+//        //创建data.json
+//        this.writeDataJson(path);
+//
+//        //调用算法,不同的类型调用不同的算法
+//        if("V2".equals(buildType)){
+//            CreateObjUtil.objToTxt(path , "1");
+//        }
+//        if("V3".equals(buildType)){
+//            CreateObjUtil.build3dModel(path , "1");
+//        }
+//
+//        //算法计算完后,生成压缩文件,上传到oss
+//        this.uploadFileofterRebuildPanoram(path, filePath, num, bucket);
+//    }
+
     /**
      * 新算法(3dtiles)上传模型逻辑
      * @param num
@@ -833,7 +820,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         });
 
         //读取oss上的floors.jsoon用于校验用户上传的模型楼层数是否一一对应
-        String ossFloorsJson = fYunFileService.getFileContent(bucket, String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh/floors.json");
+        String ossFloorsJson = ossUtil.getFileContent(String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh/floors.json");
         JSONObject orginFloorsJsonObj = JSON.parseObject(ossFloorsJson);
         JSONArray orginFloorArr = orginFloorsJsonObj.getJSONArray("floors");
         Set<String> orginFloorNameSet = orginFloorArr.stream().map(item -> {
@@ -870,69 +857,69 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
         //算法计算完后,生成压缩文件,上传到oss
         //上传3dtiles
-        fYunFileService.deleteFolder(bucket, String.format(UploadFilePath.IMG_VIEW_PATH, num) + "3dtiles");
-        fYunFileService.uploadFileByCommand(bucket, tilesPath, String.format(UploadFilePath.IMG_VIEW_PATH, num) + "3dtiles");
+        ossUtil.deleteObject(String.format(UploadFilePath.IMG_VIEW_PATH, num) + "3dtiles");
+        ossUtil.uploadFileDirCmd(tilesPath, String.format(UploadFilePath.IMG_VIEW_PATH, num) + "3dtiles", false);
         //上传mesh
-        fYunFileService.deleteFolder(bucket, String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh");
-        fYunFileService.uploadFileByCommand(bucket, meshPath, String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh");
+        ossUtil.deleteObject(String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh");
+        ossUtil.uploadFileDirCmd(meshPath, String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mesh", false);
 
     }
 
-    private void uploadFileofterRebuildPanoram(String path, String filePath, String sceneNum, String bucket) throws Exception {
-        //因为共享目录有延迟,这里循环检测算法是否计算完毕3次,每次隔五秒
-        String uploadJsonPath = path + File.separator + "results" +File.separator+"upload.json";
-        boolean exist = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
-        if(!exist){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
-        }
-        String uploadData = FileUtils.readFile(uploadJsonPath);
-        JSONObject uploadJson = null;
-        JSONArray array = null;
-        if(uploadData!=null) {
-            uploadJson = JSONObject.parseObject(uploadData);
-            array = uploadJson.getJSONArray("upload");
-        }
-
-        Map<String,String> map = new HashMap<String,String>();
-        JSONObject fileJson = null;
-        String fileName = "";
-        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
-        for(int i = 0, len = array.size(); i < len; i++) {
-            fileJson = array.getJSONObject(i);
-            fileName = fileJson.getString("file");
-            //文件不存在抛出异常
-            if (!new File(path + File.separator + "results" + File.separator + fileName).exists()) {
-                throw new Exception(path + File.separator + "results" + File.separator + fileName + "文件不存在");
-            }
-
-            //tex文件夹
-            if (fileJson.getIntValue("clazz") == 15) {
-                map.put(path + File.separator + "results" + File.separator + fileName,
-                    imgViewPath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
-                continue;
-            }
-        }
-
-        String damPath = path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k.dam";
-        CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"modeldata.txt", damPath);
-        boolean existDam = ComputerUtil.checkComputeCompleted(damPath, 5, 2);
-        if(!existDam){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
-        }
-//        CreateObjUtil.convertDamToLzma(path + File.separator + "results");
-//        CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"modeldata.txt", path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k.dam");
-//        map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma", imgViewPath +ConstantFileName.modelUUID+"_50k.dam.lzma");
-        map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam", imgViewPath+ConstantFileName.modelUUID+"_50k.dam");
-
-        String ossMeshPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum) + "mesh";
-        //删除oss中的mesh
-        fYunFileService.deleteFolder(bucket, ossMeshPath);
-        //上传obj相关文件
-        List<String> fileNames = FileUtil.listFileNames(filePath);
-        fileNames.stream().forEach(name->map.put(filePath + name, ossMeshPath + File.separator + name));
-
-        fYunFileService.uploadMulFiles(bucket, map);
-    }
+//    private void uploadFileofterRebuildPanoram(String path, String filePath, String sceneNum, String bucket) throws Exception {
+//        //因为共享目录有延迟,这里循环检测算法是否计算完毕3次,每次隔五秒
+//        String uploadJsonPath = path + File.separator + "results" +File.separator+"upload.json";
+//        boolean exist = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
+//        if(!exist){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
+//        }
+//        String uploadData = FileUtils.readFile(uploadJsonPath);
+//        JSONObject uploadJson = null;
+//        JSONArray array = null;
+//        if(uploadData!=null) {
+//            uploadJson = JSONObject.parseObject(uploadData);
+//            array = uploadJson.getJSONArray("upload");
+//        }
+//
+//        Map<String,String> map = new HashMap<String,String>();
+//        JSONObject fileJson = null;
+//        String fileName = "";
+//        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
+//        for(int i = 0, len = array.size(); i < len; i++) {
+//            fileJson = array.getJSONObject(i);
+//            fileName = fileJson.getString("file");
+//            //文件不存在抛出异常
+//            if (!new File(path + File.separator + "results" + File.separator + fileName).exists()) {
+//                throw new Exception(path + File.separator + "results" + File.separator + fileName + "文件不存在");
+//            }
+//
+//            //tex文件夹
+//            if (fileJson.getIntValue("clazz") == 15) {
+//                map.put(path + File.separator + "results" + File.separator + fileName,
+//                    imgViewPath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
+//                continue;
+//            }
+//        }
+//
+//        String damPath = path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k.dam";
+//        CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"modeldata.txt", damPath);
+//        boolean existDam = ComputerUtil.checkComputeCompleted(damPath, 5, 2);
+//        if(!existDam){
+//            throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
+//        }
+////        CreateObjUtil.convertDamToLzma(path + File.separator + "results");
+////        CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"modeldata.txt", path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k.dam");
+////        map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma", imgViewPath +ConstantFileName.modelUUID+"_50k.dam.lzma");
+//        map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam", imgViewPath+ConstantFileName.modelUUID+"_50k.dam");
+//
+//        String ossMeshPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum) + "mesh";
+//        //删除oss中的mesh
+//        ossUtil.deleteObject(ossMeshPath);
+//        //上传obj相关文件
+//        List<String> fileNames = FileUtil.listFileNames(filePath);
+//        fileNames.stream().forEach(name->map.put(filePath + name, ossMeshPath + File.separator + name));
+//
+//        ossUtil.uploadMulFiles(bucket, map);
+//    }
 
     private void writeDataJson(String path) throws IOException {
         JSONObject dataJson = new JSONObject();