tianboguang пре 3 година
родитељ
комит
0cec456087

+ 2 - 2
4dkankan-modeling/src/main/java/com/fdkankan/modeling/message/BuildSceneReceiver.java

@@ -251,7 +251,7 @@ public class BuildSceneReceiver {
                         path + File.separator + "capture");
                 FileUtil.delFile(path + File.separator + "capture" + File.separator + imgsName);
             } else if (Integer.parseInt(cameraType) == 14) {
-                CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + cameraName.replace("4DKKPRO_", "")
+                CreateObjUtil.ossUtilCpWithZfbBucket(ConstantFilePath.OSS_PREFIX + cameraName.replace("4DKKPRO_", "")
                                 .replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator
                                 + unicode + File.separator,
                         ConstantFilePath.BUILD_MODEL_LASER_PATH + cameraName.replace("4DKKPRO_", "")
@@ -259,7 +259,7 @@ public class BuildSceneReceiver {
                                 + unicode + File.separator + "capture");
                 path = ConstantFilePath.BUILD_MODEL_LASER_PATH + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode;
             } else if (Integer.parseInt(cameraType) >= 4) {
-                CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + cameraName.replace("4DKKPRO_", "")
+                CreateObjUtil.ossUtilCpWithZfbBucket(ConstantFilePath.OSS_PREFIX + cameraName.replace("4DKKPRO_", "")
                                 .replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator
                                 + unicode + File.separator,
                         ConstantFilePath.BUILD_MODEL_PATH + cameraName.replace("4DKKPRO_", "")

+ 2 - 2
4dkankan-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProAppServiceImpl.java

@@ -1156,7 +1156,7 @@ public class SceneProAppServiceImpl extends BaseServiceImpl<SceneProEntity, Long
             if("s3".equals(this.type)){
                 CreateObjUtil.ossFileCp("voice"+File.separator+"voice"+sceneNum + "/" + soundFile, partPath + File.separator + fileName);
             }else {
-                CreateObjUtil.ossUtilCp("voice"+File.separator+"voice"+sceneNum + "/" + soundFile, partPath + File.separator);
+                CreateObjUtil.ossUtilCpWithZfbBucket("voice"+File.separator+"voice"+sceneNum + "/" + soundFile, partPath + File.separator);
                 new File(partPath + File.separator + soundFile).renameTo(new File(partPath + File.separator + fileName));
             }
 
@@ -1221,7 +1221,7 @@ public class SceneProAppServiceImpl extends BaseServiceImpl<SceneProEntity, Long
         if("s3".equals(this.type)){
             CreateObjUtil.ossFileCp("voice"+File.separator+"voice"+sceneNum + "/" + soundFile, partPath + File.separator + fileName);
         }else {
-            CreateObjUtil.ossUtilCp("voice"+File.separator+"voice"+sceneNum + "/" + soundFile, partPath + File.separator);
+            CreateObjUtil.ossUtilCpWithZfbBucket("voice"+File.separator+"voice"+sceneNum + "/" + soundFile, partPath + File.separator);
             new File(partPath + File.separator + soundFile).renameTo(new File(partPath + File.separator + fileName));
         }
 

+ 2 - 2
4dkankan-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -1998,7 +1998,7 @@ public class SceneProServiceImpl extends BaseServiceImpl<SceneProEntity, Long> i
                     //亚马逊保持旧方式,超链接capture
                     CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
                 }
-                CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
+                CreateObjUtil.ossUtilCpWithZfbBucket(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
 
                 CreateObjUtil.build3dModel(target , "1");
 
@@ -3941,7 +3941,7 @@ public class SceneProServiceImpl extends BaseServiceImpl<SceneProEntity, Long> i
             //亚马逊保持旧方式,超链接capture
             CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
         }
-        CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
+        CreateObjUtil.ossUtilCpWithZfbBucket(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
 
         CreateObjUtil.build3dModel(target , "1");
 //        CreateObjUtil.build3dModel2(target , "1");

+ 8 - 0
4dkankan-scene/src/main/java/com/fdkankan/scene/util/CreateObjUtil.java

@@ -563,6 +563,14 @@ public class CreateObjUtil{
 		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
 	}
 
+	public static void ossUtilCpWithZfbBucket(String fileUrl , String path) throws Exception{
+		String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path+" zfb-4dkankan";
+		Long start = System.currentTimeMillis();
+		log.info("开始oss下载文件:" + command);
+		callshell(command);
+		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
+	}
+
 	public static void ossFileCp(String fileUrl , String path) throws Exception{
 		String command = ConstantCmd.OSS_FILE_CP + " " + fileUrl + " " + path;
 		Long start = System.currentTimeMillis();

+ 4 - 0
4dkankan-user/src/main/java/com/fdkankan/user/service/impl/UserServiceImpl.java

@@ -59,6 +59,7 @@ 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.util.ObjectUtils;
 import tk.mybatis.mapper.entity.Condition;
 
 import java.math.BigDecimal;
@@ -1476,6 +1477,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserEntity, Long> implement
 //            return -2;
 //        }
         CameraDetailEntity detailEntity = cameraDetailService.findByCameraId(sceneProEntity.getCameraId());
+        if(ObjectUtils.isEmpty(detailEntity.getTotalSpace())){
+            return 1;
+        }
         detailEntity.setUsedSpace(detailEntity.getUsedSpace().add(sceneProEntity.getSpace()));
         cameraDetailService.update(detailEntity);
 //        userEntity.setUsedSpace(scene.getSpace().add(userEntity.getUsedSpace()));