wuweihao před 4 roky
rodič
revize
b7c8416f1b

+ 9 - 0
cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -208,14 +208,21 @@ public class FileUtils {
      * @return
      */
     public Object renameUploadOss(MultipartFile file, String savePath, String ossBasePath, String ossDomain)  {
+
         if (file == null) {
             log.error("文件不能为空");
             return null;
         }
 
+        long size = file.getSize();
+        log.info("文件大小:" + size );
+        log.info("文件大小:" + (size/1000) + "kb");
+
+
         String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
 
         String fileName = file.getOriginalFilename();
+        log.info("上传的文件名:" + fileName);
 
         String fileType = getFileType(fileName);
         String dirType = "image/";
@@ -229,6 +236,8 @@ public class FileUtils {
 
         log.info("savePath: {}", savePath);
 
+
+
         try {
             FileUtil.writeFromStream(file.getInputStream(), savePath);
         } catch (IOException e) {

+ 6 - 1
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -234,13 +234,16 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         }
 
         if (result.getCode() == -1){
-            return Result.failure("查询失败");
+            log.error("VR项目接口查询失败:" + result.getMsg() );
+            return Result.failure("VR项目接口查询失败");
         }
 
         return null;
     }
 
 
+
+
     @Test
     public void test2(){
         String type = "aa.jpg";
@@ -474,8 +477,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
                 JSONObject scenePro = JSON.parseObject(o.toString());
                 String sceneProId = scenePro.getString("id");
                 List<SceneEntity> vrModelId = entityMapper.findByVrModelId2(sceneProId);
+                // 0:未使用
                 String use = "0";
                 if (vrModelId.size() > 0) {
+                    // 1: 已使用
                     use = "1";
                 }
 

+ 1 - 1
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneController.java

@@ -1,7 +1,6 @@
 package com.gis.web.controller;
 
 
-import com.alibaba.fastjson.JSONObject;
 import com.gis.common.util.Result;
 import com.gis.domain.dto.*;
 import com.gis.domain.entity.SceneEntity;
@@ -89,6 +88,7 @@ public class SceneController extends BaseController {
     @ApiOperation(value = "上传-图标", position = 2)
     @PostMapping(value = "upload")
     public Result upload(@RequestParam("file") MultipartFile file) {
+        log.info("上传图片");
         return sceneService.upload(file);
     }
 

+ 6 - 0
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/TestController.java

@@ -425,5 +425,11 @@ public class TestController extends BaseController {
 
     }
 
+    @ApiOperation(value = "上传-图标", position = 2)
+    @PostMapping(value = "upload")
+    public Result upload(@RequestParam("file") MultipartFile file) {
+        return sceneService.upload(file);
+    }
+
 
 }