瀏覽代碼

修改文件上传逻辑

tianboguang 3 年之前
父節點
當前提交
181bdc208d

+ 19 - 13
pom.xml

@@ -18,7 +18,7 @@
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-common-utils</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
       <exclusions>
         <exclusion>
           <groupId>com.google.protobuf</groupId>
@@ -61,7 +61,7 @@
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-db</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.yaml</groupId>
@@ -71,31 +71,25 @@
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-rabbitmq</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
     </dependency>
 
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-dingtalk</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
     </dependency>
 
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-app-push</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
     </dependency>
 
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-redis</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fdkankan</groupId>
-      <artifactId>4dkankan-utils-fyun</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
     </dependency>
 
     <dependency>
@@ -106,7 +100,7 @@
     <dependency>
       <groupId>com.fdkankan</groupId>
       <artifactId>4dkankan-utils-rubber-sheeting</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>3.0.0-SNAPSHOT</version>
     </dependency>
 
     <!-- https://mvnrepository.com/artifact/com.alibaba.cloud/spring-cloud-starter-alibaba-nacos-discovery -->
@@ -137,6 +131,18 @@
       <artifactId>spring-boot-starter-web</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>com.fdkankan</groupId>
+      <artifactId>4dkankan-utils-fyun-s3</artifactId>
+      <version>3.0.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fdkankan</groupId>
+      <artifactId>4dkankan-utils-fyun-oss</artifactId>
+      <version>3.0.0-SNAPSHOT</version>
+    </dependency>
+
   </dependencies>
   <build>
     <plugins>

+ 48 - 52
src/main/java/com/fdkankan/contro/service/impl/BuildScenePostServiceImpl.java

@@ -10,15 +10,17 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.*;
-import com.fdkankan.common.util.FileUtil;
-import com.fdkankan.common.util.FileUtils;
-import com.fdkankan.common.util.MatrixToImageWriterUtil;
+import com.fdkankan.common.util.*;
+import com.fdkankan.contro.bean.PointBean;
+import com.fdkankan.contro.bean.SegmentBean;
+import com.fdkankan.contro.bean.VertexBean;
+import com.fdkankan.contro.bean.WallBean;
 import com.fdkankan.contro.bean.*;
 import com.fdkankan.contro.entity.*;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.vo.SceneEditControlsVO;
-import com.fdkankan.fyun.constant.StorageType;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
+import com.fdkankan.fyun.constant.FYunTypeEnum;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.push.PushMessageConfig;
 import com.fdkankan.push.PushMsgUtil;
 import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
@@ -32,7 +34,6 @@ import org.springframework.stereotype.Service;
 
 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;
@@ -71,8 +72,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
     @Autowired
     private ISceneEditControlsService sceneEditControlsService;
     @Autowired
-    private UploadToOssUtil uploadToOssUtil;
-
+    private FYunFileServiceInterface fYunFileService;
     @Autowired
     private RedisUtil redisUtil;
     @Autowired
@@ -124,8 +124,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
 
             if(cameraType < 3){
                 this.updateDb4Sm(sceneCode, space);
-
-                uploadToOssUtil.uploadMulFiles(uploadFiles);
+                fYunFileService.uploadMulFiles(uploadFiles);
                 return;
             }
 
@@ -155,25 +154,42 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
             //生成新的分享的二维码-英文版本
             MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneCode + "&lang=en", outPathEn, false, null);
             //上传二维码
-            uploadToOssUtil.upload(outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + ".png");
-            uploadToOssUtil.upload(outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + "_en.png");
+            fYunFileService.uploadFile(outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + ".png");
+            fYunFileService.uploadFile(outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + "_en.png");
 
             Map<String, String> newUploadFiles = this.uploadFileMapHandler(sceneCode, cameraType, uploadFiles);
 
             //上传全景图俯视图
             this.uploadFloorCad(path, sceneCode, newUploadFiles);
 
+            Map<String,String> visionTxtPath = new HashMap<>();
+
+            // dam 文件设置请求头
+            newUploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("vision.modeldata"))
+                    .forEach(entry-> {
+                        try {
+                            log.info("开始转换 vision.modeldata");
+                            visionTxtPath.put(entry.getKey().replace("vision.modeldata","vision.txt"),entry.getValue().replace("vision.modeldata","vision.txt"));
+                            ConvertCommonUtils.convertVisionModelDataToTxt(entry.getKey(),entry.getKey().replace("vision.modeldata","vision.txt"));
+                        } catch (Exception e) {
+                            log.error("vision.modeldata 转换json失败!");
+                            e.printStackTrace();
+                        }
+                    });
+
+            newUploadFiles.putAll(visionTxtPath);
+
             //上传文件
-            uploadToOssUtil.uploadMulFiles(newUploadFiles);
+            fYunFileService.uploadMulFiles(newUploadFiles);
 
             Map<String,String> damFileHeaders = new HashMap<>();
             damFileHeaders.put("Content-Encoding","gzip");
 
             // dam 文件设置请求头
-            newUploadFiles.entrySet().stream().filter(entry-> FileNameUtil.extName(entry.getKey()).equals(".dam"))
-                    .forEach(entry-> uploadToOssUtil.uploadOssWithHeaders(entry.getKey(),entry.getValue(),damFileHeaders));
+            newUploadFiles.entrySet().stream().filter(entry-> FileNameUtil.extName(entry.getKey()).equals("dam"))
+                    .forEach(entry-> fYunFileService.uploadFile(entry.getKey(),entry.getValue(),damFileHeaders));
             // TODO: 2022/3/11 同时上传一份到旧版本的目录,用于过渡期使用,待重构版本稳定后删除
-            uploadToOssUtil.uploadMulFiles(uploadFiles);
+            fYunFileService.uploadMulFiles(uploadFiles);
 
             //拷贝部分文件到编辑目录,用于用户编辑
             this.copyToEditDir(sceneCode);
@@ -181,12 +197,9 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
             //生成houseTypejson并上传
             this.uploadHouseTypeJson(sceneCode);
 
-//            //上传日志文件
-//            buildScenePreService.uploadLogFile(sceneCode, sceneProExt.getDataSource());
-
             //写scene.json
-            this.writeSceneJson(sceneCode, videosJson,
-                sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus, scenePlusExt, arrearCap);
+            this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,
+                    scenePlusExt, arrearCap);
 
             //计算成功,发短信
             this.sendSms(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
@@ -223,7 +236,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
     private void writeSceneJson(String num, JSONObject videosJson, SceneEditInfo sceneEditInfo, SceneEditInfoExt sceneEditInfoExt,
                                 SceneEditControls sceneEditControls, ScenePlus scenePlus, ScenePlusExt scenePlusExt, boolean arrearCap)  throws Exception{
         String sceneJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
-        boolean exist = uploadToOssUtil.existKey(sceneJsonKey);
+        boolean exist = fYunFileService.fileExist(sceneJsonKey);
         //如果云端没有scene.json文件,生成一份
         if(!exist){
             SceneJsonBean sceneJson = new SceneJsonBean();
@@ -242,7 +255,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
 
             String sceneJsonStr = JSON.toJSONString(sceneJson);
             //上传sceneJson文件
-            uploadToOssUtil.upload(sceneJsonStr.getBytes(), sceneJsonKey);
+            fYunFileService.uploadFile(sceneJsonStr.getBytes(), sceneJsonKey);
             //scenejson写入缓存
             redisUtil.set(String.format(RedisKey.SCENE_JSON, num), sceneJsonStr);
         }
@@ -268,9 +281,8 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
             return;
 
         try{
-            if(StorageType.AWS.code().equals(ossType)){
-                PushMsgUtil
-                    .googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
+            if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
+                PushMsgUtil.googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
                         sceneName + "计算完成", "您上传的" + sceneName + "计算完成,点击查看", webSite);
                 return;
             }
@@ -326,7 +338,7 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
         map.put(editDataPath + "floorplan_cad.json", viewDataPath + "floorplan_cad.json");
 
         for (Entry<String, String> entry : map.entrySet()) {
-            uploadToOssUtil.copyFiles(entry.getValue(), entry.getKey());
+                fYunFileService.copyFileInBucket(entry.getValue(), entry.getKey());
         }
     }
 
@@ -421,10 +433,10 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
         videosJson.put("data", jsonArray);
         if(Objects.nonNull(videoVersion) && videoVersion >= 4){
             videosJson.put("version", 3);
-            if(StorageType.OSS.code().equals(ossType)){
+            if(FYunTypeEnum.OSS.code().equals(fYunFileService.getFyunType())){
                 videosJson.put("upPath", prefixAli + "data/data" + projectNum + "/Up.xml");
             }
-            if(StorageType.AWS.code().equals(ossType)){
+            if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
                 videosJson.put("upPath", ConstantUrl.PREFIX_AWS + "data/data" + projectNum + "/Up.xml");
             }
             if(cameraType == 13){
@@ -619,33 +631,17 @@ public class BuildScenePostServiceImpl implements IBuildScenePostService {
 
     public void uploadHouseTypeJson(String num) throws IOException {
 
-        JSONObject result = new JSONObject();
-        result.put("name", "houseType.json");
-        result.put("version", "2.1");
-
         String floorplanCadPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan_cad.json";
-        String floorcadStr = uploadToOssUtil.getObjectContent(this.bucket, floorplanCadPath);
-
-        JSONObject floorcadObj = JSON.parseObject(floorcadStr);
-        JSONArray floors = floorcadObj.getJSONArray("floors");
-
-        JSONArray targetFloors = new JSONArray();
-        result.put("floors", targetFloors);
-        for(int i = 0; i < floors.size(); i++){
-            JSONObject floor = (JSONObject)floors.get(i);
-            JSONArray[] pointsAndWalls = this.createHouseTypeJsonHandler(floor);
-            JSONArray points = pointsAndWalls[0];
-            JSONArray walls = pointsAndWalls[1];
-            JSONObject targetFloor = new JSONObject();
-            targetFloor.put("points", points);
-            targetFloor.put("walls", walls);
-            targetFloors.add(targetFloor);
-        }
+        fYunFileService.downloadFile(floorplanCadPath,floorplanCadPath);
+
+        JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorplanCadPath);
 
         String hourseTypeJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "houseType.json";
-        uploadToOssUtil.upload(result.toJSONString().getBytes(), hourseTypeJsonPath);
+        fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
+        hourseTypeJsonPath = String.format(UploadFilePath.DATA_EDIT_PATH, num) + "houseType.json";
+        fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
+
 
-        cn.hutool.core.io.FileUtil.writeString(result.toJSONString(), "F:\\test\\hourseType.json", StandardCharsets.UTF_8);
     }
 
     private JSONArray[] createHouseTypeJsonHandler(JSONObject floor){

+ 0 - 4
src/main/java/com/fdkankan/contro/service/impl/BuildScenePreServiceImpl.java

@@ -7,7 +7,6 @@ import com.fdkankan.common.util.FileUtil;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.common.util.SceneUtil;
 import com.fdkankan.contro.service.IBuildScenePreService;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.redis.constant.RedisKey;
@@ -42,9 +41,6 @@ public class BuildScenePreServiceImpl implements IBuildScenePreService {
     private String queueModelingCall;
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
-
-    @Autowired
     RedisUtil redisUtil;
     @Autowired
     private RabbitMqProducer mqProducer;

+ 27 - 37
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -18,8 +18,8 @@ import com.fdkankan.contro.mapper.ISceneFileBuildMapper;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.vo.ResponseSceneFile;
 import com.fdkankan.contro.vo.ScenePlusVO;
-import com.fdkankan.fyun.constant.StorageType;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
+import com.fdkankan.fyun.constant.FYunTypeEnum;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.redis.util.RedisUtil;
@@ -54,15 +54,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     @Value("${scene.pro.new.url}")
     private String sceneProNewUrl;
 
-    @Value("${upload.type}")
-    private String type;
-
     @Value("${oss.prefix.ali}")
     private String prefixAli;
 
-    @Value("${ecs.type}")
-    private String ecsType;
-
     @Value("${queue.modeling.modeling-call}")
     private String queueModelingCall;
     @Value("${queue.modeling.modeling-pre}")
@@ -75,9 +69,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     private FileRouteConfig routeConfig;
 
     @Autowired
-    private UploadToOssUtil uploadToOssUtil;
-
-    @Autowired
     private IScenePlusExtService scenePlusExtService;
 
     @Autowired
@@ -115,6 +106,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     @Autowired
     private ICompanyService companyService;
 
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
+
     @Override
     public SceneFileBuild findByFileId(String fileId) {
 
@@ -315,11 +309,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
                     CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
                     icon = prefixAli + "images/images" + sceneNum + "/" + jsonObject.getString("icon");
-                    if(StorageType.AWS.code().equals(type)){
+                    if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
                         CreateObjUtil.ossFileCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath + jsonObject.getString("icon"));
                         icon = ConstantUrl.PREFIX_AWS + imgViewPath + jsonObject.getString("icon");
                     }
-                    uploadToOssUtil.upload(filePath + jsonObject.getString("icon"), imgViewPath + jsonObject.getString("icon"));
+                    fYunFileService.uploadFile(filePath + jsonObject.getString("icon"), imgViewPath + jsonObject.getString("icon"));
                 }
 
                 JSONObject firmwareVersion = new JSONObject();
@@ -346,8 +340,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                     scenePlusService.resetSpace(sceneNum);
                 }else {
                     //上传log-main.png
-                    uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
-                    uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main-en.png", imgViewPath + "logo-main-en.png");
+                    fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
+                    fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main-en.png", imgViewPath + "logo-main-en.png");
                 }
                 ScenePlusVO scenePlusVO = null;
                 Object[] objects = null;
@@ -359,7 +353,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                             jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
                             jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
                             jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
-                            jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, ecsType,cameraDetail.getCooperationUser());
+                            jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType,cameraDetail.getCooperationUser());
 
                 }else {
                     objects = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
@@ -368,7 +362,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                             jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
                             jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
                             jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
-                            jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, ecsType, cameraDetail.getCooperationUser());
+                            jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
                 }
                 scenePlusVO = (ScenePlusVO)objects[0];
                 mqMessage = (BuildSceneCallMessage)objects[1];
@@ -384,11 +378,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                     statusJson.put("payStatus", scenePlusVO.getPayStatus());
                     statusJson.put("recStatus", scenePlusVO.getRecStatus());
                     FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
-                    uploadToOssUtil.upload(localDataPath + "status.json", dataViewPath + "status.json");
+                    fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + "status.json");
                 }
 
                 //删除oss的houst_floor.json(国际版可能会卡住)
-                uploadToOssUtil.delete(dataViewPath + "houst_floor.json");
+                fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
 
                 if(cameraDetail.getCompanyId() != null){
                     Company company = companyService.getById(cameraDetail.getCompanyId());
@@ -409,7 +403,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
                             FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),
                                     localImagesPath + "logo-main.png", true);
-                            uploadToOssUtil.upload(localImagesPath + "logo-main.png", imgViewPath + "logo-main.png");
+                            fYunFileService.uploadFile(localImagesPath + "logo-main.png", imgViewPath + "logo-main.png");
                         }
 
                         if(StrUtil.isNotEmpty(company.getFloorLogo())){
@@ -423,7 +417,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
                             FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo(),
                                     localImagesPath + "floorLogoImg.png", true);
-                            uploadToOssUtil.upload(localImagesPath + "floorLogoImg.png", imgViewPath + "floorLogoImg.png");
+                            fYunFileService.uploadFile(localImagesPath + "floorLogoImg.png", imgViewPath + "floorLogoImg.png");
 
                             sceneEditInfo.setFloorLogo("user");
                         }
@@ -496,7 +490,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         if(!filePath.exists()){
             filePath.mkdirs();
         }
-        if(StorageType.AWS.code().equals(type)){
+        if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
             CreateObjUtil.ossFileCp(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage", filePathBuffer.toString() + "data.fdage");
         }else {
             CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage", filePathBuffer.toString());
@@ -564,7 +558,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         if(!filePath.exists()){
             filePath.mkdirs();
         }
-        if(StorageType.AWS.code().equals(type)){
+        if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
             CreateObjUtil.ossFileCp(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage", filePathBuffer.toString() + "data.fdage");
         }else {
             CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage", filePathBuffer.toString());
@@ -641,11 +635,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
             CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
             icon = prefixAli + imageViewPath + jsonObject.getString("icon");
-            if(StorageType.AWS.code().equals(type)){
+            if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
                 CreateObjUtil.ossFileCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath + jsonObject.getString("icon"));
                 icon = ConstantUrl.PREFIX_AWS + imageViewPath + jsonObject.getString("icon");
             }
-            uploadToOssUtil.upload(filePath + jsonObject.getString("icon"), imageViewPath + jsonObject.getString("icon"));
+            fYunFileService.uploadFile(filePath + jsonObject.getString("icon"), imageViewPath + jsonObject.getString("icon"));
 
             log.info("上传icon成功....");
         }
@@ -675,8 +669,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             scenePlusService.resetSpace(sceneNum);
         }else {
             //上传log-main.png
-            uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main.png", imageViewPath + "logo-main.png");
-            uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main-en.png", imageViewPath + "logo-main-en.png");
+            fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imageViewPath + "logo-main.png");
+            fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main-en.png", imageViewPath + "logo-main-en.png");
             log.info("第一次计算场景,上传logo-main.png");
 
         }
@@ -686,7 +680,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
                 jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
                 jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
-                jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, ecsType, cameraDetail.getCooperationUser());
+                jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
         BuildSceneCallMessage  mqMessage = (BuildSceneCallMessage)objects[1];
         ScenePlusVO scenePlusVO = (ScenePlusVO) objects[0];
 
@@ -701,7 +695,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             statusJson.put("recStatus", scenePlusVO.getRecStatus());
             FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
 
-            uploadToOssUtil.upload(localDataPath + "status.json", dataViewPath + File.separator+"status.json");
+            fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + File.separator+"status.json");
 
             log.info("上传status.json,上传内容:{}" + statusJson.toString());
         }
@@ -721,7 +715,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
                 if(StrUtil.isNotEmpty(company.getTopLogo())){
                     FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),localImagesPath + "logo-main.png", true);
-                    uploadToOssUtil.upload(localImagesPath + "logo-main.png", imageViewPath + "logo-main.png");
+                    fYunFileService.uploadFile(localImagesPath + "logo-main.png", imageViewPath + "logo-main.png");
                 }
 
                 if(StrUtil.isNotEmpty(company.getFloorLogo())){
@@ -729,7 +723,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                     FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo(),
                         localImagesPath + "floorLogoImg.png", true);
 
-                    uploadToOssUtil.upload(localImagesPath + "floorLogoImg.png",
+                    fYunFileService.uploadFile(localImagesPath + "floorLogoImg.png",
                             imageViewPath + "floorLogoImg.png");
 
                     sceneEditInfo.setFloorLogo("user");
@@ -780,7 +774,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             }
 
             //删除oss的houst_floor.json
-            uploadToOssUtil.delete(dataViewPath + "houst_floor.json");
+            fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
 
         }
 
@@ -801,7 +795,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                                      String imgsName, String pic, String isModel, Long userId, String userName,
                                      String algorithm, Integer sceneShootCount, String sceneName,
                                      String sceneDec, Integer sceneType, String gps,Integer type,
-                                     Integer resolution, String firmwareVersion, String url, String buildType, String ecsType,
+                                     Integer resolution, String firmwareVersion, String url, String buildType,
                                      Long cooperationUser)throws Exception{
 
         ScenePlusVO scenePlusVO = new ScenePlusVO();
@@ -835,10 +829,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             scenePlusExt.setDataSource(prefix+imgsName);
         }
 
-        if(!org.springframework.util.StringUtils.isEmpty(ecsType)){
-            scenePlusExt.setEcs(ecsType);
-        }
-
         if(resolution == null || resolution.intValue() == 0){
             scenePlusExt.setSceneScheme(cameraType.intValue());
         }else {

+ 5 - 1
src/main/resources/bootstrap-test.yml

@@ -4,7 +4,7 @@ spring:
       config:
         server-addr: 120.24.144.164:8848
         file-extension: yaml
-        namespace: 4dkankan-test
+        namespace: 4dkankan-v4
         extension-configs:
           - data-id: 4dkankan-center-modeling-control.yaml
             group: DEFAULT_GROUP
@@ -33,6 +33,10 @@ spring:
           - data-id: common-mq-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: common-fyun-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         server-addr: 120.24.144.164:8848
         namespace: 4dkankan-test