Explorar el Código

修改文件上传逻辑

tianboguang hace 2 años
padre
commit
faf1fd7678

+ 3 - 3
src/main/java/com/fdkankan/modeling/job/EcsJob.java

@@ -1,7 +1,7 @@
 package com.fdkankan.modeling.job;
 
 import com.fdkankan.modeling.constants.SysConstants;
-import com.fdkankan.rubbersheeting.RubberSheetingUtil;
+import com.fdkankan.rubbersheeting.ScalingService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +19,7 @@ public class EcsJob {
     private static final Logger log = LoggerFactory.getLogger(EcsJob.class);
 
     @Autowired
-    private RubberSheetingUtil rubberSheetingUtil;
+    private ScalingService scalingService;
 
     @PostConstruct
     public void deleteEcs() {
@@ -58,7 +58,7 @@ public class EcsJob {
                         int tryTimes = -1;
                         do {
                             tryTimes++;
-                            result = rubberSheetingUtil.deleteEcs(SysConstants.hostName);
+                            result = scalingService.deleteEcs(SysConstants.hostName);
                             if (ObjectUtils.isEmpty(result)) {
                                 int time = new Random().nextInt(10) + 30;
                                 log.error("{} 关闭弹性伸缩失败,{}秒后重试", SysConstants.hostName, time);

+ 3 - 24
src/main/java/com/fdkankan/modeling/receiver/RabbitMqListener.java

@@ -197,7 +197,6 @@ public class RabbitMqListener {
 
         String dataPath = "data/data" + num;//老版本文件路径
 
-        Map<String,String> map = null;
         Integer pushChannel = null;
         String pushToken = null;
         Integer videoVersion = null;
@@ -230,7 +229,7 @@ public class RabbitMqListener {
             //生成project.json和data.json供算法部使用
             ComputerUtil.createJson(path, splitType, skyboxType, dataDescribe, num, path);
             //计算模型并返回需要上传oss的文件集合
-            map = ComputerUtil.computer(num, path, buildType);
+            ComputerUtil.computer(num, path, buildType);
 
         } else {
 
@@ -254,9 +253,7 @@ public class RabbitMqListener {
             this.deleteCachesAndResult(path);
 
             //v2版本使用4k算法
-            if(dataJson.containsKey("videoVersion")
-                && StringUtils.isNotEmpty(dataJson.getString("videoVersion"))
-                && Integer.parseInt(dataJson.getString("videoVersion")) < 4){
+            if (!ObjectUtils.isEmpty(dataJson.getInteger("videoVersion")) && dataJson.getIntValue("videoVersion") < 4) {
                 skyboxType = "SKYBOX_V6";
             }
 
@@ -264,43 +261,25 @@ public class RabbitMqListener {
             log.info("path:" + path);
             ComputerUtil.createJson(path, splitType, skyboxType, dataDescribe, num, path);
             //计算模型并返回需要上传oss的文件集合
-            map = ComputerUtil.computer(num, path, buildType);
+            ComputerUtil.computer(num, path, buildType);
             //计算完成时间
             log.info("计算完成耗时:{}",computeTime);
 
-            if(Integer.parseInt(cameraType) == 5 || Integer.parseInt(cameraType) == 6){
-                map.put(path + File.separator + "capture/stitch_params.txt", dataPath + "/stitch_params.txt");
-            }
-            map.put(path + File.separator + "capture/Up.xml", dataPath + "/Up.xml");
-            map.put(path + File.separator + "capture/Up2.xml", dataPath + "/Up2.xml");
-
-            //转台相机
-            if(Integer.parseInt(cameraType) == 13){
-                map.put(path + File.separator + "capture/Up.txt", dataPath + "/Up.txt");
-                map.put(path + File.separator + "capture/Up2.txt", dataPath + "/Up2.txt");
-            }
-
             //计算已使用容量
             payStatus = 1;
 
             log.info("八目上完oss结束修改数据:"+num);
 
-            //读取计算结果文件生成videosJson
-            String videoVersionStr = dataJson.getString("videoVersion");
-            videoVersion = StrUtil.isEmpty(videoVersionStr) ? null : Integer.parseInt(videoVersionStr);
-
             //计算成功  激光转台相机 同步 请求
             this.syncLaserSystem(message);
         }
 
         buildSceneResult.setFileId(fileId);
         buildSceneResult.setPayStatus(payStatus);
-        buildSceneResult.setUploadMap(map);
         buildSceneResult.setPath(path);
         buildSceneResult.setPushChannel(pushChannel);
         buildSceneResult.setPushToken(pushToken);
         buildSceneResult.setPrefix(prefix);
-        buildSceneResult.setVideoVersion(videoVersion);
 
         CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");