|
@@ -55,6 +55,7 @@ import com.fdkankan.scene.vo.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.errorprone.annotations.Var;
|
|
|
import java.io.File;
|
|
|
+import java.io.FileInputStream;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -62,6 +63,7 @@ import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.UUID;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import javax.sound.sampled.AudioSystem;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -732,8 +734,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
|
|
|
//原始计算根目录
|
|
|
- String path = "F:\\test";
|
|
|
-// String path = scenePlusExt.getDataSource();
|
|
|
+// String path = "F:\\test";
|
|
|
+ String path = scenePlusExt.getDataSource();
|
|
|
//全景图计算根目录
|
|
|
String target = path + "_images";
|
|
|
//解压缩文件存放目录
|
|
@@ -763,6 +765,21 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7014);
|
|
|
}
|
|
|
|
|
|
+ //判断是否有可用的jpg文件
|
|
|
+ boolean existJpg = false;
|
|
|
+ uploadFileList = FileUtil.getFileList(targetImagesPath);
|
|
|
+ if(CollUtil.isNotEmpty(uploadFileList)){
|
|
|
+ existJpg = uploadFileList.stream().anyMatch(str -> {
|
|
|
+ if(str.endsWith(".jpg")){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(!existJpg){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5061);
|
|
|
+ }
|
|
|
+
|
|
|
//列出caches/images中的文件列表
|
|
|
String imgCachePath = String.format(UploadFilePath.IMG_CACHES_PATH, num);
|
|
|
List<String> keyList = uploadToOssUtil.listKeys(imgCachePath);
|
|
@@ -785,20 +802,14 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
FileUtils.deleteFile(filePath);
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- //判断是否有可用的jpg文件
|
|
|
- boolean existJpg = false;
|
|
|
uploadFileList = FileUtil.getFileList(targetImagesPath);
|
|
|
- if(CollUtil.isNotEmpty(uploadFileList)){
|
|
|
- existJpg = uploadFileList.stream().anyMatch(str -> {
|
|
|
- if(str.endsWith(".jpg")){
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- });
|
|
|
- }
|
|
|
- if(!existJpg){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5061);
|
|
|
+ if(CollUtil.isEmpty(uploadFileList)){
|
|
|
+ if(CollUtil.isNotEmpty(notExistFileList)){
|
|
|
+ notExistFileList = notExistFileList.stream().map(filePath -> {
|
|
|
+ return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return ResultData.ok(notExistFileList);
|
|
|
}
|
|
|
|
|
|
//上传
|
|
@@ -860,7 +871,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
Thread.sleep(2000);
|
|
|
boolean exist = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
|
|
|
if(!exist){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5042);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
|
|
|
}
|
|
|
String uploadData = FileUtils.readFile(uploadJsonPath);
|
|
|
JSONObject uploadJson = null;
|